QuickGUI v0.9.5 Released! Demo available! Skin Updated!

A place to show off your latest screenshots and for people to comment on them. Only start a new thread here if you have some nice images to show off!
Post Reply
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

QuickGUI v0.9.5 Released! Demo available! Skin Updated!

Post by KungFooMasta »

Introducing QuickGUI!

Image

Created Entirely through use of Ogre Overlays, Overlay elements, and materials!

QuickGUI was formed with ideas from BetaGUI and CEGUI:

CEGUI similar user defined event handlers:

Code: Select all

		mCloseButton->addEventHandler(Event::QGUI_EVENT_MOUSE_CLICK,&Window::hide,dynamic_cast<Window*>(mParentWidget));
		mCloseButton->addEventHandler(Event::QGUI_EVENT_MOUSE_BUTTON_UP,&Window::hide,dynamic_cast<Window*>(mParentWidget));
Supports input Injections:

Code: Select all

		bool injectChar(char c);
		bool injectKeyDown(const KeyCode& kc);
		bool injectKeyUp(const KeyCode& kc);
		
		bool injectMouseButtonDown(const MouseButtonID& button);
		bool injectMouseButtonUp(const MouseButtonID& button);
		bool injectMouseLeaves(void);
		bool injectMouseMove(const int& xPixelOffset, const int& yPixelOffset);
		bool injectMousePosition(const int& xPixelPosition, const int& yPixelPosition);
		bool injectMouseWheelChange(float delta);
		void injectTime(Ogre::Real time);
Currently supports the following Widgets:

Button
ComboBox
Image
Label
List
ListItem
Menu
MenuList
NStateButton
Panel
ProgressBar
Sheet
Text
TextBox
TextCursor
TrackBar
Window (with TitleBar)


Other great points about the Library:

Works well with OIS, including automatic hiding of the cursor in DISCL_NONEXCLUSIVE mode. (can be disabled)

Works with joysticks. I have tested this with my Logitech RumblePad 2 and my Wiimote+nunchuck and it works great.

Proper cleanup of all widgets, including ability to clear all GUI. (support for multiple game states)

Library is easy to use and extend.

Licensing
I am not good on licensing, but I want everybody to have the option of using the library for commercial and non commercial use. (Same license as OGRE I guess)

QuickGUI OgreAddons Forum now available!
http://www.ogre3d.org/phpBB2addons/view ... 17a4edec33

Current Release: QuickGUI v0.9.5

Changes since v0.9.4:
- Use of Absolute/Relative/Pixel coordinates to define widget size and position.
- Added QGUI_EVENT_DRAGGED event to Widget Events.
- Added TrackBar Widget. Comes with default skin.
- Transparency Picking of Widgets. (Mouse Over event not fired unless cursor is over a non transparent part of widget apperance)
- Added dll/lib project, to create QuickGUI.dll.
- Disabling/Enabling of widgets. Disabled widgets are not detected, and do not handle any events. Disabled widget have their appearance altered. (can tweak)
- Upgraded Demo to use QuickGUI.dll, and show disabling of widgets, and TrackBar widgets.
- Fixed bug when switching from one Sheet to another.
- Fixed bug when showing a window with hidden titlebar.
- Added ComboBox::removeListItem(index) function.
- Added List::clearList() function.
- Removing widget name from global user created list, on destruction of Widget.

Changes since v0.9.3:
- Reference Name no longer exists. Every widget has the option for the user to specify a name. If a name is not specified, one will be generated for the widget.
- Checks are made to ensure all user given names are unique, for all widgets.
- Widget class stores a list of Child Widgets. All widgets were optimized to make use of this list.
- Widget::getWidgetList function for iterating through a given widget's children list.
- Removal of Plain Window.
- Removal of all FullSizeX widget functions.
- Creation of Sheet Widget. Sheet Widget's are the same size as the screen, and derives from Panel Class. In addition, Sheet Widget creates and manages Windows, instead of GUIManager.
- GUIManager creates, destroys, and manages Sheets. A Sheet is available by default. (DefaultSheet)
- Created and added MenuList widget!
- Added Widget* Widget::getChildWidget(const Ogre::String name); getChildWidget is recursive and checks grandchildren, etc.
- Made changes to ComboBox constructor, it is now smaller. List Width, List Highlight material, can be set after creation. Same applied for MenuList.
- Optimized Widget::timeElapsed function
- Created and added Panel widget! It could use a skin, but is fully functional. Window and Sheet widgets derive from the Panel widget. These 3 widgets are used to create most/all other widgets.
- Skin updates.
- Demo code updated to v0.9.4

