Plan for justin`dujardin
by Justin DuJardin · 05/19/2005 (2:52 pm) · 13 comments
So I'm off to Oregon on the 25th and I've officially shut down operations at home, and after the painful task of returning my cable modem to Comcast it dawns on me that I've posted no .PLAN in forever. Well I don't get on the road until tommorow, so I figured why not run up to the school and spend a few moments posting a small update on what I've been working on?
Well, I've been working on a many things lately, mostly involving laying around in the sun doing a bunch of nothing. However, as always I found some time during my mini-summer to hack up some TGE stuff!
Firstly, I've been wanting to, for a few months now, write a tab book control that would allow pages such as the infamous options_Dlg GUI to be edited, created, and polished in a shorter amount of time. That is to say, I wanted to make a tab control that wasup to snuff with thatof Microsoft Windows and the likes!
If you're not quite sure what I mean by a Tab control, it is simply a set of dialog pages that are ordered from front to back, with only the topmost page being visible to the end user. There are then tabs above these pages that allow easy navigation between them, allowing you to fit enormous amounts of information effectively into a very small area. But enough about all of that, let's see what we've been able to come up with!
First of all, since I know howyou all just LOVE screenshots, here's a screen shot of the control in use on a fresh TGE 1.4 CVS checkout (minus the demo gui main screen). Keep in mind though, this control is still in the very early stagesof development and so it does not have a textured look to it yet, it's simply a bunch of filled rectangles of color. Full skinned support will be added at a later point. If that's not enough for you, check out the control and all of its tricks in action at the bottom of this .PLAN (Video).

Design
Now from concept to design to implementation there was only a one day span of time, so there are still a few features lacking that need to be implemented, so let's take a look at what I want out of this control, and what I've been able to get done thus far.
* Navigatable Interface from within the GUI editor (switching pages) for quicker development of tab book sets - DONE
* Tab positioning to the order of ( Tabs on - Top, Bottom, Left, Right ) - DONE
* Rotated text for left/right aligned positioning of tabs
* Auto sizing/repositioning of child pages added to book (no guess work or aligning - DONE
* Child control awareness - Knows when a child is added or deleted - DONE
* Right click context menu in design time with options to ( Delete/Add/Move Forward/Back in order ) for page manipulation
* Easily skinnable implementation for maximum customization of look and feel for any game
These are a few of the main things I would like to get into this control, and I've gotten around to a decent portion of it already, however I am out of time, so the rest will have to be done at a later time.
Implementation
To accomplish what I want this control to do, I had to do not only development on the control itself, but for the more dynamic interaction I had to make changes to the GuiEditor control and the base GuiControl class to add support functions to make the control more aware of the engine and its childrens states.
GuiControl - Base Class
In the GuiControl base class I added a two new things, the ability for a control to tell if it is in design time or run time (whether the gui editor is opened or not), and Notifications about child events. The child events added were onChildAdded and onChildRemoved, which passes a GuiControl * named child to each of the functions.
GuiEdit - GUI Editor Class
In the GuiEdit class I added a link to the base class design time switching on and off when it awakens and sleeps in order to accomodate the GuiControl base classes code that checks the designtime state. I also added support for passing mouse events to controls while the editor is open. Normally mouse events are not passed to controls while the editor is open because you don't want buttons being clicked and their script being executed when you're just trying to move a button 2 pixels left to align it with the button above it! Keeping this in mind, I wanted to make sure that by default no controls inherite mouse events while in design time, it is only at option that controls receive these events (such as my tabcontrol switching pages while in design time - see below video)
GuiTabBookCtrl - Container control for holding tab pages
This base class contains any number of GuiTabPageCtrl's and orders them appropriately so that only the topmost is rendered and visible. It does not accept children of other control types by default and does some checking of it's own via the new onChildAdded/onChildRemoved notification callbacks to handle accidental creation of non-conforming child controls where they should not be.
GuiTabPageCtrl - Child class, based very loosely on GuiWindowCtrl, contained by GuiTabBookCtrl
This class is the 'page' class for the control, you add these to the base class and they serve as the different pages to create your GUI's on. They are switchable while the editor is open for easy navigation when designing GUI's in the editor.
---
The Spoils!
After all of that typing, I am wiped, so I can just imagine how you must be feeling if you wasted 3 minutes of your life reading it! I jest of course, the work was well worth it as I now have a mostly functional tab cook control set that is easier to work with than I ever could have imagined it would be! Feel free to check it out in action below.
That's all for now, hopefully I'll be able to get it finished while traveling before the 25th when I arrive at GG as free slave labor!
Tab Book Set In Action
Well, I've been working on a many things lately, mostly involving laying around in the sun doing a bunch of nothing. However, as always I found some time during my mini-summer to hack up some TGE stuff!
Firstly, I've been wanting to, for a few months now, write a tab book control that would allow pages such as the infamous options_Dlg GUI to be edited, created, and polished in a shorter amount of time. That is to say, I wanted to make a tab control that wasup to snuff with thatof Microsoft Windows and the likes!
If you're not quite sure what I mean by a Tab control, it is simply a set of dialog pages that are ordered from front to back, with only the topmost page being visible to the end user. There are then tabs above these pages that allow easy navigation between them, allowing you to fit enormous amounts of information effectively into a very small area. But enough about all of that, let's see what we've been able to come up with!
First of all, since I know howyou all just LOVE screenshots, here's a screen shot of the control in use on a fresh TGE 1.4 CVS checkout (minus the demo gui main screen). Keep in mind though, this control is still in the very early stagesof development and so it does not have a textured look to it yet, it's simply a bunch of filled rectangles of color. Full skinned support will be added at a later point. If that's not enough for you, check out the control and all of its tricks in action at the bottom of this .PLAN (Video).

Design
Now from concept to design to implementation there was only a one day span of time, so there are still a few features lacking that need to be implemented, so let's take a look at what I want out of this control, and what I've been able to get done thus far.
* Navigatable Interface from within the GUI editor (switching pages) for quicker development of tab book sets - DONE
* Tab positioning to the order of ( Tabs on - Top, Bottom, Left, Right ) - DONE
* Rotated text for left/right aligned positioning of tabs
* Auto sizing/repositioning of child pages added to book (no guess work or aligning - DONE
* Child control awareness - Knows when a child is added or deleted - DONE
* Right click context menu in design time with options to ( Delete/Add/Move Forward/Back in order ) for page manipulation
* Easily skinnable implementation for maximum customization of look and feel for any game
These are a few of the main things I would like to get into this control, and I've gotten around to a decent portion of it already, however I am out of time, so the rest will have to be done at a later time.
Implementation
To accomplish what I want this control to do, I had to do not only development on the control itself, but for the more dynamic interaction I had to make changes to the GuiEditor control and the base GuiControl class to add support functions to make the control more aware of the engine and its childrens states.
GuiControl - Base Class
In the GuiControl base class I added a two new things, the ability for a control to tell if it is in design time or run time (whether the gui editor is opened or not), and Notifications about child events. The child events added were onChildAdded and onChildRemoved, which passes a GuiControl * named child to each of the functions.
GuiEdit - GUI Editor Class
In the GuiEdit class I added a link to the base class design time switching on and off when it awakens and sleeps in order to accomodate the GuiControl base classes code that checks the designtime state. I also added support for passing mouse events to controls while the editor is open. Normally mouse events are not passed to controls while the editor is open because you don't want buttons being clicked and their script being executed when you're just trying to move a button 2 pixels left to align it with the button above it! Keeping this in mind, I wanted to make sure that by default no controls inherite mouse events while in design time, it is only at option that controls receive these events (such as my tabcontrol switching pages while in design time - see below video)
GuiTabBookCtrl - Container control for holding tab pages
This base class contains any number of GuiTabPageCtrl's and orders them appropriately so that only the topmost is rendered and visible. It does not accept children of other control types by default and does some checking of it's own via the new onChildAdded/onChildRemoved notification callbacks to handle accidental creation of non-conforming child controls where they should not be.
GuiTabPageCtrl - Child class, based very loosely on GuiWindowCtrl, contained by GuiTabBookCtrl
This class is the 'page' class for the control, you add these to the base class and they serve as the different pages to create your GUI's on. They are switchable while the editor is open for easy navigation when designing GUI's in the editor.
---
The Spoils!
After all of that typing, I am wiped, so I can just imagine how you must be feeling if you wasted 3 minutes of your life reading it! I jest of course, the work was well worth it as I now have a mostly functional tab cook control set that is easier to work with than I ever could have imagined it would be! Feel free to check it out in action below.
That's all for now, hopefully I'll be able to get it finished while traveling before the 25th when I arrive at GG as free slave labor!
Tab Book Set In Action
#2
05/19/2005 (3:12 pm)
Awesome, this was a guiControl I felt sorely missing.
#3
05/19/2005 (4:41 pm)
whoa that's pretty cool :-)
#4
I look forward to seeing this when it is finished.
Robert
05/19/2005 (8:00 pm)
I was going to embark on creating a tab control this summer, but I guess I don't really *need* to now, ;).I look forward to seeing this when it is finished.
Robert
#5
05/19/2005 (11:28 pm)
Very nice, I've actually just run into the need for this in my project.
#6
Nick
05/19/2005 (11:57 pm)
Very nice! Recently I was trying to create a tabbed control for an in-game GUI out of options_Dlg GUI and it was a pain. This is a great help!Nick
#7
I have a very similar Tab control working at my end but without all the fancy GUI Editor stuff. Good job!
If you'd like some code to rotate the text inside of your left and right tabs, let me know. It was surprisingly easy to add this to the TGE, even if it means a bunch of duplicated code. :o)
- LightWave Dave
05/20/2005 (10:02 am)
Greetings!I have a very similar Tab control working at my end but without all the fancy GUI Editor stuff. Good job!
If you'd like some code to rotate the text inside of your left and right tabs, let me know. It was surprisingly easy to add this to the TGE, even if it means a bunch of duplicated code. :o)
- LightWave Dave
#8
05/20/2005 (12:11 pm)
Awesome stuff. Let's talk about this when you arrive, wanna get it into HEAD! :)
#9
05/21/2005 (11:29 am)
You rock Justin! See ya in a few days here.
#10
Look forward to hearing back from you!
Oh and as an update, the control is almost done, just got done putting a pretty face on it and allowing tab rotation so you can specify vertically rotated tabs or horizontally rotated on any side of the control. Also, did some nifty hacking so that it will handle controls that are accidentally added to the tab book control that are meant for the child page controls- i am terrible at adding new controls so this helps me out alot!
05/23/2005 (12:56 pm)
@David - Shot you an email about the rendering code for rotated text. It really does hurt being such a gl newbie at times :(Look forward to hearing back from you!
Oh and as an update, the control is almost done, just got done putting a pretty face on it and allowing tab rotation so you can specify vertically rotated tabs or horizontally rotated on any side of the control. Also, did some nifty hacking so that it will handle controls that are accidentally added to the tab book control that are meant for the child page controls- i am terrible at adding new controls so this helps me out alot!
#11
07/17/2005 (7:48 pm)
did this ever get into the head?
#12
also could someone upload the video again the link is broken.
http://img127.imageshack.us/my.php?image=guitabpagerv5.png
http://img90.imageshack.us/my.php?image=guitabbookyu0.png
03/02/2007 (6:52 pm)
i don't understand this...i try using this gui (TabBook and TabPage) i either get a blank or a white gui...what is going on also could someone upload the video again the link is broken.
http://img127.imageshack.us/my.php?image=guitabpagerv5.png
http://img90.imageshack.us/my.php?image=guitabbookyu0.png
#13
The gui elements that get affected by this are usually the *first child* element inside a *panel* on a *tab page*. The second, third, ... have always (to my knowledge) been unaffected. Also elements that are parented directly to the tab page seem unaffected.
12/15/2007 (7:03 am)
I'm using TGE 1.5.2 and I get an ugly bug when the tabs (buttons not pages) wrap to the second line. When the tabs wrap, gui elements nested inside the tabbook on some pages will have their positions/sizes messed up. Sometimes the elements will expand to fill their container, other times they will just inherit strange values as their positions/sizes.The gui elements that get affected by this are usually the *first child* element inside a *panel* on a *tab page*. The second, third, ... have always (to my knowledge) been unaffected. Also elements that are parented directly to the tab page seem unaffected.

Torque 3D Owner Matthew Langley
Torque