Difference between revisions of "Using XML Resources with XRC"

From WxWiki
Jump to: navigation, search
(initial page import, 30% cleaned up, 70% to go)
 
m (Text replacement - "\<syntaxhighlight title="([^"]+)"\>" to "<syntaxhighlight lang="cpp" title="$1">")
 
(13 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This article has been rescued from [http://web.archive.org/web/20060430183944/http://ldaptool.sourceforge.net/XRCGuide/XRCGuideSingle/ this archive], and has not been completely reformatted for this wiki. Please be patient, and use the original article for now.
+
{{ToC Right}}
  
 
== Introduction ==
 
== Introduction ==
Line 11: Line 11:
 
This document deals with the third solution in a C/C++ application context.
 
This document deals with the third solution in a C/C++ application context.
  
This resource system in not a part of the standard wxWidgets library, but is delivered with the standard source packages in the contrib directory as a library.
+
This resource system in not a part of the standard wxWidgets library, but is delivered with the standard source packages in the contrib directory as a library. To build the "wxrc" library refer to the [https://docs.wxwidgets.org/stable/ wxWidgets documentation].
  
To build the "wxrc" library refer to the [http://www.wxwidgets.org/manuals/stable/wx_contents.html wxWidgets documentation].
+
XML resources are readable and processed at run-time. The goal of this article is to explain how XRC works, and show how to write XRC files by hand.  There are a number of [[Tools|RAD tools]] that simplify this process by allowing you to build windows and dialogs graphically, and automatically generate XRC files for you, it is still helpful to know how to edit XRC directly, since not all components are supported by all tools.
  
The two main advantages of XML resources, except that it is XML, is that it is quite readable and runtime processed.
+
<div style="background: #fcc; margin: 1em 3em; padding: 0.2em 0.5em;">
 
+
'''Warning'''
<div style="margin-left: 0.5in; margin-right: 0.5in">
 
=== Warning ===
 
  
 
This document is not a C/C++ tutorial for wxWidgets as other tutorials are available including the wxWidgets documentation and samples which is a good starting point.
 
This document is not a C/C++ tutorial for wxWidgets as other tutorials are available including the wxWidgets documentation and samples which is a good starting point.
 
</div>
 
</div>
  
== Using the wxXmlResource Class ==
+
== Using wxXmlResource ==
  
 
The <tt>wxXmlResource</tt> is the only class you have to deal with in order to make use of XRC files in your C/C++ application. A typical use is the following
 
The <tt>wxXmlResource</tt> is the only class you have to deal with in order to make use of XRC files in your C/C++ application. A typical use is the following
Line 39: Line 37:
 
A simple way to initialize the resource system is to call <tt>InitAllHandlers</tt> method of <tt>wxXmlResource</tt> class so you don't have to worry about all the handlers you could add.
 
A simple way to initialize the resource system is to call <tt>InitAllHandlers</tt> method of <tt>wxXmlResource</tt> class so you don't have to worry about all the handlers you could add.
  
'''Example 1. <tt>wxXmlResource</tt> initialization'''
+
<syntaxhighlight lang="cpp" title="wxXmlResource Initialization Example">
 
+
wxXmlResource::Get()->InitAllHandlers();
<pre>wxXmlResource::Get()->InitAllHandlers();
 
 
bRet = wxXmlResource::Get()->Load( Path );
 
bRet = wxXmlResource::Get()->Load( Path );
 
if( !bRet )
 
if( !bRet )
 
{
 
{
    cout  << "Could not load resource file" << Path << endl;
+
cout  << "Could not load resource file" << Path << endl;
    return false;
+
return false;
}</pre>
+
}
 +
</syntaxhighlight>
  
 
The individual resource handlers available (depending on compilation options in <tt>setup.h</tt>) are:
 
The individual resource handlers available (depending on compilation options in <tt>setup.h</tt>) are:
Line 91: Line 89:
 
Now that handlers are added to the resource handler you have to specify which '''XRC''' file(s) you want to load by calling the <tt>Load</tt> method. The parameter you pass to this method must be a valid path to the file you wand to load.
 
Now that handlers are added to the resource handler you have to specify which '''XRC''' file(s) you want to load by calling the <tt>Load</tt> method. The parameter you pass to this method must be a valid path to the file you wand to load.
  
=== Using the <tt>wxXmlResource</tt> Class to Create UI Elements ===
+
=== Creating UI Elements ===
  
 
There are 8 top level resource types that you can describe in a '''XRC''' file.
 
There are 8 top level resource types that you can describe in a '''XRC''' file.
Line 110: Line 108:
 
For example there are three ways to create a dialog :
 
For example there are three ways to create a dialog :
  
* Directly by using the following form wxDialog *Dlg;
+
1. Directly by using the following form wxDialog *Dlg;
  
 
<pre>Dlg = wxXmlResource::Get()->LoadDialog( FrameObjectPointer, "dialog_resource" );
 
<pre>Dlg = wxXmlResource::Get()->LoadDialog( FrameObjectPointer, "dialog_resource" );
 
Dlg->ShowModal();</pre>
 
Dlg->ShowModal();</pre>
  
* Indirectly by using the following form wxDialog Dlg;
+
2. Indirectly by using the following form wxDialog Dlg;
  
 
<pre>wxXmlResource::Get()->LoadDialog( &Dlg, FrameObjectPointer, "dialog_resource" );
 
<pre>wxXmlResource::Get()->LoadDialog( &Dlg, FrameObjectPointer, "dialog_resource" );
Line 126: Line 124:
 
Dlg.ShowModal();</pre>
 
Dlg.ShowModal();</pre>
  
* Indirectly in a derived class of <tt>wxDialog</tt>  
+
3. Indirectly in a derived class of <tt>wxDialog</tt>  
  
 
<pre>MyDerivedDialog::MyDerivedDialog( wxWindow *p_Parent )
 
<pre>MyDerivedDialog::MyDerivedDialog( wxWindow *p_Parent )
 
{
 
{
    wxXmlResource::Get()->LoadDialog( this, p_Parent, "dialog_resource" );
+
wxXmlResource::Get()->LoadDialog( this, p_Parent, "dialog_resource" );
 
}</pre>
 
}</pre>
  
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in">
+
<div style="background: #fcc; margin: 1em 3em; padding: 0.2em 0.5em;">
=== Important ===
+
'''Important'''
  
 
Note that in the last example the <tt>wxDialog</tt> base class constructor is not called, and should not be.
 
Note that in the last example the <tt>wxDialog</tt> base class constructor is not called, and should not be.
 
</div>
 
</div>
  
== XML Resource File (XRC) Format ==
+
== XRC File Format ==
  
 
'''XRC''' files are standard XML files. The format should be the following :
 
'''XRC''' files are standard XML files. The format should be the following :
  
'''Example 2. XRC resource file'''
+
<syntaxhighlight lang="xml">
 +
<?xml version="1.0"?>
 +
<resource version="2.3.0.1">
 +
<object class="wxFrame" name="my_main_frame">
 +
<size>200,300</size>
 +
...
 +
</object>
 +
</resource>
 +
</syntaxhighlight>
  
<pre><?xml version="1.0"?>
+
See the [https://docs.wxwidgets.org/trunk/xrc_format.html XRC format specification] for detailed description.
<resource version="2.3.0.1">
 
<object class="wxFrame" name="my_main_frame">
 
<size>200,300</size>
 
...
 
</object>
 
</resource></pre>
 
  
 
== Internationalization (i18n) ==
 
== Internationalization (i18n) ==
Line 163: Line 163:
 
== XRC Object Descriptions ==
 
== XRC Object Descriptions ==
  
This part describes each resource type available in '''XRC''' files.
+
This part describes each resource type available in '''XRC''' files. This information is also provided in the [https://docs.wxwidgets.org/trunk/xrc_format.html XRC format specification], which is the authoritative resource.
  
=== wxWindow Derived Elements ===
+
 
 +
All "object" nodes have an optional "name" parameter used as an ID for that object, which can be retieved with the <tt>XRCID()</tt> macro in code.
 +
 
 +
=== wxWindow Elements ===
  
 
Many of the elements (windows, controls) that are described in an '''XRC''' file are derived from the <tt>wxWindow</tt> class. The all have common properties available:
 
Many of the elements (windows, controls) that are described in an '''XRC''' file are derived from the <tt>wxWindow</tt> class. The all have common properties available:
 
'''Common properties for <tt>wxWindow</tt> derived elements'''
 
  
 
; exstyle
 
; exstyle
: extended window style: wxSIMPLE_BORDER, wxSUNKEN_BORDER, wxDOUBLE_BORDER, wxRAISED_BORDER, wxSTATIC_BORDER, wxNO_BORDER, wxWANTS_CHARS, wxNO_FULL_REPAINT_ON_RESIZE
+
: window styles, see the [https://docs.wxwidgets.org/stable/classwx_window.html wxWindow documentation] for possible styles (separate multiple styles with the "|" (pipe) character)
 
; bg
 
; bg
 
: background window color: RGB color in the #RRGGBB format (HTML like)
 
: background window color: RGB color in the #RRGGBB format (HTML like)
Line 190: Line 191:
 
:: font size in points
 
:: font size in points
 
:; style
 
:; style
:: font style: italic, slant
+
:: font style: normal, italic, slant
 
:; weight
 
:; weight
:: font weight: bold, light
+
:: font weight: normal, bold, light
 
;; family
 
;; family
:: font family: decorative, roman, script, swiss, modern
+
:: font family: decorative, modern, roman, script, swiss, teletype
 
;; underlined
 
;; underlined
 
:: should the font be underlined? bool value (0/1)
 
:: should the font be underlined? bool value (0/1)
Line 209: Line 210:
  
 
All sizer types contain one or more <tt>sizeritem</tt>. A <tt>sizeritem</tt> contains one object (control).
 
All sizer types contain one or more <tt>sizeritem</tt>. A <tt>sizeritem</tt> contains one object (control).
 
<div class="variablelist">
 
  
 
; flag
 
; flag
: See the [http://www.wxwidgets.org/manuals/stable/wx_wxsizer.html#wxsizeradd wxSizer documentation] for a list of possible values.
+
: See the [https://docs.wxwidgets.org/stable/classwx_sizer.html#wxsizer_flags wxSizer documentation] for a list of possible values.
 
; minsize
 
; minsize
 
: pair: minimum size of the sizer (200,200 for example).
 
: pair: minimum size of the sizer (200,200 for example).
Line 224: Line 223:
  
 
The box sizer divides the layout into two components either horizontally or vertically. It contains one or more <tt>sizeritem</tt> tags.
 
The box sizer divides the layout into two components either horizontally or vertically. It contains one or more <tt>sizeritem</tt> tags.
 
'''Properties (as XML sub-elements)'''
 
  
 
; orient
 
; orient
 
: wxBoxSizer orientation: wxVERTICAL, wxHORIZONTAL
 
: wxBoxSizer orientation: wxVERTICAL, wxHORIZONTAL
  
'''Example 3. wxBoxSizer sample'''
+
<syntaxhighlight lang="xml">
 
+
<object class="wxBoxSizer">
<pre><object class="wxBoxSizer">
+
<orient>wxHORIZONTAL</orient>
    <orient>wxHORIZONTAL</orient>
+
<object class="sizeritem">Left control</object>
    <object class="sizeritem">Left control</object>
+
<object class="sizeritem">Right control</object>
    <object class="sizeritem">Right control</object>
+
</object>
</object></pre>
+
</syntaxhighlight>
  
 
==== wxStaticBoxSizer ====
 
==== wxStaticBoxSizer ====
  
 
A static box sizer is a box sizer with a surrounding box and a label.
 
A static box sizer is a box sizer with a surrounding box and a label.
 
'''Properties (as XML sub-elements)'''
 
  
 
; orient
 
; orient
Line 253: Line 248:
 
A grid sizer divides the layout into rows and cols of identical sizes.
 
A grid sizer divides the layout into rows and cols of identical sizes.
  
'''Properties (as XML sub-elements)'''
+
; rows
 
 
; rows</span>
 
 
: Number of rows.
 
: Number of rows.
; cols</span>
+
; cols
 
: Number of cols.
 
: Number of cols.
; vgap</span>
+
; vgap
 
: vertical space between to elements.
 
: vertical space between to elements.
; hgap</span>
+
; hgap
 
: horizontal space between to elements.
 
: horizontal space between to elements.
  
<pre><object class="wxGridSizer">
+
<syntaxhighlight lang="xml">
    <rows>2</rows>
+
<object class="wxGridSizer">
    <cols>2</cols>
+
<rows>2</rows>
    <object class="sizeritem">control in 0,0 (row,col)</object>
+
<cols>2</cols>
    <object class="sizeritem">control in 0,1 (row,col)</object>
+
<object class="sizeritem">control in 0,0 (row,col)</object>
    <object class="sizeritem">control in 1,0 (row,col)</object>
+
<object class="sizeritem">control in 0,1 (row,col)</object>
    <object class="sizeritem">control in 1,1 (row,col)</object>
+
<object class="sizeritem">control in 1,0 (row,col)</object>
</object></pre>
+
<object class="sizeritem">control in 1,1 (row,col)</object>
 +
</object>
 +
</syntaxhighlight>
  
 
==== wxFlexGridSizer ====
 
==== wxFlexGridSizer ====
Line 277: Line 272:
 
A grid sizer divides the layout into rows and cols of identical sizes.
 
A grid sizer divides the layout into rows and cols of identical sizes.
  
<div class="variablelist">
+
; rows
 
 
'''Properties (as XML sub-elements)'''
 
 
 
; rows</span>
 
 
: Number of rows.
 
: Number of rows.
; cols</span>
+
; cols
 
: Number of cols.
 
: Number of cols.
; vgap</span>
+
; vgap
 
: vertical space between to elements.
 
: vertical space between to elements.
; hgap</span>
+
; hgap
 
: horizontal space between to elements.
 
: horizontal space between to elements.
; growablecols</span>
+
; growablecols
 
: list: comma separated list of cols indexes that will grow with the container.
 
: list: comma separated list of cols indexes that will grow with the container.
; growablerows</span>
+
; growablerows
 
: list: comma separated list of rows indexes that will grow with the container.
 
: list: comma separated list of rows indexes that will grow with the container.
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
=== wxBitmapButton ===
  
===5.3. wxBitmapButton===
+
Inherits <tt>wxWindow</tt> properties.
  
</div>
+
; style
 
+
: button style: wxBU_AUTODRAW, wxBU_LEFT, wxBU_RIGHT, wxBU_TOP, wxBU_BOTTOM
Inherits <tt>wxWindow</tt> properties
+
; bitmap
 
 
<div class="variablelist">
 
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxBU_AUTODRAW
 
| wxBU_LEFT
 
| wxBU_RIGHT
 
| wxBU_TOP
 
| wxBU_BOTTOM
 
|}Button styles
 
; bitmap</span>
 
 
: The bitmap path and filename
 
: The bitmap path and filename
; default</span>
+
; default
: bool value (0/1) : 1 if this button is the default button of the dialog or panel.
+
: bool value (0/1) - 1 if this button is the default button of the dialog or panel.
; selected</span>
+
; selected
 
: This is the selected bitmap specifier. Contains a bitmap tag
 
: This is the selected bitmap specifier. Contains a bitmap tag
; focus</span>
+
; focus
 
: This is the focused bitmap specifier. Contains a bitmap tag
 
: This is the focused bitmap specifier. Contains a bitmap tag
; disabled</span>
+
; disabled
 
: This is the disabled bitmap specifier. Contains a bitmap tag
 
: This is the disabled bitmap specifier. Contains a bitmap tag
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<?xml version="1.0"?>
'''Example 4. wxBitmapButton sample'''
+
<resource version="2.4.0">
 +
<object class="wxFrame" name="main_frame">
 +
<title>Testing the XRC resource system</title>
 +
<object class="wxPanel" name="main_panel">
 +
<object class="wxBoxSizer">
 +
<orient>wxVERTICAL</orient>
 +
<object class="sizeritem">
 +
<flag>wxALL|wxGROW</flag>
 +
<option>1</option>
 +
<object class="wxBitmapButton" name="bt_bitmapbutton">
 +
<style>wxBU_LEFT</style>
 +
<bitmap>bt_buttonbitmap.xpm</bitmap>
 +
<selected>bt_buttonbitmaps.xpm</selected>
 +
<focus>bt_buttonbitmapf.xpm</focus>
 +
<disabled>bt_buttonbitmapd.xpm</disabled>
 +
</object>
 +
</object>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxStaticText" name="st_description">
 +
<label>wxBitmapButton test</label>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</resource>
 +
</syntaxhighlight>
  
<?xml version="1.0"?>
+
=== wxButton ===
<resource version="2.4.0">
 
<object class="wxFrame" name="main_frame">
 
<title>Testing the XRC resource system</title>
 
    <object class="wxPanel" name="main_panel">
 
        <object class="wxBoxSizer">
 
        <orient>wxVERTICAL</orient>
 
            <object class="sizeritem">
 
            <flag>wxALL|wxGROW</flag>
 
            <option>1</option>
 
              <object class="wxBitmapButton" name="bt_bitmapbutton">
 
                  <style>wxBU_LEFT</style>
 
                  <bitmap>bt_buttonbitmap.xpm</bitmap>
 
                  <selected>
 
                      <bitmap>bt_buttonbitmaps.xpm</bitmap>
 
                  </selected>
 
                  <focus>
 
                      <bitmap>bt_buttonbitmapf.xpm</bitmap>
 
                  </focus>
 
                  <disabled>
 
                      <bitmap>bt_buttonbitmapd.xpm</bitmap>
 
                  </disabled>
 
              </object>
 
          </object>
 
          <object class="sizeritem">
 
          <flag>wxALL</flag>
 
              <object class="wxStaticText" name="st_description">
 
                  <label>wxBitmapButton test</label>
 
              </object>
 
          </object>
 
        </object>
 
    </object>
 
</object>
 
</resource>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.4. wxButton===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: The button style: wxBU_LEFT, wxBU_RIGHT, wxBU_TOP, wxBU_BOTTOM
'''Attributes'''
+
; label
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxBU_LEFT
 
| wxBU_RIGHT
 
| wxBU_TOP
 
| wxBU_BOTTOM
 
|}The button style
 
; label</span>
 
 
: The label of the button
 
: The label of the button
; default</span>
+
; default
 
: bool value (0/1): 1 if this button is the default button of the dialog or panel.
 
: bool value (0/1): 1 if this button is the default button of the dialog or panel.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<resource version="2.4.0">
 +
<object class="wxFrame" name="main_frame">
 +
<title>Testing the XRC resource system</title>
 +
<object class="wxPanel" name="main_panel">
 +
<object class="wxBoxSizer">
 +
<orient>wxVERTICAL</orient>
 +
<object class="sizeritem">
 +
<flag>wxALL|wxGROW</flag>
 +
<option>1</option>
 +
<object class="wxButton" name="bt_button">
 +
<style>wxBU_LEFT</style>
 +
<label>Button label</label>
 +
</object>
 +
</object>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxStaticText" name="st_description">
 +
<label>wxButton test</label>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</resource>
 +
</syntaxhighlight>
  
'''Example 5. wxButton sample'''
+
=== wxCalendarCtrl ===
 
 
 
<resource version="2.4.0">
 
<object class="wxFrame" name="main_frame">
 
<title>Testing the XRC resource system</title>
 
    <object class="wxPanel" name="main_panel">
 
        <object class="wxBoxSizer">
 
        <orient>wxVERTICAL</orient>
 
            <object class="sizeritem">
 
            <flag>wxALL|wxGROW</flag>
 
            <option>1</option>
 
                <object class="wxButton" name="bt_button">
 
                    <style>wxBU_LEFT</style>
 
                    <label>Button label</label>
 
                </object>
 
            </object>
 
            <object class="sizeritem">
 
            <flag>wxALL</flag>
 
                <object class="wxStaticText" name="st_description">
 
                    <label>wxButton test</label>
 
                </object>
 
            </object>
 
        </object>
 
    </object>
 
</object>
 
</resource>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.5. wxCalendarCtrl===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Calendar styles defining how the calendar control should work: wxCAL_SUNDAY_FIRST, wxCAL_MONDAY_FIRST, wxCAL_SHOW_HOLIDAYS, wxCAL_NO_YEAR_CHANGE, wxCAL_NO_MONTH_CHANGE
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxCAL_SUNDAY_FIRST
 
| wxCAL_MONDAY_FIRST
 
| wxCAL_SHOW_HOLIDAYS
 
| wxCAL_NO_YEAR_CHANGE
 
| wxCAL_NO_MONTH_CHANGE
 
|}Calendar styles defining how the calendar control should work.
 
 
 
</div><div class="example">
 
 
 
'''Example 6. wxCalendarCtrl sample'''
 
 
 
<resource version="2.4.0">
 
<object class="wxFrame" name="main_frame">
 
<title>Testing the XRC resource system</title>
 
  <object class="wxPanel" name="main_panel">
 
  <object class="wxBoxSizer">
 
  <orient>wxVERTICAL</orient>
 
    <object class="sizeritem">
 
    <flag>wxALL|wxGROW</flag>
 
    <option>1</option>
 
    <object class="wxCalendarCtrl" name="calendar">
 
      <style>wxCAL_MONDAY_FIRST|wxCAL_SHOW_HOLIDAYS</style>
 
    </object>
 
    </object>
 
    <object class="sizeritem">
 
    <flag>wxALL</flag>
 
    <object class="wxStaticText" name="st_description">
 
      <label>wxCalendarCtrl test</label>
 
    </object>
 
    </object>
 
  </object>
 
  </object>
 
</object>
 
</resource>
 
 
 
<div class="mediaobject">[[Image:wxCalendarCtrl.png]]</div></div></div><div class="sect2" lang="en"><div class="titlepage">
 
  
===5.6. wxCheckBox===
+
<syntaxhighlight lang="xml">
 +
<resource version="2.4.0">
 +
<object class="wxFrame" name="main_frame">
 +
<title>Testing the XRC resource system</title>
 +
<object class="wxPanel" name="main_panel">
 +
<object class="wxBoxSizer">
 +
<orient>wxVERTICAL</orient>
 +
<object class="sizeritem">
 +
<flag>wxALL|wxGROW</flag>
 +
<option>1</option>
 +
<object class="wxCalendarCtrl" name="calendar">
 +
<style>wxCAL_MONDAY_FIRST|wxCAL_SHOW_HOLIDAYS</style>
 +
</object>
 +
</object>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxStaticText" name="st_description">
 +
<label>wxCalendarCtrl test</label>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</resource>
 +
</syntaxhighlight>
  
</div>
+
=== wxCheckBox ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; label
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; label</span>
 
 
: Label of the check box
 
: Label of the check box
; checked</span>
+
; checked
 
: bool value (1/0): 1 if the check box is checked on creation
 
: bool value (1/0): 1 if the check box is checked on creation
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<resource version="2.4.0">
'''Example 7. wxCheckBox sample'''
+
<object class="wxFrame" name="main_frame">
 
+
<title>Testing the XRC resource system</title>
<resource version="2.4.0">
+
<object class="wxPanel" name="main_panel">
<object class="wxFrame" name="main_frame">
+
<object class="wxBoxSizer">
<title>Testing the XRC resource system</title>
+
<orient>wxVERTICAL</orient>
  <object class="wxPanel" name="main_panel">
+
<object class="sizeritem">
  <object class="wxBoxSizer">
+
<flag>wxALL|wxGROW</flag>
    <orient>wxVERTICAL</orient>
+
<object class="wxCheckBox" name="checkbox_id">
    <object class="sizeritem">
+
<size>200,50</size>
      <flag>wxALL|wxGROW</flag>
+
<label>CheckBoxItem</label>
      <object class="wxCheckBox" name="checkbox_id">
+
<checked>1</checked>
        <size>200,50</size>
+
</object>
        <label>CheckBoxItem</label>
+
</object>
        <checked>1</checked>
+
<object class="sizeritem">
      </object>
+
<flag>wxALL</flag>
    </object>
+
<object class="wxStaticText" name="st_description">
    <object class="sizeritem">
+
<label>wxCheckBox test</label>
      <flag>wxALL</flag>
+
</object>
        <object class="wxStaticText" name="st_description">
+
</object>
        <label>wxCheckBox test</label>
+
</object>
      </object>
+
</object>
    </object>
+
</object>
    </object>
+
</resource>
  </object>
+
</syntaxhighlight>
</object>
 
</resource>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.7. wxCheckList===
 
  
</div>
+
=== wxCheckListBox ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; content
 +
: list of '''item''' tags describing the elements in the control, '''item''' tag attributes:
 +
;; checked
 +
:: bool value (0/1) : 1 if the element is checked
  
'''Attributes'''
+
<syntaxhighlight lang="xml">
 
+
<object class="wxCheckListBox" name="checklistbox_id">
; name</span>
+
<size>200,100</size>
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
+
<content>
 +
<item checked="1">Item value 1</item>
 +
<item checked="0">Item value 2</item>
 +
<item checked="1">Item value 3</item>
 +
<item checked="0">Item value 4</item>
 +
<item checked="1">Item value 5</item>
 +
</content>
 +
</object>
 +
</syntaxhighlight>
  
</div><div class="variablelist">
+
=== wxChoice ===
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; content</span>
 
: list of <span class="emphasis">''item''</span> tags describing the elements in the "checklist" control.<div class="variablelist">'''item tag attribute'''
 
;; checked</span>
 
:: bool value (0/1) : 1 if the element is checked</div>
 
 
 
</div><div class="example">
 
 
 
'''Example 8. wxCheckList sample'''
 
 
 
<object class="wxCheckList" name="checklistbox_id">
 
<size>200,100</size>
 
<content>
 
  <item checked="1">Item value 1</item>
 
  <item checked="0">Item value 2</item>
 
  <item checked="1">Item value 3</item>
 
  <item checked="0">Item value 4</item>
 
  <item checked="1">Item value 5</item>
 
</content>
 
</object>
 
 
 
<div class="mediaobject">[[Image:wxCheckListSample.png]]</div></div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.8. wxChoice===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; selection
 +
: integer value: index (0 based) of the selected entry
 +
; content
 +
: list of '''item''' tags describing the elements in the control, '''item''' tag attributes:
 +
;; checked
 +
:: bool value (0/1) : 1 if the element is checked
  
'''Attributes'''
+
<syntaxhighlight lang="xml">
 +
<object class="wxChoice" name="choice_id">
 +
<size>200,100</size>
 +
<selection>2</selection>
 +
<content>
 +
<item checked="1">Item value 1</item>
 +
<item checked="0">Item value 2</item>
 +
<item checked="1">Item value 3</item>
 +
<item checked="0">Item value 4</item>
 +
<item checked="1">Item value 5</item>
 +
</content>
 +
</object>
 +
</syntaxhighlight>
  
; name</span>
+
=== wxComboBox ===
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; selection</span>
 
: integer value: index ( 0 based ) of the selected entry
 
; content</span>
 
: list of <span class="emphasis">''item''</span> tags describing the elements in the "checklist" control.<div class="variablelist">'''item tag attribute'''
 
;; checked</span>
 
:: bool value (0/1) : 1 if the element is checked</div>
 
 
 
</div><div class="example">
 
 
 
'''Example 9. wxChoice sample'''
 
 
 
<object class="wxChoice" name="choice_id">
 
<size>200,100</size>
 
<selection>2</selection>
 
  <content>
 
  <item checked="1">Item value 1</item>
 
  <item checked="0">Item value 2</item>
 
  <item checked="1">Item value 3</item>
 
  <item checked="0">Item value 4</item>
 
  <item checked="1">Item value 5</item>
 
  </content>
 
</object>
 
 
 
</div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.9. wxComboBox===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: combo style: wxCB_SIMPLE, wxCB_SORT, wxCB_READONLY, wxCB_DROPDOWN
'''Attributes'''
+
; value
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxCB_SIMPLE
 
| wxCB_SORT
 
| wxCB_READONLY
 
| wxCB_DROPDOWN
 
|}combo style
 
; value</span>
 
 
: initial value of the combo as text
 
: initial value of the combo as text
; selection</span>
+
; selection
 
: integer value: index ( 0 based ) of the selected entry
 
: integer value: index ( 0 based ) of the selected entry
; content</span>
+
; content
: list of <span class="emphasis">''item''</span> tags describing the elements in the "checklist" control.<div class="variablelist">'''item tag attribute'''
+
: list of '''item''' tags describing the elements in the control, '''item''' tag attributes:
;; checked</span>
+
;; checked
:: bool value (0/1) : this has no meaning in a combo</div>
+
:: bool value (0/1) : 1 if the element is checked
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxComboBox" name="combo_id">
'''Example 10. wxComboBox sample'''
+
<size>200,100</size>
 
+
<style>wxCB_DROPDOWN</style>
<object class="wxComboBox" name="combo_id">
+
<selection>2</selection>
<size>200,100</size>
+
<content>
<style>wxCB_DROPDOWN</style>
+
<item checked="1">Item value 1</item>
<selection>2</selection>
+
<item checked="0">Item value 2</item>
  <content>
+
<item checked="1">Item value 3</item>
  <item checked="1">Item value 1</item>
+
<item checked="0">Item value 4</item>
  <item checked="0">Item value 2</item>
+
<item checked="1">Item value 5</item>
  <item checked="1">Item value 3</item>
+
</content>
  <item checked="0">Item value 4</item>
+
</object>
  <item checked="1">Item value 5</item>
+
</syntaxhighlight>
  </content>
 
</object>
 
 
 
<div class="mediaobject">[[Image:wxComboBoxSample.png]]</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.10. wxDialog===
 
 
 
</div>
 
  
Inherits <tt>wxWindow</tt> properties.
+
=== wxDialog ===
  
This is a top-level component, and it can have multiple sub elements ( sizers, controls).
+
Inherits <tt>wxWindow</tt> properties.  This is a top-level component, and it can have multiple sub elements (sizers, controls).
  
<div class="variablelist">
+
; title
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; title</span>
 
 
: Title of the dialog as text
 
: Title of the dialog as text
; style</span>
+
; style
: {| class="simplelist" summary="Simple list"
+
: see the [https://docs.wxwidgets.org/stable/classwx_dialog.html wxDialog documentation] for a list of styles
| wxSTAY_ON_TOP
+
; centered
| wxCAPTION
 
| wxDEFAULT_DIALOG_STYLE
 
| wxTHICK_FRAME
 
| wxSYSTEM_MENU
 
|-
 
| wxRESIZE_BORDER
 
| wxRESIZE_BOX
 
| wxDIALOG_MODAL
 
| wxDIALOG_MODELESS
 
| wxNO_3D
 
|-
 
| wxTAB_TRAVERSAL
 
| wxWS_EX_VALIDATE_RECURSIVELY
 
| wxCLIP_CHILDREN
 
| wxMAXIMIZE_BOX
 
| wxMINIMIZE_BOX
 
|}Dialog styles
 
; centered</span>
 
 
: bool value(0/1) : 1 if the dialog should be centered on it's parent screen.
 
: bool value(0/1) : 1 if the dialog should be centered on it's parent screen.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxDialog" name="test_dialog">
'''Example 11. wxDialog sample'''
+
<title>My Dialog</title>
 
+
<style>wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX</style>
<object class="wxDialog" name="test_dialog">
+
<object class="wxBoxSizer">
<title>My Dialog</title>
+
<orient>wxVERTICAL</orient>
<style>wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX</style>
+
<object class="sizeritem">
  <object class="wxBoxSizer">
+
<flag>wxALL</flag>
  <orient>wxVERTICAL</orient>
+
<object class="wxTextCtrl" name="textctrl_id">
  <object class="sizeritem">
+
<value>Hello World !!!!</value>
  <flag>wxALL</flag>
+
</object>
    <object class="wxTextCtrl" name="textctrl_id">
+
</object>
    <value>Hello World !!!!</value>
+
<object class="sizeritem">
    </object>
+
<flag>wxALL</flag>
  </object>
+
<object class="wxStaticText" name="st_description">
  <object class="sizeritem">
+
<label>wxComboBox test</label>
  <flag>wxALL</flag>
+
</object>
    <object class="wxStaticText" name="st_description">
+
</object>
    <label>wxComboBox test</label>
+
</object>
    </object>
+
</object>
  </object>
+
</syntaxhighlight>
  </object>
 
</object>
 
 
 
</div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.11. wxFrame===
 
 
 
</div>
 
 
 
Inherits <tt>wxWindow</tt> properties.
 
 
 
This is a top-level component, and it can have multiple sub elements ( sizers, controls ).
 
 
 
<div class="variablelist">
 
 
 
'''Attributes'''
 
  
; name</span>
+
=== wxFrame ===
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
  
</div><div class="variablelist">
+
Inherits <tt>wxWindow</tt> properties.  This is a top-level component, and it can have multiple sub elements (sizers, controls ).
  
'''Properties(as XML sub-elements)'''
+
; title
 
 
; title</span>
 
 
: Title of the frame as text
 
: Title of the frame as text
; style</span>
+
; style
: {| class="simplelist" summary="Simple list"
+
: see the [https://docs.wxwidgets.org/stable/classwx_frame.html wxFrame documentation] for a list of styles.
| wxSTAY_ON_TOP
+
; centered
| wxCAPTION
 
| wxDEFAULT_DIALOG_STYLE
 
| wxDEFAULT_FRAME_STYLE
 
| wxTHICK_FRAME
 
|-
 
| wxSYSTEM_MENU
 
| wxRESIZE_BORDER
 
| wxRESIZE_BOX
 
| wxFRAME_TOOL_WINDOW
 
| wxFRAME_FLOAT_ON_PARENT
 
|-
 
| wxMAXIMIZE_BOX
 
| wxMINIMIZE_BOX
 
| wxSTAY_ON_TOP
 
| wxNO_3D
 
| wxTAB_TRAVERSAL
 
|-
 
| wxWS_EX_VALIDATE_RECURSIVELY
 
| wxCLIP_CHILDREN
 
|}Frame style
 
; centered</span>
 
 
: bool value(0/1) : 1 if the frame should be centered on it's parent screen.
 
: bool value(0/1) : 1 if the frame should be centered on it's parent screen.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxFrame" name="main_frame">
 +
<title>Testing the XRC resource system</title>
 +
<object class="wxPanel" name="main_panel">
 +
<object class="wxBoxSizer">
 +
<orient>wxVERTICAL</orient>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxTextCtrl" name="textctrl_id">
 +
<value>Hello World !!!!</value>
 +
</object>
 +
</object>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxStaticText" name="st_description">
 +
<label>wxComboBox test</label>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 12. wxFrame sample'''
+
=== wxGauge ===
 
 
<object class="wxFrame" name="main_frame">
 
<title>Testing the XRC resource system</title>
 
  <object class="wxPanel" name="main_panel">
 
  <object class="wxBoxSizer">
 
  <orient>wxVERTICAL</orient>
 
    <object class="sizeritem">
 
    <flag>wxALL</flag>
 
      <object class="wxTextCtrl" name="textctrl_id">
 
      <value>Hello World !!!!</value>
 
      </object>
 
    </object>
 
    <object class="sizeritem">
 
    <flag>wxALL</flag>
 
      <object class="wxStaticText" name="st_description">
 
      <label>wxComboBox test</label>
 
      </object>
 
    </object>
 
  </object>
 
  </object>
 
</object>
 
 
 
<div class="mediaobject">[[Image:wxFrameSample.png]]</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.12. wxGauge===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Gauge style: wxGA_HORIZONTAL, wxGA_VERTICAL, wxGA_PROGRESSBAR, wxGA_SMOOTH
'''Attributes'''
+
; range
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxGA_HORIZONTAL
 
| wxGA_VERTICAL
 
| wxGA_PROGRESSBAR
 
| wxGA_SMOOTH
 
|}Gauge style
 
; range</span>
 
 
: integer value: maximum value for the gauge.
 
: integer value: maximum value for the gauge.
; value</span>
+
; value
 
: integer value: initial value for the gauge position.
 
: integer value: initial value for the gauge position.
; shadow</span>
+
; shadow
 
: integer value: width of the shadow.
 
: integer value: width of the shadow.
; bezel</span>
+
; bezel
 
: integer value: width of the bezel face.
 
: integer value: width of the bezel face.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxGauge" name="gauge_id">
 +
<style>wxGA_HORIZONTAL|wxGA_PROGRESSBAR|wxGA_SMOOTH</style>
 +
<shadow>20</shadow>
 +
<bezel>40</bezel>
 +
<range>100</range>
 +
<value>33</value>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 13. wxGauge sample'''
+
=== wxGenericDirCtrl ===
  
<object class="wxGauge" name="gauge_id">
+
Inherits <tt>wxWindow</tt> properties
<style>wxGA_HORIZONTAL|wxGA_PROGRESSBAR|wxGA_SMOOTH</style>
 
<shadow>20</shadow>
 
<bezel>40</bezel>
 
<range>100</range>
 
<value>33</value>
 
</object>
 
  
</div><div class="sect2" lang="en"><div class="titlepage">
+
<div style="background: #cfc; margin: 1em 3em; padding: 0.2em 0.5em;">
 
+
'''Tip'''
===5.13. wxGenericDirCtrl===
 
  
 +
Default size of this control seems to be 0,0. So you should always put a '''size''' tag.
 
</div>
 
</div>
  
Inherits <tt>wxWindow</tt> properties
+
; style
 
+
: Control style: wxDIRCTRL_DIR_ONLY, wxDIRCTRL_3D_INTERNAL, wxDIRCTRL_SELECT_FIRST, wxDIRCTRL_SHOW_FILTERS
<div class="tip" style="margin-left: 0.5in; margin-right: 0.5in">
+
; defaultfolder
 
 
===Tip===
 
 
 
default size of this control seems to be 0,0. So you should always put a <span class="emphasis">''size''</span> tag.
 
 
 
</div><div class="variablelist">
 
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxDIRCTRL_DIR_ONLY
 
| wxDIRCTRL_3D_INTERNAL
 
| wxDIRCTRL_SELECT_FIRST
 
| wxDIRCTRL_SHOW_FILTERS
 
|}Control style
 
; defaultfolder</span>
 
 
: Text value: path of the default directory.
 
: Text value: path of the default directory.
; filter</span>
+
; filter
 
: Text value: expression of the files to be displayed (wild card enabled).
 
: Text value: expression of the files to be displayed (wild card enabled).
; defaultfilter</span>
+
; defaultfilter
 
: long value: index of the default filter.
 
: long value: index of the default filter.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxGenericDirCtrl" name="dirctrl_id">
'''Example 14. wxGenericDirCtrl sample'''
+
<size>200,200</size>
 
+
<style>wxDIRCTRL_SHOW_FILTERS</style>
<object class="wxGenericDirCtrl" name="dirctrl_id">
+
<defaultfolder>e:/temp</defaultfolder>
<size>200,200</size>
+
<defaultfilter>1</defaultfilter>
<style>wxDIRCTRL_SHOW_FILTERS</style>
+
<filter>*.txt</filter>
<defaultfolder>e:/temp</defaultfolder>
+
<filter>*.jpg</filter>
<defaultfilter>1</defaultfilter>
+
<filter>*.zip</filter>
<filter>*.txt</filter>
+
</object>
<filter>*.jpg</filter>
+
</syntaxhighlight>
<filter>*.zip</filter>
 
</object>
 
 
 
</div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.14. wxHtmlWindow===
 
  
</div>
+
=== wxHtmlWindow ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: HTML window style: wxHW_SCROLLBAR_NEVER, wxHW_SCROLLBAR_AUTO
'''Attributes'''
+
; borders
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxHW_SCROLLBAR_NEVER
 
| wxHW_SCROLLBAR_AUTO
 
|}HTML window style
 
; borders</span>
 
 
: integer value: border size to leave between the left and top border of the window, and the HTML display.
 
: integer value: border size to leave between the left and top border of the window, and the HTML display.
; htmlcode</span>
+
; htmlcode
 
: text value: the HTML the control should display.
 
: text value: the HTML the control should display.
; url</span>
+
; url
 
: text: path to an HTML file to display.
 
: text: path to an HTML file to display.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxHtmlWindow" name="htmlid_id">
'''Example 15. xwHtmlWindow sample'''
+
<size>200,200</size>
 +
<borders>20d</borders>
 +
<htmlcode>&lt;b&gt;This is a simple text&lt;/b&gt;</htmlcode>
 +
</object>
 +
</syntaxhighlight>
  
<object class="wxHtmlWindow" name="htmlid_id">
+
=== wxListBox ===
<size>200,200</size>
 
<borders>20d</borders>
 
<htmlcode>&lt;b&gt;This is a simple text&lt;/b&gt;</htmlcode>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.15. wxListBox===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 +
: List box style: wxLB_SINGLE, wxLB_MULTIPLE, wxLB_EXTENDED, wxLB_HSCROLL, wxLB_ALWAYS_SB, wxLB_NEEDED_SB, wxLB_SORT
 +
; selection
 +
: integer value: index (0 based) of the selected entry
 +
; content
 +
: list of '''item''' tags describing the elements in the control.
  
'''Attributes'''
+
<syntaxhighlight lang="xml">
 
+
<object class="wxListBox" name="listbox_id">
; name</span>
+
<selection>2</selection>
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
+
<content>
 
+
<item>Item value 1</item>
</div><div class="variablelist">
+
<item>Item value 2</item>
 
+
<item>Item value 3</item>
'''Properties(as XML sub-elements)'''
+
<item>Item value 4</item>
 +
<item>Item value 5</item>
 +
</content>
 +
</object>
 +
</syntaxhighlight>
  
; style</span>
+
=== wxListCtrl ===
: {| class="simplelist" summary="Simple list"
 
| wxLB_SINGLE
 
| wxLB_MULTIPLE
 
| wxLB_EXTENDED
 
| wxLB_HSCROLL
 
| wxLB_ALWAYS_SB
 
|-
 
| wxLB_NEEDED_SB
 
| wxLB_SORT
 
|}List box style
 
; selection</span>
 
: integer value: index ( 0 based ) of the selected entry
 
; content</span>
 
: list of <span class="emphasis">''item''</span> tags describing the elements in the "list box" control.
 
 
 
</div><div class="example">
 
 
 
'''Example 16. wxListBox sample'''
 
 
 
<object class="wxListBox" name="listbox_id">
 
<selection>2</selection>
 
<content>
 
  <item>Item value 1</item>
 
  <item>Item value 2</item>
 
  <item>Item value 3</item>
 
  <item>Item value 4</item>
 
  <item>Item value 5</item>
 
</content>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.16. wxListCtrl===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 +
: List control style, see the [https://docs.wxwidgets.org/stable/classwx_list_ctrl.html wxListCtrl documentation] for a list of styles.
  
'''Attributes'''
+
<syntaxhighlight lang="xml">
 +
<object class="wxListCtrl" name="listctrl_id">
 +
<style>wxLC_REPORT|wxLC_ICON</style>
 +
</object>
 +
</syntaxhighlight>
  
; name</span>
+
=== wxMenuBar ===
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
  
</div><div class="variablelist">
+
Does '''not''' inherit <tt>wxWindow</tt> properties. A <tt>wxMenuBar</tt> can contain one or more <tt>wxMenu</tt> sub-elements.
  
'''Properties(as XML sub-elements)'''
+
; style
 +
: Menu bar style: wxMB_DOCKABLE
  
; style</span>
+
==== wxMenu ====
: {| class="simplelist" summary="Simple list"
 
| wxLC_LIST
 
| wxLC_REPORT
 
| wxLC_ICON
 
| wxLC_SMALL_ICON
 
| wxLC_ALIGN_TOP
 
|-
 
| wxLC_ALIGN_LEFT
 
| wxLC_AUTOARRANGE
 
| wxLC_USER_TEXT
 
| wxLC_EDIT_LABELS
 
| wxLC_NO_HEADER
 
|-
 
| wxLC_SINGLE_SEL
 
| wxLC_SORT_DESCENDING
 
| wxLC_SORT_ASCENDING
 
|}List control style
 
  
</div><div class="example">
+
Does '''not''' inherit <tt>wxWindow</tt> properties. A menu contains one or more <tt>wxMenuItem</tt> tags.
  
'''Example 17. wxListCtrl sample'''
+
; style
 
+
: Menu style: wxMENU_TEAROFF
<object class="wxListCtrl" name="listctrl_id">
+
; label
<style>wxLC_REPORT|wxLC_ICON</style>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.17. wxMenuBar===
 
 
 
</div>
 
 
 
Does <span class="emphasis">''not''</span> inherit <tt>wxWindow</tt> properties. A <tt>wxMenuBar</tt> can contain one or more <tt>wxMenu</tt> sub-elements.
 
 
 
<div class="variablelist">
 
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxMB_DOCKABLE
 
|}Menu bar style
 
 
 
</div><div class="example">
 
 
 
'''Example 18. wxMenuBar sample'''
 
 
 
<object class="wxMenuBar" name="main_menu_bar">
 
  <object class="wxMenu" name="file_menu">
 
  <label>File</label>
 
  <help>File menu</help>
 
  <style>wxMENU_TEAROFF</style>
 
  <object class="wxMenuItem" name="open_menu_item">
 
    <label>Open</label>
 
    <help>Opens a file</help>
 
    <accel>Alt-O</accel>
 
  </object>
 
  <object class="wxMenuItem" name="radio_menu_item">
 
    <label>Radio</label>
 
    <radio>1</radio>
 
  </object>
 
  <object class="wxMenuItem" name="check_menu_item">
 
    <label>Check</label>
 
    <checkable>1</checkable>
 
    <enabled>1</enabled>
 
    <checked>1</checked>
 
  </object>
 
  <object class="break" />
 
  <object class="wxMenuItem" name="close_menu_item">
 
    <label>Close</label>
 
    <help>Closes a file</help>
 
    <bitmap>bt_buttonbitmap.xpm</bitmap>
 
  </object>
 
  <object class="separator" />
 
  <object class="wxMenuItem" name="exit_menu_item">
 
    <label>Exit</label>
 
    <help>Exits the program</help>
 
    <accel>Alt-X</accel>
 
  </object>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.18. wxMenu===
 
 
 
</div>
 
 
 
Does <span class="emphasis">''not''</span> inherit <tt>wxWindow</tt> properties. A menu contains one or more <tt>wxMenuItem</tt> tags.
 
 
 
<div class="variablelist">
 
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxMENU_TEAROFF
 
|}Menu style
 
; label</span>
 
 
: Text: label of the menu.
 
: Text: label of the menu.
; help</span>
+
; help
 
: Text: displayed help string.
 
: Text: displayed help string.
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
==== wxMenuItem ====
  
===5.19. wxMenuItem===
+
Does '''not''' inherit <tt>wxWindow</tt> properties.
  
</div>
+
; style
 
+
: Menu style: wxMENU_TEAROFF
Does <span class="emphasis">''not''</span> inherit <tt>wxWindow</tt> properties.
+
; label
 
 
<div class="variablelist">
 
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxMENU_TEAROFF
 
|}Menu style
 
; label</span>
 
 
: Text: label of the menu.
 
: Text: label of the menu.
; accel</span>
+
; accel
 
: Text: accelerator associated to this item ( Alt-X for example ).
 
: Text: accelerator associated to this item ( Alt-X for example ).
; help</span>
+
; help
 
: Text: displayed help string.
 
: Text: displayed help string.
; radio</span>
+
; radio
 
: bool value(0/1): 1 if this item is a radio menu item.
 
: bool value(0/1): 1 if this item is a radio menu item.
; checkable</span>
+
; checkable
 
: bool value(0/1): 1 if this item is a check menu item.
 
: bool value(0/1): 1 if this item is a check menu item.
; enabled</span>
+
; enabled
 
: bool value(0/1): 1 if this item is initially enabled.
 
: bool value(0/1): 1 if this item is initially enabled.
; checked</span>
+
; checked
 
: bool value(0/1): 1 if this (check) item is initially checked.
 
: bool value(0/1): 1 if this (check) item is initially checked.
; bitmap</span>
+
; bitmap
 
: Text: path to a bitmap to draw at the left of the item.
 
: Text: path to a bitmap to draw at the left of the item.
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxMenuBar" name="main_menu_bar">
===5.20. wxNotebook===
+
<object class="wxMenu" name="file_menu">
 
+
<label>File</label>
</div>
+
<help>File menu</help>
 
+
<style>wxMENU_TEAROFF</style>
Does <span class="emphasis">''not''</span> Inherit <tt>wxWindow</tt> properties. A <tt>wxNotebook</tt> tag contains one or more <tt>notebookpage</tt> tags.
+
<object class="wxMenuItem" name="open_menu_item">
 
+
<label>Open</label>
<div class="variablelist">
+
<help>Opens a file</help>
 
+
<accel>Alt-O</accel>
'''Attributes'''
+
</object>
 
+
<object class="wxMenuItem" name="radio_menu_item">
; name</span>
+
<label>Radio</label>
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
+
<radio>1</radio>
 +
</object>
 +
<object class="wxMenuItem" name="check_menu_item">
 +
<label>Check</label>
 +
<checkable>1</checkable>
 +
<enabled>1</enabled>
 +
<checked>1</checked>
 +
</object>
 +
<object class="break" />
 +
<object class="wxMenuItem" name="close_menu_item">
 +
<label>Close</label>
 +
<help>Closes a file</help>
 +
<bitmap>bt_buttonbitmap.xpm</bitmap>
 +
</object>
 +
<object class="separator" />
 +
<object class="wxMenuItem" name="exit_menu_item">
 +
<label>Exit</label>
 +
<help>Exits the program</help>
 +
<accel>Alt-X</accel>
 +
</object>
 +
</object>
 +
</object>
 +
</syntaxhighlight>
  
</div><div class="variablelist">
+
=== wxNotebook ===
  
'''Properties(as XML sub-elements)'''
+
Does '''not''' Inherit <tt>wxWindow</tt> properties. A <tt>wxNotebook</tt> tag contains one or more <tt>notebookpage</tt> tags.
  
; style</span>
+
; style
: {| class="simplelist" summary="Simple list"
+
: Notebook style: wxNB_FIXEDWIDTH, wxNB_MULTILINE, wxNB_NOPAGETHEME, wxBK_LEFT, wxBK_RIGHT, wxBK_BOTTOM and wxBK_TOP (wxNB_LEFT, wxNB_RIGHT, wxNB_BOTTOM and wxNB_TOP for 2.6 and below)
| wxNB_FIXEDWIDTH
+
; usenotebooksizer
| wxNB_LEFT
 
| wxNB_RIGHT
 
| wxNB_BOTTOM
 
|}Notebook style
 
; usenotebooksizer</span>
 
 
: bool value(0/1): 1 if a notebook sizer is to be used to handle notebook pages.
 
: bool value(0/1): 1 if a notebook sizer is to be used to handle notebook pages.
  
</div><div class="example">
+
==== notebookpage ====
  
'''Example 19. wxNotebook sample'''
+
A <tt>notebookpage</tt> can only appear inside a <tt>wxNotebook</tt>. It contains one or more objects like panels and controls.
  
<object class="wxNotebook" name="main_notebook">
+
; label
  <object class="notebookpage" name="firstnotepage">
 
  <label>First</label>
 
  <selected>1</selected>
 
  <object class="wxPanel" name="main_panel">
 
    <object class="wxBoxSizer">
 
    <orient>wxVERTICAL</orient>
 
    <object class="sizeritem">
 
    <flag>wxALL</flag>
 
      <object class="wxTextCtrl" name="textctrl_id">
 
      <value>Hello World !!!</value>
 
      </object>
 
    </object>
 
    <object class="sizeritem">
 
    <flag>wxALL</flag>
 
      <object class="wxStaticText" name="st_description">
 
      <label>wxListCtrl test</label>
 
      </object>
 
    </object>
 
    </object>
 
  </object>
 
  </object>
 
  <object class="notebookpage" name="secondnotepage">
 
  <label>Second</label>
 
  <object class="wxPanel" name=" secondpanel">
 
    <object class="wxFlexGridSizer">
 
    <cols>1</cols>
 
    <rows>0</rows>
 
    <growablerows>0</growablerows>
 
    <growablecols>1</growablecols>
 
    <object class="sizeritem">
 
      <flag>wxALL</flag>
 
      <object class="wxTextCtrl" name="st_second_text">
 
        <value>Static text</value>
 
      </object>
 
      </object>
 
    </object>
 
    </object>
 
  </object>
 
  </object>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.21. notebookpage===
 
 
 
</div>
 
 
 
A <tt>notebookpage</tt> can only appear inside a <tt>wxNotebook. It contains one or more objects like panels and controls.</tt>
 
 
 
<div class="variablelist">
 
 
 
; label</span>
 
 
: Text: label of the page.
 
: Text: label of the page.
; selected</span>
+
; selected
 
: bool value(0/1): is this page the selected one.
 
: bool value(0/1): is this page the selected one.
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
<syntaxhighlight lang="xml">
 +
<object class="wxNotebook" name="main_notebook">
 +
<object class="notebookpage" name="firstnotepage">
 +
<label>First</label>
 +
<selected>1</selected>
 +
<object class="wxPanel" name="main_panel">
 +
<object class="wxBoxSizer">
 +
<orient>wxVERTICAL</orient>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxTextCtrl" name="textctrl_id">
 +
<value>Hello World !!!</value>
 +
</object>
 +
</object>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxStaticText" name="st_description">
 +
<label>wxListCtrl test</label>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
<object class="notebookpage" name="secondnotepage">
 +
<label>Second</label>
 +
<object class="wxPanel" name="secondpanel">
 +
<object class="wxFlexGridSizer">
 +
<cols>1</cols>
 +
<rows>0</rows>
 +
<growablerows>0</growablerows>
 +
<growablecols>1</growablecols>
 +
<object class="sizeritem">
 +
<flag>wxALL</flag>
 +
<object class="wxTextCtrl" name="st_second_text">
 +
<value>Static text</value>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</object>
 +
</syntaxhighlight>
  
===5.22. wxPanel===
+
=== wxPanel ===
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties. A panel contains zero or more sizers and controls.
 
Inherits <tt>wxWindow</tt> properties. A panel contains zero or more sizers and controls.
  
<div class="variablelist">
+
; style
 +
: Panel style: wxNO_3D, wxTAB_TRAVERSAL, wxWS_EX_VALIDATE_RECURSIVELY, wxCLIP_CHILDREN
  
'''Attributes'''
+
=== wxRadioButton ===
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxNO_3D
 
| wxTAB_TRAVERSAL
 
| wxWS_EX_VALIDATE_RECURSIVELY
 
| wxCLIP_CHILDREN
 
|}Panel style.
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.23. wxRadioButton===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties.
 
Inherits <tt>wxWindow</tt> properties.
  
<div class="variablelist">
+
; style
 
+
: Radio button style: wxRB_GROUP
'''Attributes'''
+
; label
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxRB_GROUP
 
|}Radio button style
 
; label</span>
 
 
: Text: label of the button.
 
: Text: label of the button.
; value</span>
+
; value
 
: bool value(0/1): 1 if the button is selected.
 
: bool value(0/1): 1 if the button is selected.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxRadioButton" name="radiobutton_id">
'''Example 20. wxRadioButton sample'''
+
<label>Radio button</label>
 
+
<value>1</value>
<object class="wxRadioButton" name="radiobutton_id">
+
</object>
<label>Radio button</label>
+
</syntaxhighlight>
<value>1</value>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.24. wxRadioBox===
 
  
</div>
+
=== wxRadioBox ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Radio box style: wxRA_SPECIFY_COLS, wxRA_HORIZONTAL, wxRA_SPECIFY_ROWS, wxRA_VERTICAL
'''Attributes'''
+
; selection
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxRA_SPECIFY_COLS
 
| wxRA_HORIZONTAL
 
| wxRA_SPECIFY_ROWS
 
| wxRA_VERTICAL
 
|}Radio box style
 
; selection</span>
 
 
: integer value: index ( 0 based ) of the selected entry
 
: integer value: index ( 0 based ) of the selected entry
; content</span>
+
; content
: list of <span class="emphasis">''item''</span> tags describing the elements in the "radiobox" control.
+
: list of '''item''' tags describing the elements in the control.
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxRadioBox" name="radiobox_id">
'''Example 21. wxRadioBox sample'''
+
<label>Radio box</label>
 
+
<selection>1</selection>
<object class="wxRadioBox" name="radiobox_id">
+
<dimension>2</dimension>
<label>Radio box</label>
+
<content>
<selection>1</selection>
+
<item>Value 1</item>
<dimension>2</dimension>
+
<item>Value 2</item>
<content>
+
<item>Value 3</item>
  <item>Value 1</item>
+
<item>Value 4</item>
  <item>Value 2</item>
+
<item>Value 5</item>
  <item>Value 3</item>
+
<item>Value 6</item>
  <item>Value 4</item>
+
</content>
  <item>Value 5</item>
+
</object>
  <item>Value 6</item>
+
</syntaxhighlight>
</content>
 
</object>
 
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
=== wxScrollBar ===
 
 
===5.25. wxScrollBar===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Scroll bar style: wxSB_HORIZONTAL, wxSB_VERTICAL
'''Attributes'''
+
; value
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxSB_HORIZONTAL
 
| wxSB_VERTICAL
 
|}Scroll bar style
 
; value</span>
 
 
: long: current position
 
: long: current position
; thumbsize</span>
+
; thumbsize
 
: long: view size
 
: long: view size
; range</span>
+
; range
 
: long: max value of the scrollbar
 
: long: max value of the scrollbar
; pagesize</span>
+
; pagesize
 
: long: size of one scrolled page
 
: long: size of one scrolled page
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxScrollBar" name="scrollbar_id">
 +
<size>-1,100</size>
 +
<value>50</value>
 +
<range>100</range>
 +
<thumbsize>30</thumbsize>
 +
<style>wxSB_VERTICAL</style>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 22. wxScrollBar sample'''
+
=== wxScrolledWindow ===
 
 
<object class="wxScrollBar" name="scrollbar_id">
 
<size>-1,100</size>
 
<value>50</value>
 
<range>100</range>
 
<thumbsize>30</thumbsize>
 
<style>wxSB_VERTICAL</style>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.26. wxScrolledWindow===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 +
: Scrolled window style: wxHSCROLL, wxVSCROLL
  
'''Attributes'''
+
<syntaxhighlight lang="xml">
 
+
<object class="wxScrolledWindow" name="scrolledwindow_id">
; name</span>
+
<bg>#FFFFFF</bg>
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
+
<style>wxHSCROLL|wxVSCROLL</style>
 
+
<size>200,200</size>
</div><div class="variablelist">
+
</object>
 
+
</syntaxhighlight>
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxHSCROLL
 
| wxVSCROLL
 
|}Scrolled window style
 
 
 
</div><div class="example">
 
 
 
'''Example 23. wxScrolledWindow sample'''
 
 
 
<object class="wxScrolledWindow" name="scrolledwindow_id">
 
<bg>#FFFFFF</bg>
 
<style>wxHSCROLL|wxVSCROLL</style>
 
<size>200,200</size>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.27. wxSlider===
 
  
</div>
+
=== wxSlider ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Slider style, see the [https://docs.wxwidgets.org/stable/classwx_slider.html wxSlider documentation] for a list of styles.
'''Attributes'''
+
; value
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxSL_HORIZONTAL
 
| wxSL_VERTICAL
 
| wxSL_AUTOTICKS
 
| wxSL_LABELS
 
| wxSL_LEFT
 
|-
 
| wxSL_RIGHT
 
| wxSL_BOTTOM
 
| wxSL_BOTH
 
| wxSL_SELRANGE
 
|}Slider style
 
; value</span>
 
 
: long: current position of the slider
 
: long: current position of the slider
; min</span>
+
; min
 
: long: minimum position of the slider
 
: long: minimum position of the slider
; max</span>
+
; max
 
: long: maximum position of the slider
 
: long: maximum position of the slider
; tickfreq</span>
+
; tickfreq
 
: long: tick frequency
 
: long: tick frequency
; pagesize</span>
+
; pagesize
 
: long: The number of steps the slider moves when the user pages up or down
 
: long: The number of steps the slider moves when the user pages up or down
; linesize</span>
+
; linesize
 
: long: the number of steps the slider moves when the user moves it up or down a line
 
: long: the number of steps the slider moves when the user moves it up or down a line
; thumb</span>
+
; thumb
 
: long: sets the thumb length
 
: long: sets the thumb length
; tick</span>
+
; tick
 
: long: position of a tick
 
: long: position of a tick
; selmin, </span>selmax</span>
+
; selmin, selmax
 
: long: sets minimum and maximum selection position
 
: long: sets minimum and maximum selection position
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxSlider" name="slider_id">
'''Example 24. wxSlider sample'''
+
<style>wxSL_HORIZONTAL|wxSL_AUTOTICKS</style>
 
+
<size>200,200</size>
<object class="wxSlider" name="slider_id">
+
<tickfreq>10</tickfreq>
<style>wxSL_HORIZONTAL|wxSL_AUTOTICKS</style>
+
<value>50</value>
<size>200,200</size>
+
<min>10</min>
<tickfreq>10</tickfreq>
+
<max>200</max>
<value>50</value>
+
</object>
<min>10</min>
+
</syntaxhighlight>
<max>200</max>
 
</object>
 
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
=== wxSpinButton ===
 
 
===5.28. wxSpinButton===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Spin button style: wxSP_HORIZONTAL, wxSP_VERTICAL, wxSP_ARROW_KEYS, wxSP_WRAP
'''Attributes'''
+
; value
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxSP_HORIZONTAL
 
| wxSP_VERTICAL
 
| wxSP_ARROW_KEYS
 
| wxSP_WRAP
 
|}Spin button style
 
; value</span>
 
 
: long: current value of the spin button
 
: long: current value of the spin button
; min</span>
+
; min
 
: long: minimum value of the spin button
 
: long: minimum value of the spin button
; max</span>
+
; max
 
: long: maximum value of the spin button
 
: long: maximum value of the spin button
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxSpinButton" name="spinbutton_id">
'''Example 25. wxSpinButton sample'''
+
<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
 
+
<value>50</value>
<object class="wxSpinButton" name="spinbutton_id">
+
<min>10</min>
<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
+
<max>200</max>
<value>50</value>
+
</object>
<min>10</min>
+
</syntaxhighlight>
<max>200</max>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
  
===5.29. wxSpinCtrl===
+
=== wxSpinCtrl ===
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Spin control style: wxSP_HORIZONTAL, wxSP_VERTICAL, wxSP_ARROW_KEYS, wxSP_WRAP
'''Attributes'''
+
; value
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxSP_HORIZONTAL
 
| wxSP_VERTICAL
 
| wxSP_ARROW_KEYS
 
| wxSP_WRAP
 
|}Spin control style
 
; value</span>
 
 
: long: current value of the spin control
 
: long: current value of the spin control
; min</span>
+
; min
 
: long: minimum value of the spin control
 
: long: minimum value of the spin control
; max</span>
+
; max
 
: long: maximum value of the spin control
 
: long: maximum value of the spin control
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxSpinCtrl" name="spincontrol_id">
 +
<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
 +
<value>50</value>
 +
<min>10</min>
 +
<max>200</max>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 26. wxSpinCtrl sample'''
+
=== wxStaticBitmap ===
 
 
<object class="wxSpinCtrl" name="spincontrol_id">
 
<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
 
<value>50</value>
 
<min>10</min>
 
<max>200</max>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.30. wxStaticBitmap===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; bitmap
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; bitmap</span>
 
 
: Text: Bitmap file name
 
: Text: Bitmap file name
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxStaticBitmap" name="bitmap_id">
 +
<bitmap>bt_buttonbitmap.xpm</bitmap>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 27. wxStaticBitmap sample'''
+
=== wxStaticBox ===
 
 
<object class="wxStaticBitmap" name="bitmap_id">
 
<bitmap>bt_buttonbitmap.xpm</bitmap>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.31. wxStaticBox===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; label
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; label</span>
 
 
: Text: label of the static box
 
: Text: label of the static box
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxStaticBox" name="stbox_id">
 +
<size>200,200</size>
 +
<label>Static box sample</label>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 28. wxStaticBox sample'''
+
=== wxStaticLine ===
 
 
<object class="wxStaticBox" name="stbox_id">
 
<size>200,200</size>
 
<label>Static box sample</label>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.32. wxStaticLine===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Static line style: wxLI_HORIZONTAL, wxLI_VERTICAL
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
  
'''Properties(as XML sub-elements)'''
+
<div style="background: #cfc; margin: 1em 3em; padding: 0.2em 0.5em;">
 
+
'''Tip'''
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxLI_HORIZONTAL
 
| wxLI_VERTICAL
 
|}Static line style
 
 
 
</div><div class="tip" style="margin-left: 0.5in; margin-right: 0.5in">
 
 
 
===Tip===
 
  
 
The size property should be present to size the static line. Default size is 0,0.
 
The size property should be present to size the static line. Default size is 0,0.
 +
</div>
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxStaticLine" name="stline_id">
'''Example 29. wxStaticLine sample'''
+
<size>200,5</size>
 
+
<style>wxLI_HORIZONTAL</style>
<object class="wxStaticLine" name="stline_id">
+
</object>
<size>200,5</size>
+
</syntaxhighlight>
<style>wxLI_HORIZONTAL</style>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.33. wxStaticText===
 
  
</div>
+
=== wxStaticText ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Static text style: wxST_NO_AUTORESIZE, wxALIGN_LEFT, wxALIGN_RIGHT, wxALIGN_CENTRE
'''Attributes'''
+
; label
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxST_NO_AUTORESIZE
 
| wxALIGN_LEFT
 
| wxALIGN_RIGHT
 
| wxALIGN_CENTRE
 
|}Static text style
 