Other
- gogoplayer is working on a serializer for sheets using TinyXML. Mostly completed at this time.
- An editor is also planned, but is still in design phases.

Download
http://stormsonggames.com/downloads/QuickGUIv0.9.5.zip

Thanks to OGRE, CEGUI, BetaGUI, and their respective owners, as well as the OGRE community in general. Also thanks to gogoplayer for helping me extend the library, as well as all who have used and/or given useful feedback to make the library better. :)

KungFooMasta
Last edited by KungFooMasta on Sat Jun 23, 2007 11:00 pm, edited 8 times in total.
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Well done indeed! I can see where you got inspired from BetaGUI and CEGUI.

Since I assume your using LGPL as the license, will it be used as a library like CEGUI, or can you copy and paste the code into your application like BetaGUI?

Either way, that makes four GUI libraries for Ogre now - not bad indeed! ;)
User avatar
SpannerMan
Gold Sponsor
Gold Sponsor
Posts: 446
Joined: Fri May 02, 2003 10:05 am
Location: UK
Contact:

Post by SpannerMan »

Hey KungFooMasta, this looks interesting. Will SimpleGUI support a mix of relative and absolute positioning and sizing?
User avatar
nebukadnezzar
Halfling
Posts: 93
Joined: Sun Jun 11, 2006 4:40 pm
Location: Germany
x 1
Contact:

Post by nebukadnezzar »

looking useful so far,
but is it capable of unicode characters?

and i hope you are going to document it better than cegui actually is....
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

can you copy and paste the code into your application like BetaGUI?
This is what I had in mind, I would just give everybody a zip of files and they can drag and drop into their application. :)
Will SimpleGUI support a mix of relative and absolute positioning and sizing?
Under the hood everything is implemented in pixels, but the user works in Relative coordinates. Its not exactly the same as CEGUI where there is a sheet and every widget is a window. Basically you create a window widget, which can have child widgets of any type. If you just wanted a Button on the screen, for example, you would make an Empty Window and tell the window to make a full size button. Windows by default come with a titlebar, close button, menu, and window border, but an Empty Window has nothing but an overlay and blank PanelOverlayElement. (TitleBar, Menu, and Borders can toggle visibility)

As far as sizing, I don't know how I would implement that functionality. Looking at windows on XP for example, you can resize the MyComputer window, and the icons will move around, and add scroll bars, etc. I think at the moment that is too advanced for what I want to accomplish. I do plan to support scaling of windows, similar to WoW, where everything in the window gets bigger, so you can shrink/blow it up easily to match your preference.
is it capable of unicode characters?
I guess not, I haven't done anything advanced on it. Basically I'm following the rules of the TextAreaOverlayElement class, where you call the setFontName and setCaption function to display text. I wouldn't know how to achieve this, my first priority is making a functional GUI that is easy to create and create skins for. Hopefully tonight I will make a default skin and clean up the code so it is user friendly. :)

KungFooMasta
monsharen
Gnoblar
Posts: 14
Joined: Tue Apr 25, 2006 8:24 am

Post by monsharen »

*poke* *poke*

It looks so delicious. Seriously nice. Now, stop reading and lend us the code :wink:

Looking forward for the release. Good work!
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

Sorry for the delay. Kept finding things to work on. :)

Image

I have Update the topic, and labeling this as the SimpleGUI 0.8 release!

Provided is a default skin I slapped together with the help of my brother and a screenshot of WoW buttons. (lol) I would not encourage anybody to use the button images in any commercial applications.

