Difference between revisions of "Sample code for all Widgets"

From CEGUI Wiki - Crazy Eddie's GUI System (Open Source)
Jump to: navigation, search
m (Spelling fix)
 
(41 intermediate revisions by 6 users not shown)
Line 1: Line 1:
This code goes through every widget and demonstrates how to retrieve and set their data as well as some of their particularities.
+
{{VersionBadge|0.5}} {{VersionBadge|0.6}}
  
Please post comments or questions on the message board thread for the [http://www.cegui.org.uk/phpBB2/viewtopic.php?p=7967#7967 Widget Galore]
+
This code goes through every widget and demonstrates how to retrieve and set their data as well as some of their particularities.  Please post comments or questions on the message board thread for the [http://www.cegui.org.uk/phpBB2/viewtopic.php?p=7967#7967 Widget Galore]
  
=== Widgets===
+
=== Widgets ===
  
 
==== General ====
 
==== General ====
Line 16: Line 16:
  
 
==== StaticText ====
 
==== StaticText ====
A StaticText widget displays text; it does not receive inputs from a user.
+
There is no StaticText within CEGUI but type of widget can be obtained via the DefaultWindow class.
 
+
The currently displayed text can be specified via setText().  The color of this text can be specified via setTextColours().  The horizontal and vertical alignement can be specified via setFormatting().
+
  
 +
The currently displayed text can be specified via setText().  The colour of this text can be specified via the "TextColours" property.  The value of this property contains 4 colour definitions: top left, top right, bottom left, and bottom right.  Each colour is specified as a two-digit hexadecimal value of the format AARRGGBB (alpha, red, green, blue).  The text is aligned vertically via the "VertFormatting" property with a value of TopAligned, BottomAligned, or VertCentred.  The text is aligned horizontally via the "HorzFormatting" property with a value of LeftAligned, RightAligned, HorzCentred, HorzJustified, WordWrapLeftAligned, WordWrapRightAligned, WordWrapCentred, or WordWrapJustified.
  
 
==== StaticImage ====
 
==== StaticImage ====
A StaticImage widget displays an image; it does not receive inputs from a user.
+
There is no StaticImage within CEGUI but type of widget can be obtained via the DefaultWindow class.
 
+
The currently displayed image can be specified via setImage().
+
  
 +
The currently displayed image can be specified via the "Image" property.  This property takes two parameters, the imageset ("set") and the image name ("image").
  
 
==== ProgressBar ====
 
==== ProgressBar ====
Line 44: Line 42:
  
 
==== Checkbox ====
 
==== Checkbox ====
A Checkbox widget controls a boolean value; true when checked and false when unchecked.  This value can be obtained via isSelected() and specified via setSelected(true) to check or setSelected(true) to uncheck.
+
A Checkbox widget controls a boolean value; true when checked and false when unchecked.  This value can be obtained via isSelected() and specified via setSelected(true) to check or setSelected(false) to uncheck.
 
+
  
 
==== Spinner ====
 
==== Spinner ====
Line 98: Line 95:
 
A Listbox widget controls either a single selection or multiple selections among many choices.  Multiple selections are enabled via setMultiselectEnabled().
 
A Listbox widget controls either a single selection or multiple selections among many choices.  Multiple selections are enabled via setMultiselectEnabled().
  
The choices are listbox text items (ListboxTextItem) added to the listbox via addItem().  These do not possess a selection indicator by default; one must be specified via setSelectionBrushImage().
+
The choices are listbox text items (ListboxTextItem) added to the listbox via addItem().  These do not possess a selection indicator by default; one must be specified via setSelectionBrushImage().  The call to ensureItemIsVisible() ensures that the item is visible; the listbox will automatically scroll down if necessary.  The text of the ListboxTextItem can be changed via the setText() function.  However this new text will not be displayed until you call the Listbox's handleUpdatedItemData() function.
  
 
The selected ListboxItem can be obtained via getFirstSelectedItem() and subsequent selections through getNextSelected().  A selection can be specified via setItemSelectState().
 
The selected ListboxItem can be obtained via getFirstSelectedItem() and subsequent selections through getNextSelected().  A selection can be specified via setItemSelectState().
  
 +
It is possible for a Listbox to contain list items that are not simply composed of text.  [http://www.cegui.org.uk/wiki/index.php/Create_a_CheckListboxItem CheckListboxItem] demonstrates this advanced feature.  Another approach would be to simulate the behavior of a listbox such that each row is composed of various widgets.  [[PseudoListbox]] demonstrates this.
  
 
==== Combobox ====
 
==== Combobox ====
Line 124: Line 122:
 
A TabControl widget allows multiple windows to be displayed one at a time, via tab buttons.
 
A TabControl widget allows multiple windows to be displayed one at a time, via tab buttons.
  
Two objects must be created within the Layout Editor to generate a functional tab control.  The first is a window of type "TabControl".  This will be the parent window of the tab buttons as well as the pages.  The second is a window of type "TabPane".  This window will be placed within the TabControl (via addTab(), not through the Layout Editor) and will specify the contents of a page.  Widgets are to be placed within these TabPane via the Layout Editor.  The "TabButton" windows are not to be specified via the Layout Editor since they will be automatically created when a TabPane is added to the TabControl.
+
Two objects must be created within the Layout Editor to generate a functional tab control.  The first is a window of type "TabControl".  This will be the parent window of the tab buttons as well as the pages.  The second is a window of type "DefaultWindow".  This window will be placed within the TabControl (in code via addTab(), not through the Layout Editor) and will specify the contents of a page.  Widgets are to be placed within these TabPane via the Layout Editor.  The "TabButton" windows are not to be specified via the Layout Editor since they will be automatically created when a TabPane is added to the TabControl.
  
 
In this demo the TabControl widget was placed within a FrameWindow.  This is not a requirement.  It could have just easily been placed alongside the widgets of the other window.
 
In this demo the TabControl widget was placed within a FrameWindow.  This is not a requirement.  It could have just easily been placed alongside the widgets of the other window.
 +
 +
==== Menu & Popup Menu ====
 +
 +
See [[Menu and Popup]]
  
 
=== Files ===
 
=== Files ===
  
 
==== WidgetGalore.h ====
 
==== WidgetGalore.h ====
<pre>
+
<source lang="cpp">
 
#ifndef _WidgetGalore_h_
 
#ifndef _WidgetGalore_h_
 
#define _WidgetGalore_h_
 
#define _WidgetGalore_h_
Line 137: Line 139:
 
#include "CEGuiSample.h"
 
#include "CEGuiSample.h"
 
#include "CEGUI.h"
 
#include "CEGUI.h"
#include "WindowSystem.h"
 
  
class WindowWidgets : public WindowSystem
+
class DemoSample : public CEGuiSample
 
{
 
{
 
public:
 
public:
bool onValueChanged(const CEGUI::EventArgs& e)
+
    bool initialiseSample()
 
{
 
{
 
using namespace CEGUI;
 
using namespace CEGUI;
WindowManager& winMgr = WindowManager::getSingleton();
+
try
Scrollbar* widget = static_cast<Scrollbar*>(winMgr.getWindow("HorizontalScrollbar"));
+
{
Editbox* editbox = static_cast<Editbox*>(winMgr.getWindow("Editbox"));
+
// Retrieve the window manager
std::ostringstream stringStream;
+
WindowManager& winMgr = WindowManager::getSingleton();
stringStream << widget->getScrollPosition();
+
editbox->setText(stringStream.str());
+
return true;
+
}
+
  
void initWindow()
+
// Load the TaharezLook scheme and set up the default mouse cursor and font
{
+
SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");
// Initialise the window
+
System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
using namespace CEGUI;
+
if(!FontManager::getSingleton().isFontPresent("Commonwealth-10"))
 +
FontManager::getSingleton().createFont("Commonwealth-10.font");
  
// Initialise the windowing system
+
// Set the GUI Sheet
WindowSystem::initialise("winWidgets", // The handle of this window
+
Window* sheet = winMgr.createWindow("DefaultWindow", "root_wnd");
true); // Initially visible
+
System::getSingleton().setGUISheet(sheet);
subscribeToEvents();
+
WindowManager& winMgr = WindowManager::getSingleton();
+
  
/* Tooltip */
+
// Load a layout
System::getSingleton().setTooltip("TaharezLook/Tooltip"); // Set the name of the default tooltip
+
Window* guiLayout = winMgr.loadWindowLayout("WidgetGalore.layout");
Tooltip* tooltip = System::getSingleton().getDefaultTooltip();
+
sheet->addChildWindow(guiLayout);
tooltip->setHoverTime(0.5f); // Display the tooltip after the mouse has been hovering over the widget for half a second
+
tooltip->setDisplayTime(10.0f); // Display for 15 seconds then disappear
+
tooltip->setFadeTime(1.0f); // Duration of the transition between fully visible and fully invisible
+
  
/* StaticText */
 
StaticText* staticText = static_cast<StaticText*>(winMgr.getWindow((utf8*) "StaticText"));
 
staticText->setText("Red StaticText");
 
staticText->setTextColours( colour(1.0f, 0.0f, 0.0f, 1.0f) ); // Red text
 
staticText->setFormatting(StaticText::HorzCentred, StaticText::VertCentred); // Center the text
 
staticText->setTooltipText("This is a StaticText widget");
 
  
/* StaticImage */
 
ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "../datafiles/imagesets/GPN-2000-001437.tga");
 
StaticImage* staticImage = static_cast<StaticImage*>(winMgr.getWindow((utf8*) "StaticImage"));
 
staticImage->setImage("ImageForStaticImage", "full_image"); // "full_image" is a default name from CEGUIImageset::Imageset()
 
  
/* ProgressBar */
+
/* Tooltip */
ProgressBar* progressBar = static_cast<ProgressBar*>(winMgr.getWindow((utf8*) "ProgressBar"));
+
System::getSingleton().setDefaultTooltip("TaharezLook/Tooltip"); // Set the name of the default tooltip
progressBar->setProgress(0.25f); // Initial progress of 25%
+
Tooltip* tooltip = System::getSingleton().getDefaultTooltip();
progressBar->setStepSize(0.10f); // Calling step() will increase the progress by 10%
+
tooltip->setHoverTime(0.5f); // Display the tooltip after the mouse has been hovering over the widget for half a second
progressBar->step(); // Advance the progress by the size specified in setStepSize()
+
tooltip->setDisplayTime(10.0f); // Display for 15 seconds then disappear
progressBar->adjustProgress(-0.05f); // Adjust the progress by a delta value rather than setting a new value through setProgress
+
tooltip->setFadeTime(1.0f); // Duration of the transition between fully visible and fully invisible
float valueProgressBar = progressBar->getProgress(); // initial 0.25f + step 0.10f - adjustment 0.05f = 0.30f
+
// To set the tooltip text for a window simply call setTooltipText()   see staticText for an example
  
/* Button */
+
/* StaticText */
PushButton* btnClose = static_cast<PushButton*>(winMgr.getWindow((utf8*) "btnClose"));
+
DefaultWindow* staticText = static_cast<DefaultWindow*>(winMgr.getWindow("StaticText"));
btnClose->setText("Exit");
+
staticText->setText("Red Static Text");
 +
// Colours are specified as aarrggbb in Hexadecimal
 +
// Where aa is alpha, rr is red, gg is green, and bb is blue
 +
// tl: top left,  tr: top right,  bl: bottom left,  br: bottom right
 +
staticText->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
 +
staticText->setProperty("VertFormatting", "VertCentred"); // TopAligned, BottomAligned, VertCentred
 +
staticText->setProperty("HorzFormatting", "HorzCentred"); // LeftAligned, RightAligned, HorzCentred
 +
// HorzJustified, WordWrapLeftAligned, WordWrapRightAligned, WordWrapCentred, WordWrapJustified
 +
staticText->setTooltipText("This is a StaticText widget");
  
/* ScrollablePane */
+
/* StaticImage */
ScrollablePane* scrollablePane = static_cast<ScrollablePane*>(winMgr.getWindow((utf8*) "ScrollablePane"));
+
ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "GPN-2000-001437.tga");
ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForScrollablePane", "../datafiles/imagesets/GPN-2000-001437.tga");
+
DefaultWindow* staticImage = static_cast<DefaultWindow*>(winMgr.getWindow("StaticImage"));
StaticImage* staticImageInScrollablePane = static_cast<StaticImage*>(winMgr.createWindow("TaharezLook/StaticImage", "StaticImageInScrollablePane"));
+
staticImage->setProperty("Image", "set:ImageForStaticImage image:full_image"); // "full_image" is a default name from CEGUIImageset::Imageset()
staticImageInScrollablePane->setImage("ImageForScrollablePane", "full_image"); // "full_image" is a default name from CEGUIImageset::Imageset()
+
staticImageInScrollablePane->setPosition( Point(0.0f, 0.0f) ); // Start in the upper left corner
+
staticImageInScrollablePane->setWidth(2.0f); // Twice the width of the parent, the ScrollablePane
+
staticImageInScrollablePane->setHeight(2.0f); // Twice the height of the parent, the ScrollablePane
+
scrollablePane->addChildWindow(staticImageInScrollablePane); // Add the image to the // Twice the width of the parent, the ScrollablePane
+
Editbox* editboxInScrollablePane = static_cast<Editbox*>(winMgr.createWindow("TaharezLook/Editbox", "EditboxInScrollablePane"));
+
editboxInScrollablePane->setPosition( Point(0.0f, 2.1f) ); // Start below the image
+
editboxInScrollablePane->setWidth(2.0f);
+
editboxInScrollablePane->setHeight(0.3f);
+
scrollablePane->addChildWindow(editboxInScrollablePane);
+
  
/* Check box */
+
/* ProgressBar */
Checkbox* checkbox = static_cast<Checkbox*>(winMgr.getWindow("Checkbox"));
+
ProgressBar* progressBar = static_cast<ProgressBar*>(winMgr.getWindow("ProgressBar"));
checkbox->setSelected( true );
+
progressBar->setProgress(0.25f); // Initial progress of 25%
bool valueCheckbox = checkbox->isSelected();
+
progressBar->setStepSize(0.10f); // Calling step() will increase the progress by 10%
 +
progressBar->step(); // Advance the progress by the size specified in setStepSize()
 +
progressBar->adjustProgress(-0.05f); // Adjust the progress by a delta value rather than setting a new value through setProgress
 +
float valueProgressBar = progressBar->getProgress(); // initial 0.25f + step 0.10f - adjustment 0.05f = 0.30f
  
/* Spinner */
+
/* Button */
Spinner* spinner = static_cast<Spinner*>(winMgr.getWindow("Spinner"));
+
PushButton* btnClose = static_cast<PushButton*>(winMgr.getWindow("btnClose"));
spinner->setTextInputMode(Spinner::FloatingPoint); // FloatingPoint, Integer, Hexadecimal, Octal
+
btnClose->setText("Exit");
spinner->setMinimumValue(-10.0f);
+
spinner->setMaximumValue(10.0f);
+
spinner->setStepSize(0.2f);
+
spinner->setCurrentValue(5.2f);
+
float valueSpinner = spinner->getCurrentValue();
+
  
/* Editbox */
+
/* ScrollablePane */
Editbox* editbox = static_cast<Editbox*>(winMgr.getWindow("Editbox"));
+
ScrollablePane* scrollablePane = static_cast<ScrollablePane*>(winMgr.getWindow("ScrollablePane"));
editbox->setText("Editbox values");
+
ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForScrollablePane", "GPN-2000-001437.tga");
editbox->setMaxTextLength(13); // The trailing 's' will not be displayed
+
DefaultWindow* staticImageInScrollablePane = static_cast<DefaultWindow*>(winMgr.createWindow("TaharezLook/StaticImage", "StaticImageInScrollablePane"));
editbox->setReadOnly(false);
+
staticImageInScrollablePane->setProperty("Image", "set:ImageForScrollablePane image:full_image"); // "full_image" is a default name from CEGUIImageset::Imageset()
editbox->setTextMasked(false);
+
staticImageInScrollablePane->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); // Start in the upper left corner
editbox->setMaskCodePoint(0x002A); // *
+
staticImageInScrollablePane->setWidth(UDim(2.0f, 0.0f)); // Twice the width of the parent, the ScrollablePane
String valueEditbox = editbox->getText();
+
staticImageInScrollablePane->setHeight(UDim(2.0f, 0.0f)); // Twice the height of the parent, the ScrollablePane
 +
scrollablePane->addChildWindow(staticImageInScrollablePane); // Add the image to the // Twice the width of the parent, the ScrollablePane
 +
Editbox* editboxInScrollablePane = static_cast<Editbox*>(winMgr.createWindow("TaharezLook/Editbox", "EditboxInScrollablePane"));
 +
editboxInScrollablePane->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(2.1f, 0.0f))); // Start below the image
 +
editboxInScrollablePane->setWidth(UDim(2.0f, 0.0f));
 +
editboxInScrollablePane->setHeight(UDim(0.3f, 0.0f));
 +
scrollablePane->addChildWindow(editboxInScrollablePane);
  
/* Slider */
+
/* Check box */
Slider* slider = static_cast<Slider*>(winMgr.getWindow("Slider"));
+
Checkbox* checkbox = static_cast<Checkbox*>(winMgr.getWindow("Checkbox"));
slider->setMaxValue(100.0f);
+
checkbox->setSelected( true );
slider->setClickStep(10.0f);
+
bool valueCheckbox = checkbox->isSelected(); // Retrieve whether it is checked
slider->setCurrentValue(20.0f);
+
float valueSlider = slider->getCurrentValue();
+
  
/* Scrollbar (Horizontal) */
+
/* Spinner */
Scrollbar* scrollbarHorizontal = static_cast<Scrollbar*>(winMgr.getWindow("HorizontalScrollbar"));
+
Spinner* spinner = static_cast<Spinner*>(winMgr.getWindow("Spinner"));
scrollbarHorizontal->setDocumentSize(100.0f);
+
spinner->setTextInputMode(Spinner::FloatingPoint); // FloatingPoint, Integer, Hexadecimal, Octal
scrollbarHorizontal->setPageSize(10.0f);
+
spinner->setMinimumValue(-10.0f);
scrollbarHorizontal->setStepSize(1.0f);
+
spinner->setMaximumValue(10.0f);
scrollbarHorizontal->setScrollPosition(75.0f);
+
spinner->setStepSize(0.2f);
float valueScrollbarHorizontal = scrollbarHorizontal->getScrollPosition();
+
spinner->setCurrentValue(5.2f);
 +
float valueSpinner = spinner->getCurrentValue(); // Retrieve the value
  
/* Scrollbar (Vertical) */
+
/* Editbox */
Scrollbar* scrollbarVertical = static_cast<Scrollbar*>(winMgr.getWindow("VerticalScrollbar"));
+
Editbox* editbox = static_cast<Editbox*>(winMgr.getWindow("Editbox"));
scrollbarVertical->setDocumentSize(100.0f);
+
editbox->setText("Editbox values");
scrollbarVertical->setPageSize(10.0f);
+
editbox->setMaxTextLength(13); // The trailing 's' will not be displayed
scrollbarVertical->setStepSize(1.0f);
+
editbox->setReadOnly(false);
scrollbarVertical->setScrollPosition(25.0f);
+
editbox->setTextMasked(false);
float valueScrollbarVertical = scrollbarVertical->getScrollPosition();
+
editbox->setMaskCodePoint(0x002A); // *
 +
String valueEditbox = editbox->getText(); // Retrieve the text
  
/* MultiLineEditbox */
+
/* Slider */
MultiLineEditbox* multiLineEditbox = static_cast<MultiLineEditbox*>(winMgr.getWindow("MultiLineEditbox"));
+
Slider* slider = static_cast<Slider*>(winMgr.getWindow("Slider"));
multiLineEditbox->setText("MultiLineEditbox value");
+
slider->setMaxValue(100.0f);
multiLineEditbox->setReadOnly(false);
+
slider->setClickStep(10.0f);
multiLineEditbox->setWordWrapping(true);
+
slider->setCurrentValue(20.0f);
String valueMultiLineEditbox = multiLineEditbox->getText();
+
float valueSlider = slider->getCurrentValue(); // Retrieve the value
  
/* RadioButton */
+
/* Scrollbar (Horizontal) */
RadioButton* radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_A"));
+
Scrollbar* scrollbarHorizontal = static_cast<Scrollbar*>(winMgr.getWindow("HorizontalScrollbar"));
radioButton->setGroupID(1);
+
scrollbarHorizontal->setDocumentSize(100.0f);
radioButton->setID(101);
+
scrollbarHorizontal->setPageSize(10.0f);
radioButton->setSelected(true);
+
scrollbarHorizontal->setStepSize(1.0f);
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_B"));
+
scrollbarHorizontal->setScrollPosition(75.0f);
radioButton->setGroupID(1);
+
float valueScrollbarHorizontal = scrollbarHorizontal->getScrollPosition(); // Retrieve the scroll position
radioButton->setID(102);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_C"));
+
radioButton->setGroupID(1);
+
radioButton->setID(103);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_1"));
+
radioButton->setGroupID(2);
+
radioButton->setID(201);
+
radioButton->setSelected(true);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_2"));
+
radioButton->setGroupID(2);
+
radioButton->setID(202);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_3"));
+
radioButton->setGroupID(2);
+
radioButton->setID(203);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_A"));
+
uint valueRadioButtonLetters = radioButton->getSelectedButtonInGroup()->getID();
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_3"));
+
uint valueRadioButtonNumbers = radioButton->getSelectedButtonInGroup()->getID();
+
radioButton->setSelected(true);
+
  
/* Listbox */
+
/* Scrollbar (Vertical) */
Listbox* listbox = static_cast<Listbox*>(winMgr.getWindow("Listbox"));
+
Scrollbar* scrollbarVertical = static_cast<Scrollbar*>(winMgr.getWindow("VerticalScrollbar"));
listbox->setMultiselectEnabled(false);
+
scrollbarVertical->setDocumentSize(100.0f);
ListboxTextItem* itemListbox = new ListboxTextItem("Value A", 1);
+
scrollbarVertical->setPageSize(10.0f);
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
scrollbarVertical->setStepSize(1.0f);
listbox->addItem(itemListbox);
+
scrollbarVertical->setScrollPosition(25.0f);
itemListbox = new ListboxTextItem("Value B", 2);
+
float valueScrollbarVertical = scrollbarVertical->getScrollPosition(); // Retrieve the scroll position
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
listbox->addItem(itemListbox);
+
itemListbox = new ListboxTextItem("Value C", 3);
+
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
listbox->addItem(itemListbox);
+
itemListbox = new ListboxTextItem("Value D", 4);
+
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
listbox->addItem(itemListbox);
+
listbox->setItemSelectState(itemListbox, true);
+
uint valueListbox = listbox->getFirstSelectedItem()->getID();
+
  
/* Combobox */
+
/* MultiLineEditbox */
Combobox* combobox = static_cast<Combobox*>(winMgr.getWindow("Combobox"));
+
MultiLineEditbox* multiLineEditbox = static_cast<MultiLineEditbox*>(winMgr.getWindow("MultiLineEditbox"));
combobox->setReadOnly(true);
+
multiLineEditbox->setText("MultiLineEditbox value");
ListboxTextItem* itemCombobox = new ListboxTextItem("Value 1", 1);
+
multiLineEditbox->setReadOnly(false);
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
multiLineEditbox->setWordWrapping(true);
combobox->addItem(itemCombobox);
+
String valueMultiLineEditbox = multiLineEditbox->getText(); // Retrieve the text
itemCombobox = new ListboxTextItem("Value 2", 2);
+
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
combobox->addItem(itemCombobox);
+
itemCombobox->setSelected(true); // Select this item
+
combobox->setText(itemCombobox->getText()); // Copy the item's text into the Editbox
+
itemCombobox = new ListboxTextItem("Value 3", 3);
+
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
combobox->addItem(itemCombobox);
+
itemCombobox = new ListboxTextItem("Value 4", 4);
+
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
combobox->addItem(itemCombobox);
+
String valueCombobox = combobox->getText();
+
  
/* MultiColumnList */
+
/* RadioButton */
MultiColumnList* multiColumnList = static_cast<MultiColumnList*>(winMgr.getWindow("MultiColumnList"));
+
RadioButton* radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_A"));
multiColumnList->addColumn("Col A", 0, 0.32f);
+
radioButton->setGroupID(1);
multiColumnList->addColumn("Col B", 1, 0.32f);
+
radioButton->setID(101);
multiColumnList->addColumn("Col C", 2, 0.32f);
+
radioButton->setSelected(true);
multiColumnList->setSelectionMode(MultiColumnList::RowSingle); // MultiColumnList::RowMultiple
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_B"));
ListboxTextItem* itemMultiColumnList;
+
radioButton->setGroupID(1);
multiColumnList->addRow();
+
radioButton->setID(102);
itemMultiColumnList = new ListboxTextItem("A1", 101);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_C"));
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
radioButton->setGroupID(1);
multiColumnList->setItem(itemMultiColumnList, 0, 0); // ColumnID, RowID
+
radioButton->setID(103);
itemMultiColumnList = new ListboxTextItem("B1", 102);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_1"));
//itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush"); // This cell does not specify a selection indicator
+
radioButton->setGroupID(2);
multiColumnList->setItem(itemMultiColumnList, 1, 0); // ColumnID, RowID
+
radioButton->setID(201);
itemMultiColumnList = new ListboxTextItem("C1", 103);
+
radioButton->setSelected(true);
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_2"));
multiColumnList->setItem(itemMultiColumnList, 2, 0); // ColumnID, RowID
+
radioButton->setGroupID(2);
multiColumnList->addRow();
+
radioButton->setID(202);
itemMultiColumnList = new ListboxTextItem("A2", 201);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_3"));
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
radioButton->setGroupID(2);
multiColumnList->setItem(itemMultiColumnList, 0, 1); // ColumnID, RowID
+
radioButton->setID(203);
itemMultiColumnList = new ListboxTextItem("B2", 202);
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_A")); // Get handle of one radio button from the group
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
uint valueRadioButtonLetters = radioButton->getSelectedButtonInGroup()->getID(); // Get selected ID
multiColumnList->setItem(itemMultiColumnList, 1, 1); // ColumnID, RowID
+
radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_3")); // Can obtain the handle of any radio button in the group
itemMultiColumnList = new ListboxTextItem("C2", 203);
+
uint valueRadioButtonNumbers = radioButton->getSelectedButtonInGroup()->getID();
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
+
radioButton->setSelected(true); // Specify which button should appear selected by default
multiColumnList->setItem(itemMultiColumnList, 2, 1); // ColumnID, RowID
+
MCLGridRef grid_ref(1, 0); // Select according to a grid reference; second row
+
multiColumnList->setItemSelectState(grid_ref, true);
+
ListboxItem* listboxItem = multiColumnList->getFirstSelectedItem();
+
uint valueColumnA = listboxItem->getID();
+
listboxItem = multiColumnList->getNextSelected(listboxItem);
+
uint valueColumnB = listboxItem->getID();
+
listboxItem = multiColumnList->getNextSelected(listboxItem);
+
uint valueColumnC = listboxItem->getID();
+
}
+
  
private:
+
/* Listbox */
void subscribeToEvents()
+
Listbox* listbox = static_cast<Listbox*>(winMgr.getWindow("Listbox"));
{
+
listbox->setMultiselectEnabled(false);
// Subscribe to events
+
ListboxTextItem* itemListbox = new ListboxTextItem("Value A", 1);
using namespace CEGUI;
+
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
listbox->addItem(itemListbox);
 +
itemListbox = new ListboxTextItem("Value B", 2);
 +
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
listbox->addItem(itemListbox);
 +
itemListbox = new ListboxTextItem("Value C", 3);
 +
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
listbox->addItem(itemListbox);
 +
itemListbox = new ListboxTextItem("Value D", 4);
 +
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
listbox->addItem(itemListbox);
 +
listbox->setItemSelectState(itemListbox, true);
 +
listbox->ensureItemIsVisible(itemListbox);
 +
uint valueListbox = listbox->getFirstSelectedItem()->getID(); // Retrieve the ID of the selected listbox item
  
// WindowSystem events
+
/* Combobox */
WindowSystem::bindEvent("Toolbar_btnWidgets", PushButton::EventClicked, WindowSystem::open); // Open this window
+
Combobox* combobox = static_cast<Combobox*>(winMgr.getWindow("Combobox"));
WindowSystem::bindEvent("btnClose", PushButton::EventClicked, WindowSystem::ok); // Close this window
+
combobox->setReadOnly(true);
WindowSystem::bindEvent("winWidgets", FrameWindow::EventCloseClicked, WindowSystem::cancel); // The 'X' button was clicked
+
ListboxTextItem* itemCombobox = new ListboxTextItem("Value 1", 1);
}
+
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
};
+
combobox->addItem(itemCombobox);
 +
itemCombobox = new ListboxTextItem("Value 2", 2);
 +
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
combobox->addItem(itemCombobox);
 +
itemCombobox->setSelected(true); // Select this item
 +
combobox->setText(itemCombobox->getText()); // Copy the item's text into the Editbox
 +
itemCombobox = new ListboxTextItem("Value 3", 3);
 +
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
combobox->addItem(itemCombobox);
 +
itemCombobox = new ListboxTextItem("Value 4", 4);
 +
itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
combobox->addItem(itemCombobox);
 +
String valueCombobox = combobox->getText(); // Retrieve the displayed text
 +
uint idCombobox = combobox->getSelectedItem()->getID(); // Retrieve the ID of the selected combobox item
  
//////////////////////////////////////////////
+
/* MultiColumnList */
 +
MultiColumnList* multiColumnList = static_cast<MultiColumnList*>(winMgr.getWindow("MultiColumnList"));\
 +
multiColumnList->addColumn("Col A", 0, UDim(0.32f, 0));
 +
multiColumnList->addColumn("Col B", 1, UDim(0.32f, 0));
 +
multiColumnList->addColumn("Col C", 2, UDim(0.32f, 0));
 +
multiColumnList->setSelectionMode(MultiColumnList::RowSingle); // MultiColumnList::RowMultiple
 +
ListboxTextItem* itemMultiColumnList;
 +
multiColumnList->addRow();
 +
itemMultiColumnList = new ListboxTextItem("A1", 101);
 +
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
multiColumnList->setItem(itemMultiColumnList, 0, 0); // ColumnID, RowID
 +
itemMultiColumnList = new ListboxTextItem("B1", 102);
 +
//itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
// By commenting the line above a cell does not specify a selection indicator
 +
// selecting that line will show a "gap" in the selection.
 +
multiColumnList->setItem(itemMultiColumnList, 1, 0); // ColumnID, RowID
 +
itemMultiColumnList = new ListboxTextItem("C1", 103);
 +
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
multiColumnList->setItem(itemMultiColumnList, 2, 0); // ColumnID, RowID
 +
multiColumnList->addRow();
 +
itemMultiColumnList = new ListboxTextItem("A2", 201);
 +
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
multiColumnList->setItem(itemMultiColumnList, 0, 1); // ColumnID, RowID
 +
itemMultiColumnList = new ListboxTextItem("B2", 202);
 +
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
multiColumnList->setItem(itemMultiColumnList, 1, 1); // ColumnID, RowID
 +
itemMultiColumnList = new ListboxTextItem("C2", 203);
 +
itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
 +
multiColumnList->setItem(itemMultiColumnList, 2, 1); // ColumnID, RowID
 +
MCLGridRef grid_ref(1, 0); // Select according to a grid reference; second row
 +
multiColumnList->setItemSelectState(grid_ref, true);
 +
ListboxItem* listboxItem = multiColumnList->getFirstSelectedItem();
 +
uint valueColumnA = listboxItem->getID(); // Retrieve the value of the selected item from column A
 +
listboxItem = multiColumnList->getNextSelected(listboxItem);
 +
uint valueColumnB = listboxItem->getID(); // Retrieve the value of the selected item from column B
 +
listboxItem = multiColumnList->getNextSelected(listboxItem);
 +
uint valueColumnC = listboxItem->getID(); // Retrieve the value of the selected item from column C
  
class WindowTabControl : public WindowSystem
+
/* TabControl */
{
+
TabControl* winTabControl = static_cast<TabControl*>(winMgr.getWindow("TabControl"));
public:
+
winTabControl->setTabHeight(UDim(0.15f, 0.0f)); // Make the tab buttons a little bigger
void initWindow()
+
Window* tabPage = winMgr.getWindow("TabPane1");
{
+
tabPage->setText("Page 1");
// Initialise the dialog
+
tabPage->setSize(UVector2(UDim(1.0f, 0.0f), UDim(1.0f, 0.0f))); // Size to 100% of its parent, the TabControl
using namespace CEGUI;
+
tabPage->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); // Move to the upper left corner of its parent
WindowManager& winMgr = WindowManager::getSingleton();
+
winTabControl->addTab(tabPage);
 +
tabPage = winMgr.getWindow("TabPane2");
 +
tabPage->setText("Page 2");
 +
tabPage->setSize(UVector2(UDim(1.0f, 0.0f), UDim(1.0f, 0.0f)));
 +
tabPage->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f)));
 +
