<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../style.css">
<title>
Gambas Documentation - Class Description
</title>
</head>
<table class="none" width="100%" cellpadding="0" cellspacing="0" border="0">
<tr><td align="left">
<font size="-1">
<a href="../../../help+en"><img class="flag" alt="Home" border="0" src="../../../img/lang/en.png" align="center"></a>&nbsp;
<a href="../cat+en">Up</a>&nbsp;
<a href="date+en">Previous</a>&nbsp;
<a href="enum+en">Next</a>&nbsp;
</td></tr></table>
<div class="notab">
<h1>
Class Description
</h1>
<table class="table" border="0" bordercolor="#000000" cellpadding="4" cellspacing="0">
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_constant+en">GB_CONSTANT</a></tt>
</td><td valign="top">
Declares a constant.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_auto_creatable+en">GB_AUTO_CREATABLE</a></tt>
</td><td valign="top">
Indicates an auto-creatable class.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_declare+en">GB_DECLARE</a></tt>
</td><td valign="top">
Begins a class description.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_desc+en">GB_DESC</a></tt>
</td><td valign="top">
Class description structure.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_end_declare+en">GB_END_DECLARE</a></tt>
</td><td valign="top">
Ends a class description.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_event+en">GB_EVENT</a></tt>
</td><td valign="top">
Declares an event.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_inherits+en">GB_INHERITS</a></tt>
</td><td valign="top">
Makes the class inherit another one.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_method+en">GB_METHOD</a></tt>
</td><td valign="top">
Declares a method.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_not_creatable+en">GB_NOT_CREATABLE</a></tt>
</td><td valign="top">
Indicates that a class is not creatable.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_property+en">GB_PROPERTY</a></tt>
</td><td valign="top">
Declares a property.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_property_read+en">GB_PROPERTY_READ</a></tt>
</td><td valign="top">
Declares a read-only property.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_property_self+en">GB_PROPERTY_SELF</a></tt>
</td><td valign="top">
Declares a property that returns a <a href="../../def/virtual+en">virtual</a> class.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_static_method+en">GB_STATIC_METHOD</a></tt>
</td><td valign="top">
Declares a static method.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_static_property+en">GB_STATIC_PROPERTY</a></tt>
</td><td valign="top">
Declares a static property.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_static_property_read+en">GB_STATIC_PROPERTY_READ</a></tt>
</td><td valign="top">
Declares a static read-only property.
</td></tr>
<tr><td valign="top">
<tt><a href="../name/gb_static_property_self+en">GB_STATIC_PROPERTY_SELF</a></tt>
</td><td valign="top">
Declares a static property that returns a <a href="../../def/virtual+en">virtual</a> class.
</td></tr>
<tr class="dark"><td valign="top">
<tt><a href="../name/gb_virtual_class+en">GB_VIRTUAL_CLASS</a></tt>
</td><td valign="top">
Indicates a <a href="../../def/virtual+en">virtual</a> class.
</td></tr>
</table>
<p>
<h2>Overview</h2>
<p>
These macros must be used when describing a class.
<p>
A class description is an array of <tt><a href="../name/gb_desc+en">GB_DESC</a></tt> structure, whose
each element is filled with one of the following macros.
<p>
The first element must be filled with the <tt><a href="../name/gb_declare+en">GB_DECLARE</a></tt> macro,
and the last one must be filled with the <tt><a href="../name/gb_end_declare+en">GB_END_DECLARE</a></tt> macro.
<p>
The following macros must be used at the beginning of the array, just after
<tt><a href="../name/gb_end_declare+en">GB_END_DECLARE</a></tt>:
<ul>
<li><tt><a href="../name/gb_auto_creatable+en">GB_AUTO_CREATABLE</a></tt>
<li><tt><a href="../name/gb_inherits+en">GB_INHERITS</a></tt>
<li><tt><a href="../name/gb_not_creatable+en">GB_NOT_CREATABLE</a></tt>
<li><tt><a href="../name/gb_virtual_class+en">GB_VIRTUAL_CLASS</a></tt>
<p>
</ul>

The other macros can be used in any order, as the interpreter will sort them anyway.
<p>
Here is the declaration of the <a href="../../comp/gb.qt/window+en">Window</a> class:
<p>
<div class="gray"><font size="-2"><b>Example</b></font></div>
<pre class="example">GB_DESC CWindowDesc[] =
{
  GB_DECLARE(&quot;Window&quot;, sizeof(CWINDOW)), GB_INHERITS(&quot;Container&quot;),

  GB_CONSTANT(&quot;None&quot;, &quot;i&quot;, 0),
  GB_CONSTANT(&quot;Fixed&quot;, &quot;i&quot;, 1),
  GB_CONSTANT(&quot;Resizable&quot;, &quot;i&quot;, 2),

  GB_STATIC_METHOD(&quot;_init&quot;, NULL, CWINDOW_init, NULL),
  GB_METHOD(&quot;_new&quot;, NULL, CWINDOW_new, &quot;[(Parent)Control;]&quot;),
  GB_METHOD(&quot;_free&quot;, NULL, CWINDOW_free, NULL),

  GB_METHOD(&quot;Close&quot;, &quot;b&quot;, CWINDOW_close, &quot;[(Return)i]&quot;),
  GB_METHOD(&quot;Raise&quot;, NULL, CWINDOW_raise, NULL),
  GB_METHOD(&quot;Show&quot;, NULL, CWINDOW_show, NULL),
  GB_METHOD(&quot;ShowModal&quot;, &quot;i&quot;, CWINDOW_show_modal, NULL),
  GB_METHOD(&quot;ShowDialog&quot;, &quot;i&quot;, CWINDOW_show_modal, NULL),
  GB_METHOD(&quot;Center&quot;, NULL, CWINDOW_center, NULL),
  GB_PROPERTY_READ(&quot;Modal&quot;, &quot;b&quot;, CWINDOW_modal),

  GB_METHOD(&quot;Delete&quot;, NULL, CWINDOW_delete, NULL),

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

  GB_PROPERTY_SELF(&quot;Menus&quot;, &quot;.WindowMenus&quot;),

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

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

  GB_END_DECLARE
};</pre>

</div>
</body>
</html>

