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 » Community » Newbie corner » Field for misc. control information?
Field for misc. control information? [message #37433] Wed, 03 October 2012 22:57 Go to next message
Mircode is currently offline  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 Go to previous message
dolik.rce is currently offline  dolik.rce
Messages: 1789
Registered: August 2008
Location: Czech Republic
Ultimate Contributor

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 Smile

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 Wink

Best regards,
Honza
Previous Topic: using namespace Upp; causes errors
Next Topic: FLTK [FEATURE REQUEST]
Goto Forum:
  


Current Time: Sat Apr 27 05:37:24 CEST 2024

Total time taken to generate the page: 0.87528 seconds