dev • api • cat • desc

Class Description

GB_CONSTANT Declares a constant.
GB_AUTO_CREATABLE Indicates an auto-creatable class.
GB_DECLARE Begins a class description.
GB_DESC Class description structure.
GB_END_DECLARE Ends a class description.
GB_EVENT Declares an event.
GB_INHERITS Makes the class inherit another one.
GB_METHOD Declares a method.
GB_NOT_CREATABLE Indicates that a class is not creatable.
GB_PROPERTY Declares a property.
GB_PROPERTY_READ Declares a read-only property.
GB_PROPERTY_SELF Declares a property that returns a virtual class.
GB_STATIC_METHOD Declares a static method.
GB_STATIC_PROPERTY Declares a static property.
GB_STATIC_PROPERTY_READ Declares a static read-only property.
GB_STATIC_PROPERTY_SELF Declares a static property that returns a virtual class.
GB_VIRTUAL_CLASS Indicates a virtual class.

Overview

These macros must be used when describing a class.

A class description is an array of GB_DESC structure, whose each element is filled with one of the following macros.

The first element must be filled with the GB_DECLARE macro, and the last one must be filled with the GB_END_DECLARE macro.

The following macros must be used at the beginning of the array, just after GB_END_DECLARE:

The other macros can be used in any order, as the interpreter will sort them anyway.

Here is the declaration of the Window class:

Examples

GB_DESC CWindowDesc[] =
{
  GB_DECLARE("Window", SizeOf(CWINDOW)), GB_INHERITS("Container"),

  GB_CONSTANT("None", "i", 0),
  GB_CONSTANT("Fixed", "i", 1),
  GB_CONSTANT("Resizable", "i", 2),

  GB_STATIC_METHOD("_init", Null, CWINDOW_init, Null),
  GB_METHOD("_new", Null, CWINDOW_new, "[(Parent)Control;]"),
  GB_METHOD("_free", Null, CWINDOW_free, Null),

  GB_METHOD("Close", "b", CWINDOW_close, "[(Return)i]"),
  GB_METHOD("Raise", Null, CWINDOW_raise, Null),
  GB_METHOD("Show", Null, CWINDOW_show, Null),
  GB_METHOD("ShowModal", "i", CWINDOW_show_modal, Null),
  GB_METHOD("ShowDialog", "i", CWINDOW_show_modal, Null),
  GB_METHOD("Center", Null, CWINDOW_center, Null),
  GB_PROPERTY_READ("Modal", "b", CWINDOW_modal),

  GB_METHOD("Delete", Null, CWINDOW_delete, Null),

  GB_PROPERTY("Persistent", "b", CWINDOW_persistent),
  GB_PROPERTY("Text", "s", CWINDOW_text),
  GB_PROPERTY("Title", "s", CWINDOW_text),
  GB_PROPERTY("Caption", "s", CWINDOW_text),
  GB_PROPERTY("Icon", "Picture", CWINDOW_icon),
  GB_PROPERTY("Picture", "Picture", CWINDOW_picture),
  GB_PROPERTY("Mask", "b", CWINDOW_mask),
  GB_PROPERTY("Border", "i<Window,None,Fixed,Resizable>", CWINDOW_border),
  GB_PROPERTY("Minimized", "b", CWINDOW_minimized),
  GB_PROPERTY("Maximized", "b", CWINDOW_maximized),
  GB_PROPERTY("FullScreen", "b", CWINDOW_full_screen),
  GB_PROPERTY("TopOnly", "b", CWINDOW_top_only),
  GB_PROPERTY("SkipTaskbar", "b", CWINDOW_skip_taskbar),
  GB_PROPERTY("ToolBox", "b", CWINDOW_tool),
  GB_PROPERTY("Visible", "b", CWINDOW_visible),
  GB_PROPERTY("Arrangement", "i<Arrange>", CCONTAINER_arrangement),
  GB_PROPERTY("Padding", "i", CCONTAINER_padding),
  GB_PROPERTY("Spacing", "i", CCONTAINER_spacing),

  GB_PROPERTY_SELF("Menus", ".WindowMenus"),

  GB_CONSTANT("_Properties", "s", "*,Text,Icon,Picture,Mask,Persistent,Border,Minimized,Maximized,"
                                  "FullScreen,TopOnly,SkipTaskbar,ToolBox,Arrangement,Spacing,Padding"),
  GB_CONSTANT("_DefaultEvent", "s", "Open"),
  GB_CONSTANT("_Arrangement", "i", ARRANGE_FILL),

  GB_EVENT("Close", "b", Null, & EVENT_Close),
  GB_EVENT("Open", Null, Null, & EVENT_Open),
  GB_EVENT("Activate", Null, Null, & EVENT_Activate),
  GB_EVENT("Deactivate", Null, Null, & EVENT_Deactivate),
  GB_EVENT("Move", Null, Null, & EVENT_Move),
  GB_EVENT("Resize", Null, Null, & EVENT_Resize),
  GB_EVENT("Show", Null, Null, & EVENT_Show),
  GB_EVENT("Hide", Null, Null, & EVENT_Hide),
  GB_EVENT("Embed", Null, Null, & EVENT_Embed),

  GB_END_DECLARE
};