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 » Howto create control-collection -control? [SOLVED -good example]
Re: Howto create control-collection -control? [SOLVED -good example] [message #20786 is a reply to message #20782] Tue, 07 April 2009 12:10 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
kbyte wrote on Tue, 07 April 2009 09:53

Any simple app example to show the way how we use this new control?

Alex

It's very easy:
class CtrlLibTest : public WithCtrlLibTestLayout<TopWindow> {
public:
	typedef CtrlLibTest CLASSNAME;	
	WithTestLayout<ParentCtrl> c1, c2;
	ExpressPane pane;

	CtrlLibTest::CtrlLibTest()
	{
		CtrlLayout(*this, "Window title");
		Sizeable();
		CtrlLayout(c1);
		CtrlLayout(c2);
		pane.Add("Child 1", c1);
		pane.Add("Child 2", c2);	
		Add(pane.SizePos());
	}
};

It's basically a Splitter with a set of buttons at the bottom for different Ctrls that can be dynamically added/removed by the user. A nice concept.

My suggestions for improvement:
-Instead of having the buttons in the Splitter put them in a FrameSplitter. This will make your layout simpler and also give you the option of having the buttons on the left, right or top of the ctrl.
-The buttons would look better if you used a ButtonOption, maybe with a custom Style, and no spacing between them. This would also remove the need for the isInSplitter member.
-Inherit from ParentCtrl, not Ctrl.
-I'm not entirely convinced a Splitter is the best way here, Outlook seems to just swap the controls (only having one visible at a time).
-You may also be interested in this package, which is a different approach to a similar problem.

James

[Updated on: Wed, 08 April 2009 10:47]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Help needed to deal with Display
Next Topic: Application crush
Goto Forum:
  


Current Time: Fri May 10 09:33:01 CEST 2024

Total time taken to generate the page: 0.02500 seconds