; label</span>
 
 
: Text: label of the static text
 
: Text: label of the static text
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 +
<object class="wxStaticText" name="sttext_id">
 +
<style>wxALIGN_CENTRE</style>
 +
<label>Hello, World!!!</label>
 +
</object>
 +
</syntaxhighlight>
  
'''Example 30. wxStaticText sample'''
+
=== wxTextCtrl ===
 
 
<object class="wxStaticText" name="sttext_id">
 
<style>wxALIGN_CENTRE</style>
 
<label>Hello, World!!!</label>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.34. wxTextCtrl===
 
 
 
</div>
 
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 
+
: Text control style, see the [https://docs.wxwidgets.org/stable/classwx_text_ctrl.html wxTextCtrl documentation] for a list of styles.
'''Attributes'''
+
; value
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxTE_PROCESS_ENTER
 
| wxTE_PROCESS_TAB
 
| wxTE_MULTILINE
 
| wxTE_PASSWORD
 
| wxTE_READONLY
 
|-
 
| wxHSCROLL
 
| wxTE_RICH
 
| wxTE_RICH2
 
| wxTE_AUTO_URL
 
| wxTE_NOHIDESEL
 
|-
 
| wxTE_LEFT
 
| wxTE_CENTRE
 
| wxTE_RIGHT
 
| wxTE_DONTWRAP
 
| wxTE_LINEWRAP
 
|-
 
| wxTE_WORDWRAP
 
|}Text control style
 
