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 » U++ Widgets - General questions or Mixed problems » more containers of widgets
more containers of widgets [message #8155] Tue, 13 February 2007 02:48 Go to previous message
exolon is currently offline  exolon
Messages: 62
Registered: July 2006
Location: 53'21N 6'18W
Member
Hey guys,

I've been wondering if there are nicer ways of adding widgets to [Parent]Ctrls than specifying an exact position or using H/VSizePos and H/VCenterPos or whatever, or using the layout designer's springs.

The Java Swing (I think) API uses layout managers to determine where a new widget will be added in a container Panel, basically following the useful Strategy design pattern.

So you might have a Panel and decide that it uses the BorderLayout class, and then add items to it specifying north, south, northeast etc. Or you could set it to use some other (default) layout class which just spaces the widgets equally horizontally as you add them.
It's very convenient this way to have panels with subpanels, just like how you'd arrange a webpage with nested tables, each with its own alignment and configuration.

I can't seem to find any way to just Add() a widget to a ParentCtrl and have it 'figure out' a simple heuristic positioning for it, perhaps like this default layout manager in Swing, by spacing widgets horizontally if nothing is specified.
Has this kind of work been done already, or is it purposely avoided in UPP, or is it just too much work at the moment?

It would be so handy to just go...

ParentCtrl pane;
pane.SetLayout(Ctrl.LAYOUT_TOPDOWN);

ParentCtrl topSubPane;
ParentCtrl bottomSubPane;

topSubPane.Add(mickeyMouseDrawing);
bottomSubPane.Add(button1).Add(button2).Add(button3);


It would mean creating and reorganising forms/etc would be much faster and potentially more flexible.

The reason I've discounted the layout manager immediately is that it just isn't cut out for dealing with ParentCtrls in ParentCtrls - even if I designed the subpanes separately, widgets which were conceptually related would end up in different classes and they're not visible in the one place.

What do you think?
Oisín
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Update impossible?
Next Topic: Navigating with tab key
Goto Forum:
  


Current Time: Tue Jun 11 14:56:48 CEST 2024

Total time taken to generate the page: 0.02061 seconds