winTabControl->addTab(tabPage);
  
// Initialise the windowing system
 
WindowSystem::initialise("winTabControl", // The handle of this window
 
false); // Initially invisible
 
 
TabControl* winTabControl = static_cast<TabControl*>(winMgr.getWindow((utf8*) "TabControl"));
 
winTabControl->setTabHeight(0.15f); // Make the tab buttons a little bigger
 
 
Window* tabPage = winMgr.getWindow((utf8*) "TabPane1");
 
tabPage->setText("Page 1");
 
tabPage->setSize(CEGUI::Size(1.0f, 1.0f)); // Size to 100 of its parent, the TabControl
 
tabPage->setPosition(CEGUI::Point(0.00f, 0.0f)); // Move to the upper left corner of its parent
 
winTabControl->addTab(tabPage);
 
 
tabPage = winMgr.getWindow((utf8*) "TabPane2");
 
tabPage->setText("Page 2");
 
tabPage->setSize(CEGUI::Size(1.0f, 1.0f));
 
tabPage->setPosition(CEGUI::Point(0.00f, 0.0f));
 
winTabControl->addTab(tabPage);
 
 
subscribeToEvents();
 
}
 
private:
 
void subscribeToEvents()
 
{
 
// Subscribe to events
 
using namespace CEGUI;
 
 
// WindowSystem events
 
WindowSystem::bindEvent("Toolbar_btnTabControl", PushButton::EventClicked, WindowSystem::open); // Open this window
 
WindowSystem::bindEvent("btnOk", PushButton::EventClicked, WindowSystem::ok);
 
WindowSystem::bindEvent("btnCancel", PushButton::EventClicked, WindowSystem::cancel);
 
WindowSystem::bindEvent("btnApply", PushButton::EventClicked, WindowSystem::apply);
 
WindowSystem::bindEvent("winTabControl", FrameWindow::EventCloseClicked, WindowSystem::cancel); // The 'X' button was clicked
 
 
// These events trigger a 'modified' event, activating the 'apply' button
 
WindowSystem::bindEvent( "EditBoxPage1", Editbox::EventTextChanged, WindowSystem::modified);
 
WindowSystem::bindEvent( "EditBoxPage2", Editbox::EventTextChanged, WindowSystem::modified);
 
}
 
 
};
 
 
//////////////////////////////////////////
 
 
class DemoSample : public CEGuiSample
 