; value</span>
 
 
: Text: initial value of the text control
 
: Text: initial value of the text control
  
</div><div class="example">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxTextCtrl" name="textctrl_id">
'''Example 31. wxTextCtrl sample'''
+
<style>wxTE_MULTILINE</style>
 
+
<value>Hello, World!!!</value>
<object class="wxTextCtrl" name="textctrl_id">
+
</object>
<style>wxTE_MULTILINE</style>
+
</syntaxhighlight>
<value>Hello, World!!!</value>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
  
===5.35. wxToolBar===
+
=== wxToolBar ===
 
 
</div>
 
  
 
A <tt>wxToolBar</tt> contains zero or more <tt>tool</tt> and <tt>separator</tt> tags.
 
A <tt>wxToolBar</tt> contains zero or more <tt>tool</tt> and <tt>separator</tt> tags.
  
<div class="variablelist">
+
; style
 
+
: Toolbar style: wxTB_FLAT, wxTB_DOCKABLE, wxTB_VERTICAL, wxTB_HORIZONTAL
'''Attributes'''
+
; bitmapsize
 
+
: size: size of the tools bitmaps (16,16 for example)
; name</span>
+
; margins
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxTB_FLAT
 
| wxTB_DOCKABLE
 
| wxTB_VERTICAL
 
