menusystem and listbox changes

Discussion regarding the development of CEGUI itself - as opposed to questions about CEGUI usage that should be in the help forums.

Moderators: CEGUI MVP, CEGUI Team

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

menusystem and listbox changes

Postby lindquist » Fri Apr 01, 2005 11:44

Hi all my fellow CEGUI coders.

As I have said in a few other posts, I'm working on a menu system for CEGUI.
I have used the Roadmap to guide me, and thus I done the following:

- Made the ItemEntry class and a few subclasses: TextItem, MenubarItem currently. The only difference between a DefaultWindow and a TextItem is that the latter has a textColour and prints a text label.
MenubarItem has pushed,hover etc. states...

- Made a ItemListBase class that has the basic features for manipulating a list of item widgets.
wnd->addItem() should be used to add ItemEntry child windows.

- Derived a Menubar and PopupMenu from the ItemListBase to handle the actual menu windows.


Currently I have left the Listbox as it is, and I will only start on it when the menusystem is done. I have taken measures to make it fairly easy to convert to the ItemListBase/ItemEntry implementation. And most function names/behavior has not changed for compatibility.

I'm starting with WindowsLook, and will do taharez when it's all done.

Right now only the Menubar works, but It's almost done.
Items work too. I have just started the PopupMenu.

So... I just wanted to hear if anyone have had any thoughts about the menusystem. Things are going faster now as most of the boring code is over, so I'd really like some feedback.

heres a little screenshot of the menubar:
Image

Setting it up is very easy. You just set the size of the menubar, and the text on the items. Add the items and everything gets laid out automatically.

I have'nt worked that much on the imagery yet though...

Guest

Re: menusystem and listbox changes

Postby Guest » Fri Apr 01, 2005 12:01

Sounds great. Will it be in cvs soon?
Also, do you plan to modify the layout handler to let users feed menus with items directly from xml?
Congratulations for your work.

--
Chris

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Fri Apr 01, 2005 12:47

I do not have write access to anything but the scriptmodule.
But I will submit a patch (a fairly large patch) soon.

There is still quite a few things that has to be done.
properties are not written yet.. documentation is lagging etc. so don't expect it tomorrow.

With regards to the layouts, that was the plan...

and thanx 8)

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Sun Apr 03, 2005 14:39

Ok... the menusystem is coming along nicely now.

here a little screener for the impatient:
Image

I'm having a little trouble with the automatic resize feature though.
It just wont work i relative mode.
My current workaround is to default the metricsmode to Absolute for the menubar and popupmenu.

Anyone who has the magic key to get relative working ?
I have'nt really worked that much with the coordinate system of CEGUI, or looked at the code yet...

Anyway...
I'd like some ideas for graphics. First windows look.
as said earlier Taharez will come when its done.

Guest

Re: menusystem and listbox changes

Postby Guest » Sun Apr 03, 2005 19:01

Just wanna say that i find your current graphics pretty good. You're really doing great work!

And for the second point, i'm not sure but this may help you :
http://www.cegui.org.uk/api_reference/c ... Windowa137

--
Chris

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Mon Apr 04, 2005 16:34

a little update:

the menu system is now practically done. only minor cleanups etc. remain left.
sub-popups are'nt done yet but all the backing code is there, so it's a minor modification.

To be able to emultate win32 menu's, I had to be able to know if the parent window of a menuitem was either a menubar or a popupmenu.
I needed this to implement the automatic closing/opening (browsing) of popups.

So I have made a new virtual member of CEGUI::Window:

Code: Select all

virtual const String& getEventNamespace(void) const {return EventNamespace;}

to all classes with an EventNamespace.

there are a few issues with this though. fx. I somebody chooses to subclass the menubar and add their own events, the event namespace would change and the menuitems would no longer act as if they were in a menu!

Have I missed some existing functionality for getting the "real" type of a window object?

anyway....
Currently popupmenu's only allow one sub-popup open, while menubar has two modes.