{
 
public:
 
    bool initialiseSample()
 
{
 
using namespace CEGUI;
 
try
 
{
 
// Retrieve the window manager
 
WindowManager& winMgr = WindowManager::getSingleton();
 
 
// Load the TaharezLook scheme and set up the default mouse cursor and font
 
SchemeManager::getSingleton().loadScheme("../datafiles/schemes/TaharezLookSkin.scheme");
 
System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
 
FontManager::getSingleton().createFont("../datafiles/fonts/Commonwealth-10.font");
 
 
// Set the GUI Sheet
 
Window* sheet = winMgr.createWindow("DefaultWindow", "root_wnd");
 
System::getSingleton().setGUISheet(sheet);
 
 
// Load a layout
 
Window* guiLayout = winMgr.loadWindowLayout("../datafiles/layouts/03WidgetGalore.layout");
 
sheet->addChildWindow(guiLayout);
 
 
// Initialise the windows
 
winWidgets.initWindow();
 
winTabControl.initWindow();
 
 
}
 
}
 
catch(Exception &e)
 
catch(Exception &e)
Line 475: Line 406:
 
{
 
{
 
}
 
}
private:
 
WindowWidgets winWidgets;
 
WindowTabControl winTabControl;
 
 
};
 
};
  
 
#endif // _WidgetGalore_h_
 
