Home » U++ Library support » U++ Widgets - General questions or Mixed problems » State of "button"
Re: State of "button" [message #15451 is a reply to message #15341] |
Thu, 24 April 2008 13:08   |
cbpporter
Messages: 1427 Registered: September 2007
|
Ultimate Contributor |
|
|
Here is a little annoyance: doing something like this switches from the OS skin to some other skin in ToolButton:
static ToolButton::Style s = ToolButton::StyleDefault();
but.SetStyle(s);
This is actually due to my fix for skins outside a ToolBar, by adding this line to the constructor:
ToolButton::ToolButton()
{
Reset();
checked = false;
paint_checked = false;
// next line
SetStyle(ToolBar::StyleDefault().buttonstyle);
Transparent();
}
This was not the best fix, because it does not update the default style. My understanding of Chameleon is better now, and I think it would be better to update the style directly:
void ChHostSkin()
{
ChSysInit();
.................
{
ToolBar::Style& s = ToolBar::StyleDefault().Write();
Win32Look(s.buttonstyle.look, 6, XP_TOOLBAR, 1, 1);
Win32Look(ToolButton::StyleDefault().Write().look, 6, XP_TOOLBAR, 1, 1);
Win32Look(s.arealook, XP_REBAR, 0, 1);
s.breaksep.l2 = SColorLight();
}
This is also IMO better, since ToolButton has a style default, and thus should own it's style. buttonstyle from TollBar is still updated to maintain backward compatibility.
Also, would it be possible to add this style to ToolButton?
CH_STYLE(ToolButton, Style, StyleSolid)
{
const Button::Style& bs = Button::StyleNormal();
look[0] = bs.look[0];
look[1] = bs.look[1];
look[2] = bs.look[2];
look[3] = bs.look[3];
look[4] = bs.look[2];
look[5] = bs.look[1];
font = StdFont();
for(int i = 0; i < 4; i++)
textcolor[i] = Button::StyleNormal().textcolor[i];
textcolor[CTRL_CHECKED] = textcolor[CTRL_NORMAL];
textcolor[CTRL_HOTCHECKED] = textcolor[CTRL_HOT];
for(int i = 0; i < 6; i++) {
light[i] = false;
contrast[i] = 0;
}
light[CTRL_PRESSED] = light[CTRL_HOT] = light[CTRL_HOTCHECKED] = true;
}
|
|
|
 |
|
State of "button"
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mrjt on Tue, 15 April 2008 10:48
|
 |
|
Re: State of "button"
By: mirek on Wed, 16 April 2008 10:17
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mirek on Sat, 26 April 2008 09:59
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mirek on Tue, 29 April 2008 19:30
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mirek on Mon, 16 March 2009 10:31
|
 |
|
Re: State of "button"
By: mrjt on Mon, 16 March 2009 17:26
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mirek on Thu, 19 March 2009 18:29
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mirek on Thu, 19 March 2009 19:32
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
|
 |
|
Re: State of "button"
By: mirek on Fri, 20 March 2009 21:02
|
 |
|
Re: State of "button"
By: mirek on Thu, 19 March 2009 19:28
|
Goto Forum:
Current Time: Mon May 12 03:41:46 CEST 2025
Total time taken to generate the page: 0.03907 seconds
|