I encourage everybody to give the code a shot and post their experience with the library, so that I/we can make it better. :D

Tips for using SimpleGUI:

Here are some sample methods I used to connect OIS to SimpleGUI.

OIS keyReleased handler

Code: Select all

mGUIManager->injectKeyUp(static_cast<SimpleGUI::KeyCode>(arg.key));
OIS keyPressed handler, injecting input to SimpleGUI:

Code: Select all

	char c = static_cast<char>(arg.text);
	if( isalpha(c) || isdigit(c) || ispunct(c) || isspace(c) ) mGUIManager->injectChar(c);
	mGUIManager->injectKeyDown(static_cast<SimpleGUI::KeyCode>(arg.key));
I call this every frame to sync the OS cursor to the software cursor:

Code: Select all

	const OIS::MouseState ms = mMouse->getMouseState();

	mGUIManager->injectMousePosition(ms.X.abs,ms.Y.abs);
It also helps to hide the OS cursor (works for windows XP):

Code: Select all

void LumeriaApplication::windowFocusChange(Ogre::RenderWindow* rw)
{
	if(mOSCursorShown)
	{
		mOSCursorShown = false;
		ShowCursor(mOSCursorShown);
	}
	else
	{
		mOSCursorShown = true;
		ShowCursor(mOSCursorShown);
	}
}
Creating a *skin* (OGRE materials):

Included in the download is the file SkinTemplate.material, which can be used to create your own skin. The file outlines the following materials:

Code: Select all

material skin.pointer
material skin.window
material skin.window.border
material skin.window.titlebar
material skin.window.titlebar.button
material skin.window.titlebar.button.over
material skin.window.titlebar.button.down
material skin.textbox
material skin.textbox.border
material skin.label
material skin.menu
material skin.button
material skin.button.over
material skin.button.down
Replace the word "skin" with your own skin name, and save the file with a different name (keeping the skin template would probably be useful). By default, each material is set to apply "transparent.png", so nothing will display. This also means that you do not have to define all the materials, you can just leave it as is (although you won't be able to see any widgets using these materials!). Alternatively, you can use the provided sgui skin, as shown in the screenshot. The font and color are not tied to the skin, and can be changed for every widget.

Plans for v0.9:

Widgets:
-NStateButton: (can be used as a checkbox (2 states). Will require 3 materials per state: initial/over/down)
-MenuStrip
-ListItem: needed to make the Menu and MenuStrip widgets useful

Other:
-TextBox Cursor: setting text cursor position via mouse, deleting at position, backspace at position (may need to inject time into SimpleGUI, aka calling "update" every frame)
-Handling situation when input text is longer than TextBox

Help:
Help is welcome, especially with the Other section.
Also post anything that would make the library more convenient or appealing. Although there are limits.. SimpleGUI is not my main hobby project, and I code my GUI via code and not XML scripts.

For Licensing, I haven't added that in, but it is provided without warrany, and can be used for commercial/non-commercial. Basically, it will have the same licensing as Ogre.

Hope to find people using the library! Lets make it a great GUI library, I've already laid down the tracks! :D

KungFooMasta
Last edited by KungFooMasta on Tue May 15, 2007 9:33 am, edited 5 times in total.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

I have made some changes to SimpleGUI and updated the link. If you have downloaded the source prior to this update I recommend you update. I have added a *Text* widget, differentiating this from my previous Label widget. There are also bug fixes that I have made, and a new Label skin (although I should have made it a little transparent).

:?: Can anybody confirm or verify the caption (say "test" is the caption) of a TextAreaOverlayElement with charHeight set to 20 pixels (for example) takes up the same height as a PanelOverlayElement with height of 20 pixels?

According to the screenshot on the previous post, all of my Text Widgets are vertically and horizontally aligned to the center of their parent widgets (button/label/titlebar), but you can see there is some space below each text..

The Text Widget is supposed to maintain the same width/height dimensions as the actual Text dimensions at all times.

KungFooMasta
User avatar
betajaen
OGRE Moderator
OGRE Moderator
Posts: 3447
Joined: Mon Jul 18, 2005 4:15 pm
Location: Wales, UK
x 58
Contact:

Post by betajaen »

Congratulations on making the 4th Ogre GUI :D

After my university work is over, I'll have a little fiddle, and parts of the GUI implementation are better than mine. I'll steal them ;)
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

