Class Description
Overview
Estas macros pueden usarse para describir una clase.
La descripción de una clase es un vector de estructura
/wiki/api/name/gb_desc
, en el que cada elemento se rellena con uno de las siguientes macros.
El primer elemento se tiene que rellenar con la macro
/wiki/api/name/gb_declare
, y el último con la macro
/wiki/api/name/gb_end_declare
.
Las siguientes macros se pueden usar el principio del vector, justo después de
/wiki/api/name/gb_end_declare
:
Las otras macros se pueden usar en cualquier orden, pues el interprete las ordenará.
Lo que sigue es la declaración de la clase
Window :
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
};