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? [message #1663 is a reply to message #1519] |
Sun, 12 March 2006 11:25 |
wilho
Messages: 19 Registered: February 2006
|
Promising Member |
|
|
OK, you convinced me.
class ExpressPane : public Ctrl {
struct SlaveControl {
bool isInSplitter;
Ctrl* slave;
};
Array<Button> closer;
Array<SlaveControl> slaves;
Splitter splitter;
static const int BTN_SPACE = 22;
typedef ExpressPane CLASSNAME;
int btnIndx;
void Toggle(int);
public:
void Add(const char *text, Ctrl& slave);
ExpressPane();
};
ExpressPane::ExpressPane(){
Ctrl::Add(splitter);
splitter.Vert();
}
void ExpressPane::Toggle(int indx){
slaves[indx].isInSplitter = slaves[indx].isInSplitter == true ? false:true;
for(int loopI=slaves.GetCount()-1; loopI>-1; loopI--){
splitter.RemoveChild( slaves[loopI].slave );
if (slaves[loopI].isInSplitter == true){
splitter << *slaves[loopI].slave;
}
}
splitter.RefreshLayout();
}
void ExpressPane::Add(const char *text, Ctrl& slave){
Button* button = new Button;
Callback argCB = callback1(this,Toggle, btnIndx++);
*button <<= argCB;
button->SetLabel(text);
button->HSizePosZ(0, 0).BottomPosZ(BTN_SPACE * (btnIndx-1), BTN_SPACE -2);
splitter.HSizePosZ(0, 0).VSizePosZ(0, BTN_SPACE * btnIndx);
Ctrl::Add(*button);
closer.Add(button);
SlaveControl slvCtrl;
slvCtrl.isInSplitter = false;
slvCtrl.slave = &slave;
slaves.Add(slvCtrl);
}
Thank you, this has ben very...educational
[Updated on: Sun, 12 March 2006 11:26] Report message to a moderator
|
|
|
|
|
Howto create control-collection -control? [SOLVED -good example]
By: wilho on Tue, 07 March 2006 22:45
|
|
|
Re: Howto create control-collection -control?
By: mirek on Tue, 07 March 2006 23:32
|
|
|
Re: Howto create control-collection -control?
By: wilho on Sat, 11 March 2006 18:09
|
|
|
Re: Howto create control-collection -control?
By: mirek on Sat, 11 March 2006 18:43
|
|
|
Re: Howto create control-collection -control?
By: wilho on Sat, 11 March 2006 19:33
|
|
|
Re: Howto create control-collection -control?
By: mirek on Sat, 11 March 2006 20:39
|
|
|
Re: Howto create control-collection -control?
By: wilho on Sun, 12 March 2006 11:25
|
|
|
Re: Howto create control-collection -control?
By: mirek on Sun, 12 March 2006 12:47
|
|
|
Re: Howto create control-collection -control?
By: wilho on Mon, 13 March 2006 20:42
|
|
|
Re: Howto create control-collection -control?
By: mirek on Mon, 13 March 2006 22:04
|
|
|
Re: Howto create control-collection -control?
By: fudadmin on Tue, 14 March 2006 18:05
|
|
|
Re: Howto create control-collection -control?
By: wilho on Tue, 14 March 2006 19:23
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: kbyte on Tue, 07 April 2009 10:53
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: mrjt on Tue, 07 April 2009 12:10
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: kbyte on Tue, 07 April 2009 15:29
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: kbyte on Tue, 07 April 2009 15:36
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: mrjt on Wed, 08 April 2009 10:52
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: kbyte on Wed, 08 April 2009 11:46
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: mrjt on Wed, 08 April 2009 16:05
|
|
|
Re: Howto create control-collection -control? [SOLVED -good example]
By: kbyte on Thu, 09 April 2009 10:26
|
Goto Forum:
Current Time: Fri May 10 07:52:11 CEST 2024
Total time taken to generate the page: 0.02448 seconds
|