| wxTB_HORIZONTAL
 
|}Toolbar style
 
; bitmapsize</span>
 
: size: size of the tools bitmaps ( 16,16 for example )
 
; margins</span>
 
 
: size: margins size
 
: size: margins size
; packing</span>
+
; packing
 
: long: space between tools
 
: long: space between tools
; separation</span>
+
; separation
 
: long: size of the separator
 
: long: size of the separator
  
</div><div class="example">
+
==== tool ====
 
 
'''Example 32. wxToolBar sample'''
 
 
 
<object class="wxToolBar" name="main_toolbar">
 
<bitmapsize>50,50</bitmapsize>
 
<style>wxTB_DOCKABLE|wxTB_HORIZONTAL</style>
 
  <object class="tool" name="tool1">
 
  <bitmap>bt_buttonbitmap.xpm</bitmap>
 
  <bitmap2>bt_buttonbitmapd.xpm</bitmap2>
 
  <toggle>1</toggle>
 
  <tooltip>first button</tooltip>
 
  <longhelp>long help first button</longhelp>
 
  </object>
 
  <object class="separator"/>
 
  <object class="tool" name="tool2">
 
  <bitmap>bt_buttonbitmap.xpm</bitmap>
 
  <bitmap2>bt_buttonbitmapd.xpm</bitmap2>
 
  <toggle>0</toggle>
 
  <tooltip>second button</tooltip>
 
  <longhelp>long help second button</longhelp>
 
  </object>
 