1) only allow one popupmenu open at a time.
you click a menuitem to open the popup. click again to close, or while its open move the mouse-cursor over one of the other items in the same menubar. this will then close the currently open popup and open the one for the menuitem under the cursor instead.
Image

2) allowMultiplePopups.
you click a menuitem to toggle its popupmenu.
multiple popups can be opened at once.
Image

all popups in a chain of popups are closed when an item is clicked.

I'll probably post a patch here in this thread tonight or tomorrow, but I won't post it to the tracker before TaharezLook is done too.

What do you think of the new colours?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Thu Apr 07, 2005 01:07

the patch is a little delayed...
I've been working on a few features, and I really did'nt like the getEventNamespace approach.
But thats fixed now!

I've played around with a little alpha fade in/out feature. Should I include it in the patch or is it something people should customize themselves?

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Fri Apr 08, 2005 15:53

The first step is done, and I have uploaded the patch.
You can find at the tracker.

Still just WindowsLook, but everything I could think of is complete.

Layouts work. adding an ItemEntry as a child adds it as an item.
add a popupmenu as a child to a menuitem attaches the popup to it.

properties are done.

well... check for patch for more ;)

Forget the first few posts. They do not reflect the current system!

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Re: menusystem and listbox changes

Postby _mental_ » Sun Apr 10, 2005 00:02

Cool. I'll review the patch and commit it.

User avatar
_mental_
CEGUI Team (Retired)
Posts: 157
Joined: Wed Jan 12, 2005 12:06
Contact:

Re: menusystem and listbox changes

Postby _mental_ » Wed Apr 13, 2005 02:05

This looks pretty good. I'll commit it this weekend after a little more testing.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Sat Apr 16, 2005 12:50

hi.
good to hear the patch is useful... took a while to code it.

anyway, just to let you know, I'll resume work on TaharezLook and further Listbox changes once it is in CVS.

I've just had a nice little week off C++... (insted PHP took my time) so now I'm fresh for another round :)

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Fri May 20, 2005 16:54

I just realized that I have been given write access to cegui CVS module (not just the scripting module)

So expect to see this in CVS soon

UPDATE: This has now been committed. So in about 24 hours it should become available in anonymous CVS.

I'll resume work now, and I would love some feedback.

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Sun May 22, 2005 17:48

There are no breaking changes in the code.

The WindowsLook titlebar imagery has been updated to avoid some scaling issues though, so you will need to update your imageset

User avatar
spannerman
Home away from home
Home away from home
Posts: 330
Joined: Wed Jan 12, 2005 12:06

Re: menusystem and listbox changes

Postby spannerman » Sun May 22, 2005 22:13

Just wanted to say that this is looking great, youve done a very good job. Hopefully I'll get chance to test this soon - a menu is very useful widget to have!

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: menusystem and listbox changes

Postby lindquist » Mon May 23, 2005 12:59

thanx spannerman :)

I just realized I forgot the makefiles though.

I have updated the MSVC7.1 project files, as that is the only 'platform' I have access to.

I'll take a look at the other 'makefiles' today (probably edit them by hand), but I can't test them though...

for anyone interested, the new files (both .h and .cpp variants) are:

Code: Select all

elements/CEGUIItemEntry.x
elements/CEGUIItemListBase.x
elements/CEGUIItemListBaseProperties.x
elements/CEGUIMenubar.x
elements/CEGUIMenuBase.x
elements/CEGUIMenuBaseProperties.x
elements/CEGUIMenuItem.x
elements/CEGUIMenuItemProperties.x
elements/CEGUIPopupMenu.x
elements/CEGUIPopupMenuProperties.x
elements/CEGUITextItem.x
elements/CEGUITextItemProperties.x

WindowsLook:
WLMenubar.x
WLMenuItem.x
WLPopupMenu.x
WLTextItem.x


Return to “CEGUI Library Development Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests