<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://cegui.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Levia</id>
		<title>CEGUI Wiki - Crazy Eddie's GUI System (Open Source) - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://cegui.org/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Levia"/>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/Special:Contributions/Levia"/>
		<updated>2026-05-10T17:07:45Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.24.1</generator>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2645</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2645"/>
				<updated>2007-05-09T14:53:21Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
====CheckListItem.h====&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
         static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
====CheckListItem.cpp====&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name) :&lt;br /&gt;
             ItemEntry(type, name)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt; is quite important here. It tells CEGUI where we are placing the code that comes with the window. As you can see this class is quite empty, you are, of course, free to add anything you like to this class - these are just the mere basics.&lt;br /&gt;
&lt;br /&gt;
Now, there is one more important thing to do. Register this window properly in CEGUI.&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
addFalagardWindowMappings parameters are as follows: Name, Type, LooknFeel, WindowRenderer. Just put this code somewhere in your main file or on another place that you are sure is executed before using our new item. Also note, in order to use &amp;lt;b&amp;gt;CEGUI_WINDOW_FACTORY()&amp;lt;/b&amp;gt; you need to be in the CEGUI namespace.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;SDLLoader.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 void doStuff();&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
 int main (int argc, char **argv) &lt;br /&gt;
 {&lt;br /&gt;
     SDLLoader sdl;&lt;br /&gt;
     sdl.init();&lt;br /&gt;
     CEGUI::bindCEGUI();&lt;br /&gt;
     doStuff();&lt;br /&gt;
     sdl.main_loop();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 void doStuff()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::System * m_System = CEGUI::System::getSingletonPtr();&lt;br /&gt;
     CEGUI::Logger::getSingletonPtr()-&amp;gt;setLoggingLevel(CEGUI::Insane);&lt;br /&gt;
     CEGUI::WindowManager * m_WndMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
     CEGUI::Window * m_Root = m_System-&amp;gt;getGUISheet();&lt;br /&gt;
     &amp;lt;br&amp;gt;&lt;br /&gt;
     CEGUI::ItemListbox * lb = (CEGUI::ItemListbox*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/ItemListbox&amp;quot;, &amp;quot;Lol&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.0f), CEGUI::UDim(0.3f, 0.0f)));&lt;br /&gt;
     lb-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0.0f), CEGUI::UDim(0.1f, 0.0f)));&lt;br /&gt;
     m_Root-&amp;gt;addChildWindow(lb);&lt;br /&gt;
     &amp;lt;br&amp;gt;&lt;br /&gt;
     CEGUI::CheckListboxItem * check = (CEGUI::CheckListboxItem*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Test&amp;quot;);&lt;br /&gt;
     check-&amp;gt;setText(&amp;quot;Test&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;addChildWindow(check);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As you can see in the main function, the function that registers the window is called before actually creating it. Dont pay any attention to the sdl initiation - it's just my personal test environment.&lt;br /&gt;
&lt;br /&gt;
Congratulations! You have just created a CheckListboxItem. This was a very good practice because you also learned the technique required to write a completely new widget.&lt;br /&gt;
&lt;br /&gt;
Please contact me if you have any question, comments, feedback - anything, email me at [mailto:levia@openfrag.org levia at openfrag dot com].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2643</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2643"/>
				<updated>2007-05-08T11:59:49Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MultiLineEditbox====&lt;br /&gt;
&lt;br /&gt;
This widget is pretty much the same as editbox, but allows more lines.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged - Fired when text has been changed. Inherited from window.&lt;br /&gt;
&lt;br /&gt;
This widget doesn't have the event TextAccepted, so you'll need to 'apply' the input by a button for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;MultiLineEditbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/MultiLineEditbox&amp;quot;, &amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(multiLineEditbox);&lt;br /&gt;
multiLineEditbox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setSize(UVector2(cegui_reldim(0.3f), cegui_reldim(0.3f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
multiLineEditbox-&amp;gt;subscribeEvent(MultiLineEditbox::EventTextChanged, Event::Subscriber(&amp;amp;EventGalore::onTextChanged, this));&lt;br /&gt;
&lt;br /&gt;
// This text is going to show the result.&lt;br /&gt;
Window * textWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(textWindow);&lt;br /&gt;
textWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.5f)));&lt;br /&gt;
textWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.6f), cegui_reldim(0.1f)));&lt;br /&gt;
textWindow-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;CEGUI::MultiLineEditbox*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * textWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	textWindow-&amp;gt;setText(multiLineEditbox-&amp;gt;getText());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice what happens when you enter text on another line though :)&lt;br /&gt;
&lt;br /&gt;
====FrameWindow====&lt;br /&gt;
&lt;br /&gt;
This is a window where you usually put your widgets on.&lt;br /&gt;
&lt;br /&gt;
* EventCloseClicked - Fired when the 'X' in the upper right corner is clicked (of the Framewindow).&lt;br /&gt;
* EventRollupToggled - Fired when the window gets rolled up, or rolled down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
FrameWindow * frameWindow = static_cast&amp;lt;FrameWindow*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/FrameWindow&amp;quot;, &amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(frameWindow)&lt;br /&gt;
frameWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
frameWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&amp;amp;EventGalore::onCloseClicked, this));&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventRollupToggled, Event::Subscriber(&amp;amp;EventGalore::onRollupToggled, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCloseClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Someone has clicked the upper right 'X'.&lt;br /&gt;
&lt;br /&gt;
	// We don't HAVE to cast to FrameWindow, as the method we are going to use to close the window&lt;br /&gt;
	//  is available in Window, but for the sake of clarity...&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
	frameWindow-&amp;gt;destroy();&lt;br /&gt;
	// Note: Dont try to delete the pointer.&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onRollupToggled(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (frameWindow-&amp;gt;isRolledup())&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Rolled up&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ProgressBar====&lt;br /&gt;
&lt;br /&gt;
A progress widget.&lt;br /&gt;
&lt;br /&gt;
* EventProgressDone - Fired when the progress bar reaches 100%(1.0f).&lt;br /&gt;
* EventProgressChanged - Fired when the progress changes.&lt;br /&gt;
* EventMouseClick - Fired when someone clicked on the window. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
ProgressBar * progressBar = static_cast&amp;lt;ProgressBar*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/ProgressBar&amp;quot;, &amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(progressBar);&lt;br /&gt;
progressBar-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
progressBar-&amp;gt;setSize(UVector2(cegui_reldim(0.5f), cegui_reldim(0.04f)));&lt;br /&gt;
&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventProgressDone, Event::Subscriber(&amp;amp;EventGalore::onProgressDone, this));&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventProgressChanged, Event::Subscriber(&amp;amp;EventGalore::onProgressChanged, this));&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventMouseClick, Event::Subscriber(&amp;amp;EventGalore::onMouseClick, this));&lt;br /&gt;
&lt;br /&gt;
Window * resultWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(resultWindow);&lt;br /&gt;
resultWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.05f)));&lt;br /&gt;
resultWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.5f), cegui_reldim(0.06f)));&lt;br /&gt;
resultWindow-&amp;gt;setText(&amp;quot;Lets start progressing!&amp;quot;);&lt;br /&gt;
resultWindow-&amp;gt;setProperty(&amp;quot;FrameEnabled&amp;quot;, &amp;quot;false&amp;quot;);&lt;br /&gt;
resultWindow-&amp;gt;setProperty(&amp;quot;BackgroundEnabled&amp;quot;, &amp;quot;false&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onProgressDone(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The progress bar is full.&lt;br /&gt;
	CEGUI::Window * resultWindow = CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	resultWindow-&amp;gt;setText(&amp;quot;We are done!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onProgressChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The progress changed.&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::ProgressBar * progressBar = static_cast&amp;lt;CEGUI::ProgressBar*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * resultWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	float progress = progressBar-&amp;gt;getProgress();&lt;br /&gt;
	int finalProgress = static_cast&amp;lt;int&amp;gt;(progress*100);&lt;br /&gt;
	std::stringstream resultStr;&lt;br /&gt;
	resultStr &amp;lt;&amp;lt; &amp;quot;Progress: &amp;quot; &amp;lt;&amp;lt; finalProgress &amp;lt;&amp;lt; &amp;quot;%&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	resultWindow-&amp;gt;setText(resultStr.str());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseClick(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::ProgressBar * progressBar = static_cast&amp;lt;CEGUI::ProgressBar*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
	progressBar-&amp;gt;setProgress(progressBar-&amp;gt;getProgress() + 0.05f);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Slider====&lt;br /&gt;
&lt;br /&gt;
====Spinner====&lt;br /&gt;
&lt;br /&gt;
====MultiColumnList====&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2640</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2640"/>
				<updated>2007-05-07T17:22:06Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MultiLineEditbox====&lt;br /&gt;
&lt;br /&gt;
This widget is pretty much the same as editbox, but allows more lines.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged - Fired when text has been changed. Inherited from window.&lt;br /&gt;
&lt;br /&gt;
This widget doesn't have the event TextAccepted, so you'll need to 'apply' the input by a button for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;MultiLineEditbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/MultiLineEditbox&amp;quot;, &amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(multiLineEditbox);&lt;br /&gt;
multiLineEditbox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setSize(UVector2(cegui_reldim(0.3f), cegui_reldim(0.3f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
multiLineEditbox-&amp;gt;subscribeEvent(MultiLineEditbox::EventTextChanged, Event::Subscriber(&amp;amp;EventGalore::onTextChanged, this));&lt;br /&gt;
&lt;br /&gt;
// This text is going to show the result.&lt;br /&gt;
Window * textWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(textWindow);&lt;br /&gt;
textWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.5f)));&lt;br /&gt;
textWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.6f), cegui_reldim(0.1f)));&lt;br /&gt;
textWindow-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;CEGUI::MultiLineEditbox*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * textWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	textWindow-&amp;gt;setText(multiLineEditbox-&amp;gt;getText());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice what happens when you enter text on another line though :)&lt;br /&gt;
&lt;br /&gt;
====FrameWindow====&lt;br /&gt;
&lt;br /&gt;
This is a window where you usually put your widgets on.&lt;br /&gt;
&lt;br /&gt;
* EventCloseClicked - Fired when the 'X' in the upper right corner is clicked (of the Framewindow).&lt;br /&gt;
* EventRollupToggled - Fired when the window gets rolled up, or rolled down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
FrameWindow * frameWindow = static_cast&amp;lt;FrameWindow*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/FrameWindow&amp;quot;, &amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(frameWindow)&lt;br /&gt;
frameWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
frameWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&amp;amp;EventGalore::onCloseClicked, this));&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventRollupToggled, Event::Subscriber(&amp;amp;EventGalore::onRollupToggled, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCloseClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Someone has clicked the upper right 'X'.&lt;br /&gt;
&lt;br /&gt;
	// We don't HAVE to cast to FrameWindow, as the method we are going to use to close the window&lt;br /&gt;
	//  is available in Window, but for the sake of clarity...&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
	frameWindow-&amp;gt;destroy();&lt;br /&gt;
	// Note: Dont try to delete the pointer.&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onRollupToggled(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (frameWindow-&amp;gt;isRolledup())&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Rolled up&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ProgressBar====&lt;br /&gt;
&lt;br /&gt;
A progress widget.&lt;br /&gt;
&lt;br /&gt;
* EventProgressDone - Fired when the progress bar reaches 100%(1.0f).&lt;br /&gt;
* EventProgressChanged - Fired when the progress changes.&lt;br /&gt;
* EventMouseClick - Fired when someone clicked on the window. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
ProgressBar * progressBar = static_cast&amp;lt;ProgressBar*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/ProgressBar&amp;quot;, &amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(progressBar);&lt;br /&gt;
progressBar-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
progressBar-&amp;gt;setSize(UVector2(cegui_reldim(0.5f), cegui_reldim(0.04f)));&lt;br /&gt;
&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventProgressDone, Event::Subscriber(&amp;amp;EventGalore::onProgressDone, this));&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventProgressChanged, Event::Subscriber(&amp;amp;EventGalore::onProgressChanged, this));&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventMouseClick, Event::Subscriber(&amp;amp;EventGalore::onMouseClick, this));&lt;br /&gt;
&lt;br /&gt;
Window * resultWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(resultWindow);&lt;br /&gt;
resultWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.05f)));&lt;br /&gt;
resultWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.5f), cegui_reldim(0.06f)));&lt;br /&gt;
resultWindow-&amp;gt;setText(&amp;quot;Lets start progressing!&amp;quot;);&lt;br /&gt;
resultWindow-&amp;gt;setProperty(&amp;quot;FrameEnabled&amp;quot;, &amp;quot;false&amp;quot;);&lt;br /&gt;
resultWindow-&amp;gt;setProperty(&amp;quot;BackgroundEnabled&amp;quot;, &amp;quot;false&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onProgressDone(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The progress bar is full.&lt;br /&gt;
	CEGUI::Window * resultWindow = CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	resultWindow-&amp;gt;setText(&amp;quot;We are done!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onProgressChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The progress changed.&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::ProgressBar * progressBar = static_cast&amp;lt;CEGUI::ProgressBar*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * resultWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	float progress = progressBar-&amp;gt;getProgress();&lt;br /&gt;
	int finalProgress = static_cast&amp;lt;int&amp;gt;(progress*100);&lt;br /&gt;
	std::stringstream resultStr;&lt;br /&gt;
	resultStr &amp;lt;&amp;lt; &amp;quot;Progress: &amp;quot; &amp;lt;&amp;lt; finalProgress &amp;lt;&amp;lt; &amp;quot;%&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	resultWindow-&amp;gt;setText(resultStr.str());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseClick(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::ProgressBar * progressBar = static_cast&amp;lt;CEGUI::ProgressBar*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
	progressBar-&amp;gt;setProgress(progressBar-&amp;gt;getProgress() + 0.05f);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2639</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2639"/>
				<updated>2007-05-07T17:21:58Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MultiLineEditbox====&lt;br /&gt;
&lt;br /&gt;
This widget is pretty much the same as editbox, but allows more lines.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged - Fired when text has been changed. Inherited from window.&lt;br /&gt;
&lt;br /&gt;
This widget doesn't have the event TextAccepted, so you'll need to 'apply' the input by a button for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;MultiLineEditbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/MultiLineEditbox&amp;quot;, &amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(multiLineEditbox);&lt;br /&gt;
multiLineEditbox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setSize(UVector2(cegui_reldim(0.3f), cegui_reldim(0.3f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
multiLineEditbox-&amp;gt;subscribeEvent(MultiLineEditbox::EventTextChanged, Event::Subscriber(&amp;amp;EventGalore::onTextChanged, this));&lt;br /&gt;
&lt;br /&gt;
// This text is going to show the result.&lt;br /&gt;
Window * textWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(textWindow);&lt;br /&gt;
textWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.5f)));&lt;br /&gt;
textWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.6f), cegui_reldim(0.1f)));&lt;br /&gt;
textWindow-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;CEGUI::MultiLineEditbox*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * textWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	textWindow-&amp;gt;setText(multiLineEditbox-&amp;gt;getText());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice what happens when you enter text on another line though :)&lt;br /&gt;
&lt;br /&gt;
====FrameWindow====&lt;br /&gt;
&lt;br /&gt;
This is a window where you usually put your widgets on.&lt;br /&gt;
&lt;br /&gt;
* EventCloseClicked - Fired when the 'X' in the upper right corner is clicked (of the Framewindow).&lt;br /&gt;
* EventRollupToggled - Fired when the window gets rolled up, or rolled down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
FrameWindow * frameWindow = static_cast&amp;lt;FrameWindow*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/FrameWindow&amp;quot;, &amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(frameWindow)&lt;br /&gt;
frameWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
frameWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&amp;amp;EventGalore::onCloseClicked, this));&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventRollupToggled, Event::Subscriber(&amp;amp;EventGalore::onRollupToggled, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCloseClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Someone has clicked the upper right 'X'.&lt;br /&gt;
&lt;br /&gt;
	// We don't HAVE to cast to FrameWindow, as the method we are going to use to close the window&lt;br /&gt;
	//  is available in Window, but for the sake of clarity...&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
	frameWindow-&amp;gt;destroy();&lt;br /&gt;
	// Note: Dont try to delete the pointer.&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onRollupToggled(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (frameWindow-&amp;gt;isRolledup())&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Rolled up&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====ProgressBar====&lt;br /&gt;
&lt;br /&gt;
A progress widget.&lt;br /&gt;
&lt;br /&gt;
* EventProgressDone - Fired when the progress bar reaches 100%(1.0f).&lt;br /&gt;
* EventProgressChanged - Fired when the progress changes.&lt;br /&gt;
* EventMouseClick - Fired when someone clicked on the window. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
ProgressBar * progressBar = static_cast&amp;lt;ProgressBar*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/ProgressBar&amp;quot;, &amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(progressBar);&lt;br /&gt;
progressBar-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
progressBar-&amp;gt;setSize(UVector2(cegui_reldim(0.5f), cegui_reldim(0.04f)));&lt;br /&gt;
&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventProgressDone, Event::Subscriber(&amp;amp;EventGalore::onProgressDone, this));&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventProgressChanged, Event::Subscriber(&amp;amp;EventGalore::onProgressChanged, this));&lt;br /&gt;
progressBar-&amp;gt;subscribeEvent(ProgressBar::EventMouseClick, Event::Subscriber(&amp;amp;EventGalore::onMouseClick, this));&lt;br /&gt;
&lt;br /&gt;
Window * resultWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(resultWindow);&lt;br /&gt;
resultWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.05f)));&lt;br /&gt;
resultWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.5f), cegui_reldim(0.06f)));&lt;br /&gt;
resultWindow-&amp;gt;setText(&amp;quot;Lets start progressing!&amp;quot;);&lt;br /&gt;
resultWindow-&amp;gt;setProperty(&amp;quot;FrameEnabled&amp;quot;, &amp;quot;false&amp;quot;);&lt;br /&gt;
resultWindow-&amp;gt;setProperty(&amp;quot;BackgroundEnabled&amp;quot;, &amp;quot;false&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onProgressDone(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The progress bar is full.&lt;br /&gt;
	CEGUI::Window * resultWindow = CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	resultWindow-&amp;gt;setText(&amp;quot;We are done!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onProgressChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The progress changed.&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::ProgressBar * progressBar = static_cast&amp;lt;CEGUI::ProgressBar*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * resultWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	float progress = progressBar-&amp;gt;getProgress();&lt;br /&gt;
	int finalProgress = static_cast&amp;lt;int&amp;gt;(progress*100);&lt;br /&gt;
	std::stringstream resultStr;&lt;br /&gt;
	resultStr &amp;lt;&amp;lt; &amp;quot;Progress: &amp;quot; &amp;lt;&amp;lt; finalProgress &amp;lt;&amp;lt; &amp;quot;%&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	resultWindow-&amp;gt;setText(resultStr.str());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseClick(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::ProgressBar * progressBar = static_cast&amp;lt;CEGUI::ProgressBar*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;ProgressBar1&amp;quot;));&lt;br /&gt;
	progressBar-&amp;gt;setProgress(progressBar-&amp;gt;getProgress() + 0.05f);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2638</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2638"/>
				<updated>2007-05-07T16:44:00Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MultiLineEditbox====&lt;br /&gt;
&lt;br /&gt;
This widget is pretty much the same as editbox, but allows more lines.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged - Fired when text has been changed. Inherited from window.&lt;br /&gt;
&lt;br /&gt;
This widget doesn't have the event TextAccepted, so you'll need to 'apply' the input by a button for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;MultiLineEditbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/MultiLineEditbox&amp;quot;, &amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(multiLineEditbox);&lt;br /&gt;
multiLineEditbox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setSize(UVector2(cegui_reldim(0.3f), cegui_reldim(0.3f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
multiLineEditbox-&amp;gt;subscribeEvent(MultiLineEditbox::EventTextChanged, Event::Subscriber(&amp;amp;EventGalore::onTextChanged, this));&lt;br /&gt;
&lt;br /&gt;
// This text is going to show the result.&lt;br /&gt;
Window * textWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(textWindow);&lt;br /&gt;
textWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.5f)));&lt;br /&gt;
textWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.6f), cegui_reldim(0.1f)));&lt;br /&gt;
textWindow-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;CEGUI::MultiLineEditbox*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * textWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	textWindow-&amp;gt;setText(multiLineEditbox-&amp;gt;getText());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice what happens when you enter text on another line though :)&lt;br /&gt;
&lt;br /&gt;
====FrameWindow====&lt;br /&gt;
&lt;br /&gt;
This is a window where you usually put your widgets on.&lt;br /&gt;
&lt;br /&gt;
* EventCloseClicked - Fired when the 'X' in the upper right corner is clicked (of the Framewindow).&lt;br /&gt;
* EventRollupToggled - Fired when the window gets rolled up, or rolled down.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
FrameWindow * frameWindow = static_cast&amp;lt;FrameWindow*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/FrameWindow&amp;quot;, &amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(frameWindow)&lt;br /&gt;
frameWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
frameWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventCloseClicked, Event::Subscriber(&amp;amp;EventGalore::onCloseClicked, this));&lt;br /&gt;
frameWindow-&amp;gt;subscribeEvent(FrameWindow::EventRollupToggled, Event::Subscriber(&amp;amp;EventGalore::onRollupToggled, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCloseClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Someone has clicked the upper right 'X'.&lt;br /&gt;
&lt;br /&gt;
	// We don't HAVE to cast to FrameWindow, as the method we are going to use to close the window&lt;br /&gt;
	//  is available in Window, but for the sake of clarity...&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
	frameWindow-&amp;gt;destroy();&lt;br /&gt;
	// Note: Dont try to delete the pointer.&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onRollupToggled(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::FrameWindow * frameWindow = static_cast&amp;lt;CEGUI::FrameWindow*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;FrameWindow1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (frameWindow-&amp;gt;isRolledup())&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Rolled up&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		frameWindow-&amp;gt;setText(&amp;quot;Our window&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2637</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2637"/>
				<updated>2007-05-07T12:47:30Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: /* MultiLineEditbox */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MultiLineEditbox====&lt;br /&gt;
&lt;br /&gt;
This widget is pretty much the same as editbox, but allows more lines.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged - Fired when text has been changed. Inherited from window.&lt;br /&gt;
&lt;br /&gt;
This widget doesn't have the event TextAccepted, so you'll need to 'apply' the input by a button for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;MultiLineEditbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/MultiLineEditbox&amp;quot;, &amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(multiLineEditbox);&lt;br /&gt;
multiLineEditbox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setSize(UVector2(cegui_reldim(0.3f), cegui_reldim(0.3f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
multiLineEditbox-&amp;gt;subscribeEvent(MultiLineEditbox::EventTextChanged, Event::Subscriber(&amp;amp;EventGalore::onTextChanged, this));&lt;br /&gt;
&lt;br /&gt;
// This text is going to show the result.&lt;br /&gt;
Window * textWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(textWindow);&lt;br /&gt;
textWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.5f)));&lt;br /&gt;
textWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.6f), cegui_reldim(0.1f)));&lt;br /&gt;
textWindow-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;CEGUI::MultiLineEditbox*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * textWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	textWindow-&amp;gt;setText(multiLineEditbox-&amp;gt;getText());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice what happens when you enter text on another line though :)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2636</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2636"/>
				<updated>2007-05-07T12:45:59Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====MultiLineEditbox====&lt;br /&gt;