</object>
 
 
 
</div></div><div class="sect2" lang="en"><div class="titlepage">
 
 
 
===5.36. tool===
 
 
 
</div>
 
  
 
A <tt>tool</tt> can only appear in a <tt>wxToolBar</tt> tag and describes a item of this tool bar.
 
A <tt>tool</tt> can only appear in a <tt>wxToolBar</tt> tag and describes a item of this tool bar.
  
<div class="variablelist">
+
; bitmap
 
 
'''Attributes'''
 
 
 
; name</span>
 
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
 
 
 
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; bitmap</span>
 
 
: Text: path to the main bitmap file
 
: Text: path to the main bitmap file
; bitmap2</span>
+
; bitmap2
 
: Text: path to the second bitmap file (pressed)
 
: Text: path to the second bitmap file (pressed)
; toggle</span>
+
; toggle
 
: bool value(0/1): 1 if the button should toggle when pressed
 
: bool value(0/1): 1 if the button should toggle when pressed
; tooltip</span>
+
; tooltip
 
: Text: tooltip associated to the tool
 
: Text: tooltip associated to the tool
; longhelp</span>
+
; longhelp
 
: Text: help string associated to the tool
 
: Text: help string associated to the tool
  
</div></div><div class="sect2" lang="en"><div class="titlepage">
+
==== separator ====
 
 
===5.37. separator===
 
 
 
</div>
 
  
 
A <tt>separator</tt> tag can only appear inside a <tt>wxToolBar</tt> tag and has not properties and no attributes.
 
A <tt>separator</tt> tag can only appear inside a <tt>wxToolBar</tt> tag and has not properties and no attributes.
  
</div><div class="sect2" lang="en"><div class="titlepage">
+
<syntaxhighlight lang="xml">
 
+
<object class="wxToolBar" name="main_toolbar">
===5.38. wxTreeCtrl===
+
<bitmapsize>50,50</bitmapsize>
 +
<style>wxTB_DOCKABLE|wxTB_HORIZONTAL</style>
 +
<object class="tool" name="tool1">
 +
<bitmap>bt_buttonbitmap.xpm</bitmap>
 +
<bitmap2>bt_buttonbitmapd.xpm</bitmap2>
 +
<toggle>1</toggle>
 +
<tooltip>first button</tooltip>
 +
<longhelp>long help first button</longhelp>
 +
</object>
 +
<object class="separator"/>
 +
<object class="tool" name="tool2">
 +
<bitmap>bt_buttonbitmap.xpm</bitmap>
 +
<bitmap2>bt_buttonbitmapd.xpm</bitmap2>
 +
<toggle>0</toggle>
 +
<tooltip>second button</tooltip>
 +
<longhelp>long help second button</longhelp>
 +
</object>
 +
</object>
 +
</syntaxhighlight>
  
</div>
+
=== wxTreeCtrl ===
  
 
Inherits <tt>wxWindow</tt> properties
 
Inherits <tt>wxWindow</tt> properties
  
<div class="variablelist">
+
; style
 +