#endif // _WidgetGalore_h_
</pre>
+
</source>
 
+
  
 
==== main.cpp ====
 
==== main.cpp ====
<pre>
+
<source lang="cpp">
 
#if defined( __WIN32__ ) || defined( _WIN32 )
 
#if defined( __WIN32__ ) || defined( _WIN32 )
 
#define WIN32_LEAN_AND_MEAN
 
#define WIN32_LEAN_AND_MEAN
Line 504: Line 431:
 
     return app.run();
 
     return app.run();
 
}
 
}
</pre>
+
</source>
  
  
 
==== WidgetGalore.layout ====
 
==== WidgetGalore.layout ====
<pre>
+
<source lang="xml">
 
<?xml version="1.0" encoding="UTF-8"?>
 
<?xml version="1.0" encoding="UTF-8"?>
<GUILayout>
+
 
<Window Type="DefaultWindow" Name="Root" >
+
<GUILayout >
<Property Name="Text" Value="1" />
+
    <Window Type="DefaultWindow" Name="Root" >
<Property Name="UnifiedAreaRect" Value="{{0.000000,0.000000},{0.000000,0.000000},{1.000000,0.000000},{1.000000,0.000000}}" />
+
        <Property Name="Text" >1</Property>
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
        <Property Name="InheritsAlpha" Value="False" />
<Window Type="TaharezLook/FrameWindow" Name="winToolbar" >
+
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="AlwaysOnTop" Value="True" />
+
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
<Property Name="CaptionColour" Value="00FFFFFF" />
+
        <Window Type="DefaultWindow" Name="TabPane2" >
<Property Name="CloseButtonEnabled" Value="False" />
+
            <Property Name="Font" Value="Commonwealth-10" />
<Property Name="EWSizingCursorImage" Value="set:TaharezLook image:MouseEsWeCursor" />
+
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
+
            <Property Name="UnifiedAreaRect" Value="{{0.72875,0},{0.7185,0},{0.97875,0},{0.9685,0}}" />
<Property Name="NESWSizingCursorImage" Value="set:TaharezLook image:MouseNeSwCursor" />
+
            <Window Type="TaharezLook/StaticText" Name="StaticTextPage2" >
<Property Name="NSSizingCursorImage" Value="set:TaharezLook image:MouseNoSoCursor" />
+
                <Property Name="Font" Value="Commonwealth-10" />
<Property Name="NWSESizingCursorImage" Value="set:TaharezLook image:MouseNwSeCursor" />
+
                <Property Name="Text" >In Page 2:</Property>
<Property Name="Text" Value="Toolbar" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TitlebarEnabled" Value="False" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.226667,0},{0.415,0},{0.476667,0}}" />
<Property Name="TitlebarFont" Value="Commonwealth-10" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.248750,0.000000},{0.010001,0.000000},{0.568749,0.000000},{0.081667,0.000000}}" />
+
            <Window Type="TaharezLook/Editbox" Name="EditBoxPage2" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Font" Value="Commonwealth-10" />
<Window Type="TaharezLook/Button" Name="Toolbar_btnWidgets" >
+
                <Property Name="MaxTextLength" Value="1073741823" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="Text" Value="Widgets" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.420001,0},{0.22,0},{0.99,0},{0.47,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.065103,0.000000},{0.227595,0.000000},{0.475554,0.000000},{0.686899,0.000000}}" />
+
            </Window>
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
        </Window>
</Window>
+
        <Window Type="TaharezLook/FrameWindow" Name="winTabControl" >
<Window Type="TaharezLook/Button" Name="Toolbar_btnTabControl" >
+
            <Property Name="Text" >Tab Control Window</Property>
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
+
            <Property Name="TitlebarFont" Value="Commonwealth-10" />
<Property Name="Text" Value="Tab Control" />
+
            <Property Name="CaptionColour" Value="00FFFFFF" />
<Property Name="UnifiedAreaRect" Value="{{0.538253,0.000000},{0.227595,0.000000},{0.948703,0.000000},{0.686899,0.000000}}" />
+
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            <Property Name="TitlebarEnabled" Value="True" />
</Window>
+
            <Property Name="UnifiedAreaRect" Value="{{0.695627,0},{0.2725,0},{0.993122,0},{0.704167,0}}" />
</Window>
+
            <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
<Window Type="TaharezLook/TabPane" Name="TabPane2" >
+
            <Window Type="TaharezLook/TabControl" Name="TabControl" >
<Property Name="BackgroundEnabled" Value="False" />
+
                <Property Name="TabHeight" Value="{0,0}" />
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="TabTextPadding" Value="{0,0}" />
<Property Name="FrameEnabled" Value="False" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.728750,0.000000},{0.718500,0.000000},{0.978750,0.000000},{0.968500,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.088566,0},{0.174378,0},{0.931404,0},{0.804637,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            </Window>
<Window Type="TaharezLook/StaticText" Name="StaticTextPage2" >
+
            <Window Type="TaharezLook/Button" Name="btnOk" >
<Property Name="BackgroundImage" Value="set:TaharezLook image:StaticBackdrop" />
+
                <Property Name="Text" >Ok</Property>
<Property Name="BottomFrameImage" Value="set:TaharezLook image:StaticBottom" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="BottomLeftFrameImage" Value="set:TaharezLook image:StaticBottomLeft" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.128412,0},{0.841464,0},{0.365583,0},{0.926003,0}}" />
<Property Name="BottomRightFrameImage" Value="set:TaharezLook image:StaticBottomRight" />
+
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="Font" Value="Commonwealth-10" />
+
            </Window>
<Property Name="LeftFrameImage" Value="set:TaharezLook image:StaticLeft" />
+
            <Window Type="TaharezLook/Button" Name="btnCancel" >
<Property Name="RightFrameImage" Value="set:TaharezLook image:StaticRight" />
+
                <Property Name="Text" >Cancel</Property>
<Property Name="Text" Value="In Page 2:" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TopFrameImage" Value="set:TaharezLook image:StaticTop" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.400429,0},{0.841464,0},{0.637601,0},{0.926003,0}}" />
<Property Name="TopLeftFrameImage" Value="set:TaharezLook image:StaticTopLeft" />
+
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="TopRightFrameImage" Value="set:TaharezLook image:StaticTopRight" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.060000,0.000000},{0.226667,0.000000},{0.415000,0.000000},{0.476667,0.000000}}" />
+
            <Window Type="TaharezLook/Button" Name="btnApply" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Text" >Apply</Property>
</Window>
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Window Type="TaharezLook/Editbox" Name="EditBoxPage2" >
+
                <Property Name="UnifiedAreaRect" Value="{{0.668224,0},{0.843977,0},{0.905394,0},{0.928516,0}}" />
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="MaxTextLength" Value="1073741823" />
+
            </Window>
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTextBar" />
+
        </Window>
<Property Name="UnifiedAreaRect" Value="{{0.420001,0.000000},{0.220000,0.000000},{0.990000,0.000000},{0.470000,0.000000}}" />
+
        <Window Type="DefaultWindow" Name="TabPane1" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
</Window>
+
            <Property Name="ClippedByParent" Value="False" />
</Window>
+
            <Property Name="UnifiedAreaRect" Value="{{0.72875,0},{0.012178,0},{0.97875,0},{0.262178,0}}" />
<Window Type="TaharezLook/FrameWindow" Name="winTabControl" >
+
            <Window Type="TaharezLook/StaticText" Name="StaticTextPage1" >
<Property Name="CaptionColour" Value="00FFFFFF" />
+
                <Property Name="Text" >In Page 1:</Property>
<Property Name="EWSizingCursorImage" Value="set:TaharezLook image:MouseEsWeCursor" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.226667,0},{0.415,0},{0.476667,0}}" />
<Property Name="NESWSizingCursorImage" Value="set:TaharezLook image:MouseNeSwCursor" />
+
            </Window>
<Property Name="NSSizingCursorImage" Value="set:TaharezLook image:MouseNoSoCursor" />
+
            <Window Type="TaharezLook/Editbox" Name="EditBoxPage1" >
<Property Name="NWSESizingCursorImage" Value="set:TaharezLook image:MouseNwSeCursor" />
+
                <Property Name="MaxTextLength" Value="1073741823" />
<Property Name="Text" Value="Tab Control Window" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TitlebarEnabled" Value="True" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.420001,0},{0.22,0},{0.99,0},{0.47,0}}" />
<Property Name="TitlebarFont" Value="Commonwealth-10" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.695627,0.000000},{0.272500,0.000000},{0.993122,0.000000},{0.704167,0.000000}}" />
+
        </Window>
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
        <Window Type="TaharezLook/FrameWindow" Name="winWidgets" >
<Window Type="TaharezLook/TabControl" Name="TabControl" >
+
            <Property Name="Text" >Dave, it&apos;s full of widgets!</Property>
<Property Name="UnifiedAreaRect" Value="{{0.088566,0.000000},{0.174378,0.000000},{0.931404,0.000000},{0.804637,0.000000}}" />
+
            <Property Name="TitlebarFont" Value="Commonwealth-10" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            <Property Name="CaptionColour" Value="00FFFFFF" />
</Window>
+
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Window Type="TaharezLook/Button" Name="btnOk" >
+
            <Property Name="TitlebarEnabled" Value="True" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
+
            <Property Name="UnifiedAreaRect" Value="{{0.00375,0},{0.143333,0},{0.751248,0},{0.806665,0}}" />
<Property Name="Text" Value="Ok" />
+
            <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
<Property Name="UnifiedAreaRect" Value="{{0.128412,0.000000},{0.841464,0.000000},{0.365583,0.000000},{0.926003,0.000000}}" />
+
            <Window Type="TaharezLook/Button" Name="btnClose" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Text" >Close</Property>
</Window>
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Window Type="TaharezLook/Button" Name="btnCancel" >
+
                <Property Name="UnifiedAreaRect" Value="{{0.732397,0},{0.895137,0},{0.976465,0},{0.975697,0}}" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
+
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
<Property Name="Text" Value="Cancel" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.400429,0.000000},{0.841464,0.000000},{0.637601,0.000000},{0.926003,0.000000}}" />
+
            <Window Type="TaharezLook/Editbox" Name="Editbox" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Font" Value="Commonwealth-10" />
</Window>
+
                <Property Name="MaxTextLength" Value="1073741823" />
<Window Type="TaharezLook/Button" Name="btnApply" >
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.62442,0},{0.090471,0},{0.969776,0},{0.153443,0}}" />
<Property Name="Text" Value="Apply" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.668224,0.000000},{0.843977,0.000000},{0.905394,0.000000},{0.928516,0.000000}}" />
+
            <Window Type="TaharezLook/Checkbox" Name="Checkbox" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Text" >Check</Property>
</Window>
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
</Window>
+
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.396859,0},{0.944201,0},{0.453147,0}}" />
<Window Type="TaharezLook/TabPane" Name="TabPane1" >
+
            </Window>
<Property Name="BackgroundEnabled" Value="False" />
+
            <Window Type="TaharezLook/Combobox" Name="Combobox" >
<Property Name="ClippedByParent" Value="False" />
+
                <Property Name="Text" >Combo Box</Property>
<Property Name="FrameEnabled" Value="False" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.728750,0.000000},{0.012178,0.000000},{0.978750,0.000000},{0.262178,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.090471,0},{0.613522,0},{0.413287,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="MaxEditTextLength" Value="1073741823" />
<Window Type="TaharezLook/StaticText" Name="StaticTextPage1" >
+
            </Window>
<Property Name="BackgroundImage" Value="set:TaharezLook image:StaticBackdrop" />
+
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_A" >
<Property Name="BottomFrameImage" Value="set:TaharezLook image:StaticBottom" />
+
                <Property Name="Font" Value="Commonwealth-10" />
<Property Name="BottomLeftFrameImage" Value="set:TaharezLook image:StaticBottomLeft" />
+
                <Property Name="Text" >A</Property>
<Property Name="BottomRightFrameImage" Value="set:TaharezLook image:StaticBottomRight" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="LeftFrameImage" Value="set:TaharezLook image:StaticLeft" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.652856,0},{0.189876,0},{0.704964,0},{0.246164,0}}" />
<Property Name="RightFrameImage" Value="set:TaharezLook image:StaticRight" />
+
            </Window>
