CXTButton, more than one style/theme? |
Post Reply |
Author | |
Dimitris
Newbie Joined: 06 February 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
Posted: 06 February 2006 at 3:00am |
Hello,
I am using the CXTButton class for some of the buttons in my app, because I want to have the flat look. Some of these buttons appear in a dialog, and some of them appear in a CFormView derived class, with different background colors. All these buttons have just an icon with transparency on them. I use the SetAlternateColors() function to set the correct colors for the buttons. The problem is, that when the formview appears at the same time as the dialog, the background color of the buttons gets messed up (either in the dialog or the view), and after that they remain messed up. It seems as if when I call SetAlternateColors() the colors affect the theme (which is shared by all CXTButtons), and not the specific buttons. I tried initializing and using different themes, but I keep getting memory errors when the app closes. Any ideas? We are using version 9.5.1 |
|
Dimitris
Newbie Joined: 06 February 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
Nobody's seen this before?
Anybody? |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi, 9.5.1 is quite old version, it used another way to theme buttons...
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Dimitris
Newbie Joined: 06 February 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
So, there is no solution for 9.5.1 other than upgrade?
|
|
rmercer
Groupie Joined: 22 February 2006 Status: Offline Points: 34 |
Post Options
Thanks(0)
|
I'm using 9.81 and have the same problem. If you look at their code you'll understand why it's doing this. When you set the colors it's actually setting them in the theme, and the theme handles painting the button. The end result is if you modify one button it will effect all CXTButtons the next time they repaint. It would be great if you could set the button theme and colors on a per-button basis. |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hello, At least in 9.70 it is possible to set theme for individual buttons. |
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
Barto
Groupie Joined: 27 February 2005 Location: Germany Status: Offline Points: 60 |
Post Options
Thanks(0)
|
class CMyButtonTheme : public CXTButtonTheme friend class CXTButton; m_wButton.SetTheme(new CMyButtonTheme);
|
|
Dimitris
Newbie Joined: 06 February 2006 Status: Offline Points: 6 |
Post Options
Thanks(0)
|
I'm not sure your solution would work Barto, but I think you're right about the way to do it.
I would subclass the CXTButton class rather than CXTButtonTheme and create two seperate classes to use two different themes. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |