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]
Howto create control-collection -control? [SOLVED -good example] [message #1519] Tue, 07 March 2006 22:45 Go to previous message
wilho is currently offline  wilho
Messages: 19
Registered: February 2006
Promising Member
Hi!

Edit: this was a way too hasty question now slowly becoming tutorial it seems Smile I'm creating simple control by combining splitter, button and user defined control. Couple of these SplitterButtons could create something like there's in outlook's left pane. So here's what I got so far:

class SplitterButton : public ParentCtrl{
	Splitter splitter;
	Button button;
	typedef SplitterButton CLASSNAME;
public:
	SplitterButton();
	void Vert(Ctrl&);
	void Toggle();
	void SplitterButton::SetSplitPos(int);
};
SplitterButton::SplitterButton(){
	button <<= THISBACK(Toggle);
	Add(splitter);
}
void SplitterButton::Vert(Ctrl& ctrl){
	splitter.Vert(ctrl, button);
}
void SplitterButton::Toggle(){
	splitter.Zoom(splitter.GetZoom() == 1 ? -1 : 1);		
	//todo:resize code
}
void SplitterButton::SetSplitPos(int newpos){
	splitter.SetPos(newpos);
}


Next thing is to create code for the control to resize itself...I suppose that there's no way link controls position into another one, so I have to move other controls out of the way and back by hand?

If you think this is wrong approach or here's something wrong, feel free to open up. I'll be back.

[Updated on: Sun, 09 April 2006 04:08] by Moderator

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: Sat Apr 27 20:00:42 CEST 2024

Total time taken to generate the page: 0.04318 seconds