<Property Name="Text" Value="In Page 1:" />
+
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_B" >
<Property Name="TopFrameImage" Value="set:TaharezLook image:StaticTop" />
+
                <Property Name="Font" Value="Commonwealth-10" />
<Property Name="TopLeftFrameImage" Value="set:TaharezLook image:StaticTopLeft" />
+
                <Property Name="Text" >B</Property>
<Property Name="TopRightFrameImage" Value="set:TaharezLook image:StaticTopRight" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.060000,0.000000},{0.226667,0.000000},{0.415000,0.000000},{0.476667,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.707569,0},{0.189876,0},{0.759678,0},{0.246164,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            </Window>
</Window>
+
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_C" >
<Window Type="TaharezLook/Editbox" Name="EditBoxPage1" >
+
                <Property Name="Font" Value="Commonwealth-10" />
<Property Name="MaxTextLength" Value="1073741823" />
+
                <Property Name="Text" >C</Property>
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTextBar" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.420001,0.000000},{0.220000,0.000000},{0.990000,0.000000},{0.470000,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.761542,0},{0.189876,0},{0.813651,0},{0.246164,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            </Window>
</Window>
+
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_1" >
</Window>
+
                <Property Name="Font" Value="Commonwealth-10" />
<Window Type="TaharezLook/FrameWindow" Name="winWidgets" >
+
                <Property Name="Text" >1</Property>
<Property Name="CaptionColour" Value="00FFFFFF" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="EWSizingCursorImage" Value="set:TaharezLook image:MouseEsWeCursor" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.189876,0},{0.897272,0},{0.246164,0}}" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
+
            </Window>
<Property Name="NESWSizingCursorImage" Value="set:TaharezLook image:MouseNeSwCursor" />
+
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_2" >
<Property Name="NSSizingCursorImage" Value="set:TaharezLook image:MouseNoSoCursor" />
+
                <Property Name="Font" Value="Commonwealth-10" />
<Property Name="NWSESizingCursorImage" Value="set:TaharezLook image:MouseNwSeCursor" />
+
                <Property Name="Text" >2</Property>
<Property Name="Text" Value="Dave, it's full of widgets!" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="TitlebarEnabled" Value="True" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.245152,0},{0.897272,0},{0.30144,0}}" />
<Property Name="TitlebarFont" Value="Commonwealth-10" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.003750,0.000000},{0.143333,0.000000},{0.751248,0.000000},{0.806665,0.000000}}" />
+
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_3" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Font" Value="Commonwealth-10" />
<Window Type="TaharezLook/Button" Name="btnClose" >
+
                <Property Name="Text" >3</Property>
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="Text" Value="Close" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.300429,0},{0.897272,0},{0.356717,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.732397,0.000000},{0.895137,0.000000},{0.976465,0.000000},{0.975697,0.000000}}" />
+
            </Window>
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            <Window Type="TaharezLook/HorizontalScrollbar" Name="HorizontalScrollbar" >
</Window>
+
                <Property Name="PageSize" Value="0" />
<Window Type="TaharezLook/Editbox" Name="Editbox" >
+
                <Property Name="StepSize" Value="1" />
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="OverlapSize" Value="0" />
<Property Name="MaxTextLength" Value="1073741823" />
+
                <Property Name="DocumentSize" Value="1" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTextBar" />
+
                <Property Name="ScrollPosition" Value="0" />
<Property Name="UnifiedAreaRect" Value="{{0.624420,0.000000},{0.090471,0.000000},{0.969776,0.000000},{0.153443,0.000000}}" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.185427,0},{0.613522,0},{0.26206,0}}" />
</Window>
+
            </Window>
<Window Type="TaharezLook/Checkbox" Name="Checkbox" >
+
            <Window Type="TaharezLook/VerticalScrollbar" Name="VerticalScrollbar" >
<Property Name="Text" Value="Check" />
+
                <Property Name="PageSize" Value="0" />
<Property Name="UnifiedAreaRect" Value="{{0.845164,0.000000},{0.396859,0.000000},{0.944201,0.000000},{0.453147,0.000000}}" />
+
                <Property Name="StepSize" Value="1" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="OverlapSize" Value="0" />
</Window>
+
                <Property Name="DocumentSize" Value="1" />
<Window Type="TaharezLook/Combobox" Name="Combobox" >
+
                <Property Name="ScrollPosition" Value="0" />
<Property Name="ActiveEditSelectionColour" Value="FF6060FF" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="InactiveEditSelectionColour" Value="FF808080" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.026087,0},{0.090471,0},{0.082106,0},{0.606802,0}}" />
<Property Name="MaxEditTextLength" Value="1073741823" />
+
            </Window>
<Property Name="NormalEditTextColour" Value="FFFFFFFF" />
+
            <Window Type="TaharezLook/Listbox" Name="Listbox" >
<Property Name="SelectedEditTextColour" Value="FF000000" />
+
                <Property Name="Text" >List Box</Property>
<Property Name="Text" Value="Combo Box" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.183835,0.000000},{0.090471,0.000000},{0.613522,0.000000},{0.413287,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.626634,0},{0.427903,0},{0.876634,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
</Window>
+
            </Window>
<Window Type="TaharezLook/RadioButton" Name="RadioButton_A" >
+
            <Window Type="TaharezLook/MultiColumnList" Name="MultiColumnList" >
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="Text" Value="A" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.271357,0},{0.816779,0},{0.551507,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.652856,0.000000},{0.189876,0.000000},{0.704964,0.000000},{0.246164,0.000000}}" />
+
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            </Window>
</Window>
+
            <Window Type="TaharezLook/MultiLineEditbox" Name="MultiLineEditbox" >
<Window Type="TaharezLook/RadioButton" Name="RadioButton_B" >
+
                <Property Name="Text" >           
<Property Name="Font" Value="Commonwealth-10" />
+
</Property>
<Property Name="Text" Value="B" />
+
                <Property Name="MaxTextLength" Value="1073741823" />
<Property Name="UnifiedAreaRect" Value="{{0.707569,0.000000},{0.189876,0.000000},{0.759678,0.000000},{0.246164,0.000000}}" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.462498,0},{0.626634,0},{0.706566,0},{0.876634,0}}" />
</Window>
+
            </Window>
<Window Type="TaharezLook/RadioButton" Name="RadioButton_C" >
+
            <Window Type="TaharezLook/ProgressBar" Name="ProgressBar" >
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="StepSize" Value="0.01" />
<Property Name="Text" Value="C" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.761542,0.000000},{0.189876,0.000000},{0.813651,0.000000},{0.246164,0.000000}}" />
+
                <Property Name="CurrentProgress" Value="0" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.559296,0},{0.816779,0},{0.608291,0}}" />
</Window>
+
            </Window>
<Window Type="TaharezLook/RadioButton" Name="RadioButton_1" >
+
            <Window Type="TaharezLook/Slider" Name="Slider" >
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="CurrentValue" Value="0" />
<Property Name="Text" Value="1" />
+
                <Property Name="MaximumValue" Value="1" />
<Property Name="UnifiedAreaRect" Value="{{0.845164,0.000000},{0.189876,0.000000},{0.897272,0.000000},{0.246164,0.000000}}" />
+
                <Property Name="ClickStepSize" Value="0.01" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
</Window>
+
                <Property Name="UnifiedAreaRect" Value="{{0.099415,0},{0.090471,0},{0.155434,0},{0.606802,0}}" />
<Window Type="TaharezLook/RadioButton" Name="RadioButton_2" >
+
            </Window>
<Property Name="Font" Value="Commonwealth-10" />
+
            <Window Type="TaharezLook/Spinner" Name="Spinner" >
<Property Name="Text" Value="2" />
+
                <Property Name="StepSize" Value="1" />
<Property Name="UnifiedAreaRect" Value="{{0.845164,0.000000},{0.245152,0.000000},{0.897272,0.000000},{0.301440,0.000000}}" />
+
                <Property Name="CurrentValue" Value="0" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="MaximumValue" Value="32767" />
</Window>
+
                <Property Name="MinimumValue" Value="-32768" />
<Window Type="TaharezLook/RadioButton" Name="RadioButton_3" >
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="Font" Value="Commonwealth-10" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.48995,0},{0.944201,0},{0.551507,0}}" />
<Property Name="Text" Value="3" />
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.845164,0.000000},{0.300429,0.000000},{0.897272,0.000000},{0.356717,0.000000}}" />
+
            <Window Type="TaharezLook/StaticImage" Name="StaticImage" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
</Window>
+
                <Property Name="UnifiedAreaRect" Value="{{0.732397,0},{0.626634,0},{0.976465,0},{0.876634,0}}" />
<Window Type="TaharezLook/HorizontalScrollbar" Name="HorizontalScrollbar" >
+
            </Window>
<Property Name="UnifiedAreaRect" Value="{{0.183835,0.000000},{0.185427,0.000000},{0.613522,0.000000},{0.262060,0.000000}}" />
+
            <Window Type="TaharezLook/StaticText" Name="StaticText" >
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="Text" >Static Text</Property>
</Window>
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Window Type="TaharezLook/VerticalScrollbar" Name="VerticalScrollbar" >
+
                <Property Name="UnifiedAreaRect" Value="{{0.462498,0},{0.895137,0},{0.706566,0},{0.975697,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.026087,0.000000},{0.090471,0.000000},{0.082106,0.000000},{0.606802,0.000000}}" />
+
            </Window>
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
            <Window Type="TaharezLook/ScrollablePane" Name="ScrollablePane" >
</Window>
+
                <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" />
<Window Type="TaharezLook/Listbox" Name="Listbox" >
+
                <Property Name="HorzStepSize" Value="0.1" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
+
                <Property Name="VertStepSize" Value="0.1" />
<Property Name="Text" Value="List Box" />
+
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="UnifiedAreaRect" Value="{{0.183835,0.000000},{0.626634,0.000000},{0.427903,0.000000},{0.876634,0.000000}}" />
+
                <Property Name="HorzOverlapSize" Value="0.01" />
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
                <Property Name="UnifiedAreaRect" Value="{{0.019063,0},{0.629399,0},{0.157023,0},{0.879399,0}}" />
</Window>
+
                <Property Name="VertOverlapSize" Value="0.01" />
<Window Type="TaharezLook/MultiColumnList" Name="MultiColumnList" >
+
                <Property Name="HorzScrollPosition" Value="0" />
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
+
                <Property Name="VertScrollPosition" Value="0" />
<Property Name="UnifiedAreaRect" Value="{{0.183835,0.000000},{0.271357,0.000000},{0.816779,0.000000},{0.551507,0.000000}}" />
+
            </Window>
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
        </Window>
</Window>
+
    </Window>
