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 » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Different color for three state option button
Different color for three state option button [message #2402] Tue, 11 April 2006 22:19 Go to next message
forlano is currently offline  forlano
Messages: 1202
Registered: March 2006
Location: Italy
Senior Contributor
One more question...

The nice three state button has the following states:
1] empty square
2] green square
3] green 'V' over an empty square.

I would like that state 2] and 3] had a different color: one of the two state should be RED (the other can remain green).
Now I'm afraid to ask this Smile . But this feature (double color) I feel would attract better the user for delicate task.
So, is it possible?
With my old tool I had a two state case button but I could set two images and switch them. Maybe with U++ I can set three images and switch among them.
Luigi
Re: Different color for three state option button [message #2405 is a reply to message #2402] Tue, 11 April 2006 22:31 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Everything is possible! Just a question of time Smile.
At the moment I can't you answer quickly because I've just broken my library with too many experiments... Smile. Maybe Mirek or other guys can answer more quickly....
Re: Different color for three state option button [message #2407 is a reply to message #2402] Tue, 11 April 2006 23:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
forlano wrote on Tue, 11 April 2006 16:19

One more question...

The nice three state button has the following states:
1] empty square
2] green square
3] green 'V' over an empty square.

I would like that state 2] and 3] had a different color: one of the two state should be RED (the other can remain green).
Now I'm afraid to ask this Smile . But this feature (double color) I feel would attract better the user for delicate task.
So, is it possible?
With my old tool I had a two state case button but I could set two images and switch them. Maybe with U++ I can set three images and switch among them.
Luigi


