Home » U++ Library support » StatusBar&InfoCtrl » howto add more InfoCtrl's to StatusBar?
Re: howto add more InfoCtrl's to StatusBar? [message #233 is a reply to message #232] |
Sun, 04 December 2005 23:07 |
|
mirek
Messages: 13980 Registered: November 2005
|
Ultimate Member |
|
|
Quote: |
I felt that... but I haven't been successful. What would be the correct way then?
|
#include <CtrlLib/CtrlLib.h>
class MyClassWindow : public TopWindow {
private:
StatusBar status1; //edited: was MyStatusBar
InfoCtrl info2;
public:
typedef MyClassWindow CLASSNAME;
MyClassWindow();
};
MyClassWindow::MyClassWindow()
{
status1.AddFrame(info2.Width(250));
info2="info2: Welcome to the Ultimate++ !";
AddFrame(status1.Height(25));
}
GUI_APP_MAIN
{
MyClassWindow().Title("MyClassWindow1").Zoomable().Sizeable().Run();
MyClassWindow().SetRect(0, 0, 260, 80);
}
Note once again that this is basically the wrong code - I am just demonstrating that in similar situation, creating separate class is not necessarry - and not creating it is better, as you will have to access that "info2" from MyClassWindow anyway.
The lesson to learn is that in U++, class composition does not have to follow GUI hierarchy. It is not uncommon to e.g. have TopWindow as member variable and put "self" into it:
struct Foo : Button {
TopWindow win;
void Perform() { win.Run(); }
Foo() {
win.Add(SizePos());
}
};
[Updated on: Mon, 05 December 2005 11:09] by Moderator Report message to a moderator
|
|
|
|
|
howto add more InfoCtrl's to StatusBar?
By: fudadmin on Sat, 03 December 2005 18:29
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: fudadmin on Sun, 04 December 2005 18:11
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 18:28
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 18:29
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: fudadmin on Sun, 04 December 2005 22:41
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 23:07
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Mon, 05 December 2005 22:51
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: digodigo on Thu, 29 November 2007 15:29
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Tue, 26 February 2008 21:03
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
|
|
|
Re: howto add more InfoCtrl's to StatusBar?
By: mirek on Sun, 04 December 2005 18:25
|
Goto Forum:
Current Time: Thu May 16 06:40:33 CEST 2024
Total time taken to generate the page: 0.02776 seconds
|