<Window Type="TaharezLook/MultiLineEditbox" Name="MultiLineEditbox" >
+
<Property Name="MaxTextLength" Value="1073741823" />
+
<Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTextBar" />
+
<Property Name="Text" Value="        
+
" />
+
<Property Name="UnifiedAreaRect" Value="{{0.462498,0.000000},{0.626634,0.000000},{0.706566,0.000000},{0.876634,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
<Window Type="TaharezLook/ProgressBar" Name="ProgressBar" >
+
<Property Name="UnifiedAreaRect" Value="{{0.183835,0.000000},{0.559296,0.000000},{0.816779,0.000000},{0.608291,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
<Window Type="TaharezLook/Slider" Name="Slider" >
+
<Property Name="UnifiedAreaRect" Value="{{0.099415,0.000000},{0.090471,0.000000},{0.155434,0.000000},{0.606802,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
<Window Type="TaharezLook/Spinner" Name="Spinner" >
+
<Property Name="UnifiedAreaRect" Value="{{0.845164,0.000000},{0.489950,0.000000},{0.944201,0.000000},{0.551507,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
<Window Type="TaharezLook/StaticImage" Name="StaticImage" >
+
<Property Name="BackgroundImage" Value="set:TaharezLook image:StaticBackdrop" />
+
<Property Name="BottomFrameImage" Value="set:TaharezLook image:StaticBottom" />
+
<Property Name="BottomLeftFrameImage" Value="set:TaharezLook image:StaticBottomLeft" />
+
<Property Name="BottomRightFrameImage" Value="set:TaharezLook image:StaticBottomRight" />
+
<Property Name="LeftFrameImage" Value="set:TaharezLook image:StaticLeft" />
+
<Property Name="RightFrameImage" Value="set:TaharezLook image:StaticRight" />
+
<Property Name="TopFrameImage" Value="set:TaharezLook image:StaticTop" />
+
<Property Name="TopLeftFrameImage" Value="set:TaharezLook image:StaticTopLeft" />
+
<Property Name="TopRightFrameImage" Value="set:TaharezLook image:StaticTopRight" />
+
<Property Name="UnifiedAreaRect" Value="{{0.732397,0.000000},{0.626634,0.000000},{0.976465,0.000000},{0.876634,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
<Window Type="TaharezLook/StaticText" Name="StaticText" >
+
<Property Name="BackgroundImage" Value="set:TaharezLook image:StaticBackdrop" />
+
<Property Name="BottomFrameImage" Value="set:TaharezLook image:StaticBottom" />
+
<Property Name="BottomLeftFrameImage" Value="set:TaharezLook image:StaticBottomLeft" />
+
<Property Name="BottomRightFrameImage" Value="set:TaharezLook image:StaticBottomRight" />
+
<Property Name="LeftFrameImage" Value="set:TaharezLook image:StaticLeft" />
+
<Property Name="RightFrameImage" Value="set:TaharezLook image:StaticRight" />
+
<Property Name="Text" Value="Static Text" />
+
<Property Name="TopFrameImage" Value="set:TaharezLook image:StaticTop" />
+
<Property Name="TopLeftFrameImage" Value="set:TaharezLook image:StaticTopLeft" />
+
<Property Name="TopRightFrameImage" Value="set:TaharezLook image:StaticTopRight" />
+
<Property Name="UnifiedAreaRect" Value="{{0.462498,0.000000},{0.895137,0.000000},{0.706566,0.000000},{0.975697,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
<Window Type="TaharezLook/ScrollablePane" Name="ScrollablePane" >
+
<Property Name="UnifiedAreaRect" Value="{{0.019063,0.000000},{0.629399,0.000000},{0.157023,0.000000},{0.879399,0.000000}}" />
+
<Property Name="UnifiedMaxSize" Value="{{1.000000,0.000000},{1.000000,0.000000}}" />
+
</Window>
+
</Window>
+
</Window>
+
 
</GUILayout>
 
</GUILayout>
</pre>
+
</source>
 +
 
 +
[[Category:Manuals]]
 +
[[Category:Update requested]]

Latest revision as of 23:57, 3 March 2011

Written for CEGUI 0.5


Works with versions 0.5.x (obsolete)

Written for CEGUI 0.6


Works with versions 0.6.x (obsolete)

This code goes through every widget and demonstrates how to retrieve and set their data as well as some of their particularities. Please post comments or questions on the message board thread for the Widget Galore

Widgets

General

A widget can be enabled/disabled via setEnabled(). Disabling a widget prevents the user from activating it and manipulating its contents. A widget can be hidden/shown via setVisible().


Tooltip

A Tooltip widget displays text when the mouse has been hovering over a widget for a certain amount of time. This widget requires that time be injected within CEGUI via injectTimePulse().

The graphical aspect (the scheme) of the tooltip can be specified via setTooltip(). The amount of hovering time required to activate the tooltip can be specified via setHoverTime(). The amount of time the tooltip is displayed can be specified via setDisplayTime(). And the fade transition time can be specified via setFadeTime(); this affects both the fade in and the fade out times. The tooltip text of a widget can be specified via setTooltipText(). Please note that some complex widgets are composed of several widgets. In order to have a tooltip text displayed while hovering over any region of the complex widget then every component widget needs to have a tooltip text specified. For example a Spinner widget is composed of an Editbox widget and two Button widgets.


StaticText

There is no StaticText within CEGUI but type of widget can be obtained via the DefaultWindow class.

The currently displayed text can be specified via setText(). The colour of this text can be specified via the "TextColours" property. The value of this property contains 4 colour definitions: top left, top right, bottom left, and bottom right. Each colour is specified as a two-digit hexadecimal value of the format AARRGGBB (alpha, red, green, blue). The text is aligned vertically via the "VertFormatting" property with a value of TopAligned, BottomAligned, or VertCentred. The text is aligned horizontally via the "HorzFormatting" property with a value of LeftAligned, RightAligned, HorzCentred, HorzJustified, WordWrapLeftAligned, WordWrapRightAligned, WordWrapCentred, or WordWrapJustified.

StaticImage

There is no StaticImage within CEGUI but type of widget can be obtained via the DefaultWindow class.

The currently displayed image can be specified via the "Image" property. This property takes two parameters, the imageset ("set") and the image name ("image").

ProgressBar

A ProgressBar widget displays a progression; it does not receive inputs from a user.

The current progress can be specified via setProgress(). Progress can be advanced through steps. The step size can be specified via setStepSize() and a step performed via step(). Progress can be adjusted by a delta value via adjustProgress(). The current progress value can be obtained via getProgress().


Button

A Button widget displays a text and receives an activation instruction from the user.

The text can be specified via setText().


ScrollablePane

A ScrollablePane widget displays contents that can be scrolled. Contents can be added via addChildWindow(). When that content exceeds the dimensions of the ScrollablePane then scrollbars appear to allow the use to view and interact with that hidden content.


Checkbox

A Checkbox widget controls a boolean value; true when checked and false when unchecked. This value can be obtained via isSelected() and specified via setSelected(true) to check or setSelected(false) to uncheck.

Spinner

A Spinner widget controls a numerical values (float) through an editbox or the use of the increment or decrement buttons.

This value is bounded within a minimum and a maximum by calling setMinimumValue() and setMaximumValue(). The arrow buttons increment or decrement the value by the amount specified with setStepSize(). The numerical value can be displayed in four formats: FloatingPoint, Integer, Hexadecimal, Octal.

The current value is obtained via getCurrentValue() and specified via setCurrentValue().


Editbox

An Editbox widget controls printable character values; letters, numbers, punctuations, and symbols.

The maximal number of characters that can be specified is bound by setMaxTextLength(). The value can be set to readable only (modifications by users are not allowed) via setReadOnly(true). The value can be masked via setTextMasked() and the default value of * can be modified via setMaskCodePoint().

The current value can be obtained via getText() and specified via setText().


Slider

A Slider widget controls a numerical value (float) through the position of a "thumb".

This value is bounded within a maximum by setMaxValue(); the minimum value is set to 0.0f. The thumb can be dragged to the desired position or moved by clicking on either side of the thumb. The increment or decrement value is set by setClickStep().

The current value can be obtained via getCurrentValue() and specified via setCurrentValue().


Scrollbar

A Scrollbar widget controls a numerical value (float) through the position of a "thumb".

This value is bounded within a maximum by setDocumentSize(); the minimum value is set to 0.0f. The thumb can be dragged to the desired position or moved by clicking on either side of the thumb. The increment or decrement value is set by setPageSize(). The arrow buttons increment or decrement the value by the amount specified with setStepSize().

The current value can be obtained via getScrollPosition() and specified via setScrollPosition(). Note that the actual maximum value that the scrollbar will return is set by the following formula: document_size - page_size. Thus, a document of size 100 and a page size of 10 will have a value from 0 to 90.


MultiLineEditbox

A MultiLineEditbox widget controls printable character values; letters, numbers, punctuations, and symbols.

Unlike the Editbox widget there is no maximal number of characters that can be specified. The value can be set to readable only (modifications by users are not allowed) via setReadOnly(true). Text can be automatically wrapped via a call to setWordWrapping(true).

The current value can be obtained via getText() and specified via setText().


RadioButton

A RadioButton widget controls a single selection among many choices.

The choices are grouped by calling setGroupID(). Only one RadioButton per group ID can be selected; this widget does not support multiple selection. However it is possible for a choice to possess no decision; initially every RadioButton of a group is unselected.

The currently selected RadioButton can be obtained via getSelectedButtonInGroup(). This RadioButton pointer can then be used to query the ID via getID(), the text (visible label of the RadioButton) via getText(), or user data via getUserData(). A RadioButton can be selected via setSelected(true). Passing false will deselect the RadioButton, potentially making every RadioButton of the group unselected.


Listbox

A Listbox widget controls either a single selection or multiple selections among many choices. Multiple selections are enabled via setMultiselectEnabled().

The choices are listbox text items (ListboxTextItem) added to the listbox via addItem(). These do not possess a selection indicator by default; one must be specified via setSelectionBrushImage(). The call to ensureItemIsVisible() ensures that the item is visible; the listbox will automatically scroll down if necessary. The text of the ListboxTextItem can be changed via the setText() function. However this new text will not be displayed until you call the Listbox's handleUpdatedItemData() function.

The selected ListboxItem can be obtained via getFirstSelectedItem() and subsequent selections through getNextSelected(). A selection can be specified via setItemSelectState().

It is possible for a Listbox to contain list items that are not simply composed of text. CheckListboxItem demonstrates this advanced feature. Another approach would be to simulate the behavior of a listbox such that each row is composed of various widgets. PseudoListbox demonstrates this.

Combobox

A Combobox widget controls a single selection among many choices.

The choices are listbox text items (ListboxTextItem) added to the combobox via addItem(). These do not possess a selection indicator by default; one must be specified via setSelectionBrushImage().

The value of the text within the Editbox can be obtained via getText() and the last selected ListboxItem can be obtained via getSelectedItem(). However there is no guarantee that both are synchronized; typing text within the Editbox will not automatically select the corresponding ListboxItem. Fortunately the reverse is not true; selecting a ListboxItem will place that text within the Editbox. Placing the Editbox in read-only mode with setReadOnly(true) can avoid problems. The current value can be specified via listboxTextItem->setSelected(true) and a setText(itemCombobox->getText()).


MultiColumnList

A MultiColumnList widget controls controls either a single selection or multiple selections among many choices. Multiple selections are enabled via setSelectionMode(MultiColumnList::RowMultiple).

A MultiColumnList widget may contain a single column or multiple columns. Columns are added via addColumn(), specifying a label, a column ID, and a column width.

Three steps are required to add a row. The first step is to add a new row with addRow(). The second step is to create a ListboxTextItem for each cell of the row and specify the selection indicator via setSelectionBrushImage(). The third step is to add the newly created ListboxTextItem to the MultiColumnList via setItem(), specifying the ListboxTextItem, the column ID, and the row ID.

The selected row can be obtained via getFirstSelectedItem() and subsequent selections through getNextSelected(). This will iterate through every selected cell, returning each selected ListboxTextItem . A selection can be specified via setItemSelectState(); by setting the selection mode to rows (either RowSingle or RowMultiple) you actually only need to select the ListboxTextItem of the first column.


TabControl

A TabControl widget allows multiple windows to be displayed one at a time, via tab buttons.

Two objects must be created within the Layout Editor to generate a functional tab control. The first is a window of type "TabControl". This will be the parent window of the tab buttons as well as the pages. The second is a window of type "DefaultWindow". This window will be placed within the TabControl (in code via addTab(), not through the Layout Editor) and will specify the contents of a page. Widgets are to be placed within these TabPane via the Layout Editor. The "TabButton" windows are not to be specified via the Layout Editor since they will be automatically created when a TabPane is added to the TabControl.

In this demo the TabControl widget was placed within a FrameWindow. This is not a requirement. It could have just easily been placed alongside the widgets of the other window.

Menu & Popup Menu

See Menu and Popup

Files

WidgetGalore.h

#ifndef _WidgetGalore_h_
#define _WidgetGalore_h_
 
#include "CEGuiSample.h"
#include "CEGUI.h"
 
