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 » 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 Go to next message
James Thomas is currently offline  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):
http://img247.imageshack.us/img247/2241/enabledbuttonssg7.jpg
Would it be difficult for me to reproduce this behaviour whilst still using the rest of the Chameleon code?

Cheers.
Re: Appearance of disabled Button/ButtonOption does not match when using images [message #7607 is a reply to message #7604] Tue, 09 January 2007 20:44 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Thanks, fixed.

As for old vs new look, I have adding Style to ButtonOption, that should allow you to setup any specific appearance you need.

Mirek
Re: Appearance of disabled Button/ButtonOption does not match when using images [message #7620 is a reply to message #7607] Wed, 10 January 2007 15:48 Go to previous messageGo to next message
James Thomas is currently offline  James Thomas
Messages: 26
Registered: June 2006
Promising Member
It seems you've added it to Button but not ButtonOption.
Re: Appearance of disabled Button/ButtonOption does not match when using images [message #7622 is a reply to message #7620] Wed, 10 January 2007 20:08 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
Sorry, I have added it based on your request, it will be in the next release.

Mirek
Re: Appearance of disabled Button/ButtonOption does not match when using images [message #7629 is a reply to message #7622] Thu, 11 January 2007 12:49 Go to previous message
James Thomas is currently offline  James Thomas
Messages: 26
Registered: June 2006
Promising Member
Thank you very much. I really like the new Chameleon stuff, I have been using a lot of specialised/custom controls and the additional flexibility is extremely useful.

[Updated on: Thu, 11 January 2007 12:56]

Report message to a moderator

Previous Topic: How to get rid of the "minimal size limitation" of TopWindow?
Next Topic: How to find the top-most window the mouse is over (Linux)?
Goto Forum:
  


Current Time: Thu Oct 31 23:57:32 CET 2024

Total time taken to generate the page: 0.01619 seconds