Well, something we have not anticipated Smile (once again? Smile

The trouble is that it is not 2 or 3 images, but in fact 20 different images to show all possible visual combinations...

It would be quite hard for EACH Option to carry them all.

Mirek
Re: Different color for three state option button [message #2410 is a reply to message #2402] Wed, 12 April 2006 03:38 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
Ok, Luigi, it' time for you to learn image designer... Smile
Try and tell how it works...
P.S I haven't tested the logic and all functionality properly. This is a quick sample. Try to improve...
Any questions - just ask...
Unzip into ForlanoOption folder (no folders inside!)

Edit: You can download the latest version from topic
"OptionImage ctrl: how to make it better..."

[Updated on: Wed, 12 April 2006 17:27]

Report message to a moderator

Re: Different color for three state option button [message #2414 is a reply to message #2410] Wed, 12 April 2006 11:28 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
fudadmin wrote on Tue, 11 April 2006 21:38

Ok, Luigi, it' time for you to learn image designer... Smile
Try and tell how it works...
P.S I haven't tested the logic and all functionality properly. This is a quick sample. Try to improve...
Any questions - just ask...
Unzip into ForlanoOption folder (no folders inside!)


I am not quite sure whether altering the library code is the right path here....

I guess, if you really insist on different images for option,

- make your option

- make me add customization of Option (something I in fact did not thought is necessary).

Of course, thing will be solved by Chameleon soon, but that will work for all options (Option calss), not just specific one.

Mirek
Re: Different color for three state option button [message #2415 is a reply to message #2410] Wed, 12 April 2006 11:55 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1202
Registered: March 2006
Location: Italy
Senior Contributor
fudadmin wrote on Wed, 12 April 2006 03:38

Ok, Luigi, it' time for you to learn image designer... Smile
Try and tell how it works...
P.S I haven't tested the logic and all functionality properly. This is a quick sample. Try to improve...
Any questions - just ask...
Unzip into ForlanoOption folder (no folders inside!)


Aris,

It works as all your code although this time it is not at all friendly and in the laizy people style Smile

If I desire a three state button with no standard images I think should be enough a declaration as this:
btnOpt.Add("Label_text", img1thState, img2thState, img3thState);

where img1thState, img2thState, img3thState are the images defined in the *.iml file.
Moreover it could be useful a method that set the position of the text with respect the image:
btnOpt.TextvsImage(LEFT); // test at the left of the image
btnOpt.TextvsImage(RIGHT); // test at the left of the image

The bottom and top case can be resolved with a separate label below of upper the button. Then, in the U++ style, should be possible the following line:
btnOpt.Add("Label_text", img1thState, img2thState, img3thState).TextvsImage(LEFT);

The same for a two state button:
btnOpt.Add("Label_text", img1thState, img2thState).TextvsImage(LEFT);


The minimum dimension of the button should be calculate considering the text lenght and the greatest of the three image dimension.
If I've not said silly thing I'll put this post in the wish list.

Luigi
Re: Different color for three state option button [message #2416 is a reply to message #2415] Wed, 12 April 2006 12:20 Go to previous messageGo to next message
mr_ped is currently offline  mr_ped
Messages: 825
Registered: November 2005
Location: Czech Republic - Praha
Experienced Contributor
Generally speaking it's not good to change native look of UI common controls, i.e. option should look just like any other default option on that operating system (I mean not imitating the default skin, but using user's skin instead, so it really looks like what the user is used to).

But I can imagine cases when your personal skin for controls is more intuitive than original ones. (like icons in toolbar for buttons, you don't have the same "button" icon for every one, that would be bad for user).

So I think the ability to skin controls can be both nice and good for final user, if the developer doesn't change control's look just to make them "look cool", that's bad.

Changing just colors looks to me more like "look cool" approarch (even if the intent is to make it more intuitive), which will in the end break "chameleon" skinning, when it will be finally available.
Re: Different color for three state option button [message #2420 is a reply to message #2416] Wed, 12 April 2006 13:27 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1202
Registered: March 2006
Location: Italy
Senior Contributor
mr_ped wrote on Wed, 12 April 2006 12:20

... "chameleon" skinning, when it will be finally available.


What "Chameleon" are you speaking about? Even Mirek said something about it. What is it?
Re: Different color for three state option button [message #2422 is a reply to message #2414] Wed, 12 April 2006 13:31 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
luzr wrote on Wed, 12 April 2006 10:28

fudadmin wrote on Tue, 11 April 2006 21:38

Ok, Luigi, it' time for you to learn image designer... Smile
Try and tell how it works...
P.S I haven't tested the logic and all functionality properly. This is a quick sample. Try to improve...
Any questions - just ask...
Unzip into ForlanoOption folder (no folders inside!)


1. I am not quite sure whether altering the library code is the right path here....

I guess, if you really insist on different images for option,

2. - make your option

- make me add customization of Option (something I in fact did not thought is necessary).

Of course, thing will be solved by Chameleon soon, but that will work for all options (Option calss), not just specific one.

Mirek


1. Is overiding virtual paint in subclassed widget considered "altering" library code?

2. How then to make "your option"?

Re: Different color for three state option button [message #2426 is a reply to message #2415] Wed, 12 April 2006 13:44 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1321
Registered: November 2005
Location: Kaunas, Lithuania
Ultimate Contributor
Administrator
forlano wrote on Wed, 12 April 2006 10:55

fudadmin wrote on Wed, 12 April 2006 03:38

Ok, Luigi, it' time for you to learn image designer... Smile
Try and tell how it works...
P.S I haven't tested the logic and all functionality properly. This is a quick sample. Try to improve...
Any questions - just ask...
Unzip into ForlanoOption folder (no folders inside!)


Aris,

It works as all your code although this time it is not at all friendly and in the lazy people style Smile

1. If I desire a three state button with no standard images I think should be enough a declaration as this:
btnOpt.Add("Label_text", img1thState, img2thState, img3thState);

where img1thState, img2thState, img3thState are the images defined in the *.iml file.

2. The minimum dimension of the button should be calculate considering the text lenght and the greatest of the three image dimension.
Luigi


1. and 2. I expected you are not so lazy... Smile and add this funcionality yourself... Smile

Btw, 2. - Do you want different size images? - it's even more against native look Laughing
Re: Different color for three state option button [message #2430 is a reply to message #2426] Wed, 12 April 2006 14:11 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1202
Registered: March 2006
Location: Italy
Senior Contributor
fudadmin wrote on Wed, 12 April 2006 13:44

Quote:

Aris,

It works as all your code although this time it is not at all friendly and in the lazy people style Smile

1. If I desire a three state button with no standard images I think should be enough a declaration as this:
btnOpt.Add("Label_text", img1thState, img2thState, img3thState);

where img1thState, img2thState, img3thState are the images defined in the *.iml file.

2. The minimum dimension of the button should be calculate considering the text lenght and the greatest of the three image dimension.
Luigi


1. and 2. I expected you are not so lazy... Smile and add this funcionality yourself... Smile

Btw, 2. - Do you want different size images? - it's even more against native look Laughing


1. I've learned the lesson and now I trying to think in the laziest way I can Smile

2. Of course not, I was just speaking in general.

Luigi
Re: Different color for three state option button [message #2438 is a reply to message #2422] Wed, 12 April 2006 17:42 Go to previous message
mirek is currently offline  mirek
Messages: 14105
Registered: November 2005
Ultimate Member
1. Sorry, I have not see your code... I was thinking that you are suggesting to alter CtrlLib.iml file

2. I meant make your Option widget Wink Seriously, Option has about 40 lines....

Mirek
Previous Topic: F2 tree editor...
Next Topic: OptionImage ctrl: how to make it better...
Goto Forum:
  


Current Time: Fri Nov 01 01:10:25 CET 2024

Total time taken to generate the page: 0.02756 seconds