class DemoSample : public CEGuiSample
{
public:
    bool initialiseSample()
	{
		using namespace CEGUI;
		try
		{
			// Retrieve the window manager
			WindowManager& winMgr = WindowManager::getSingleton();
 
			// Load the TaharezLook scheme and set up the default mouse cursor and font
			SchemeManager::getSingleton().loadScheme("TaharezLook.scheme");
			System::getSingleton().setDefaultMouseCursor("TaharezLook", "MouseArrow");
			if(!FontManager::getSingleton().isFontPresent("Commonwealth-10"))
				FontManager::getSingleton().createFont("Commonwealth-10.font");
 
			// Set the GUI Sheet
			Window* sheet = winMgr.createWindow("DefaultWindow", "root_wnd");
			System::getSingleton().setGUISheet(sheet);
 
			// Load a layout
			Window* guiLayout = winMgr.loadWindowLayout("WidgetGalore.layout");
			sheet->addChildWindow(guiLayout);
 
 
 
			/* Tooltip */
			System::getSingleton().setDefaultTooltip("TaharezLook/Tooltip"); // Set the name of the default tooltip
			Tooltip* tooltip = System::getSingleton().getDefaultTooltip();
			tooltip->setHoverTime(0.5f); // Display the tooltip after the mouse has been hovering over the widget for half a second
			tooltip->setDisplayTime(10.0f); // Display for 15 seconds then disappear
			tooltip->setFadeTime(1.0f); // Duration of the transition between fully visible and fully invisible
			// To set the tooltip text for a window simply call setTooltipText()   see staticText for an example
 
			/* StaticText */
			DefaultWindow* staticText = static_cast<DefaultWindow*>(winMgr.getWindow("StaticText"));
			staticText->setText("Red Static Text");
			// Colours are specified as aarrggbb in Hexadecimal
			// Where aa is alpha, rr is red, gg is green, and bb is blue 
			// tl: top left,  tr: top right,  bl: bottom left,  br: bottom right
			staticText->setProperty("TextColours", "tl:FFFF0000 tr:FFFF0000 bl:FFFF0000 br:FFFF0000");
			staticText->setProperty("VertFormatting", "VertCentred"); // TopAligned, BottomAligned, VertCentred
			staticText->setProperty("HorzFormatting", "HorzCentred"); // LeftAligned, RightAligned, HorzCentred
				// HorzJustified, WordWrapLeftAligned, WordWrapRightAligned, WordWrapCentred, WordWrapJustified
			staticText->setTooltipText("This is a StaticText widget");
 
			/* StaticImage */
			ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForStaticImage", "GPN-2000-001437.tga");
			DefaultWindow* staticImage = static_cast<DefaultWindow*>(winMgr.getWindow("StaticImage"));
			staticImage->setProperty("Image", "set:ImageForStaticImage image:full_image"); // "full_image" is a default name from CEGUIImageset::Imageset()
 
			/* ProgressBar */
			ProgressBar* progressBar = static_cast<ProgressBar*>(winMgr.getWindow("ProgressBar"));
			progressBar->setProgress(0.25f); // Initial progress of 25%
			progressBar->setStepSize(0.10f); // Calling step() will increase the progress by 10%
			progressBar->step(); // Advance the progress by the size specified in setStepSize()
			progressBar->adjustProgress(-0.05f); // Adjust the progress by a delta value rather than setting a new value through setProgress
			float valueProgressBar = progressBar->getProgress(); // initial 0.25f + step 0.10f - adjustment 0.05f = 0.30f
 
			/* Button */
			PushButton* btnClose = static_cast<PushButton*>(winMgr.getWindow("btnClose"));
			btnClose->setText("Exit");
 
			/* ScrollablePane */
			ScrollablePane* scrollablePane = static_cast<ScrollablePane*>(winMgr.getWindow("ScrollablePane"));
			ImagesetManager::getSingleton().createImagesetFromImageFile("ImageForScrollablePane", "GPN-2000-001437.tga");
			DefaultWindow* staticImageInScrollablePane = static_cast<DefaultWindow*>(winMgr.createWindow("TaharezLook/StaticImage", "StaticImageInScrollablePane"));
				staticImageInScrollablePane->setProperty("Image", "set:ImageForScrollablePane image:full_image"); // "full_image" is a default name from CEGUIImageset::Imageset()
				staticImageInScrollablePane->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); // Start in the upper left corner
				staticImageInScrollablePane->setWidth(UDim(2.0f, 0.0f)); // Twice the width of the parent, the ScrollablePane
				staticImageInScrollablePane->setHeight(UDim(2.0f, 0.0f)); // Twice the height of the parent, the ScrollablePane
				scrollablePane->addChildWindow(staticImageInScrollablePane); // Add the image to the // Twice the width of the parent, the ScrollablePane
			Editbox* editboxInScrollablePane = static_cast<Editbox*>(winMgr.createWindow("TaharezLook/Editbox", "EditboxInScrollablePane"));
				editboxInScrollablePane->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(2.1f, 0.0f))); // Start below the image
				editboxInScrollablePane->setWidth(UDim(2.0f, 0.0f)); 
				editboxInScrollablePane->setHeight(UDim(0.3f, 0.0f));
				scrollablePane->addChildWindow(editboxInScrollablePane);
 
			/* Check box */
			Checkbox* checkbox = static_cast<Checkbox*>(winMgr.getWindow("Checkbox"));
			checkbox->setSelected( true );
			bool valueCheckbox = checkbox->isSelected(); // Retrieve whether it is checked
 
			/* Spinner */
			Spinner* spinner = static_cast<Spinner*>(winMgr.getWindow("Spinner"));
			spinner->setTextInputMode(Spinner::FloatingPoint); // FloatingPoint, Integer, Hexadecimal, Octal
			spinner->setMinimumValue(-10.0f);
			spinner->setMaximumValue(10.0f);
			spinner->setStepSize(0.2f);
			spinner->setCurrentValue(5.2f);
			float valueSpinner = spinner->getCurrentValue(); // Retrieve the value
 
			/* Editbox */
			Editbox* editbox = static_cast<Editbox*>(winMgr.getWindow("Editbox"));
			editbox->setText("Editbox values");
			editbox->setMaxTextLength(13); // The trailing 's' will not be displayed
			editbox->setReadOnly(false);
			editbox->setTextMasked(false);
			editbox->setMaskCodePoint(0x002A); // *
			String valueEditbox = editbox->getText(); // Retrieve the text
 
			/* Slider */
			Slider* slider = static_cast<Slider*>(winMgr.getWindow("Slider"));
			slider->setMaxValue(100.0f);
			slider->setClickStep(10.0f);
			slider->setCurrentValue(20.0f);
			float valueSlider = slider->getCurrentValue(); // Retrieve the value
 
			/* Scrollbar (Horizontal) */
			Scrollbar* scrollbarHorizontal = static_cast<Scrollbar*>(winMgr.getWindow("HorizontalScrollbar"));
			scrollbarHorizontal->setDocumentSize(100.0f);
			scrollbarHorizontal->setPageSize(10.0f);
			scrollbarHorizontal->setStepSize(1.0f);
			scrollbarHorizontal->setScrollPosition(75.0f);
			float valueScrollbarHorizontal = scrollbarHorizontal->getScrollPosition(); // Retrieve the scroll position
 
			/* Scrollbar (Vertical) */
			Scrollbar* scrollbarVertical = static_cast<Scrollbar*>(winMgr.getWindow("VerticalScrollbar"));
			scrollbarVertical->setDocumentSize(100.0f);
			scrollbarVertical->setPageSize(10.0f);
			scrollbarVertical->setStepSize(1.0f);
			scrollbarVertical->setScrollPosition(25.0f);
			float valueScrollbarVertical = scrollbarVertical->getScrollPosition(); // Retrieve the scroll position
 
			/* MultiLineEditbox */
			MultiLineEditbox* multiLineEditbox = static_cast<MultiLineEditbox*>(winMgr.getWindow("MultiLineEditbox"));
			multiLineEditbox->setText("MultiLineEditbox value");
			multiLineEditbox->setReadOnly(false);
			multiLineEditbox->setWordWrapping(true);
			String valueMultiLineEditbox = multiLineEditbox->getText(); // Retrieve the text
 
			/* RadioButton */
			RadioButton* radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_A"));
				radioButton->setGroupID(1);
				radioButton->setID(101);
				radioButton->setSelected(true);
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_B"));
				radioButton->setGroupID(1);
				radioButton->setID(102);
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_C"));
				radioButton->setGroupID(1);
				radioButton->setID(103);
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_1"));
				radioButton->setGroupID(2);
				radioButton->setID(201);
				radioButton->setSelected(true);
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_2"));
				radioButton->setGroupID(2);
				radioButton->setID(202);
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_3"));
				radioButton->setGroupID(2);
				radioButton->setID(203);
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_A")); // Get handle of one radio button from the group
			uint valueRadioButtonLetters = radioButton->getSelectedButtonInGroup()->getID(); // Get selected ID
			radioButton = static_cast<RadioButton*>(winMgr.getWindow("RadioButton_3")); // Can obtain the handle of any radio button in the group
			uint valueRadioButtonNumbers = radioButton->getSelectedButtonInGroup()->getID();
			radioButton->setSelected(true); // Specify which button should appear selected by default
 
			/* Listbox */
			Listbox* listbox = static_cast<Listbox*>(winMgr.getWindow("Listbox"));
			listbox->setMultiselectEnabled(false);
			ListboxTextItem* itemListbox = new ListboxTextItem("Value A", 1);
				itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				listbox->addItem(itemListbox);
			itemListbox = new ListboxTextItem("Value B", 2);
				itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				listbox->addItem(itemListbox);
			itemListbox = new ListboxTextItem("Value C", 3);
				itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				listbox->addItem(itemListbox);
			itemListbox = new ListboxTextItem("Value D", 4);
				itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				listbox->addItem(itemListbox);
			listbox->setItemSelectState(itemListbox, true);
			listbox->ensureItemIsVisible(itemListbox);
			uint valueListbox = listbox->getFirstSelectedItem()->getID(); // Retrieve the ID of the selected listbox item
 
			/* Combobox */
			Combobox* combobox = static_cast<Combobox*>(winMgr.getWindow("Combobox"));
			combobox->setReadOnly(true);
			ListboxTextItem* itemCombobox = new ListboxTextItem("Value 1", 1);
				itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				combobox->addItem(itemCombobox);
			itemCombobox = new ListboxTextItem("Value 2", 2);
				itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				combobox->addItem(itemCombobox);
				itemCombobox->setSelected(true); // Select this item
				combobox->setText(itemCombobox->getText()); // Copy the item's text into the Editbox
			itemCombobox = new ListboxTextItem("Value 3", 3);
				itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				combobox->addItem(itemCombobox);
			itemCombobox = new ListboxTextItem("Value 4", 4);
				itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				combobox->addItem(itemCombobox);
			String valueCombobox = combobox->getText(); // Retrieve the displayed text
			uint idCombobox = combobox->getSelectedItem()->getID(); // Retrieve the ID of the selected combobox item
 
			/* MultiColumnList */
			MultiColumnList* multiColumnList = static_cast<MultiColumnList*>(winMgr.getWindow("MultiColumnList"));\
			multiColumnList->addColumn("Col A", 0, UDim(0.32f, 0));
			multiColumnList->addColumn("Col B", 1, UDim(0.32f, 0));
			multiColumnList->addColumn("Col C", 2, UDim(0.32f, 0));
			multiColumnList->setSelectionMode(MultiColumnList::RowSingle); // MultiColumnList::RowMultiple
			ListboxTextItem* itemMultiColumnList;
			multiColumnList->addRow();
			itemMultiColumnList = new ListboxTextItem("A1", 101);
				itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				multiColumnList->setItem(itemMultiColumnList, 0, 0); // ColumnID, RowID
			itemMultiColumnList = new ListboxTextItem("B1", 102);
				//itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				// By commenting the line above a cell does not specify a selection indicator
				//  selecting that line will show a "gap" in the selection.
				multiColumnList->setItem(itemMultiColumnList, 1, 0); // ColumnID, RowID
			itemMultiColumnList = new ListboxTextItem("C1", 103);
				itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				multiColumnList->setItem(itemMultiColumnList, 2, 0); // ColumnID, RowID
			multiColumnList->addRow();
			itemMultiColumnList = new ListboxTextItem("A2", 201);
				itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				multiColumnList->setItem(itemMultiColumnList, 0, 1); // ColumnID, RowID
			itemMultiColumnList = new ListboxTextItem("B2", 202);
				itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				multiColumnList->setItem(itemMultiColumnList, 1, 1); // ColumnID, RowID
			itemMultiColumnList = new ListboxTextItem("C2", 203);
				itemMultiColumnList->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
				multiColumnList->setItem(itemMultiColumnList, 2, 1); // ColumnID, RowID
			MCLGridRef grid_ref(1, 0); // Select according to a grid reference; second row
			multiColumnList->setItemSelectState(grid_ref, true);
			ListboxItem* listboxItem = multiColumnList->getFirstSelectedItem();
			uint valueColumnA = listboxItem->getID(); // Retrieve the value of the selected item from column A
			listboxItem = multiColumnList->getNextSelected(listboxItem);
			uint valueColumnB = listboxItem->getID(); // Retrieve the value of the selected item from column B
			listboxItem = multiColumnList->getNextSelected(listboxItem);
			uint valueColumnC = listboxItem->getID(); // Retrieve the value of the selected item from column C
 
			/* TabControl */
			TabControl* winTabControl = static_cast<TabControl*>(winMgr.getWindow("TabControl"));
			winTabControl->setTabHeight(UDim(0.15f, 0.0f)); // Make the tab buttons a little bigger
			Window* tabPage = winMgr.getWindow("TabPane1");
				tabPage->setText("Page 1");
				tabPage->setSize(UVector2(UDim(1.0f, 0.0f), UDim(1.0f, 0.0f))); // Size to 100% of its parent, the TabControl
				tabPage->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); // Move to the upper left corner of its parent
				winTabControl->addTab(tabPage);
			tabPage = winMgr.getWindow("TabPane2");
				tabPage->setText("Page 2");
				tabPage->setSize(UVector2(UDim(1.0f, 0.0f), UDim(1.0f, 0.0f))); 
				tabPage->setPosition(UVector2(UDim(0.0f, 0.0f), UDim(0.0f, 0.0f))); 
				winTabControl->addTab(tabPage);
 
		}
		catch(Exception &e)
		{
			#if defined( __WIN32__ ) || defined( _WIN32 )
				MessageBox(NULL, e.getMessage().c_str(), "Error initializing the demo", MB_OK | MB_ICONERROR | MB_TASKMODAL);
			#else
				std::cerr << "Error initializing the demo:" << e.getMessage().c_str() << "\n";
			#endif
		}
 
		return true;
	}
 
    void cleanupSample(void)
	{
	}
};
 
