Let me explain the example:
First I set the plugin variables:
Resources paths: Media/Demos/Demo_Themes;Media/Common/Demos;Media/Common/Themes
The main resource file (with the main theme ): MyGUI_Core.xml
Then the layouts (windows): Wallpaper.layout for the background, HelpPanel.layout for the top left window and Themes.layout for the main window.
All this files are loaded at EditTime and at Runtime to render the layout.
I create a private variable MainLayout which contains the layout of the main window (Themes.layout).
Start of layout
Step 7: I set the textbox called "Text" (described in HelpPanel.layout) with a caption. Then I create my demo window (call "CreateDemo").
CreateDemo function with theme number to load as parameter:
Step 8: First I unload the main window by calling "DestroyDemo".
Step 9 to 11: depending on the value of function parameter, the main theme is changed by a load resource file.
Step 12: I fill the entries of the combo box called "ComboBox" and set the index the same as the input parameter. I also set the ComboBox to be a drop box only with no edit field. Then I tell the ComboBox to react to "On accept" event with a "Set event". Some events have parameters. "On accept" has 2 parameters: sender (widget's name who sent the event) and index (the new selected index in the combo box). These parametes are retrieved using "GetEventParameter(paramNumber).
Step 13: unload Themes.layout
On ComboBox accept
Step 14: I call CreateDemo with event parameter 1 which is the new selected index retrieved by "GetEventParameter(1)".
I hope that will help to understand the demo a bit more
By the way, GetEventParameter is zero-base indexed, shouldn't it be one-base indexed?