|
|
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
|
|
|
|
|
Re: Different color for three state option button [message #2415 is a reply to message #2410] |
Wed, 12 April 2006 11:55 |
|
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...
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
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 |
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 #2422 is a reply to message #2414] |
Wed, 12 April 2006 13:31 |
|
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...
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 |
|
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...
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
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... and add this funcionality yourself...
Btw, 2. - Do you want different size images? - it's even more against native look
|
|
|
Re: Different color for three state option button [message #2430 is a reply to message #2426] |
Wed, 12 April 2006 14:11 |
|
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
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... and add this funcionality yourself...
Btw, 2. - Do you want different size images? - it's even more against native look
|
1. I've learned the lesson and now I trying to think in the laziest way I can
2. Of course not, I was just speaking in general.
Luigi
|
|
|
|
Goto Forum:
Current Time: Fri Nov 01 01:10:25 CET 2024
Total time taken to generate the page: 0.02756 seconds
|
|
|