: Tree control style, see the [https://docs.wxwidgets.org/stable/classwx_tree_ctrl.html wxTreeCtrl documentation] for a list of styles.
  
'''Attributes'''
+
<syntaxhighlight lang="xml">
 
+
<object class="wxTreeCtrl" name="treectrl_id">
; name</span>
+
<style>wxTR_EDIT_LABELS|wxTR_HAS_BUTTONS|wxTR_HAS_VARIABLE_ROW_HEIGHT</style>
: <span class="type">string</span><nowiki>:unique identifier for the resource</nowiki>
+
</object>
 
+
</syntaxhighlight>
</div><div class="variablelist">
 
 
 
'''Properties(as XML sub-elements)'''
 
 
 
; style</span>
 
: {| class="simplelist" summary="Simple list"
 
| wxTR_EDIT_LABELS
 
| wxTR_NO_BUTTONS
 
| wxTR_HAS_BUTTONS
 
| wxTR_TWIST_BUTTONS
 
| wxTR_NO_LINES
 
|-
 
| wxTR_FULL_ROW_HIGHLIGHT
 
| wxTR_LINES_AT_ROOT
 
| wxTR_HIDE_ROOT
 
| wxTR_ROW_LINES
 
| wxTR_HAS_VARIABLE_ROW_HEIGHT
 
|-
 
| wxTR_SINGLE
 
| wxTR_MULTIPLE
 
| wxTR_EXTENDED
 
| wxTR_DEFAULT_STYLE
 
|}Tree control style
 
 
 
</div><div class="example">
 
 
 
'''Example 33. wxTreeCtrl sample'''
 
 
 
<object class="wxTreeCtrl" name="treectrl_id">
 
<style>wxTR_EDIT_LABELS|wxTR_HAS_BUTTONS|wxTR_HAS_VARIABLE_ROW_HEIGHT</style>
 
</object>
 

Latest revision as of 18:33, 19 October 2018

Introduction

Building a user interface with wxWidgets is quite easy, and three non exclusive solutions are available:

  1. you can directly handle graphical objects and layout in your code
  2. you can make use of the wxWidgets standard resource files (wxr)
  3. you can make use of XML resource files (XRC files)

This document deals with the third solution in a C/C++ application context.

This resource system in not a part of the standard wxWidgets library, but is delivered with the standard source packages in the contrib directory as a library. To build the "wxrc" library refer to the wxWidgets documentation.

XML resources are readable and processed at run-time. The goal of this article is to explain how XRC works, and show how to write XRC files by hand. There are a number of RAD tools that simplify this process by allowing you to build windows and dialogs graphically, and automatically generate XRC files for you, it is still helpful to know how to edit XRC directly, since not all components are supported by all tools.

Warning

This document is not a C/C++ tutorial for wxWidgets as other tutorials are available including the wxWidgets documentation and samples which is a good starting point.

Using wxXmlResource

The wxXmlResource is the only class you have to deal with in order to make use of XRC files in your C/C++ application. A typical use is the following

Initialization

wxXmlResource handles a reference to a unique resource handler (smart pointer), which must be initialized before you can use it. It is accessed in the following manner :

wxXmlResource::Get()->methodname

This initialization could be done in the OnInit method of your wxApp derived class.

Each resource type has its own handler, and if you intend to use it in your application you should add it to the wxXmlResource object.

A simple way to initialize the resource system is to call InitAllHandlers method of wxXmlResource class so you don't have to worry about all the handlers you could add.

wxXmlResource::Get()->InitAllHandlers();
bRet = wxXmlResource::Get()->Load( Path );
if( !bRet )
{
	cout  << "Could not load resource file" << Path << endl;
	return false;
}

The individual resource handlers available (depending on compilation options in setup.h) are:

  • wxBitmapXmlHandler
  • wxIconXmlHandler
  • wxMenuXmlHandler
  • wxMenuBarXmlHandler
  • wxDialogXmlHandler
  • wxPanelXmlHandler
  • wxSizerXmlHandler
  • wxButtonXmlHandler
  • wxBitmapButtonXmlHandler
  • wxStaticTextXmlHandler
  • wxStaticBitmapXmlHandler
  • wxTreeCtrlXmlHandler
  • wxCalendarCtrlXmlHandler
  • wxListCtrlXmlHandler
  • wxCheckListXmlHandler
  • wxChoiceXmlHandler
  • wxSliderXmlHandler
  • wxGaugeXmlHandler
  • wxCheckBoxXmlHandler
  • wxHtmlWindowXmlHandler
  • wxSpinButtonXmlHandler
  • wxSpinCtrlXmlHandler
  • wxScrollBarXmlHandler
  • wxRadioBoxXmlHandler
  • wxRadioButtonXmlHandler
  • wxComboBoxXmlHandler
  • wxNotebookXmlHandler
  • wxTextCtrlXmlHandler
  • wxListBoxXmlHandler
  • wxToolBarXmlHandler
  • wxStaticLineXmlHandler
  • wxUnknownWidgetXmlHandler
  • wxGenericDirCtrlXmlHandler
  • wxFrameXmlHandler
  • wxScrolledWindowXmlHandler

wxWidgets controls and windows that are not listed here are not handled in XRC files. But however you can write your own handler to handle them by deriving wxUnknownWidgetXmlHandler

Now that handlers are added to the resource handler you have to specify which XRC file(s) you want to load by calling the Load method. The parameter you pass to this method must be a valid path to the file you wand to load.

Creating UI Elements

There are 8 top level resource types that you can describe in a XRC file.

  • Frames (LoadFrame method)
  • Dialogs (LoadDialog method)
  • Panels (LoadPanel method)
  • MenuBars (LoadMenuBar method)
  • Menus (LoadMenu method)
  • Toolbars (LoadToolBar method)
  • Bitmaps (LoadBitmap method)
  • Icons (LoadIcon method)

Except for bitmaps and icons, the resource system handles all the resource types contained in the resource description, but you cannot directly load an wxTextCtrl for example.

LoadBitmap, LoadIcon, LoadMenu, LoadMenuBar, LoadToolBar methods return new created objects. The cannot be used to initialize existing object as LoadFrame, LoadDialog and LoadPanel do.

For example there are three ways to create a dialog :

1. Directly by using the following form wxDialog *Dlg;

Dlg = wxXmlResource::Get()->LoadDialog( FrameObjectPointer, "dialog_resource" );
Dlg->ShowModal();

2. Indirectly by using the following form wxDialog Dlg;

wxXmlResource::Get()->LoadDialog( &Dlg, FrameObjectPointer, "dialog_resource" );
Dlg.ShowModal();

where "dialog_resource" is the name of the resource in the XML file, or

MyDerivedDialog Dlg;
wxXmlResource::Get()->LoadDialog( &Dlg, FrameObjectPointer, "dialog_resource" );
Dlg.ShowModal();

3. Indirectly in a derived class of wxDialog

MyDerivedDialog::MyDerivedDialog( wxWindow *p_Parent )
{
	wxXmlResource::Get()->LoadDialog( this, p_Parent, "dialog_resource" );
}

Important

Note that in the last example the wxDialog base class constructor is not called, and should not be.

XRC File Format

XRC files are standard XML files. The format should be the following :

<?xml version="1.0"?>
<resource version="2.3.0.1">
	<object class="wxFrame" name="my_main_frame">
		<size>200,300</size>
		...
	</object>
</resource>

See the XRC format specification for detailed description.

Internationalization (i18n)

The wxWidgets source distribution contains a project name wxrc in the contrib/utils directory. This utility is used to produce zipped XRC resource files, but can also extract strings for i18n:

wxrc.exe [/g] [-o] [outputfile] [resourcefile]

outputfile will contain strings in the wxWidgets classical i18n compatible form _("string") and which can be processed by xgettext.

XRC Object Descriptions

This part describes each resource type available in XRC files. This information is also provided in the XRC format specification, which is the authoritative resource.


All "object" nodes have an optional "name" parameter used as an ID for that object, which can be retieved with the XRCID() macro in code.

wxWindow Elements

Many of the elements (windows, controls) that are described in an XRC file are derived from the wxWindow class. The all have common properties available:

exstyle
window styles, see the wxWindow documentation for possible styles (separate multiple styles with the "|" (pipe) character)
bg
background window color: RGB color in the #RRGGBB format (HTML like)
fg
foreground window color: RGB color in the #RRGGBB format (HTML like)
enabled
is the window enabled? bool value (0/1)
focused
should this window have the focus? bool value (0/1)
hidden
should this window be hidden? bool value (0/1)
tooltip
free texttooltip text associated to the window (must have been enabled in setup.h)
font
font description
size
font size in points
style
font style: normal, italic, slant
weight
font weight: normal, bold, light
family
font family: decorative, modern, roman, script, swiss, teletype
underlined
should the font be underlined? bool value (0/1)
encoding
CHARSET in text formatfont encoding
face
font for this window: FACENAME in text formatfont face

Sizers

Sizers are a very important part of the XRC resources. Their goal is to let you lay out the controls you need in a panel, a window or a frame.

sizeritem

All sizer types contain one or more sizeritem. A sizeritem contains one object (control).

flag
See the wxSizer documentation for a list of possible values.
minsize
pair: minimum size of the sizer (200,200 for example).
option
long: used to tell the sizer item it has a certain "weight" in the proportions among all sizer items.
border
long: border size (for borders specified in "flag").

wxBoxSizer

The box sizer divides the layout into two components either horizontally or vertically. It contains one or more sizeritem tags.

orient
wxBoxSizer orientation: wxVERTICAL, wxHORIZONTAL
<object class="wxBoxSizer">
	<orient>wxHORIZONTAL</orient>
	<object class="sizeritem">Left control</object>
	<object class="sizeritem">Right control</object>
</object>

wxStaticBoxSizer

A static box sizer is a box sizer with a surrounding box and a label.

orient
wxBoxSizer orientation: wxVERTICAL, wxHORIZONTAL
label
Text: label of the static box.

wxGridSizer

A grid sizer divides the layout into rows and cols of identical sizes.

rows
Number of rows.
cols
Number of cols.
vgap
vertical space between to elements.
hgap
horizontal space between to elements.
<object class="wxGridSizer">
	<rows>2</rows>
	<cols>2</cols>
	<object class="sizeritem">control in 0,0 (row,col)</object>
	<object class="sizeritem">control in 0,1 (row,col)</object>
	<object class="sizeritem">control in 1,0 (row,col)</object>
	<object class="sizeritem">control in 1,1 (row,col)</object>
</object>

wxFlexGridSizer

A grid sizer divides the layout into rows and cols of identical sizes.

rows
Number of rows.
cols
Number of cols.
vgap
vertical space between to elements.
hgap
horizontal space between to elements.
growablecols
list: comma separated list of cols indexes that will grow with the container.
growablerows
list: comma separated list of rows indexes that will grow with the container.

wxBitmapButton

Inherits wxWindow properties.

style
button style: wxBU_AUTODRAW, wxBU_LEFT, wxBU_RIGHT, wxBU_TOP, wxBU_BOTTOM
bitmap
The bitmap path and filename
default
bool value (0/1) - 1 if this button is the default button of the dialog or panel.
selected
This is the selected bitmap specifier. Contains a bitmap tag
focus
This is the focused bitmap specifier. Contains a bitmap tag
disabled
This is the disabled bitmap specifier. Contains a bitmap tag
<?xml version="1.0"?>
<resource version="2.4.0">
	<object class="wxFrame" name="main_frame">
		<title>Testing the XRC resource system</title>
		<object class="wxPanel" name="main_panel">
			<object class="wxBoxSizer">
				<orient>wxVERTICAL</orient>
				<object class="sizeritem">
					<flag>wxALL|wxGROW</flag>
					<option>1</option>
					<object class="wxBitmapButton" name="bt_bitmapbutton">
						<style>wxBU_LEFT</style>
						<bitmap>bt_buttonbitmap.xpm</bitmap>
						<selected>bt_buttonbitmaps.xpm</selected>
						<focus>bt_buttonbitmapf.xpm</focus>
						<disabled>bt_buttonbitmapd.xpm</disabled>
					</object>
				</object>
				<object class="sizeritem">
	 				<flag>wxALL</flag>
					<object class="wxStaticText" name="st_description">
						<label>wxBitmapButton test</label>
					</object>
				</object>
			</object>
		</object>
	</object>
</resource>

wxButton

Inherits wxWindow properties

style
The button style: wxBU_LEFT, wxBU_RIGHT, wxBU_TOP, wxBU_BOTTOM
label
The label of the button
default
bool value (0/1): 1 if this button is the default button of the dialog or panel.
<resource version="2.4.0">
	<object class="wxFrame" name="main_frame">
		<title>Testing the XRC resource system</title>
		<object class="wxPanel" name="main_panel">
			<object class="wxBoxSizer">
				<orient>wxVERTICAL</orient>
				<object class="sizeritem">
					<flag>wxALL|wxGROW</flag>
					<option>1</option>
					<object class="wxButton" name="bt_button">
						<style>wxBU_LEFT</style>
						<label>Button label</label>
					</object>
				</object>
				<object class="sizeritem">
					<flag>wxALL</flag>
					<object class="wxStaticText" name="st_description">
						<label>wxButton test</label>
					</object>
				</object>
			</object>
		</object>
	</object>
</resource>

wxCalendarCtrl

Inherits wxWindow properties

style
Calendar styles defining how the calendar control should work: wxCAL_SUNDAY_FIRST, wxCAL_MONDAY_FIRST, wxCAL_SHOW_HOLIDAYS, wxCAL_NO_YEAR_CHANGE, wxCAL_NO_MONTH_CHANGE
<resource version="2.4.0">
	<object class="wxFrame" name="main_frame">
		<title>Testing the XRC resource system</title>
		<object class="wxPanel" name="main_panel">
			<object class="wxBoxSizer">
				<orient>wxVERTICAL</orient>
				<object class="sizeritem">
					<flag>wxALL|wxGROW</flag>
					<option>1</option>
					<object class="wxCalendarCtrl" name="calendar">
						<style>wxCAL_MONDAY_FIRST|wxCAL_SHOW_HOLIDAYS</style>
					</object>
				</object>
				<object class="sizeritem">
					<flag>wxALL</flag>
					<object class="wxStaticText" name="st_description">
						<label>wxCalendarCtrl test</label>
					</object>
				</object>
			</object>
		</object>
	</object>
</resource>

wxCheckBox

Inherits wxWindow properties

label
Label of the check box
checked
bool value (1/0): 1 if the check box is checked on creation
<resource version="2.4.0">
	<object class="wxFrame" name="main_frame">
		<title>Testing the XRC resource system</title>
		<object class="wxPanel" name="main_panel">
			<object class="wxBoxSizer">
				<orient>wxVERTICAL</orient>
				<object class="sizeritem">
					<flag>wxALL|wxGROW</flag>
					<object class="wxCheckBox" name="checkbox_id">
						<size>200,50</size>
						<label>CheckBoxItem</label>
						<checked>1</checked>
					</object>
				</object>
				<object class="sizeritem">
					<flag>wxALL</flag>
					<object class="wxStaticText" name="st_description">
						<label>wxCheckBox test</label>
					</object>
				</object>
			</object>
		</object>
	</object>
</resource>

wxCheckListBox

Inherits wxWindow properties

content
list of item tags describing the elements in the control, item tag attributes:
checked
bool value (0/1) : 1 if the element is checked
<object class="wxCheckListBox" name="checklistbox_id">
	<size>200,100</size>
	<content>
		<item checked="1">Item value 1</item>
		<item checked="0">Item value 2</item>
		<item checked="1">Item value 3</item>
		<item checked="0">Item value 4</item>
		<item checked="1">Item value 5</item>
	</content>
</object>

wxChoice

Inherits wxWindow properties

selection
integer value: index (0 based) of the selected entry
content
list of item tags describing the elements in the control, item tag attributes:
checked
bool value (0/1) : 1 if the element is checked
<object class="wxChoice" name="choice_id">
	<size>200,100</size>
	<selection>2</selection>
	<content>
		<item checked="1">Item value 1</item>
		<item checked="0">Item value 2</item>
		<item checked="1">Item value 3</item>
		<item checked="0">Item value 4</item>
		<item checked="1">Item value 5</item>
	</content>
</object>

wxComboBox

Inherits wxWindow properties

style
combo style: wxCB_SIMPLE, wxCB_SORT, wxCB_READONLY, wxCB_DROPDOWN
value
initial value of the combo as text
selection
integer value: index ( 0 based ) of the selected entry
content
list of item tags describing the elements in the control, item tag attributes:
checked
bool value (0/1) : 1 if the element is checked
<object class="wxComboBox" name="combo_id">
	<size>200,100</size>
	<style>wxCB_DROPDOWN</style>
	<selection>2</selection>
	<content>
		<item checked="1">Item value 1</item>
		<item checked="0">Item value 2</item>
		<item checked="1">Item value 3</item>
		<item checked="0">Item value 4</item>
		<item checked="1">Item value 5</item>
	</content>
</object>

wxDialog

Inherits wxWindow properties. This is a top-level component, and it can have multiple sub elements (sizers, controls).

title
Title of the dialog as text
style
see the wxDialog documentation for a list of styles
centered
bool value(0/1) : 1 if the dialog should be centered on it's parent screen.
<object class="wxDialog" name="test_dialog">
	<title>My Dialog</title>
	<style>wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX</style>
	<object class="wxBoxSizer">
		<orient>wxVERTICAL</orient>
		<object class="sizeritem">
			<flag>wxALL</flag>
			<object class="wxTextCtrl" name="textctrl_id">
				<value>Hello World !!!!</value>
			</object>
		</object>
		<object class="sizeritem">
			<flag>wxALL</flag>
			<object class="wxStaticText" name="st_description">
				<label>wxComboBox test</label>
			</object>
		</object>
	</object>
</object>

wxFrame

Inherits wxWindow properties. This is a top-level component, and it can have multiple sub elements (sizers, controls ).

title
Title of the frame as text
style
see the wxFrame documentation for a list of styles.
centered
bool value(0/1) : 1 if the frame should be centered on it's parent screen.
<object class="wxFrame" name="main_frame">
	<title>Testing the XRC resource system</title>
	<object class="wxPanel" name="main_panel">
		<object class="wxBoxSizer">
			<orient>wxVERTICAL</orient>
			<object class="sizeritem">
				<flag>wxALL</flag>
				<object class="wxTextCtrl" name="textctrl_id">
					<value>Hello World !!!!</value>
				</object>
			</object>
			<object class="sizeritem">
				<flag>wxALL</flag>
				<object class="wxStaticText" name="st_description">
					<label>wxComboBox test</label>
				</object>
			</object>
		</object>
	</object>
</object>

wxGauge

Inherits wxWindow properties

style
Gauge style: wxGA_HORIZONTAL, wxGA_VERTICAL, wxGA_PROGRESSBAR, wxGA_SMOOTH
range
integer value: maximum value for the gauge.
value
integer value: initial value for the gauge position.
shadow
integer value: width of the shadow.
bezel
integer value: width of the bezel face.
<object class="wxGauge" name="gauge_id">
	<style>wxGA_HORIZONTAL|wxGA_PROGRESSBAR|wxGA_SMOOTH</style>
	<shadow>20</shadow>
	<bezel>40</bezel>
	<range>100</range>
	<value>33</value>
</object>

wxGenericDirCtrl

Inherits wxWindow properties

Tip

Default size of this control seems to be 0,0. So you should always put a size tag.

style
Control style: wxDIRCTRL_DIR_ONLY, wxDIRCTRL_3D_INTERNAL, wxDIRCTRL_SELECT_FIRST, wxDIRCTRL_SHOW_FILTERS
defaultfolder
Text value: path of the default directory.
filter
Text value: expression of the files to be displayed (wild card enabled).
defaultfilter
long value: index of the default filter.
<object class="wxGenericDirCtrl" name="dirctrl_id">
	<size>200,200</size>
	<style>wxDIRCTRL_SHOW_FILTERS</style>
	<defaultfolder>e:/temp</defaultfolder>
	<defaultfilter>1</defaultfilter>
	<filter>*.txt</filter>
	<filter>*.jpg</filter>
	<filter>*.zip</filter>
</object>

wxHtmlWindow

Inherits wxWindow properties

style
HTML window style: wxHW_SCROLLBAR_NEVER, wxHW_SCROLLBAR_AUTO
borders
integer value: border size to leave between the left and top border of the window, and the HTML display.
htmlcode
text value: the HTML the control should display.
url
text: path to an HTML file to display.
<object class="wxHtmlWindow" name="htmlid_id">
	<size>200,200</size>
	<borders>20d</borders>
	<htmlcode>&lt;b&gt;This is a simple text&lt;/b&gt;</htmlcode>
</object>

wxListBox

Inherits wxWindow properties

style
List box style: wxLB_SINGLE, wxLB_MULTIPLE, wxLB_EXTENDED, wxLB_HSCROLL, wxLB_ALWAYS_SB, wxLB_NEEDED_SB, wxLB_SORT
selection
integer value: index (0 based) of the selected entry
content
list of item tags describing the elements in the control.
<object class="wxListBox" name="listbox_id">
	<selection>2</selection>
	<content>
		<item>Item value 1</item>
		<item>Item value 2</item>
		<item>Item value 3</item>
		<item>Item value 4</item>
		<item>Item value 5</item>
	</content>
</object>

wxListCtrl

Inherits wxWindow properties

style
List control style, see the wxListCtrl documentation for a list of styles.
<object class="wxListCtrl" name="listctrl_id">
	<style>wxLC_REPORT|wxLC_ICON</style>
</object>

wxMenuBar

Does not inherit wxWindow properties. A wxMenuBar can contain one or more wxMenu sub-elements.

style
Menu bar style: wxMB_DOCKABLE

wxMenu

Does not inherit wxWindow properties. A menu contains one or more wxMenuItem tags.

style
Menu style: wxMENU_TEAROFF
label
Text: label of the menu.
help
Text: displayed help string.

wxMenuItem

Does not inherit wxWindow properties.

style
Menu style: wxMENU_TEAROFF
label
Text: label of the menu.
accel
Text: accelerator associated to this item ( Alt-X for example ).
help
Text: displayed help string.
radio
bool value(0/1): 1 if this item is a radio menu item.
checkable
bool value(0/1): 1 if this item is a check menu item.
enabled
bool value(0/1): 1 if this item is initially enabled.
checked
bool value(0/1): 1 if this (check) item is initially checked.
bitmap
Text: path to a bitmap to draw at the left of the item.
<object class="wxMenuBar" name="main_menu_bar">
	<object class="wxMenu" name="file_menu">
		<label>File</label>
		<help>File menu</help>
		<style>wxMENU_TEAROFF</style>
		<object class="wxMenuItem" name="open_menu_item">
			<label>Open</label>
			<help>Opens a file</help>
			<accel>Alt-O</accel>
		</object>
		<object class="wxMenuItem" name="radio_menu_item">
			<label>Radio</label>
			<radio>1</radio>
		</object>
		<object class="wxMenuItem" name="check_menu_item">
			<label>Check</label>
			<checkable>1</checkable>
			<enabled>1</enabled>
			<checked>1</checked>
		</object>
		<object class="break" />
		<object class="wxMenuItem" name="close_menu_item">
			<label>Close</label>
			<help>Closes a file</help>
			<bitmap>bt_buttonbitmap.xpm</bitmap>
		</object>
		<object class="separator" />
		<object class="wxMenuItem" name="exit_menu_item">
			<label>Exit</label>
			<help>Exits the program</help>
			<accel>Alt-X</accel>
		</object>
	</object>
</object>

wxNotebook

Does not Inherit wxWindow properties. A wxNotebook tag contains one or more notebookpage tags.

style
Notebook style: wxNB_FIXEDWIDTH, wxNB_MULTILINE, wxNB_NOPAGETHEME, wxBK_LEFT, wxBK_RIGHT, wxBK_BOTTOM and wxBK_TOP (wxNB_LEFT, wxNB_RIGHT, wxNB_BOTTOM and wxNB_TOP for 2.6 and below)
usenotebooksizer
bool value(0/1): 1 if a notebook sizer is to be used to handle notebook pages.

notebookpage

A notebookpage can only appear inside a wxNotebook. It contains one or more objects like panels and controls.

label
Text: label of the page.
selected
bool value(0/1): is this page the selected one.
<object class="wxNotebook" name="main_notebook">
	<object class="notebookpage" name="firstnotepage">
		<label>First</label>
		<selected>1</selected>
		<object class="wxPanel" name="main_panel">
			<object class="wxBoxSizer">
				<orient>wxVERTICAL</orient>
				<object class="sizeritem">
					<flag>wxALL</flag>
					<object class="wxTextCtrl" name="textctrl_id">
						<value>Hello World !!!</value>
					</object>
				</object>
				<object class="sizeritem">
					<flag>wxALL</flag>
					<object class="wxStaticText" name="st_description">
						<label>wxListCtrl test</label>
					</object>
				</object>
			</object>
		</object>
	</object>
	<object class="notebookpage" name="secondnotepage">
		<label>Second</label>
		<object class="wxPanel" name="secondpanel">
			<object class="wxFlexGridSizer">
				<cols>1</cols>
				<rows>0</rows>
				<growablerows>0</growablerows>
				<growablecols>1</growablecols>
				<object class="sizeritem">
					<flag>wxALL</flag>
					<object class="wxTextCtrl" name="st_second_text">
						<value>Static text</value>
					</object>
				</object>
			</object>
		</object>
	</object>
</object>

wxPanel

Inherits wxWindow properties. A panel contains zero or more sizers and controls.

style
Panel style: wxNO_3D, wxTAB_TRAVERSAL, wxWS_EX_VALIDATE_RECURSIVELY, wxCLIP_CHILDREN

wxRadioButton

Inherits wxWindow properties.

style
Radio button style: wxRB_GROUP
label
Text: label of the button.
value
bool value(0/1): 1 if the button is selected.
<object class="wxRadioButton" name="radiobutton_id">
	<label>Radio button</label>
	<value>1</value>
</object>

wxRadioBox

Inherits wxWindow properties

style
Radio box style: wxRA_SPECIFY_COLS, wxRA_HORIZONTAL, wxRA_SPECIFY_ROWS, wxRA_VERTICAL
selection
integer value: index ( 0 based ) of the selected entry
content
list of item tags describing the elements in the control.
<object class="wxRadioBox" name="radiobox_id">
	<label>Radio box</label>
	<selection>1</selection>
	<dimension>2</dimension>
	<content>
		<item>Value 1</item>
		<item>Value 2</item>
		<item>Value 3</item>
		<item>Value 4</item>
		<item>Value 5</item>
		<item>Value 6</item>
	</content>
</object>

wxScrollBar

Inherits wxWindow properties

style
Scroll bar style: wxSB_HORIZONTAL, wxSB_VERTICAL
value
long: current position
thumbsize
long: view size
range
long: max value of the scrollbar
pagesize
long: size of one scrolled page
<object class="wxScrollBar" name="scrollbar_id">
	<size>-1,100</size>
	<value>50</value>
	<range>100</range>
	<thumbsize>30</thumbsize>
	<style>wxSB_VERTICAL</style>
</object>

wxScrolledWindow

Inherits wxWindow properties

style
Scrolled window style: wxHSCROLL, wxVSCROLL
<object class="wxScrolledWindow" name="scrolledwindow_id">
	<bg>#FFFFFF</bg>
	<style>wxHSCROLL|wxVSCROLL</style>
	<size>200,200</size>
</object>

wxSlider

Inherits wxWindow properties

style
Slider style, see the wxSlider documentation for a list of styles.
value
long: current position of the slider
min
long: minimum position of the slider
max
long: maximum position of the slider
tickfreq
long: tick frequency
pagesize
long: The number of steps the slider moves when the user pages up or down
linesize
long: the number of steps the slider moves when the user moves it up or down a line
thumb
long: sets the thumb length
tick
long: position of a tick
selmin, selmax
long: sets minimum and maximum selection position
<object class="wxSlider" name="slider_id">
	<style>wxSL_HORIZONTAL|wxSL_AUTOTICKS</style>
	<size>200,200</size>
	<tickfreq>10</tickfreq>
	<value>50</value>
	<min>10</min>
	<max>200</max>
</object>

wxSpinButton

Inherits wxWindow properties

style
Spin button style: wxSP_HORIZONTAL, wxSP_VERTICAL, wxSP_ARROW_KEYS, wxSP_WRAP
value
long: current value of the spin button
min
long: minimum value of the spin button
max
long: maximum value of the spin button
<object class="wxSpinButton" name="spinbutton_id">
	<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
	<value>50</value>
	<min>10</min>
	<max>200</max>
</object>

wxSpinCtrl

Inherits wxWindow properties

style
Spin control style: wxSP_HORIZONTAL, wxSP_VERTICAL, wxSP_ARROW_KEYS, wxSP_WRAP
value
long: current value of the spin control
min
long: minimum value of the spin control
max
long: maximum value of the spin control
<object class="wxSpinCtrl" name="spincontrol_id">
	<style>wxSP_HORIZONTAL|wxSP_ARROW_KEYS</style>
	<value>50</value>
	<min>10</min>
	<max>200</max>
</object>

wxStaticBitmap

Inherits wxWindow properties

bitmap
Text: Bitmap file name
<object class="wxStaticBitmap" name="bitmap_id">
	<bitmap>bt_buttonbitmap.xpm</bitmap>
</object>

wxStaticBox

Inherits wxWindow properties

label
Text: label of the static box
<object class="wxStaticBox" name="stbox_id">
	<size>200,200</size>
	<label>Static box sample</label>
</object>

wxStaticLine

Inherits wxWindow properties

style
Static line style: wxLI_HORIZONTAL, wxLI_VERTICAL

Tip

The size property should be present to size the static line. Default size is 0,0.

<object class="wxStaticLine" name="stline_id">
	<size>200,5</size>
	<style>wxLI_HORIZONTAL</style>
</object>

wxStaticText

Inherits wxWindow properties

style
Static text style: wxST_NO_AUTORESIZE, wxALIGN_LEFT, wxALIGN_RIGHT, wxALIGN_CENTRE
label
Text: label of the static text
<object class="wxStaticText" name="sttext_id">
	<style>wxALIGN_CENTRE</style>
	<label>Hello, World!!!</label>
</object>

wxTextCtrl

Inherits wxWindow properties

style
Text control style, see the wxTextCtrl documentation for a list of styles.
value
Text: initial value of the text control
<object class="wxTextCtrl" name="textctrl_id">
	<style>wxTE_MULTILINE</style>
	<value>Hello, World!!!</value>
</object>

wxToolBar

A wxToolBar contains zero or more tool and separator tags.

style
Toolbar style: wxTB_FLAT, wxTB_DOCKABLE, wxTB_VERTICAL, wxTB_HORIZONTAL
bitmapsize
size: size of the tools bitmaps (16,16 for example)
margins
size: margins size
packing
long: space between tools
separation
long: size of the separator

tool

A tool can only appear in a wxToolBar tag and describes a item of this tool bar.

bitmap
Text: path to the main bitmap file
bitmap2
Text: path to the second bitmap file (pressed)
toggle
bool value(0/1): 1 if the button should toggle when pressed
tooltip
Text: tooltip associated to the tool
longhelp
Text: help string associated to the tool

separator

A separator tag can only appear inside a wxToolBar tag and has not properties and no attributes.

<object class="wxToolBar" name="main_toolbar">
	<bitmapsize>50,50</bitmapsize>
	<style>wxTB_DOCKABLE|wxTB_HORIZONTAL</style>
	<object class="tool" name="tool1">
		<bitmap>bt_buttonbitmap.xpm</bitmap>
		<bitmap2>bt_buttonbitmapd.xpm</bitmap2>
		<toggle>1</toggle>
		<tooltip>first button</tooltip>
		<longhelp>long help first button</longhelp>
	</object>
	<object class="separator"/>
	<object class="tool" name="tool2">
		<bitmap>bt_buttonbitmap.xpm</bitmap>
		<bitmap2>bt_buttonbitmapd.xpm</bitmap2>
		<toggle>0</toggle>
		<tooltip>second button</tooltip>
		<longhelp>long help second button</longhelp>
	</object>
</object>

wxTreeCtrl

Inherits wxWindow properties

style
Tree control style, see the wxTreeCtrl documentation for a list of styles.
<object class="wxTreeCtrl" name="treectrl_id">
	<style>wxTR_EDIT_LABELS|wxTR_HAS_BUTTONS|wxTR_HAS_VARIABLE_ROW_HEIGHT</style>
</object>