&lt;br /&gt;
This widget is pretty much the same as editbox, but allows more lines.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged - Fired when text has been changed. Inherited from window.&lt;br /&gt;
&lt;br /&gt;
This widget doesn't have the even TextAccepted, so you'll need to 'apply' the input by a button for example.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;MultiLineEditbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/MultiLineEditbox&amp;quot;, &amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(multiLineEditbox);&lt;br /&gt;
multiLineEditbox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setSize(UVector2(cegui_reldim(0.3f), cegui_reldim(0.3f)));&lt;br /&gt;
multiLineEditbox-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
multiLineEditbox-&amp;gt;subscribeEvent(MultiLineEditbox::EventTextChanged, Event::Subscriber(&amp;amp;EventGalore::onTextChanged, this));&lt;br /&gt;
&lt;br /&gt;
// This text is going to show the result.&lt;br /&gt;
Window * textWindow = winMgr.createWindow(&amp;quot;TaharezLook/StaticText&amp;quot;, &amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(textWindow);&lt;br /&gt;
textWindow-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.5f)));&lt;br /&gt;
textWindow-&amp;gt;setSize(UVector2(cegui_reldim(0.6f), cegui_reldim(0.1f)));&lt;br /&gt;
textWindow-&amp;gt;setText(&amp;quot;Now edit me!&amp;quot;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::WindowManager * winMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
	CEGUI::MultiLineEditbox * multiLineEditbox = static_cast&amp;lt;CEGUI::MultiLineEditbox*&amp;gt;(winMgr-&amp;gt;getWindow(&amp;quot;MultiEditbox1&amp;quot;));&lt;br /&gt;
	CEGUI::Window * textWindow = winMgr-&amp;gt;getWindow(&amp;quot;StaticText1&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	textWindow-&amp;gt;setText(multiLineEditbox-&amp;gt;getText());&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Notice what happens when you enter text on another line though :)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2632</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2632"/>
				<updated>2007-05-06T11:11:08Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Editbox====&lt;br /&gt;
&lt;br /&gt;
A simple editable box where text can be entered.&lt;br /&gt;
&lt;br /&gt;
* EventTextAccepted - Fired when someone has pressed TAB or RETURN, or when someone has clicked another window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Editbox * editBox = static_cast&amp;lt;Editbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Editbox&amp;quot;, &amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(editBox);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
editBox-&amp;gt;setText(&amp;quot;Edit me!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
editBox-&amp;gt;subscribeEvent(Editbox::EventTextAccepted, Event::Subscriber(&amp;amp;EventGalore::onTextAccepted, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onTextAccepted(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our text has been accepted by either deactivating it or pressing tab or enter.&lt;br /&gt;
	CEGUI::Editbox * editBox = static_cast&amp;lt;CEGUI::Editbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Editbox1&amp;quot;));&lt;br /&gt;
	// So we got the text here, do something with it. Lets just..put the text back in reverse order.&lt;br /&gt;
	CEGUI::String currentText = editBox-&amp;gt;getText();&lt;br /&gt;
&lt;br /&gt;
	std::string finalString;&lt;br /&gt;
&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkNode = currentText.rbegin();&lt;br /&gt;
	CEGUI::String::reverse_iterator ppkEnd = currentText.rend();&lt;br /&gt;
&lt;br /&gt;
	for (; ppkNode != ppkEnd; ++ppkNode)&lt;br /&gt;
	{&lt;br /&gt;
		finalString.push_back((*ppkNode));&lt;br /&gt;
	}&lt;br /&gt;
	editBox-&amp;gt;setText(finalString);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2631</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2631"/>
				<updated>2007-05-05T20:57:57Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;br /&gt;
&lt;br /&gt;
====RadioButton====&lt;br /&gt;
&lt;br /&gt;
Similar to Checkbox, only it can be grouped, and once selected, it cannot be unselected (except when another button has been selected). Note, in this case, both functions are called when you click the unselected radiobutton. This is because one is unselected and one is selected.&lt;br /&gt;
&lt;br /&gt;
* EventSelectStateChanged - Fired when the radiobutton has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
RadioButton * radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton1SelectChanged, this));&lt;br /&gt;
// To make sure the event is fired.&lt;br /&gt;
radioButton-&amp;gt;setSelected(true);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
radioButton = static_cast&amp;lt;RadioButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/RadioButton&amp;quot;, &amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(radioButton);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.2f)));&lt;br /&gt;
radioButton-&amp;gt;setSize(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
radioButton-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
radioButton-&amp;gt;setGroupID(0);&lt;br /&gt;
&lt;br /&gt;
radioButton-&amp;gt;subscribeEvent(RadioButton::EventSelectStateChanged, Event::Subscriber(&amp;amp;EventGalore::onButton2SelectChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onButton1SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::RadioButton * radioButton1 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton1-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Ok then. Yes it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton1-&amp;gt;setText(&amp;quot;Yes&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onButton2SelectChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// We have chosen no.&lt;br /&gt;
	CEGUI::RadioButton * radioButton2 = static_cast&amp;lt;CEGUI::RadioButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;RadioButton2&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (radioButton2-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// This one just got selected.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;Ok then. No it is.&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// This one got unselected. Reset it.&lt;br /&gt;
		radioButton2-&amp;gt;setText(&amp;quot;No&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2630</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2630"/>
				<updated>2007-05-05T16:08:33Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Checkbox====&lt;br /&gt;
&lt;br /&gt;
A checkable item useful for boolean(true or false) 'questions'.&lt;br /&gt;
&lt;br /&gt;
* EventCheckStateChanged - Fired when the checkbox got checked or un-checked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse hovers over the checkbox. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse moves out of the checkbox. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Checkbox * checkBox = static_cast&amp;lt;Checkbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Checkbox&amp;quot;, &amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(checkBox);&lt;br /&gt;
checkBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
checkBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.1f)));&lt;br /&gt;
&lt;br /&gt;
// A question where people can only answer yes or no (true or false)&lt;br /&gt;
checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventCheckStateChanged, Event::Subscriber(&amp;amp;EventGalore::onCheckStateChanged, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
checkBox-&amp;gt;subscribeEvent(Checkbox::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onCheckStateChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our item has been checked or unchecked, update our item accordingly.&lt;br /&gt;
	updateCheckbox();&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// The mouse has entered, update the checkbox accordingly.&lt;br /&gt;
	updateCheckbox();		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
	// Reset&lt;br /&gt;
	checkBox-&amp;gt;setText(&amp;quot;Hey! Do you want to be rich?&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
	&lt;br /&gt;
void updateCheckbox()&lt;br /&gt;
{&lt;br /&gt;
	CEGUI::Checkbox * checkBox = static_cast&amp;lt;CEGUI::Checkbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Checkbox1&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
	if (checkBox-&amp;gt;isSelected())&lt;br /&gt;
	{&lt;br /&gt;
		// Our checkbox is selected, so someone has previously said 'yes'.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose no!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
	else&lt;br /&gt;
	{&lt;br /&gt;
		// Our item is not selected, so someone hasn't done anything yet, or it has been previously&lt;br /&gt;
		//  unchecked.&lt;br /&gt;
		checkBox-&amp;gt;setText(&amp;quot;Click to choose yes!&amp;quot;);&lt;br /&gt;
	}&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This might confuse at first sight. Let me go through this here, in steps.&lt;br /&gt;
* First, our checkbox is created and our mouse remains still.&lt;br /&gt;
* Second, the mouse enters the checkbox, updateCheckbox is called. In this case, our checkbox isn't selected by default, so the text becomes 'Click to choose yes!'.&lt;br /&gt;
* Third, we click. The onCheckStateChanged function is called, and that function calls updateCheckbox again to instantly change the text again. We have clicked the checkbox, while it wasn't previously checked, this means its checked now. Text becomes 'Click to choose no!'.&lt;br /&gt;
* Fourth, we move our mouse away from the checkbox. The onMouseLeaves function is called, where we reset the text to our question.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2629</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2629"/>
				<updated>2007-05-05T15:48:48Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2628</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2628"/>
				<updated>2007-05-05T15:48:21Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, where a few are introduced by other widgets, and where many are unimportant. If a event is taken from this Window class, it is mentioned.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Fired when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Fired when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Fired when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Fired when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Fired when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Fired when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pushButton = static_cast&amp;lt;PushButton*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pushButton-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pushButton-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pushButton-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pushButton = static_cast&amp;lt;CEGUI::PushButton*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;));&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pushButton-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Listbox====&lt;br /&gt;
&lt;br /&gt;
The listbox is a very usefull listing widget. Only has one important event.&lt;br /&gt;
&lt;br /&gt;
* EventSelectionChanged - Fired when a or another item has been selected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
Listbox * listBox = static_cast&amp;lt;Listbox*&amp;gt;(winMgr.createWindow(&amp;quot;TaharezLook/Listbox&amp;quot;, &amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
sheet-&amp;gt;addChildWindow(listBox);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
listBox-&amp;gt;setSize(UVector2(cegui_reldim(0.4f), cegui_reldim(0.4f)));&lt;br /&gt;
			&lt;br /&gt;
ListboxTextItem * listBoxItem = new ListboxTextItem(&amp;quot;Our very first item.&amp;quot;, 1);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBoxItem = new ListboxTextItem(&amp;quot;Our second item.&amp;quot;, 2);&lt;br /&gt;
listBoxItem-&amp;gt;setSelectionBrushImage(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MultiListSelectionBrush&amp;quot;);&lt;br /&gt;
listBox-&amp;gt;addItem(listBoxItem);&lt;br /&gt;
&lt;br /&gt;
listBox-&amp;gt;subscribeEvent(Listbox::EventSelectionChanged, Event::Subscriber(&amp;amp;EventGalore::onSelectionChanged, this));&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onSelectionChanged(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
        // The selection has changed.&lt;br /&gt;
	CEGUI::Listbox * listBox = static_cast&amp;lt;CEGUI::Listbox*&amp;gt;(CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Listbox1&amp;quot;));&lt;br /&gt;
	// Get the item we selected&lt;br /&gt;
	CEGUI::ListboxItem * selectedItem = listBox-&amp;gt;getFirstSelectedItem();&lt;br /&gt;
	selectedItem-&amp;gt;setText(&amp;quot;Oh we got selected!&amp;quot;);&lt;br /&gt;
		&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2627</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2627"/>
				<updated>2007-05-05T11:59:11Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       try&lt;br /&gt;
       {&lt;br /&gt;
		using namespace CEGUI;&lt;br /&gt;
		&lt;br /&gt;
		WindowManager&amp;amp; winMgr = WindowManager::getSingleton();&lt;br /&gt;
&lt;br /&gt;
		// Load the TaharezLook scheme and set up the default mouse cursor and font&lt;br /&gt;
		SchemeManager::getSingleton().loadScheme(&amp;quot;TaharezLook.scheme&amp;quot;);&lt;br /&gt;
		System::getSingleton().setDefaultMouseCursor(&amp;quot;TaharezLook&amp;quot;, &amp;quot;MouseArrow&amp;quot;);&lt;br /&gt;
		FontManager::getSingleton().createFont(&amp;quot;Commonwealth-10.font&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
		// Set the GUI Sheet&lt;br /&gt;
		Window* sheet = winMgr.createWindow(&amp;quot;DefaultWindow&amp;quot;, &amp;quot;root_wnd&amp;quot;);&lt;br /&gt;
		System::getSingleton().setGUISheet(sheet);&lt;br /&gt;
&lt;br /&gt;
		// Place here the code from the widgets, place functions below this function.&lt;br /&gt;
	&lt;br /&gt;
	}&lt;br /&gt;
	catch(CEGUI::Exception &amp;amp;e)&lt;br /&gt;
	{&lt;br /&gt;
		#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
			MessageBox(NULL, e.getMessage().c_str(), &amp;quot;Error initializing the demo&amp;quot;, MB_OK | MB_ICONERROR | MB_TASKMODAL);&lt;br /&gt;
		#else&lt;br /&gt;
			std::cerr &amp;lt;&amp;lt; &amp;quot;Error initializing the demo:&amp;quot; &amp;lt;&amp;lt; e.getMessage().c_str() &amp;lt;&amp;lt; &amp;quot;\n&amp;quot;;&lt;br /&gt;
		#endif&lt;br /&gt;
	}&lt;br /&gt;
	return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, but we are only going to handle a few.&lt;br /&gt;
&lt;br /&gt;
* EventDragDropItemEnters - Called when a drag and drop item floats over the window.&lt;br /&gt;
* EventDragDropItemLeaves - Called when a drag and drop item floats out of the window.&lt;br /&gt;
* EventDragDropItemDropped - Called when the item has been dropped on the window.&lt;br /&gt;
&lt;br /&gt;
====PushButton====&lt;br /&gt;
&lt;br /&gt;
The button is a simple, expected widget. It contains only one important event, but we are going to add a few more.&lt;br /&gt;
&lt;br /&gt;
* EventClicked - Called when the button has been clicked.&lt;br /&gt;
* EventMouseEnters - Called when the mouse enters the widget. Inherited from Window.&lt;br /&gt;
* EventMouseLeaves - Called when the mouse leaves the widget. Inherited from Window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
PushButton * pb = (PushButton*)winMgr.createWindow(&amp;quot;TaharezLook/Button&amp;quot;, &amp;quot;Button1&amp;quot;);&lt;br /&gt;
sheet-&amp;gt;addChildWindow(pb);&lt;br /&gt;
pb-&amp;gt;setPosition(UVector2(cegui_reldim(0.1f), cegui_reldim(0.1f)));&lt;br /&gt;
pb-&amp;gt;setSize(UVector2(cegui_reldim(0.2f), cegui_reldim(0.08f)));&lt;br /&gt;
pb-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
pb-&amp;gt;subscribeEvent(PushButton::EventClicked, Event::Subscriber(&amp;amp;EventGalore::onPushButtonClicked, this));&lt;br /&gt;
pb-&amp;gt;subscribeEvent(PushButton::EventMouseEnters, Event::Subscriber(&amp;amp;EventGalore::onMouseEnters, this));&lt;br /&gt;
pb-&amp;gt;subscribeEvent(PushButton::EventMouseLeaves, Event::Subscriber(&amp;amp;EventGalore::onMouseLeaves, this));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
bool onPushButtonClicked(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Our button has been clicked!&lt;br /&gt;
	CEGUI::PushButton * pb = (CEGUI::PushButton*)CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;);&lt;br /&gt;
	pb-&amp;gt;setText(&amp;quot;We got clicked!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseEnters(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has entered the button. (Hover)&lt;br /&gt;
	CEGUI::PushButton * pb = (CEGUI::PushButton*)CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;);&lt;br /&gt;
	pb-&amp;gt;setText(&amp;quot;Now click!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
bool onMouseLeaves(const CEGUI::EventArgs &amp;amp;e)&lt;br /&gt;
{&lt;br /&gt;
	// Mouse has left the button.&lt;br /&gt;
	CEGUI::PushButton * pb = (CEGUI::PushButton*)CEGUI::WindowManager::getSingletonPtr()-&amp;gt;getWindow(&amp;quot;Button1&amp;quot;);&lt;br /&gt;
	// Back to its original state!&lt;br /&gt;
	pb-&amp;gt;setText(&amp;quot;Hey! Come here!&amp;quot;);&lt;br /&gt;
	return true;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2626</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2626"/>
				<updated>2007-05-05T11:24:38Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       using namespace CEGUI;&lt;br /&gt;
&lt;br /&gt;
       return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, but we are only going to handle a few.&lt;br /&gt;
&lt;br /&gt;
* EventTextChanged  Called whenever the text of the window has changed.&lt;br /&gt;
*&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2625</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2625"/>
				<updated>2007-05-05T11:24:22Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       using namespace CEGUI;&lt;br /&gt;
&lt;br /&gt;
       return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;br /&gt;
&lt;br /&gt;
The Window widget is a important baseclass, all widgets inherit this class. It has lots 'n lots of events, but we are only going to handle a few.&lt;br /&gt;
&lt;br /&gt;
- EventTextChanged  Called whenever the text of the window has changed.&lt;br /&gt;
-&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2623</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2623"/>
				<updated>2007-05-05T11:07:27Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       using namespace CEGUI;&lt;br /&gt;
&lt;br /&gt;
       return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Widgets===&lt;br /&gt;
&lt;br /&gt;
====Window====&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2622</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2622"/>
				<updated>2007-05-05T11:06:18Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
I'm only going to change the initialiseSample function for each widget + adding some others.&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       using namespace CEGUI;&lt;br /&gt;
&lt;br /&gt;
       return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2621</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2621"/>
				<updated>2007-05-05T10:57:31Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
&lt;br /&gt;
====EventGalore.h====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#ifndef _EventGalore_h_&lt;br /&gt;
#define _EventGalore_h_&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
#include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class EventGalore : public CEGuiSample&lt;br /&gt;
{&lt;br /&gt;
public:&lt;br /&gt;
   bool initialiseSample()&lt;br /&gt;
   {&lt;br /&gt;
       using namespace CEGUI;&lt;br /&gt;
&lt;br /&gt;
       return true;&lt;br /&gt;
   }&lt;br /&gt;
   void cleanupSample(void)&lt;br /&gt;
   {&lt;br /&gt;
   }&lt;br /&gt;
};&lt;br /&gt;
#endif // _EventGalore_h_&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====main.cpp====&lt;br /&gt;
&amp;lt;code&amp;gt;&amp;lt;cpp/&amp;gt;&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
	#define WIN32_LEAN_AND_MEAN&lt;br /&gt;
	#define NOMINMAX&lt;br /&gt;
	#include &amp;quot;windows.h&amp;quot;&lt;br /&gt;
#endif&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;EventGalore.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
#if defined( __WIN32__ ) || defined( _WIN32 )&lt;br /&gt;
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)&lt;br /&gt;
#else&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
#endif&lt;br /&gt;
{&lt;br /&gt;
    EventGalore app;&lt;br /&gt;
    return app.run();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2620</id>
		<title>Most important events</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Most_important_events&amp;diff=2620"/>
				<updated>2007-05-05T10:52:43Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article is going to show you the most important and usefull events of each widget.&lt;br /&gt;
&lt;br /&gt;
===Getting started===&lt;br /&gt;
&lt;br /&gt;
==EventGalore.h==&lt;br /&gt;
 #ifndef _EventGalore_h_&lt;br /&gt;
 #define _EventGalore_h_&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 #include &amp;quot;CEGuiSample.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;CEGUI.h&amp;quot;&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
 class EventGalore : public CEGuiSample&lt;br /&gt;
 {&lt;br /&gt;
 public:&lt;br /&gt;
    bool initialiseSample()&lt;br /&gt;
    {&lt;br /&gt;
&amp;lt;b&amp;gt;        using namespace CEGUI;&lt;br /&gt;
	&amp;lt;br&amp;gt;&lt;br /&gt;
        return true;&amp;lt;/b&amp;gt;&lt;br /&gt;
    }&lt;br /&gt;
    void cleanupSample(void)&lt;br /&gt;
    {&lt;br /&gt;
    }&lt;br /&gt;
 };&lt;br /&gt;
 #endif // _WidgetGalore_h_&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2566</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2566"/>
				<updated>2007-04-10T11:07:50Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
         static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text) :&lt;br /&gt;
             ItemEntry(type, name),&lt;br /&gt;
             d_itemText(text)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&amp;lt;b&amp;gt;CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt; is quite important here. It tells CEGUI where we are placing the code that comes with the window. As you can see this class is quite empty, you are, of course, free to add anything you like to this class - these are just the mere basics.&lt;br /&gt;
&lt;br /&gt;
Now, there is one more important thing to do. Register this window properly in CEGUI.&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
addFalagardWindowMappings parameters are as follows: Name, Type, LooknFeel, WindowRenderer. Just put this code somewhere in your main file or on another place that you are sure is executed before using our new item. Also note, in order to use &amp;lt;b&amp;gt;CEGUI_WINDOW_FACTORY()&amp;lt;/b&amp;gt; you need to be in the CEGUI namespace.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;SDLLoader.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 void doStuff();&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
 int main (int argc, char **argv) &lt;br /&gt;
 {&lt;br /&gt;
     SDLLoader sdl;&lt;br /&gt;
     sdl.init();&lt;br /&gt;
     CEGUI::bindCEGUI();&lt;br /&gt;
     doStuff();&lt;br /&gt;
     sdl.main_loop();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 void doStuff()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::System * m_System = CEGUI::System::getSingletonPtr();&lt;br /&gt;
     CEGUI::Logger::getSingletonPtr()-&amp;gt;setLoggingLevel(CEGUI::Insane);&lt;br /&gt;
     CEGUI::WindowManager * m_WndMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
     CEGUI::Window * m_Root = m_System-&amp;gt;getGUISheet();&lt;br /&gt;
     &amp;lt;br&amp;gt;&lt;br /&gt;
     CEGUI::ItemListbox * lb = (CEGUI::ItemListbox*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/ItemListbox&amp;quot;, &amp;quot;Lol&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.0f), CEGUI::UDim(0.3f, 0.0f)));&lt;br /&gt;
     lb-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0.0f), CEGUI::UDim(0.1f, 0.0f)));&lt;br /&gt;
     m_Root-&amp;gt;addChildWindow(lb);&lt;br /&gt;
     &amp;lt;br&amp;gt;&lt;br /&gt;
     CEGUI::CheckListboxItem * check = (CEGUI::CheckListboxItem*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Test&amp;quot;);&lt;br /&gt;
     check-&amp;gt;setText(&amp;quot;Test&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;addChildWindow(check);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
As you can see in the main function, the function that registers the window is called before actually creating it. Dont pay any attention to the sdl initiation - it's just my personal test environment.&lt;br /&gt;
&lt;br /&gt;
Congratulations! You have just created a CheckListboxItem. This was a very good practice because you also learned the technique required to write a completely new widget.&lt;br /&gt;
&lt;br /&gt;
Please contact me if you have any question, comments, feedback - anything, email me at [mailto:levia@openfrag.org levia at openfrag dot com].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2565</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2565"/>
				<updated>2007-04-10T11:00:26Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
         static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text) :&lt;br /&gt;
             ItemEntry(type, name),&lt;br /&gt;
             d_itemText(text)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem) is quite important here. It tells CEGUI where we are placing the code that comes with the window. As you can see this class is quite empty, you are, of course, free to add anything you like to this class - these are just the mere basics.&lt;br /&gt;
&lt;br /&gt;
Now, there is one more important thing to do. Register this window properly in CEGUI.&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
addFalagardWindowMappings parameters are as follows: Name, Type, LooknFeel, WindowRenderer. Just put this code somewhere in your main file or on another place that you are sure is executed before using our new item.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;SDLLoader.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 void doStuff();&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
 int main (int argc, char **argv) &lt;br /&gt;
 {&lt;br /&gt;
     SDLLoader sdl;&lt;br /&gt;
     sdl.init();&lt;br /&gt;
     CEGUI::bindCEGUI();&lt;br /&gt;
     doStuff();&lt;br /&gt;
     sdl.main_loop();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
 void doStuff()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::System * m_System = CEGUI::System::getSingletonPtr();&lt;br /&gt;
     CEGUI::Logger::getSingletonPtr()-&amp;gt;setLoggingLevel(CEGUI::Insane);&lt;br /&gt;
     CEGUI::WindowManager * m_WndMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
     CEGUI::Window * m_Root = m_System-&amp;gt;getGUISheet();&lt;br /&gt;
     &amp;lt;br&amp;gt;&lt;br /&gt;
     CEGUI::ItemListbox * lb = (CEGUI::ItemListbox*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/ItemListbox&amp;quot;, &amp;quot;Lol&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.0f), CEGUI::UDim(0.3f, 0.0f)));&lt;br /&gt;
     lb-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0.0f), CEGUI::UDim(0.1f, 0.0f)));&lt;br /&gt;
     m_Root-&amp;gt;addChildWindow(lb);&lt;br /&gt;
     CEGUI::CheckListboxItem * check = (CEGUI::CheckListboxItem*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Test&amp;quot;);&lt;br /&gt;
     check-&amp;gt;setText(&amp;quot;Test&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;addChildWindow(check);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2564</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2564"/>
				<updated>2007-04-10T10:59:27Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
         static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text) :&lt;br /&gt;
             ItemEntry(type, name),&lt;br /&gt;
             d_itemText(text)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem) is quite important here. It tells CEGUI where we are placing the code that comes with the window. As you can see this class is quite empty, you are, of course, free to add anything you like to this class - these are just the mere basics.&lt;br /&gt;
&lt;br /&gt;
Now, there is one more important thing to do. Register this window properly in CEGUI.&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
addFalagardWindowMappings parameters are as follows: Name, Type, LooknFeel, WindowRenderer. Just put this code somewhere in your main file or on another place that you are sure is executed before using our new item.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;SDLLoader.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 void doStuff();&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
 int main (int argc, char **argv) &lt;br /&gt;
 {&lt;br /&gt;
     SDLLoader sdl;&lt;br /&gt;
     sdl.init();&lt;br /&gt;
     CEGUI::bindCEGUI();&lt;br /&gt;
     doStuff();&lt;br /&gt;
     sdl.main_loop();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void doStuff()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::System * m_System = CEGUI::System::getSingletonPtr();&lt;br /&gt;
     CEGUI::Logger::getSingletonPtr()-&amp;gt;setLoggingLevel(CEGUI::Insane);&lt;br /&gt;
     CEGUI::WindowManager * m_WndMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
     CEGUI::Window * m_Root = m_System-&amp;gt;getGUISheet();&lt;br /&gt;
     &amp;lt;br&amp;gt;&lt;br /&gt;
     CEGUI::ItemListbox * lb = (CEGUI::ItemListbox*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/ItemListbox&amp;quot;, &amp;quot;Lol&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.0f), CEGUI::UDim(0.3f, 0.0f)));&lt;br /&gt;
     lb-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0.0f), CEGUI::UDim(0.1f, 0.0f)));&lt;br /&gt;
     m_Root-&amp;gt;addChildWindow(lb);&lt;br /&gt;
     CEGUI::CheckListboxItem * check = (CEGUI::CheckListboxItem*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Test&amp;quot;);&lt;br /&gt;
     check-&amp;gt;setText(&amp;quot;Test&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;addChildWindow(check);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2563</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2563"/>
				<updated>2007-04-10T10:58:27Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
         static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text) :&lt;br /&gt;
             ItemEntry(type, name),&lt;br /&gt;
             d_itemText(text)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem) is quite important here. It tells CEGUI where we are placing the code that comes with the window. As you can see this class is quite empty, you are, of course, free to add anything you like to this class - these are just the mere basics.&lt;br /&gt;
