Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » How to combine two widget-class in the topwindow
Re: How to combine two widget-class in the topwindow [message #2117 is a reply to message #2115] |
Sat, 01 April 2006 19:56 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
Hello,
One more question...
I'm working with the designer, then copy and past the code as Fudadmin pointed out. It seems easy. Now I have many labels. They are all passive and show some text. I would like to declare just one label widget like this:
Label label;
and the use 'label' everywhere (I used to do so with another GUI in C). So I believed that the following code:
label.SetLabel(t_("Label 1"));
label.SetAlign(ALIGN_CENTER);
label.LeftPosZ(236, 48);
label.TopPosZ(96, 19);
Add(label);
label.SetLabel(t_("Label 2"));
label.SetAlign(ALIGN_CENTER);
label.LeftPosZ(136, 48);
label.TopPosZ(46, 49);
Add(label);
could show two labels. Instead seems that 'Label 2' override the first one. So at the end I see only 1, the last.
This means that I have to use two separate variables (object):
Label label, label1;
label.SetLabel(t_("Label 1"));
label.SetAlign(ALIGN_CENTER);
label.LeftPosZ(236, 48);
label.TopPosZ(96, 19);
Add(label);
label1.SetLabel(t_("Label 2"));
label1.SetAlign(ALIGN_CENTER);
label1.LeftPosZ(136, 48);
label1.TopPosZ(46, 49);
Add(label1);
and both appear. I would like to know if there is some trick to use the same object or I must in any case declare each object I use.
Thank you
Luigi
|
|
|
|
|
How to combine two widget-class in the topwindow
By: forlano on Thu, 30 March 2006 14:20
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Thu, 30 March 2006 15:06
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Thu, 30 March 2006 22:04
|
|
|
Re: How to combine two widget-class in the topwindow
By: mirek on Thu, 30 March 2006 22:17
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Fri, 31 March 2006 19:17
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Fri, 31 March 2006 23:14
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Fri, 31 March 2006 23:40
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Fri, 31 March 2006 23:52
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Sat, 01 April 2006 12:34
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Sat, 01 April 2006 14:31
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Sat, 01 April 2006 15:24
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Sat, 01 April 2006 17:40
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Sat, 01 April 2006 19:56
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Sat, 01 April 2006 20:27
|
|
|
Re: How to combine two widget-class in the topwindow
By: mirek on Sat, 01 April 2006 20:36
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Sat, 01 April 2006 20:48
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Sat, 01 April 2006 21:03
|
|
|
Re: How to combine two widget-class in the topwindow
By: mirek on Sat, 01 April 2006 21:09
|
|
|
Re: How to combine two widget-class in the topwindow
By: forlano on Sun, 02 April 2006 10:22
|
|
|
Re: How to combine two widget-class in the topwindow
By: fudadmin on Sun, 02 April 2006 12:39
|
Goto Forum:
Current Time: Mon May 13 16:39:02 CEST 2024
Total time taken to generate the page: 0.03092 seconds
|