Noob has a few questions

Spookey

27-07-2009 22:08:18

Hi guys,

Great work on MyGUI, it is the cleanest gui app I have worked with when it comes to using Ogre. I have a few questions about a few of the controls because they work in the LE when testing, but not in my app I know it must be something I am doing. They do show up, but some of the functionality is gone. Does this have anything to do with what layer they are on?

On the game options window, there is a tab control, but changing the tab doesn't work. Also none of the combo boxes drop down on mouse click.

Also one last thing, how do I access the close button "X" on the WindowCSX control?

Loading layout files
MyGUI::LayoutManager::getInstance().load("coths_game_options.layout");
MyGUI::LayoutManager::getInstance().load("coths_video_options.layout");
MyGUI::LayoutManager::getInstance().load("coths_audio_options.layout");


coths_game_options.layout
<MyGUI type="Layout">
<Widget type="Window" skin="WindowCS" position="456 128 400 450" layer="Modal" name="wnd_GameOptions">
<Property key="Widget_Caption" value="Game Otions"/>
<Property key="Window_AutoAlpha" value="false"/>
<Property key="Widget_Enabled" value="true"/>
<Property key="Window_MinSize" value="400 450"/>
<Property key="Window_MaxSize" value="400 450"/>
<Property key="Widget_Visible" value="false"/>
<Property key="Widget_NeedMouse" value="true"/>
<Widget type="Tab" skin="Tab" position="8 0 384 360" name="tbp_GameOptions">
<Property key="Widget_Caption" value="General"/>
<Widget type="TabItem" skin="Default" position="4 26 375 328">
<Property key="Widget_Caption" value="General"/>
<Property key="Sheet_Select" value="true"/>
<Widget type="ComboBox" skin="ComboBox" position="248 8 128 26">
<Property key="ComboBox_AddItem" value="1"/>
<Property key="ComboBox_AddItem" value="2"/>
<Property key="ComboBox_AddItem" value="3"/>
<Property key="ComboBox_AddItem" value="4"/>
<Property key="ComboBox_AddItem" value="5"/>
<Property key="ComboBox_AddItem" value="6"/>
<Property key="ComboBox_AddItem" value="7"/>
<Property key="ComboBox_AddItem" value="8"/>
<Property key="ComboBox_AddItem" value="9"/>
<Property key="ComboBox_AddItem" value="10"/>
<Property key="Widget_NeedKey" value="false"/>
<Property key="Widget_NeedMouse" value="true"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="32 8 224 24">
<Property key="Widget_Caption" value="Chat lines on screen"/>
</Widget>
<Widget type="ComboBox" skin="ComboBox" position="248 48 128 26">
<Property key="ComboBox_AddItem" value="Small"/>
<Property key="ComboBox_AddItem" value="Medium"/>
<Property key="ComboBox_AddItem" value="Large"/>
<Property key="Widget_NeedKey" value="false"/>
<Property key="Widget_NeedMouse" value="true"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="32 48 144 16">
<Property key="Widget_Caption" value="Chat Size"/>
</Widget>
</Widget>
<Widget type="TabItem" skin="Default" position="4 26 375 328">
<Property key="Widget_Caption" value="Hot Keys"/>
<Widget type="Edit" skin="Edit" position="376 8 48 26" name="tbx_HK001"/>
<Widget type="StaticText" skin="StaticText" position="8 8 368 24">
<Property key="Widget_Caption" value="Toggle Map"/>
</Widget>
</Widget>
</Widget>
<Widget type="Button" skin="Button" position="296 376 77 25" layer="Back" name="btn_CancelGameOptions">
<Property key="Widget_Caption" value="Cancel"/>
</Widget>
</Widget>
</MyGUI>


coths_audio_options.layout
<MyGUI type="Layout">
<Widget type="Window" skin="WindowCS" position="432 152 400 450" layer="Modal" name="wnd_AudioOptions">
<Property key="Widget_Caption" value="Audio Options"/>
<Property key="Window_MinSize" value="400 450"/>
<Property key="Window_MaxSize" value="400 450"/>
<Property key="Widget_Visible" value="false"/>
<Widget type="StaticText" skin="StaticText" position="16 16 176 24">
<Property key="Widget_Caption" value="Main Volume"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="16 48 176 24">
<Property key="Widget_Caption" value="FX Volume"/>
</Widget>
<Widget type="Button" skin="Button" position="296 376 88 26" name="btn_Cancel_AO">
<Property key="Widget_Caption" value="Cancel"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="16 80 208 24">
<Property key="Widget_Caption" value="Speech Volume"/>
</Widget>
<Widget type="HScroll" skin="HSlider" position="144 16 240 15" name="sld_MainVolume">
<Property key="Scroll_Position" value="50"/>
<Property key="Scroll_Range" value="100"/>
</Widget>
<Widget type="HScroll" skin="HSlider" position="144 48 240 15" name="sld_FXVolume">
<Property key="Scroll_Range" value="100"/>
<Property key="Scroll_Position" value="50"/>
</Widget>
<Widget type="HScroll" skin="HSlider" position="144 80 240 15" name="sld_SpeechVolume">
<Property key="Scroll_Range" value="100"/>
<Property key="Scroll_Position" value="50"/>
</Widget>
</Widget>
</MyGUI>


coths_video_options.layout
<MyGUI type="Layout">
<Widget type="Window" skin="WindowCS" position="432 152 400 450" layer="Modal" name="wnd_VideoOptions">
<Property key="Widget_Caption" value="Video Options"/>
<Property key="Widget_Visible" value="false"/>
<Widget type="StaticText" skin="StaticText" position="16 16 176 24" layer="Back">
<Property key="Widget_Caption" value="Resolution"/>
</Widget>
<Widget type="ComboBox" skin="ComboBox" position="192 16 192 26" name="cbx_Resolution">
<Property key="ComboBox_ModeDrop" value="true"/>
<Property key="ComboBox_AddItem" value="800 x 600"/>
<Property key="ComboBox_AddItem" value="1024 x 768"/>
<Property key="ComboBox_AddItem" value="1280 x 800"/>
</Widget>
<Widget type="StaticText" skin="StaticText" position="16 48 176 24">
<Property key="Widget_Caption" value="Detail Level"/>
</Widget>
<Widget type="ComboBox" skin="ComboBox" position="192 48 192 26" name="cbx_VideoDetail">
<Property key="ComboBox_AddItem" value="Low"/>
<Property key="ComboBox_AddItem" value="Medium"/>
<Property key="ComboBox_AddItem" value="High"/>
<Property key="ComboBox_ModeDrop" value="true"/>
</Widget>
<Widget type="Button" skin="Button" position="240 376 144 26" name="btn_Cancel_VO">
<Property key="Widget_Caption" value="Cancel"/>
</Widget>
</Widget>
</MyGUI>



Thanks a lot,

Tom

my.name

27-07-2009 23:10:34

>> Also one last thing, how do I access the close button "X" on the WindowCSX control?

/** Event : Window button pressed.\n
signature : void method(MyGUI::WindowPtr _sender, const std::string& _name)
@param _sender widget that called this event
@param _name of pressed button
*/
EventPair<EventHandle_WidgetString, EventHandle_WindowPtrCStringRef> eventWindowButtonPressed;


example

void notifyWindowButtonPressed(MyGUI::WindowPtr _sender, const std::string& _name)
{
if (_name == "close")
// action
}

Spookey

27-07-2009 23:50:41

Thanks for that my.name. I try to read through the documents, but after a while the Doxygen output makes my eyes cross. :shock:

Tom