Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Look and Chameleon Technology » Styles and Widgets
Re: Styles and Widgets [message #9121 is a reply to message #8498] Wed, 18 April 2007 11:24 Go to previous messageGo to previous message
WebChaot is currently offline  WebChaot
Messages: 53
Registered: September 2006
Location: Austria, Vienna
Member
Hi Mirek!

>>> Ah. Well, there are better solution to this. See DynamicDlg example. In nutshell, you can create widgets in container, e.g. ArrayMap. GUI never owns widgets, therefore you can still use them in the dialog, but use container to access individual editors.

Project grows every day - I think, you will have a new demo application for your homepage in about one month. I understand DynamicDlg now and it works fine. But two more questions about this topic:

1. I make "containers" (=ArrayMaps) for each control type (I know, it would be possible to store all ctrls in one arraymap). That works fine. But I need a similar solution for menu items and toolbuttons. At the moment I store all related data in an array and on every change in menu I recreate the whole menu from that array: menu.Clear() and the step through the array and add each item (and this recursive). Is there an easier way - e.g. to store the menu items in an arraymap and delete them via .find() method directly (but what with clients)? Concerning this topic here is the second question:

2. Menus are build in tree structure. I would need that too for my gui-elements. I have to know, which elements are on which parent (e.g. nested staticrects, ...). In ArrayMap I can only store an "Id" and the control. Nice to find and get value or delete. But for my application I need a way to get all child values of the edit fields on an specific parent element.

For exampe: I have 2 Frames, a splitter - on right frame 2 nested staticrects - and in the inner one two edit fields. I would need now a function with the parameter "parent" which reads all edit fields which are on these parent at runtime. Should also work with parent of the second staticrect and with whole window (which reads all edit fields of the window).

I hope, you know what I mean.

How I would do that now:

Make structs for each edit element - with "ParentId" and the type of element.

For each of that structs an arraymap where I can find the elements via "Id" and then step recursive over the array and look for children ("ParentId" = "Id"). But this sounds a little bit exhausting to me, because I have to read the whole array many times recursively to parse the structure. Same when deleting some element and have to do that with all children before.

I'm sure, there is a better solution, but I dont know it yet Smile

Would be nice, if you have some ideas about this topic.

Or in short form: What I need to do is completely create a window dynamically by code (via xml-like file). It must be possible to remove some elements (with all children on this element - also menu item) and then read all values of edit elements on an specific parent (from topwindow down to last level).

All the examples contains add() - but didn'n find any remove or step over all elements example Wink

Thanks in advance,

WebChaot.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MenuItem Chameleon bug report & question
Next Topic: OS X Aqua look and feel?
Goto Forum:
  


Current Time: Tue May 07 12:53:45 CEST 2024

Total time taken to generate the page: 0.01883 seconds