Image

Image

The above show 2 different *states* in my game, making use of user defined event handlers and calling GUIManager::clearAll and creating the other one. I can go back and forth between the two states faster then I could with CEGUI. :D

Now I just need to implement the equivalent of a checkbox and combobox to be back to where I was using CEGUI. (I'll change the red buttons later :P )

Nobody else has tried the code? :(

Its not as bad as it looks.. that's just programmer art, lol. (and red buttons from WoW)

[edit] Oh yah, about the sizing issue, I believe it to be correct, I had just forgotten about certain font characters like 'g', 'y', 'j', 'p', etc that occur lower than the mid section of the font. Noticed that when I saw my button labels, and they do look centered. [/edit]

KungFooMasta
User avatar
abstractcoder
Gnome
Posts: 336
Joined: Wed Oct 12, 2005 1:50 pm
Location: UK
Contact:

Post by abstractcoder »

Just as soon as I get a moment I am planning on trying out your code :). I am just starting out on a small project to make a simple game with a friend. So it will be nice to have something easier to use than CEGUI :).
Chimelion
Kobold
Posts: 35
Joined: Sun Mar 25, 2007 10:52 am

Post by Chimelion »

@KungFooMasta: I have your code, and have browsed through it, nice, clear style. I plan on testing it out soon, maybe tonight after work. I'll let you know how it goes after I give it a spin.
User avatar
Aladrin
Orc
Posts: 465
Joined: Fri Mar 10, 2006 10:22 pm

Post by Aladrin »

Oooh, those buttons are looking really nice. Good job!
User avatar
milliams
Gremlin
Posts: 172
Joined: Fri Feb 16, 2007 1:47 am
Location: Portsmouth, UK
Contact:

Post by milliams »

It looks great. You're making fantastic progress. I haven't tried the code yet but I'll give it a go later.
Bekas
OGRE Expert User
OGRE Expert User
Posts: 253
Joined: Sat Oct 16, 2004 11:21 pm
x 1

Post by Bekas »

betajaen wrote:Congratulations on making the 4th Ogre GUI :D

After my university work is over, I'll have a little fiddle, and parts of the GUI implementation are better than mine. I'll steal them ;)
Umm, is there a chance that everyone can come together and collaborate for one "OgreGUI" or something ?
Just throwing some ideas around here :)
MOGRE (Managed OGRE) - Advanced .NET wrapper for Ogre
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

I actually wanted to name the library OgreGUI, but Sinbad frowned on it. So I renamed everything to SimpleGUI.

I'd be happy to rename it if enough people like it and Sinbad approves. :D

I'm planning on releasing v0.9 within the next 2-3 days. It will have a lot of improvements, and some new Widgets to work with, and maybe some skin upgrades. (I'm learning Photoshop.. lol. At least people can see how easy it is to make skins)

KungFooMasta
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

Image

Instead of doing anything more with the TextBox Widget, I went ahead and tackled some other widgets. ComboBox is pretty much done, but was a lot of work! Sometime this weekend I'll put out v0.9. :)

KungFooMasta
User avatar
ruichaves
Kobold
Posts: 35
Joined: Sat Dec 16, 2006 8:49 pm
Location: Portugal

Post by ruichaves »

I try to compile your GUI but i have linking problem's with ogre::memorymanager...

I'm using the last ogre version (1.4).

Other thing to ask is this GUI have the possibility to put background image's or create menu's and sub-menu's ??
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

What does the error log say? I haven't done anything out of the ordinary, I'm just using the Ogre 1.4 SDK with no modifications, built in release mode.

I'm working on the Menu's at the moment, hopefully will have it completed soon. Everything is made with Overlay's and Overlay elements, so any type of Ogre material can be used to customize any widget's appearance. :)

KungFooMasta
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Post by Noman »

Looking good!

Just a question - do you plan any way to scriptably control fonts (similar to what I did in BetaGUI) ?
User avatar
ruichaves
Kobold
Posts: 35
Joined: Sat Dec 16, 2006 8:49 pm
Location: Portugal

Post by ruichaves »

Could you give an source example to try the SimpleGUI??

Could you add the background image widget to next release??

And congratulations, you are doing a good job!
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

Noman, it looks useful and you've already provided the code, I just need to figure out how it will fit in.

The map UI you showed me could be done in SimpleGUI by making a window and placing buttons on the window. You'd then have to add eventHandlers for MOUSE_BUTTON_DOWN such that the button size gets larger, and gets size restored for MOUSE_BUTTON_UP.

The only real problem I see is that my Text Widget's height is always the same as the character height. So if the scripts set properties (ie, setCharHeight) without modifying the actual Widget dimensions, alignment won't work properly. In general, if you set properties without going through SimpleGUI, I can't gaurantee everything would work as it should. It would be much better if you could somehow have function calls in the script.

Take this:

Code: Select all

template element TextArea(fire.button.caption) 
{ 
   font_name Cloister 
   char_height 35 
   colour_top 0.56 0.52 0.29 1.0 
   colour_bottom 0.56 0.52 0.29 1.0 
} 

template element TextArea(fire.button.caption.over) 
{ 
   font_name Cloister 
   char_height 35 
   colour_top 1.0 0.0 0.2 1.0 
   colour_bottom 1.0 0.0 0.2 1.0 
} 

template element TextArea(fire.button.caption.active) 
{ 
   font_name Cloister 
   char_height 50 
   colour_top 1.0 0.0 0.2 1.0 
   colour_bottom 1.0 0.0 0.2 1.0 
}
And make it into something like this: (Note the relative coords for font height)

Code: Select all

template element TextArea(fire.button) 
{ 
   setFont Cloister 
   setCharacterHeight 0.0583  
   setTextColorTop 0.56 0.52 0.29 1.0  
   setTextColorBot 0.56 0.52 0.29 1.0  
} 

template element TextArea(fire.button.MOUSE_ENTER) 
{ 
   setFont Cloister  
   setCharacterHeight 0.0583  
   setTextColor 1.0 0.0 0.2 1.0  
} 

template element TextArea(fire.button.MOUSE_BUTTON_DOWN) 
{ 
   setFont Cloister  
   setCharacterHeight 0.083  
   setTextColor 1.0 0.0 0.2 1.0  
}
I don't know how to accomplish this, but I could look into it. If all the calls are functions suported by SimpleGUI, then everything should work fine. I'm not sure about overlay scripts, so it would take some time to figure out a solution. Although if you're interested you are definately welcome to implement your original script functionality and see how it works, or try to create scripting the way I outlined. :D

I don't think it will make it into v0.9, since I was planning to release it very soon.

KungFooMasta
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Post by KungFooMasta »

Image

Image

Image

Image

Image

SimpleGUI V0.9 Is released!

(updated to v0.9.2)
http://stormsonggames.com/downloads/Sim ... source.zip

A lot of changes have been made, but unfortunately, I did not keep track of them. Here is what I can remember:

