Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Appearance of disabled Button/ButtonOption does not match when using images
Appearance of disabled Button/ButtonOption does not match when using images [message #7604] |
Tue, 09 January 2007 19:11 |
James Thomas
Messages: 26 Registered: June 2006
|
Promising Member |
|
|
Tested with 612-dev3.
The image shading is different. In Button the Image is Etched (lighter and inset), but not in ButtonOption. I'm not sure if this is a mistake and not a deliberate decision since the code has been re-written for chameleon recently, but since I need them to look identical for the control set below I have found the fix.
In ButtonOption::Paint the line:
w.DrawImage(p.x, p.y, (option && !IsNull(image1)) ? image1 : image);
should be something like:
w.DrawImage(p.x, p.y, (option && !IsNull(image1)) ? image1 : IsEnabled() ? image : MakeImage(image, Etched));
The old code used DrawXPButton which also has an error when drawing the background color in the same case:
case BUTTON_DISABLED:
frame = SColorDisabled;
outlight = outshade = light = shade = SColorFace;
break;
should be:
case BUTTON_DISABLED:
frame = SColorDisabled;
outlight = outshade = light = shade = Blend(SColorLight, SColorFace);
break;
Also, IMO the old code had a much nicer effect when the push button was depressed (though it didn't match XP):
Would it be difficult for me to reproduce this behaviour whilst still using the rest of the Chameleon code?
Cheers.
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Oct 31 23:57:32 CET 2024
Total time taken to generate the page: 0.01619 seconds
|