&lt;br /&gt;
Now, there is one more important thing to do. Register this window properly in CEGUI.&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
addFalagardWindowMappings parameters are as follows: Name, Type, LooknFeel, WindowRenderer. Just put this code somewhere in your main file or on another place that you are sure is executed before using our new item.&lt;br /&gt;
&lt;br /&gt;
'''Example'''&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;quot;SDLLoader.h&amp;quot;&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
 void doStuff();&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
 void bindCEGUI()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::WindowFactoryManager&amp;amp; wfMgr = CEGUI::WindowFactoryManager::getSingleton();&lt;br /&gt;
     wfMgr.addFactory(&amp;amp;CEGUI_WINDOW_FACTORY(CheckListboxItem));&lt;br /&gt;
&lt;br /&gt;
     wfMgr.addFalagardWindowMapping(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;CEGUI/ItemEntry&amp;quot;, &amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Falagard/ItemEntry&amp;quot;);&lt;br /&gt;
 }&lt;br /&gt;
 }&lt;br /&gt;
 int main (int argc, char **argv) &lt;br /&gt;
 {&lt;br /&gt;
     SDLLoader sdl;&lt;br /&gt;
     sdl.init();&lt;br /&gt;
     CEGUI::bindCEGUI();&lt;br /&gt;
     doStuff();&lt;br /&gt;
     sdl.main_loop();&lt;br /&gt;
     return 0;&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
 void doStuff()&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI::System * m_System = CEGUI::System::getSingletonPtr();&lt;br /&gt;
     CEGUI::Logger::getSingletonPtr()-&amp;gt;setLoggingLevel(CEGUI::Insane);&lt;br /&gt;
     CEGUI::WindowManager * m_WndMgr = CEGUI::WindowManager::getSingletonPtr();&lt;br /&gt;
     CEGUI::Window * m_Root = m_System-&amp;gt;getGUISheet();&lt;br /&gt;
&lt;br /&gt;
     CEGUI::ItemListbox * lb = (CEGUI::ItemListbox*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/ItemListbox&amp;quot;, &amp;quot;Lol&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.0f), CEGUI::UDim(0.3f, 0.0f)));&lt;br /&gt;
     lb-&amp;gt;setPosition(CEGUI::UVector2(CEGUI::UDim(0.1f, 0.0f), CEGUI::UDim(0.1f, 0.0f)));&lt;br /&gt;
     m_Root-&amp;gt;addChildWindow(lb);&lt;br /&gt;
     CEGUI::CheckListboxItem * check = (CEGUI::CheckListboxItem*)m_WndMgr-&amp;gt;createWindow(&amp;quot;WindowsLook/CheckListboxItem&amp;quot;, &amp;quot;Test&amp;quot;);&lt;br /&gt;
     check-&amp;gt;setText(&amp;quot;Test&amp;quot;);&lt;br /&gt;
     lb-&amp;gt;addChildWindow(check);&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2562</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2562"/>
				<updated>2007-04-10T10:51:28Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