- Widget Event Firing optimized (determining which widget mouse is over, etc.)
- Option for Auto Naming of Widgets.
- Implementing several widgets: NStateButton (checkbox for example), List, ListItem, ComboBox.
- Added some more images for the skin (still haven't replaced red buttons :P )
- Got Menu Widget to a functional state using Lists and ListItems.
- Restructured code for easier Widget Creation.

I have taken down the link for v0.8, v0.9 should be used now.

As for v1.0, I will approach this more slowly, as I want to get back to my main hobby. I have a big list of desired widgets for use in my game, and I will implement them as I need them. If you want to help me out it would be greatly appreciated. Also, please let me know of any problems with the code, or fixes, or suggestions for problems or added convenience, etc. Hopefully more people give SimpleGUI a shot this time. :P

Some things I didn't get around to:
- Working on the TextBox. Implementing a cursor would take some work..
- Allowing List Widget to add on child List Widgets. (Think of Menu's with sub Menu's..)

Planned Widgets for v1.0:
- Finish the Image widget to include Render To Texture (this should be really easy)
- Track Bar
- Progress Bar
- Tool Tip
- Dialogue
- Sub Menu's
- TextBox Cursor

Other:
- Basic Example (Similar to CEGUI/OGRE example)
- Commenting. I'm a little burnt out at the moment, and didn't want to postpone things for commenting. I did a good job commenting v0.8, and although some of the comments were removed when I refactored the code, I'm hoping I named things well enough so people know what a function does. :)

And any bug fixes / suggestions that don't take large sums of time. Noman has a good idea for scripting OverlayElement properties, but I'm not sure how well I can fit it into the library. It would be best to use function calls, rather than modifying the elements directly.

This was the GUI code I used for the screenshot, hopefully its not too scary. A lot of it was testing various things. I'm sure I missed a lot of cases, but if people start using this maybe it will become more robust. Otherwise, I'll have to uncover/investigate/fix as I run across it..

Here is the code:

Code: Select all

void System_GameOptions::createGUI()
{
	mGUIManager->setDefaultFont("Celtic");
	mGUIManager->createMouseCursor(Ogre::Vector2(.05,.05), "sgui.pointer");
	mApplication->syncHardwareToSoftwareMouseCursor();

	SimpleGUI::Button* bVideo = mGUIManager->createEmptyWindow(Ogre::Vector4(0.6,0.05,0.275,0.08))->createFullSizeButton("sgui.button");
	bVideo->setText("Video");
	bVideo->addEventHandler(SimpleGUI::Widget::Event::MOUSE_BUTTON_UP,&System_GameOptions::evtHndlr_showVideoOptions,this);

	_createVideoOptions();

	SimpleGUI::Button* bSound = mGUIManager->createEmptyWindow(Ogre::Vector4(0.65,0.25,0.275,0.08))->createFullSizeButton("sgui.button");
	bSound->setText("Sound");

	SimpleGUI::Button* bGamePlay = mGUIManager->createEmptyWindow(Ogre::Vector4(0.7,0.45,0.275,0.08))->createFullSizeButton("sgui.button");
	bGamePlay->setText("Game Play");

	SimpleGUI::Button* bBonusMaterial = mGUIManager->createEmptyWindow(Ogre::Vector4(0.65,0.65,0.275,0.08))->createFullSizeButton("sgui.button");
	bBonusMaterial->setText("Bonus Material");

	SimpleGUI::Button* mMainMenu= mGUIManager->createEmptyWindow(Ogre::Vector4(0.6,0.85,0.275,0.08))->createFullSizeButton("sgui.button");
	mMainMenu->setText("Main Menu");
	mMainMenu->addEventHandler(SimpleGUI::Widget::Event::MOUSE_BUTTON_UP,&System_GameOptions::evtHndlr_goMainMenu,this);
}

void System_GameOptions::_createVideoOptions()
{
	mVideoOptionsWindow = mGUIManager->createWindow(Ogre::Vector4(0.05,0.1,0.5,0.4),"sgui.window",false);
	mVideoOptionsWindow->setText("Video Options");
	mVideoOptionsWindow->createLabel(Ogre::Vector4(0.025,0.2,0.4,0.15),"sgui.label")->setText("Resolution:");
	mVideoOptionsWindow->createLabel(Ogre::Vector4(0.025,0.4,0.4,0.15),"sgui.label")->setText("Full Screen:");
	SimpleGUI::NStateButton* fullScreenCheckBox = mVideoOptionsWindow->createNStateButton(Ogre::Vector4(0.65,0.4,0.15,0.15));
	fullScreenCheckBox->addState("Unchecked","sgui.button.state1");
	fullScreenCheckBox->addState("Checked","sgui.button.state2");
	SimpleGUI::ComboBox* resolutionList = mVideoOptionsWindow->createComboBox(Ogre::Vector4(0.525,0.2,0.4,0.15),"sgui.combobox","sgui.listitem.highlight");
	resolutionList->addListItem("Item1");
	resolutionList->addListItem("Item2");
	resolutionList->addListItem("Item3");
	resolutionList->setCharacterHeight(0.6);
	resolutionList->removeListItem(1);
	resolutionList->addListItem("Item4");
	resolutionList->addListItem("Item5");
	resolutionList->addListItem("Item6");
	resolutionList->addListItem("Item7");
	//resolutionList->alignListItemText(SimpleGUI::HorizontalAlignment::HA_RIGHT,SimpleGUI::VerticalAlignment::VA_BOTTOM);

	SimpleGUI::Window* menuWindow = mGUIManager->createEmptyWindow(Ogre::Vector4(0,0,1,0.05));
	menuWindow->setZOrder(647);
	SimpleGUI::Menu* menu1 = menuWindow->createFullSizeMenu("sgui.menu");
	
	SimpleGUI::List* fileMenuList = menu1->addMenuList("File",Ogre::Vector4(0.02,0,0.1,1),"sgui.menubutton",0.175,"sgui.menulist","sgui.listitem.highlight");
	SimpleGUI::ListItem* newMenuItem = fileMenuList->addListItem("New");
	SimpleGUI::Image* evilGrinImage = newMenuItem->addImage(Ogre::Vector4(0,0,0.2,1),"evilgrin");
	SimpleGUI::ListItem* openMenuItem = fileMenuList->addListItem("Open");
	SimpleGUI::ListItem* exitMenuItem = fileMenuList->addListItem("Exit");
	exitMenuItem->addEventHandler(SimpleGUI::Widget::Event::MOUSE_BUTTON_DOWN,&System_GameOptions::evtHndlr_goMainMenu,this);

	SimpleGUI::List* editMenuList = menu1->addMenuList("Edit",Ogre::Vector4(0.12,0,0.1,1),"sgui.menubutton",0.125,"sgui.menulist","sgui.listitem.highlight");
	SimpleGUI::ListItem* undoMenuItem = editMenuList->addListItem("Undo");
	SimpleGUI::ListItem* redoMenuItem = editMenuList->addListItem("Redo");
	SimpleGUI::NStateButton* nsb = redoMenuItem->addNStateButton(Ogre::Vector4(0.75,0.05,0.2,0.9));
	nsb->addState("Unchecked","sgui.button.state1");
	nsb->addState("Checked","sgui.button.state2");
	
	//SimpleGUI::TextBox* tb = mGUIManager->createEmptyWindow("textbox window",Ogre::Vector4(0.1,0.7,0.4,0.05))->createFullSizeTextBox("sgui2.textbox");
}
I'm really happy with the code so far. But I'd be happier to see if anybody could successfully use it in their own apps.

KungFooMasta
Last edited by KungFooMasta on Tue May 01, 2007 9:32 am, edited 1 time in total.
User avatar
Noman
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 714
Joined: Mon Jan 31, 2005 7:21 pm
Location: Israel
x 2
Contact:

Post by Noman »

Congrats! Looking good! Both visually and API-wise.

As for my style templates, if I will have the time I will try to do something like that. Haven't looked into ogre's scripting API (if it has one to define custom scripts), perhaps betajean will know?

Also, as for keeping track of your changes, consider using source control if you aren't already. Sites like assembla.com offer free svn hosting even if your project is not open sourced. Simple svn log can tell you what you did between 0.8 and 0.9...
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Post by jacmoe »

Noman wrote:Congrats! Looking good! Both visually and API-wise.
I agree! :)

Would be a good idea to use source control, like SVN, even for a one-person project.
It saves lives.. And wits. :wink:
Noman wrote:Perhaps betajean will know?
It's betajaen, goddamnit! :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Post Reply