Home » Community » Newbie corner » Field for misc. control information?
Field for misc. control information? [message #37433] |
Wed, 03 October 2012 22:57 |
Mircode
Messages: 17 Registered: September 2012
|
Promising Member |
|
|
Hi there!
I would like to know if there is a field for userspecific information about a control.
In my case: I want to have a button with a certain default style. Then this button gets highlighted, using another style. Afterwards I want it to have its normal style again. So before I change the style, I want to store a pointer to the standard style somewhere in the button, like:
But.UserData=&normalStyle;
or
But.Misc=&normalStyle;
Is there a field reserved for arbitrary purposes like this?
Greetings!
|
|
|
Re: Field for misc. control information? [message #37434 is a reply to message #37433] |
Thu, 04 October 2012 07:30 |
|
Hi Mirko
Mircode wrote on Wed, 03 October 2012 22:57 | But.UserData=&normalStyle;
or
But.Misc=&normalStyle;
Is there a field reserved for arbitrary purposes like this?
Greetings!
|
Short answer: No, U++ is not a low level plain C library
Longer answer: It can, U++ is highly customizable, so it is very easy to add any fields by inheriting. In your case, you can do something like:class MyButton: public Button {
public:
void * userData;
MyButton() {}
~MyButton() {}
}
However, since you already have the power to add anything, I would highly recommend to avoid the generic solution and use a proper naming and specific fields/methods
Best regards,
Honza
|
|
|
Goto Forum:
Current Time: Sat Apr 27 05:37:24 CEST 2024
Total time taken to generate the page: 0.87528 seconds
|