'''Definition'''&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
         static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text) :&lt;br /&gt;
             ItemEntry(type, name),&lt;br /&gt;
             d_itemText(text)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2561</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2561"/>
				<updated>2007-04-10T10:50:42Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
'''Definition'''&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
	 static const String WidgetTypeName;&lt;br /&gt;
    };&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
As you can see, this class inherits ItemEntry. This is necessary as its THE thing that makes this item working properly. Pay special attention to &amp;lt;b&amp;gt;CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&amp;lt;/b&amp;gt;. This tells CEGUI that we are declarating the window.&lt;br /&gt;
&lt;br /&gt;
 #include &amp;quot;CheckListItem.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
     CEGUI_DEFINE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
     const String CheckListboxItem::WidgetTypeName(&amp;quot;CEGUI/CheckListboxItem&amp;quot;);&lt;br /&gt;
     CheckListboxItem::CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text) :&lt;br /&gt;
             ItemEntry(type, name),&lt;br /&gt;
             d_itemText(text)&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
     CheckListboxItem::~CheckListboxItem()&lt;br /&gt;
     {&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2560</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2560"/>
				<updated>2007-04-10T10:44:21Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
&lt;br /&gt;
 #ifndef _CHECKLISTITEM_&lt;br /&gt;
 #define _CHECKLISTITEM_&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 #include &amp;lt;CEGUI.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 namespace CEGUI&lt;br /&gt;
 {&lt;br /&gt;
&lt;br /&gt;
     class CheckListboxItem : public ItemEntry&lt;br /&gt;
     {&lt;br /&gt;
     protected:&lt;br /&gt;
     public:&lt;br /&gt;
&lt;br /&gt;
         CheckListboxItem(const String &amp;amp;type, const String &amp;amp;name, const String&amp;amp; text = &amp;quot;test&amp;quot;);&lt;br /&gt;
         virtual ~CheckListboxItem();&lt;br /&gt;
&lt;br /&gt;
	 static const String WidgetTypeName;&lt;br /&gt;
&lt;br /&gt;
    };&lt;br /&gt;
&lt;br /&gt;
    CEGUI_DECLARE_WINDOW_FACTORY(CheckListboxItem)&lt;br /&gt;
 }&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 #endif&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2549</id>
		<title>Build from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2549"/>
				<updated>2007-04-05T21:06:50Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I happened to notice that this article needed to be written and I was about to install CEGUI from source right now, so I thought I'd document the steps I used, in hopes that they may be useful to somebody.&lt;br /&gt;
&lt;br /&gt;
I'm on ubuntu 6.06 (Dapper)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need:&amp;lt;br&amp;gt;&lt;br /&gt;
- A C++ compiler (g++ in my case)&amp;lt;br&amp;gt;&lt;br /&gt;
- Linux Makefile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First you need to download the latest source tarball. I think it's a good idea to keep all the libraries you install from source in a directory, so you can re-compile later with different options if you wish. /home/user/Installs in my case.&lt;br /&gt;
Move the downloaded tar to your &amp;quot;installs directory&amp;quot; and extract it with:&amp;lt;br&amp;gt;&lt;br /&gt;
tar xzf CEGUI-0.5.0b.tar.gz&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the CEGUI file:&amp;lt;br&amp;gt;&lt;br /&gt;
cd CEGUI-0.5.0/&amp;lt;br&amp;gt;&lt;br /&gt;
and type &amp;lt;br&amp;gt;&lt;br /&gt;
./configure --help&amp;lt;br&amp;gt;&lt;br /&gt;
Scroll up a bit and take a look at the available compile options. Pay special attention to the optional ones, so you can make sure that you get all the features you need.&lt;br /&gt;
then type&amp;lt;br&amp;gt;&lt;br /&gt;
./configure&amp;lt;br&amp;gt;&lt;br /&gt;
If everything worked you should get a summary of the build you are going to make. If you don't get the summary, it's probably because you don't have the libraries CEGUI needs to compile. Make sure you have the _DEVELOPMENT_ libraries installed. If you are not happy with the summary, run configure again and use the options from the help section to tweak it.&amp;lt;br&amp;gt;&lt;br /&gt;
Here is what I got.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 ************************************************&lt;br /&gt;
 * Crazy Eddie's GUI System - Configuration Results Summary&lt;br /&gt;
 ************************************************&lt;br /&gt;
&lt;br /&gt;
 * Library Release Version:                              0.5.0&lt;br /&gt;
 *&lt;br /&gt;
 * Code options:&lt;br /&gt;
 *         Building CEGUI in debug mode:                 no&lt;br /&gt;
 *&lt;br /&gt;
 * Renderer Modules:&lt;br /&gt;
 *         Building OpenGL Renderer:                     yes&lt;br /&gt;
 *         Building Irrlict Renderer:                    no&lt;br /&gt;
 *&lt;br /&gt;
 * Image Loading Codec Modules (currently for OpenGL Renderer only):&lt;br /&gt;
 *         Building Corona Image Codec:                  no&lt;br /&gt;
 *         Building DevIL Image Codec:                   no&lt;br /&gt;
 *         Building FreeImage Image Codec:               no&lt;br /&gt;
 *         Building SILLY Image Codec:                   no&lt;br /&gt;
 *         Building TGA Image Codec:                     yes&lt;br /&gt;
 *&lt;br /&gt;
 *         Default Image Codec will be:                  TGAImageCodec&lt;br /&gt;
 *&lt;br /&gt;
 * XML Parser Modules:&lt;br /&gt;
 *         Building TinyXMLParser:                       yes&lt;br /&gt;
 *         Building ExpatParser:                         no&lt;br /&gt;
 *         Building LibXMLParser:                        no&lt;br /&gt;
 *         Building XercesParser:                        no&lt;br /&gt;
 *&lt;br /&gt;
 *         Default XML Parser is:                        TinyXMLParser&lt;br /&gt;
 *&lt;br /&gt;
 * Scripting:&lt;br /&gt;
 *         Building Lua scripting module:                no&lt;br /&gt;
 *         Building tolua++cegui generator:              no&lt;br /&gt;
 *&lt;br /&gt;
 * Samples Framework:&lt;br /&gt;
 *         Building Samples:                             yes&lt;br /&gt;
 *         GTK2 based dialog for renderer selection:     no&lt;br /&gt;
 *         OpenGL Renderer available in samples:         yes&lt;br /&gt;
 *         Irrlict Renderer available in samples:        no&lt;br /&gt;
 *         Ogre3D Renderer available in samples:         no&lt;br /&gt;
 ************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
the next part is easy, just type 'make' then 'make install'.&amp;lt;br&amp;gt;&lt;br /&gt;
In practice you'll need root privileges to install the files, so with ubuntu:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo make install&amp;lt;br&amp;gt;&lt;br /&gt;
or in gentoo for example:&amp;lt;br&amp;gt;&lt;br /&gt;
su&amp;lt;br&amp;gt;&lt;br /&gt;
make install&amp;lt;br&amp;gt;&lt;br /&gt;
Hope this helps.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2548</id>
		<title>Build from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2548"/>
				<updated>2007-04-05T21:05:35Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I happened to notice that this article needed to be written and I was about to install CEGUI from source right now, so I thought I'd document the steps I used, in hopes that they may be useful to somebody.&lt;br /&gt;
&lt;br /&gt;
I'm on ubuntu 6.06 (Dapper)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need:&amp;lt;br&amp;gt;&lt;br /&gt;
- A C++ compiler (g++ in my case)&amp;lt;br&amp;gt;&lt;br /&gt;
- Linux Makefile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First you need to download the latest source tarball. I think it's a good idea to keep all the libraries you install from source in a directory, so you can re-compile later with different options if you wish. /home/user/Installs in my case.&lt;br /&gt;
Move the downloaded tar to your &amp;quot;installs directory&amp;quot; and extract it with:&amp;lt;br&amp;gt;&lt;br /&gt;
tar xzf CEGUI-0.5.0b.tar.gz&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the CEGUI file:&amp;lt;br&amp;gt;&lt;br /&gt;
cd CEGUI-0.5.0/&amp;lt;br&amp;gt;&lt;br /&gt;
and type &amp;lt;br&amp;gt;&lt;br /&gt;
./configure --help&amp;lt;br&amp;gt;&lt;br /&gt;
Scroll up a bit and take a look at the available compile options. Pay special attention to the optional ones, so you can make sure that you get all the features you need.&lt;br /&gt;
then type&amp;lt;br&amp;gt;&lt;br /&gt;
./configure&amp;lt;br&amp;gt;&lt;br /&gt;
If everything worked you should get a summary of the build you are going to make. If you don't get the summary, it's probably because you don't have the libraries CEGUI needs to compile. Make sure you have the _DEVELOPMENT_ libraries installed. If you are not happy with the summary, run configure again and use the options from the help section to tweak it.&amp;lt;br&amp;gt;&lt;br /&gt;
Here is what I got.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
 ************************&lt;br /&gt;
 * Crazy Eddie's GUI System - Configuration Results Summary&lt;br /&gt;
 ************************&lt;br /&gt;
&lt;br /&gt;
 * Library Release Version:                              0.5.0&lt;br /&gt;
*&lt;br /&gt;
* Code options:&lt;br /&gt;
*         Building CEGUI in debug mode:                 no&lt;br /&gt;
*&lt;br /&gt;
* Renderer Modules:&lt;br /&gt;
*         Building OpenGL Renderer:                     yes&lt;br /&gt;
*         Building Irrlict Renderer:                    no&lt;br /&gt;
*&lt;br /&gt;
* Image Loading Codec Modules (currently for OpenGL Renderer only):&lt;br /&gt;
*         Building Corona Image Codec:                  no&lt;br /&gt;
*         Building DevIL Image Codec:                   no&lt;br /&gt;
*         Building FreeImage Image Codec:               no&lt;br /&gt;
*         Building SILLY Image Codec:                   no&lt;br /&gt;
*         Building TGA Image Codec:                     yes&lt;br /&gt;
*&lt;br /&gt;
*         Default Image Codec will be:                  TGAImageCodec&lt;br /&gt;
*&lt;br /&gt;
* XML Parser Modules:&lt;br /&gt;
*         Building TinyXMLParser:                       yes&lt;br /&gt;
*         Building ExpatParser:                         no&lt;br /&gt;
*         Building LibXMLParser:                        no&lt;br /&gt;
*         Building XercesParser:                        no&lt;br /&gt;
*&lt;br /&gt;
*         Default XML Parser is:                        TinyXMLParser&lt;br /&gt;
*&lt;br /&gt;
* Scripting:&lt;br /&gt;
*         Building Lua scripting module:                no&lt;br /&gt;
*         Building tolua++cegui generator:              no&lt;br /&gt;
*&lt;br /&gt;
* Samples Framework:&lt;br /&gt;
*         Building Samples:                             yes&lt;br /&gt;
*         GTK2 based dialog for renderer selection:     no&lt;br /&gt;
*         OpenGL Renderer available in samples:         yes&lt;br /&gt;
*         Irrlict Renderer available in samples:        no&lt;br /&gt;
*         Ogre3D Renderer available in samples:         no&lt;br /&gt;
************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
the next part is easy, just type 'make' then 'make install'.&amp;lt;br&amp;gt;&lt;br /&gt;
In practice you'll need root privileges to install the files, so with ubuntu:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo make install&amp;lt;br&amp;gt;&lt;br /&gt;
or in gentoo for example:&amp;lt;br&amp;gt;&lt;br /&gt;
su&amp;lt;br&amp;gt;&lt;br /&gt;
make install&amp;lt;br&amp;gt;&lt;br /&gt;
Hope this helps.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2547</id>
		<title>Build from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2547"/>
				<updated>2007-04-05T21:05:04Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I happened to notice that this article needed to be written and I was about to install CEGUI from source right now, so I thought I'd document the steps I used, in hopes that they may be useful to somebody.&lt;br /&gt;
&lt;br /&gt;
I'm on ubuntu 6.06 (Dapper)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need:&amp;lt;br&amp;gt;&lt;br /&gt;
- A C++ compiler (g++ in my case)&amp;lt;br&amp;gt;&lt;br /&gt;
- Linux Makefile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First you need to download the latest source tarball. I think it's a good idea to keep all the libraries you install from source in a directory, so you can re-compile later with different options if you wish. /home/user/Installs in my case.&lt;br /&gt;
Move the downloaded tar to your &amp;quot;installs directory&amp;quot; and extract it with:&amp;lt;br&amp;gt;&lt;br /&gt;
tar xzf CEGUI-0.5.0b.tar.gz&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the CEGUI file:&amp;lt;br&amp;gt;&lt;br /&gt;
cd CEGUI-0.5.0/&amp;lt;br&amp;gt;&lt;br /&gt;
and type &amp;lt;br&amp;gt;&lt;br /&gt;
./configure --help&amp;lt;br&amp;gt;&lt;br /&gt;
Scroll up a bit and take a look at the available compile options. Pay special attention to the optional ones, so you can make sure that you get all the features you need.&lt;br /&gt;
then type&amp;lt;br&amp;gt;&lt;br /&gt;
./configure&amp;lt;br&amp;gt;&lt;br /&gt;
If everything worked you should get a summary of the build you are going to make. If you don't get the summary, it's probably because you don't have the libraries CEGUI needs to compile. Make sure you have the _DEVELOPMENT_ libraries installed. If you are not happy with the summary, run configure again and use the options from the help section to tweak it.&amp;lt;br&amp;gt;&lt;br /&gt;
Here is what I got.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
************************&lt;br /&gt;
* Crazy Eddie's GUI System - Configuration Results Summary&lt;br /&gt;
&lt;br /&gt;
* Library Release Version:                              0.5.0&lt;br /&gt;
*&lt;br /&gt;
* Code options:&lt;br /&gt;
*         Building CEGUI in debug mode:                 no&lt;br /&gt;
*&lt;br /&gt;
* Renderer Modules:&lt;br /&gt;
*         Building OpenGL Renderer:                     yes&lt;br /&gt;
*         Building Irrlict Renderer:                    no&lt;br /&gt;
*&lt;br /&gt;
* Image Loading Codec Modules (currently for OpenGL Renderer only):&lt;br /&gt;
*         Building Corona Image Codec:                  no&lt;br /&gt;
*         Building DevIL Image Codec:                   no&lt;br /&gt;
*         Building FreeImage Image Codec:               no&lt;br /&gt;
*         Building SILLY Image Codec:                   no&lt;br /&gt;
*         Building TGA Image Codec:                     yes&lt;br /&gt;
*&lt;br /&gt;
*         Default Image Codec will be:                  TGAImageCodec&lt;br /&gt;
*&lt;br /&gt;
* XML Parser Modules:&lt;br /&gt;
*         Building TinyXMLParser:                       yes&lt;br /&gt;
*         Building ExpatParser:                         no&lt;br /&gt;
*         Building LibXMLParser:                        no&lt;br /&gt;
*         Building XercesParser:                        no&lt;br /&gt;
*&lt;br /&gt;
*         Default XML Parser is:                        TinyXMLParser&lt;br /&gt;
*&lt;br /&gt;
* Scripting:&lt;br /&gt;
*         Building Lua scripting module:                no&lt;br /&gt;
*         Building tolua++cegui generator:              no&lt;br /&gt;
*&lt;br /&gt;
* Samples Framework:&lt;br /&gt;
*         Building Samples:                             yes&lt;br /&gt;
*         GTK2 based dialog for renderer selection:     no&lt;br /&gt;
*         OpenGL Renderer available in samples:         yes&lt;br /&gt;
*         Irrlict Renderer available in samples:        no&lt;br /&gt;
*         Ogre3D Renderer available in samples:         no&lt;br /&gt;
************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
the next part is easy, just type 'make' then 'make install'.&amp;lt;br&amp;gt;&lt;br /&gt;
In practice you'll need root privileges to install the files, so with ubuntu:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo make install&amp;lt;br&amp;gt;&lt;br /&gt;
or in gentoo for example:&amp;lt;br&amp;gt;&lt;br /&gt;
su&amp;lt;br&amp;gt;&lt;br /&gt;
make install&amp;lt;br&amp;gt;&lt;br /&gt;
Hope this helps.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2546</id>
		<title>Build from source for Linux</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Build_from_source_for_Linux&amp;diff=2546"/>
				<updated>2007-04-05T21:02:29Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I happened to notice that this article needed to be written and I was about to install CEGUI from source right now, so I thought I'd document the steps I used, in hopes that they may be useful to somebody.&lt;br /&gt;
&lt;br /&gt;
I'm on ubuntu 6.06 (Dapper)&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You need:&amp;lt;br&amp;gt;&lt;br /&gt;
- A C++ compiler (g++ in my case)&amp;lt;br&amp;gt;&lt;br /&gt;
- Linux Makefile&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First you need to download the latest source tarball. I think it's a good idea to keep all the libraries you install from source in a directory, so you can re-compile later with different options if you wish. /home/user/Installs in my case.&lt;br /&gt;
Move the downloaded tar to your &amp;quot;installs directory&amp;quot; and extract it with:&amp;lt;br&amp;gt;&lt;br /&gt;
tar xzf CEGUI-0.5.0b.tar.gz&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enter the CEGUI file:&amp;lt;br&amp;gt;&lt;br /&gt;
cd CEGUI-0.5.0/&amp;lt;br&amp;gt;&lt;br /&gt;
and type &amp;lt;br&amp;gt;&lt;br /&gt;
./configure --help&amp;lt;br&amp;gt;&lt;br /&gt;
Scroll up a bit and take a look at the available compile options. Pay special attention to the optional ones, so you can make sure that you get all the features you need.&lt;br /&gt;
then type&amp;lt;br&amp;gt;&lt;br /&gt;
./configure&amp;lt;br&amp;gt;&lt;br /&gt;
If everything worked you should get a summary of the build you are going to make. If you don't get the summary, it's probably because you don't have the libraries CEGUI needs to compile. Make sure you have the _DEVELOPMENT_ libraries installed. If you are not happy with the summary, run configure again and use the options from the help section to tweak it.&amp;lt;br&amp;gt;&lt;br /&gt;
Here is what I got.&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Crazy Eddie's GUI System - Configuration Results Summary&lt;br /&gt;
&lt;br /&gt;
* Library Release Version:                              0.5.0&lt;br /&gt;
*&lt;br /&gt;
* Code options:&lt;br /&gt;
*         Building CEGUI in debug mode:                 no&lt;br /&gt;
*&lt;br /&gt;
* Renderer Modules:&lt;br /&gt;
*         Building OpenGL Renderer:                     yes&lt;br /&gt;
*         Building Irrlict Renderer:                    no&lt;br /&gt;
*&lt;br /&gt;
* Image Loading Codec Modules (currently for OpenGL Renderer only):&lt;br /&gt;
*         Building Corona Image Codec:                  no&lt;br /&gt;
*         Building DevIL Image Codec:                   no&lt;br /&gt;
*         Building FreeImage Image Codec:               no&lt;br /&gt;
*         Building SILLY Image Codec:                   no&lt;br /&gt;
*         Building TGA Image Codec:                     yes&lt;br /&gt;
*&lt;br /&gt;
*         Default Image Codec will be:                  TGAImageCodec&lt;br /&gt;
*&lt;br /&gt;
* XML Parser Modules:&lt;br /&gt;
*         Building TinyXMLParser:                       yes&lt;br /&gt;
*         Building ExpatParser:                         no&lt;br /&gt;
*         Building LibXMLParser:                        no&lt;br /&gt;
*         Building XercesParser:                        no&lt;br /&gt;
*&lt;br /&gt;
*         Default XML Parser is:                        TinyXMLParser&lt;br /&gt;
*&lt;br /&gt;
* Scripting:&lt;br /&gt;
*         Building Lua scripting module:                no&lt;br /&gt;
*         Building tolua++cegui generator:              no&lt;br /&gt;
*&lt;br /&gt;
* Samples Framework:&lt;br /&gt;
*         Building Samples:                             yes&lt;br /&gt;
*         GTK2 based dialog for renderer selection:     no&lt;br /&gt;
*         OpenGL Renderer available in samples:         yes&lt;br /&gt;
*         Irrlict Renderer available in samples:        no&lt;br /&gt;
*         Ogre3D Renderer available in samples:         no&lt;br /&gt;
********************************************************************************&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
the next part is easy, just type 'make' then 'make install'.&amp;lt;br&amp;gt;&lt;br /&gt;
In practice you'll need root privileges to install the files, so with ubuntu:&amp;lt;br&amp;gt;&lt;br /&gt;
sudo make install&amp;lt;br&amp;gt;&lt;br /&gt;
or in gentoo for example:&amp;lt;br&amp;gt;&lt;br /&gt;
su&amp;lt;br&amp;gt;&lt;br /&gt;
make install&amp;lt;br&amp;gt;&lt;br /&gt;
Hope this helps.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2544</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2544"/>
				<updated>2007-04-05T20:53:04Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: /* Coding our item */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. We need to do a few things to call this one finished. First, we need to create the CheckListboxItem class. Then we are going to add the window factory to the system. Last but not least is adding the Falagard mapping. We'll start with the CheckListboxItem class.&lt;br /&gt;
// TODO: More to come, gotta go for now :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2543</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2543"/>
				<updated>2007-04-05T20:49:32Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. &lt;br /&gt;
// TODO: More to come, gotta go for now :)&lt;br /&gt;
&lt;br /&gt;
--[[User:Levia|Levia]] 21:10, 5 April 2007 (GMT+1)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2541</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2541"/>
				<updated>2007-04-05T19:24:14Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Pfew am I glad thats done. &lt;br /&gt;
&lt;br /&gt;
==Coding our item==&lt;br /&gt;
&lt;br /&gt;
We have come to the part where we actually try out our new item. &lt;br /&gt;
// TODO: More to come, gotta go for now :)&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2540</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2540"/>
				<updated>2007-04-05T19:21:16Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
I am assuming you know what the basics like the Area, Dim and such. Though FontDim is used to change the size of the item depending on a label. The part we just added now defines the size of the item.&lt;br /&gt;
Instead of adding the whole code here again, I'm only showing the additions from now on.&lt;br /&gt;
&lt;br /&gt;
Ok! Now we are going to add the actual Checkbox. This is crucial for our goal, as it allows the item to be checked upon click. We dont have to write the states and all that for the Checkbox, we just use Child! Just place this under our NamedArea and above the first StateImagery.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;Area&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
         &amp;lt;/Dim&amp;gt;&lt;br /&gt;
     &amp;lt;/Area&amp;gt;&lt;br /&gt;
 &amp;lt;/Child&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This adds a WindowsLook/Checkbox to our item. The suffix is necessary to make the name unique. the rest is pretty straight forward - it adds the checkbox on the left side of the item, starting from 3 pixels to make it look smooth.&lt;br /&gt;
&lt;br /&gt;
Now we need a label, this part is simple and I will not spend as much time on clarifying it, it basically explains itself.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The TextComponent simply states this this can contain text. The Dim's are just positioning. Note the LeftEdge, the label starts at 18 pixels from the left. This is because the first ~15 pixels are occupied by the checkbox.&lt;br /&gt;
&lt;br /&gt;
Now something important! The selection image.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
 &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that we give it the name selection, as used in the StateImagery. The Area part is just positioning and fitting again. The Dim's used there simply make sure the whole item is filled. ImageProperty defines the image to use. We have defined SelectionBrush at the top of our WidgetLook. It simply fills the Area with that image now. ColourProperty colors the image, we have also defined SelectionColour at the top of the WidgetLook. VertFormat and HorzFormat are stretched, if its not stretched, it will only draw one pixel of the image, making it near invisible. Stretching it just makes sure the whole area is covered.&lt;br /&gt;
&lt;br /&gt;
That was it! We wrote our looknfeel entry!!&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&lt;br /&gt;
     &amp;lt;Child type =&amp;quot;WindowsLook/Checkbox&amp;quot; nameSuffix=&amp;quot;__auto__checkbox&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;LeftEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;3&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;0&amp;quot; type=&amp;quot;TopEdge&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Width&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;Height&amp;quot;/&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/Child&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;TextComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;18&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; offset=&amp;quot;-3&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
         &amp;lt;/TextComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;ImagerySection name=&amp;quot;selection&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;ImageryComponent&amp;gt;&lt;br /&gt;
             &amp;lt;Area&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;RightEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;RightEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
                 &amp;lt;Dim type=&amp;quot;BottomEdge&amp;quot;&amp;gt;&lt;br /&gt;
                     &amp;lt;UnifiedDim scale=&amp;quot;1&amp;quot; type=&amp;quot;BottomEdge&amp;quot; /&amp;gt;&lt;br /&gt;
                 &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;/Area&amp;gt;&lt;br /&gt;
             &amp;lt;ImageProperty name=&amp;quot;SelectionBrush&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;ColourProperty name=&amp;quot;SelectionColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;VertFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;HorzFormat type=&amp;quot;Stretched&amp;quot; /&amp;gt;&lt;br /&gt;
         &amp;lt;/ImageryComponent&amp;gt;&lt;br /&gt;
     &amp;lt;/ImagerySection&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2539</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2539"/>
				<updated>2007-04-05T19:03:50Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;br /&gt;
&lt;br /&gt;
==Writing the functional parts==&lt;br /&gt;
&lt;br /&gt;
We now need to add the parts where the background, text and the selection gets drawn. This seems hard, but isn't actually. We are going to start off with a NamedArea. This is required for a listbox item as the listbox needs to know how big the item is to fit it into the list. &lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;b&amp;gt;&amp;lt;NamedArea name=&amp;quot;ContentSize&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Area&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;LeftEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;TopEdge&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;AbsoluteDim value=&amp;quot;0&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Width&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;HorzExtent&amp;quot; padding=&amp;quot;6&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
             &amp;lt;Dim type=&amp;quot;Height&amp;quot; &amp;gt;&lt;br /&gt;
                 &amp;lt;FontDim type=&amp;quot;LineSpacing&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Dim&amp;gt;&lt;br /&gt;
         &amp;lt;/Area&amp;gt;&lt;br /&gt;
     &amp;lt;/NamedArea&amp;gt;&amp;lt;/b&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2538</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2538"/>
				<updated>2007-04-05T18:59:02Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;br /&gt;
&lt;br /&gt;
Now we are going to add the definitions of some colors and property's.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;TextColour&amp;quot; initialValue=&amp;quot;FF000000&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectedTextColour&amp;quot; initialValue=&amp;quot;FFFFFFFF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionBrush&amp;quot; initialValue=&amp;quot;set:WindowsLook image:Background&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;PropertyDefinition name=&amp;quot;SelectionColour&amp;quot; initialValue=&amp;quot;FF3030FF&amp;quot; redrawOnWrite=&amp;quot;true&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;Property name=&amp;quot;Selectable&amp;quot; value=&amp;quot;True&amp;quot; /&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Our first PropertyDefinition just defines a text for a colour used in the StateImagery sections. Same goes for the other PropertyDefinitions except the SelectionBrush. Instead of defining a color, it defines a image. In this case it uses the WindowsLook Background image defined in the imageset. Then we got a Property, which simply implies some sort of setting. In this case, we make it a item by adding the Property 'Selectable' and setting it to true as we want it to act like an item.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2537</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2537"/>
				<updated>2007-04-05T18:54:01Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We define a state via StateImagery. It requires the attribute name which specifies what state its in. Don't worry about Layer for now. Section is always used. This part takes care of actually changing the look. It requires a attribute section, this is actually WHAT to change, in this case the label. TextColour is a simple colour (black), we will define it below. Now as you can see the Enabled state just sets the text colour to black, thats all it does. Same goes for Disabled (remember this is an item, items are not commonly disabled).&lt;br /&gt;
&lt;br /&gt;
Now we are going to take a look at the other two states.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedEnabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                  &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;SelectedDisabled&amp;quot;&amp;gt;&lt;br /&gt;
         &amp;lt;Layer&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;selection&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                 &amp;lt;ColourProperty name=&amp;quot;SelectedTextColour&amp;quot; /&amp;gt;&lt;br /&gt;
             &amp;lt;/Section&amp;gt;&lt;br /&gt;
         &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These states pretty much speak for themselves altough there are more sections listed. Section not only defines what to change, also defines what needs to be shown. In the Enabled state we dont want it to look like its selected, so there is no selection section. Note that the order of which you put the Sections are also the Z order. In this case we are putting the selection image first, and then text. If we would do it the other way around, we wouldn't see the text.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2536</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2536"/>
				<updated>2007-04-05T18:46:26Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
==Writing the requirements==&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining. Now we are going to add the states. These states are necessary for the item to respond to certain events. For example, when the item is disabled, the state Disabled is used.&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Enabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
     &amp;lt;StateImagery name=&amp;quot;Disabled&amp;quot;&amp;gt;&lt;br /&gt;
          &amp;lt;Layer&amp;gt;&lt;br /&gt;
               &amp;lt;Section section=&amp;quot;label&amp;quot;&amp;gt;&lt;br /&gt;
                   &amp;lt;ColourProperty name=&amp;quot;TextColour&amp;quot; /&amp;gt;&lt;br /&gt;
               &amp;lt;/Section&amp;gt;&lt;br /&gt;
          &amp;lt;/Layer&amp;gt;&lt;br /&gt;
     &amp;lt;/StateImagery&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2535</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2535"/>
				<updated>2007-04-05T18:40:50Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
I'm assuming you are just using a standard imageset, with a standard scheme (currently TaharezLook and WindowsLook are supported).&lt;br /&gt;
&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;br /&gt;
&lt;br /&gt;
Open the appriopiate looknfeel file (WindowsLook.looknfeel or TaharezLook.looknfeel), and place this at the bottom (inside the Falagard tags though!)&lt;br /&gt;
&lt;br /&gt;
''' Our start '''&lt;br /&gt;
 &amp;lt;WidgetLook name=&amp;quot;WindowsLook/CheckListboxItem&amp;quot;&amp;gt;&lt;br /&gt;
 &amp;lt;/WidgetLook&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We first need to define a WidgetLook, this is where all the action happens in. It takes one attribute, name. This is simply the name of the widget you are defining.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2534</id>
		<title>Create a CheckListboxItem</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Create_a_CheckListboxItem&amp;diff=2534"/>
				<updated>2007-04-05T18:36:30Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Sometimes you need a list where the items are checkable. The ItemListbox introduced in CEGUI 0.5 accepts all sorts of items, as long as they inherit ItemEntry. I'm going to teach you how to create a CheckListboxItem to put in your list.&lt;br /&gt;
&lt;br /&gt;
==Getting started!==&lt;br /&gt;
We are first going to get started by writing the looknfeel entry. This is the most important part of this tutorial, as its basically 70% of what we need to do to achieve our goal. First of all, this entry has a few states:&lt;br /&gt;
&lt;br /&gt;
#Enabled: How the item looks when the item is enabled.&lt;br /&gt;
#Disabled: How the item looks when the item is disabled.&lt;br /&gt;
#SelectedEnabled: How the item looks when the item is selected and is enabled.&lt;br /&gt;
#SelectedDisabled: How the item looks when the item is selected and is disabled.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Tutorials&amp;diff=2533</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Tutorials&amp;diff=2533"/>
				<updated>2007-04-05T18:33:03Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: /* Miscellaneous HOW-TOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== CrazyEddie's Beginner Guides ===&lt;br /&gt;
* [[The Beginner Guide to Getting CEGUI Rendering]] - How to initialise CEGUI to render properly.&lt;br /&gt;
* [[The Beginner Guide to Loading Data Files and Initialisation]] - How to load some data files and perform basic system initialisation.&lt;br /&gt;
* [[The Beginner Guide to Creating a CEGUI Window]] - How to create a simple window and get it on screen.&lt;br /&gt;
* [[The Beginner Guide to Injecting Inputs]] - How to inject inputs into CEGUI and get interactive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scripting with CEGUI ===&lt;br /&gt;
* [[Getting Started with Lua and CEGUI]] - How to initialise CEGUI with a Lua script module and configuration file.&lt;br /&gt;
* [[Handling Events from Lua]] - How to load Lua script files and bind CEGUI events to Lua functions.&lt;br /&gt;
* [[Writing CEGUI scripts]] - Code snippets&lt;br /&gt;
* [[Adding LuaScriptModule to Sample_FirstWindow]] - Experience adding scripting to an existing sample.&lt;br /&gt;
* [http://www.gpwiki.org/index.php/Crazy_Eddies_GUI_System:Tutorials:Creating_a_scriptable_interface_using_CEGUI Creating a scriptable interface using CEGUI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window System Examples ===&lt;br /&gt;
* [[Using CEGUI with SDL and OpenGL]] - Guidelines on how to get SDL, OpenGL and CEGUI running together.&lt;br /&gt;
* [[Using CEGUI with Producer and OpenGL]] - Guidelines on how to render and inject input to CEGUI from the Producer API.&lt;br /&gt;
* [http://artis.imag.fr/Membres/Xavier.Decoret/resources/CEGUI/ Using CEGUI with Qt/QGLViewer]&lt;br /&gt;
* [[Using CEGUI with GLUT]] - Some tips on using OpenGL's GLUT with CEGUI.&lt;br /&gt;
&lt;br /&gt;
=== Extending CEGUI ===&lt;br /&gt;
* [[Using Expat XML parser within CEGUI]] - How to add support for another XML parser.&lt;br /&gt;
&lt;br /&gt;
=== Skins - Tutorial For Artists ===&lt;br /&gt;
* [[Creating Skins]] - Extra notes for artists on how to create skins.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part I]] - Learn by doing a Button.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part II]] - More Falagard fun, this time with the Editbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overviews ===&lt;br /&gt;
* [[Overview of GUI files]] - A quick introduction to all the XML files used by CEGUI.&lt;br /&gt;
* [[Overview of resource system enhancements in 0.5.0]] - Introduction to enhancements made for the 0.5.0 release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous HOW-TOs ===&lt;br /&gt;
* [[Create ImageButtons]] - A few different ways to create image buttons.&lt;br /&gt;
* [[Create a CheckListboxItem]] - Create a CheckListBoxItem that you can use with ItemListbox.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	<entry>
		<id>http://cegui.org/wiki/index.php?title=Tutorials&amp;diff=2531</id>
		<title>Tutorials</title>
		<link rel="alternate" type="text/html" href="http://cegui.org/wiki/index.php?title=Tutorials&amp;diff=2531"/>
				<updated>2007-04-05T18:29:57Z</updated>
		
		<summary type="html">&lt;p&gt;Levia: /* Miscellaneous HOW-TOs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== CrazyEddie's Beginner Guides ===&lt;br /&gt;
* [[The Beginner Guide to Getting CEGUI Rendering]] - How to initialise CEGUI to render properly.&lt;br /&gt;
* [[The Beginner Guide to Loading Data Files and Initialisation]] - How to load some data files and perform basic system initialisation.&lt;br /&gt;
* [[The Beginner Guide to Creating a CEGUI Window]] - How to create a simple window and get it on screen.&lt;br /&gt;
* [[The Beginner Guide to Injecting Inputs]] - How to inject inputs into CEGUI and get interactive.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Scripting with CEGUI ===&lt;br /&gt;
* [[Getting Started with Lua and CEGUI]] - How to initialise CEGUI with a Lua script module and configuration file.&lt;br /&gt;
* [[Handling Events from Lua]] - How to load Lua script files and bind CEGUI events to Lua functions.&lt;br /&gt;
* [[Writing CEGUI scripts]] - Code snippets&lt;br /&gt;
* [[Adding LuaScriptModule to Sample_FirstWindow]] - Experience adding scripting to an existing sample.&lt;br /&gt;
* [http://www.gpwiki.org/index.php/Crazy_Eddies_GUI_System:Tutorials:Creating_a_scriptable_interface_using_CEGUI Creating a scriptable interface using CEGUI]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Window System Examples ===&lt;br /&gt;
* [[Using CEGUI with SDL and OpenGL]] - Guidelines on how to get SDL, OpenGL and CEGUI running together.&lt;br /&gt;
* [[Using CEGUI with Producer and OpenGL]] - Guidelines on how to render and inject input to CEGUI from the Producer API.&lt;br /&gt;
* [http://artis.imag.fr/Membres/Xavier.Decoret/resources/CEGUI/ Using CEGUI with Qt/QGLViewer]&lt;br /&gt;
* [[Using CEGUI with GLUT]] - Some tips on using OpenGL's GLUT with CEGUI.&lt;br /&gt;
&lt;br /&gt;
=== Extending CEGUI ===&lt;br /&gt;
* [[Using Expat XML parser within CEGUI]] - How to add support for another XML parser.&lt;br /&gt;
&lt;br /&gt;
=== Skins - Tutorial For Artists ===&lt;br /&gt;
* [[Creating Skins]] - Extra notes for artists on how to create skins.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part I]] - Learn by doing a Button.&lt;br /&gt;
* [[The Beginners Guide to Falagard skinning - Part II]] - More Falagard fun, this time with the Editbox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Overviews ===&lt;br /&gt;
* [[Overview of GUI files]] - A quick introduction to all the XML files used by CEGUI.&lt;br /&gt;
* [[Overview of resource system enhancements in 0.5.0]] - Introduction to enhancements made for the 0.5.0 release.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Miscellaneous HOW-TOs ===&lt;br /&gt;
* [[Create ImageButtons]] - A few different ways to create image buttons.&lt;br /&gt;
* [[Create a CheckListBoxItem]] - Create a CheckListBoxItem that you can use with ItemListbox.&lt;/div&gt;</summary>
		<author><name>Levia</name></author>	</entry>

	</feed>