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 » Look and Chameleon Technology » Easiest way to change button color
Easiest way to change button color [message #26418] Fri, 30 April 2010 13:29 Go to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I have a ButtonOption control.
Please consult which is the easiest way to make this button e.g. red? Theme I use is mostly classic, Win2000-style.

Thanks in forward.

P.S. I'd redefine Paint() virtual function filling control with custom color, but my label is a QTF with embedded images and I have no idea how to draw it.

[Updated on: Fri, 30 April 2010 13:39]

Report message to a moderator

Re: Easiest way to change button color [message #26420 is a reply to message #26418] Fri, 30 April 2010 13:45 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Hi Pavel!
I use chameleon style.
See examples and chameleon forum branch.


SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Easiest way to change button color [message #26422 is a reply to message #26420] Fri, 30 April 2010 13:55 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

I tried to play a bit with ButtonOption::Style but it has limited functionality (4 images, 4 text colors and 2 flags). I could not find how to change "fill" color of ButtonOption itself. If you know how, please give me a clue.
Re: Easiest way to change button color [message #26423 is a reply to message #26422] Fri, 30 April 2010 14:02 Go to previous messageGo to next message
sergeynikitin is currently offline  sergeynikitin
Messages: 748
Registered: January 2008
Location: Moscow, Russia
Contributor

Make Image with 2x2 (or 3x3) pixels of one color and use it as style.

SergeyNikitin<U++>( linux, wine )
{
    under( Ubuntu || Debian || Raspbian );
}
Re: Easiest way to change button color [message #26427 is a reply to message #26423] Fri, 30 April 2010 15:52 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 14162
Registered: November 2005
Ultimate Member
sergeynikitin wrote on Fri, 30 April 2010 08:02

Make Image with 2x2 (or 3x3) pixels of one color and use it as style.


Or you can use just Color Smile Standard chameleon routine understands that.

Mirek
Re: Easiest way to change button color [message #27178 is a reply to message #26418] Tue, 29 June 2010 18:34 Go to previous messageGo to next message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
I don't know if you resolved this but the method I use for modifying the fill color of ButtonOptions (while retaining theming) is given in this thread.
Re: Easiest way to change button color [message #27189 is a reply to message #27178] Wed, 30 June 2010 06:51 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

mrjt, thank you for your notice.

Finally I used the same method as you (and as Sergey proposed).
Using image as a background even helped making a little 3D-look for button (a little shiny for unpressed, a little dimmed for pressed).

I also used plain drawing to make it more clear which of buttons is selected (due to interface to be used inside factories, plain desktop GUI may not need these).

It looks like this:
index.php?t=getfile&id=2620&private=0
  • Attachment: optbut2.png
    (Size: 32.12KB, Downloaded 956 times)
Re: Easiest way to change button color [message #27190 is a reply to message #27189] Wed, 30 June 2010 06:54 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

And this (3d-effect is little more noticeable here):
index.php?t=getfile&id=2622&private=0
  • Attachment: optbut3.png
    (Size: 11.01KB, Downloaded 899 times)

[Updated on: Wed, 30 June 2010 06:55]

Report message to a moderator

Re: Easiest way to change button color [message #27192 is a reply to message #26418] Wed, 30 June 2010 10:34 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
nice design. Smile
Re: Easiest way to change button color [message #27200 is a reply to message #27192] Thu, 01 July 2010 17:18 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
Yes, very nice Smile
Previous Topic: FIX: proper use of Style in Ctrls from CtrlLib
Next Topic: Style: DefaultInk / default
Goto Forum:
  


Current Time: Sat Dec 14 13:28:23 CET 2024

Total time taken to generate the page: 0.02915 seconds