#endif // _WidgetGalore_h_

main.cpp

#if defined( __WIN32__ ) || defined( _WIN32 )
	#define WIN32_LEAN_AND_MEAN
	#define NOMINMAX
	#include "windows.h"
#endif
 
#include "WidgetGalore.h"
 
 
#if defined( __WIN32__ ) || defined( _WIN32 )
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,int nCmdShow)
#else
int main(int argc, char *argv[])
#endif
{
    DemoSample app;
    return app.run();
}


WidgetGalore.layout

<?xml version="1.0" encoding="UTF-8"?>
 
<GUILayout >
    <Window Type="DefaultWindow" Name="Root" >
        <Property Name="Text" >1</Property>
        <Property Name="InheritsAlpha" Value="False" />
        <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
        <Property Name="UnifiedAreaRect" Value="{{0,0},{0,0},{1,0},{1,0}}" />
        <Window Type="DefaultWindow" Name="TabPane2" >
            <Property Name="Font" Value="Commonwealth-10" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="UnifiedAreaRect" Value="{{0.72875,0},{0.7185,0},{0.97875,0},{0.9685,0}}" />
            <Window Type="TaharezLook/StaticText" Name="StaticTextPage2" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >In Page 2:</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.226667,0},{0.415,0},{0.476667,0}}" />
            </Window>
            <Window Type="TaharezLook/Editbox" Name="EditBoxPage2" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="MaxTextLength" Value="1073741823" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.420001,0},{0.22,0},{0.99,0},{0.47,0}}" />
            </Window>
        </Window>
        <Window Type="TaharezLook/FrameWindow" Name="winTabControl" >
            <Property Name="Text" >Tab Control Window</Property>
            <Property Name="TitlebarFont" Value="Commonwealth-10" />
            <Property Name="CaptionColour" Value="00FFFFFF" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="TitlebarEnabled" Value="True" />
            <Property Name="UnifiedAreaRect" Value="{{0.695627,0},{0.2725,0},{0.993122,0},{0.704167,0}}" />
            <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
            <Window Type="TaharezLook/TabControl" Name="TabControl" >
                <Property Name="TabHeight" Value="{0,0}" />
                <Property Name="TabTextPadding" Value="{0,0}" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.088566,0},{0.174378,0},{0.931404,0},{0.804637,0}}" />
            </Window>
            <Window Type="TaharezLook/Button" Name="btnOk" >
                <Property Name="Text" >Ok</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.128412,0},{0.841464,0},{0.365583,0},{0.926003,0}}" />
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
            </Window>
            <Window Type="TaharezLook/Button" Name="btnCancel" >
                <Property Name="Text" >Cancel</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.400429,0},{0.841464,0},{0.637601,0},{0.926003,0}}" />
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
            </Window>
            <Window Type="TaharezLook/Button" Name="btnApply" >
                <Property Name="Text" >Apply</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.668224,0},{0.843977,0},{0.905394,0},{0.928516,0}}" />
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
            </Window>
        </Window>
        <Window Type="DefaultWindow" Name="TabPane1" >
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="ClippedByParent" Value="False" />
            <Property Name="UnifiedAreaRect" Value="{{0.72875,0},{0.012178,0},{0.97875,0},{0.262178,0}}" />
            <Window Type="TaharezLook/StaticText" Name="StaticTextPage1" >
                <Property Name="Text" >In Page 1:</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.06,0},{0.226667,0},{0.415,0},{0.476667,0}}" />
            </Window>
            <Window Type="TaharezLook/Editbox" Name="EditBoxPage1" >
                <Property Name="MaxTextLength" Value="1073741823" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.420001,0},{0.22,0},{0.99,0},{0.47,0}}" />
            </Window>
        </Window>
        <Window Type="TaharezLook/FrameWindow" Name="winWidgets" >
            <Property Name="Text" >Dave, it&apos;s full of widgets!</Property>
            <Property Name="TitlebarFont" Value="Commonwealth-10" />
            <Property Name="CaptionColour" Value="00FFFFFF" />
            <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
            <Property Name="TitlebarEnabled" Value="True" />
            <Property Name="UnifiedAreaRect" Value="{{0.00375,0},{0.143333,0},{0.751248,0},{0.806665,0}}" />
            <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
            <Window Type="TaharezLook/Button" Name="btnClose" >
                <Property Name="Text" >Close</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.732397,0},{0.895137,0},{0.976465,0},{0.975697,0}}" />
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseArrow" />
            </Window>
            <Window Type="TaharezLook/Editbox" Name="Editbox" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="MaxTextLength" Value="1073741823" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.62442,0},{0.090471,0},{0.969776,0},{0.153443,0}}" />
            </Window>
            <Window Type="TaharezLook/Checkbox" Name="Checkbox" >
                <Property Name="Text" >Check</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.396859,0},{0.944201,0},{0.453147,0}}" />
            </Window>
            <Window Type="TaharezLook/Combobox" Name="Combobox" >
                <Property Name="Text" >Combo Box</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.090471,0},{0.613522,0},{0.413287,0}}" />
                <Property Name="MaxEditTextLength" Value="1073741823" />
            </Window>
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_A" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >A</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.652856,0},{0.189876,0},{0.704964,0},{0.246164,0}}" />
            </Window>
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_B" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >B</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.707569,0},{0.189876,0},{0.759678,0},{0.246164,0}}" />
            </Window>
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_C" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >C</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.761542,0},{0.189876,0},{0.813651,0},{0.246164,0}}" />
            </Window>
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_1" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >1</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.189876,0},{0.897272,0},{0.246164,0}}" />
            </Window>
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_2" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >2</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.245152,0},{0.897272,0},{0.30144,0}}" />
            </Window>
            <Window Type="TaharezLook/RadioButton" Name="RadioButton_3" >
                <Property Name="Font" Value="Commonwealth-10" />
                <Property Name="Text" >3</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.300429,0},{0.897272,0},{0.356717,0}}" />
            </Window>
            <Window Type="TaharezLook/HorizontalScrollbar" Name="HorizontalScrollbar" >
                <Property Name="PageSize" Value="0" />
                <Property Name="StepSize" Value="1" />
                <Property Name="OverlapSize" Value="0" />
                <Property Name="DocumentSize" Value="1" />
                <Property Name="ScrollPosition" Value="0" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.185427,0},{0.613522,0},{0.26206,0}}" />
            </Window>
            <Window Type="TaharezLook/VerticalScrollbar" Name="VerticalScrollbar" >
                <Property Name="PageSize" Value="0" />
                <Property Name="StepSize" Value="1" />
                <Property Name="OverlapSize" Value="0" />
                <Property Name="DocumentSize" Value="1" />
                <Property Name="ScrollPosition" Value="0" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.026087,0},{0.090471,0},{0.082106,0},{0.606802,0}}" />
            </Window>
            <Window Type="TaharezLook/Listbox" Name="Listbox" >
                <Property Name="Text" >List Box</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.626634,0},{0.427903,0},{0.876634,0}}" />
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
            </Window>
            <Window Type="TaharezLook/MultiColumnList" Name="MultiColumnList" >
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.271357,0},{0.816779,0},{0.551507,0}}" />
                <Property Name="MouseCursorImage" Value="set:TaharezLook image:MouseTarget" />
            </Window>
            <Window Type="TaharezLook/MultiLineEditbox" Name="MultiLineEditbox" >
                <Property Name="Text" >            
</Property>
                <Property Name="MaxTextLength" Value="1073741823" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.462498,0},{0.626634,0},{0.706566,0},{0.876634,0}}" />
            </Window>
            <Window Type="TaharezLook/ProgressBar" Name="ProgressBar" >
                <Property Name="StepSize" Value="0.01" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="CurrentProgress" Value="0" />
                <Property Name="UnifiedAreaRect" Value="{{0.183835,0},{0.559296,0},{0.816779,0},{0.608291,0}}" />
            </Window>
            <Window Type="TaharezLook/Slider" Name="Slider" >
                <Property Name="CurrentValue" Value="0" />
                <Property Name="MaximumValue" Value="1" />
                <Property Name="ClickStepSize" Value="0.01" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.099415,0},{0.090471,0},{0.155434,0},{0.606802,0}}" />
            </Window>
            <Window Type="TaharezLook/Spinner" Name="Spinner" >
                <Property Name="StepSize" Value="1" />
                <Property Name="CurrentValue" Value="0" />
                <Property Name="MaximumValue" Value="32767" />
                <Property Name="MinimumValue" Value="-32768" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.845164,0},{0.48995,0},{0.944201,0},{0.551507,0}}" />
            </Window>
            <Window Type="TaharezLook/StaticImage" Name="StaticImage" >
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.732397,0},{0.626634,0},{0.976465,0},{0.876634,0}}" />
            </Window>
            <Window Type="TaharezLook/StaticText" Name="StaticText" >
                <Property Name="Text" >Static Text</Property>
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="UnifiedAreaRect" Value="{{0.462498,0},{0.895137,0},{0.706566,0},{0.975697,0}}" />
            </Window>
            <Window Type="TaharezLook/ScrollablePane" Name="ScrollablePane" >
                <Property Name="ContentArea" Value="l:0 t:0 r:0 b:0" />
                <Property Name="HorzStepSize" Value="0.1" />
                <Property Name="VertStepSize" Value="0.1" />
                <Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
                <Property Name="HorzOverlapSize" Value="0.01" />
                <Property Name="UnifiedAreaRect" Value="{{0.019063,0},{0.629399,0},{0.157023,0},{0.879399,0}}" />
                <Property Name="VertOverlapSize" Value="0.01" />
                <Property Name="HorzScrollPosition" Value="0" />
                <Property Name="VertScrollPosition" Value="0" />
            </Window>
        </Window>
    </Window>
</GUILayout>