Description de Classe
Plan d'ensemble
Ces macros doivent être utilisées pour décrire une classe.
Une description de classe est un tableau de structure
GB_DESC
,
dont chaque élément est rempli avec une des macros suivantes.
Le premier élément doit être rempli avec la macro
GB_DECLARE
,
et le dernier doit être rempli avec la macro
GB_END_DECLARE
.
Les macros suivantes doivent être utilisées au début du tableau, juste après
GB_END_DECLARE
:
Les autres macros peuvent être utilisées dans n' importe quel ordre, car
l' interpréteur les triera de toute façon.
Voici la déclaration de la classe
Window :
Exemples
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
};