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 » DropList - Changing colors
DropList - Changing colors [message #20615] Fri, 27 March 2009 02:40 Go to next message
kbyte is currently offline  kbyte
Messages: 87
Registered: July 2008
Member
Hi,

I would like to change the forecolor and backcolor of a DropList but I have no idea how do i do it.

For Edits I use EditField::Style, what about DropLists?

Thank you

Alex

[Updated on: Fri, 27 March 2009 02:42]

Report message to a moderator

Re: DropList - Changing colors [message #20617 is a reply to message #20615] Fri, 27 March 2009 09:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Either assign a different Display or use AttrText.

Mirek
Re: DropList - Changing colors [message #20618 is a reply to message #20617] Fri, 27 March 2009 09:49 Go to previous messageGo to next message
kbyte is currently offline  kbyte
Messages: 87
Registered: July 2008
Member
I dont know how to assign a new display or a new AttrText to droplist. Sad

Please could you help me again with a code example? My droplist has the name cbEsc and was drawn during design time in a form.

Please, a innocente question:
I like upp very very much and today it is my framework to develop applications for Windows (even for commercial ones, some day). It works very well and has ready-to-use controls that feet my needs. I am not a pro in C++ but i want to be some day.
So, why UPP controls doesnt have the same methods like in VB, say, .SetColor(), .SetBakGround() ?


Alex

[Updated on: Fri, 27 March 2009 09:52]

Report message to a moderator

Re: DropList - Changing colors [message #20642 is a reply to message #20618] Sun, 29 March 2009 10:27 Go to previous messageGo to next message
Mindtraveller is currently offline  Mindtraveller
Messages: 917
Registered: August 2007
Location: Russia, Moscow rgn.
Experienced Contributor

kbyte wrote on Fri, 27 March 2009 11:49


1. I dont know how to assign a new display or a new AttrText to droplist. Please could you help me again with a code example?
2. Why UPP controls doesnt have the same methods like in VB, say, .SetColor(), .SetBakGround() ?

1. Please use forum search. This topic was discussed a number of times. If you don`t find any, write here, I`ll try to help finding one.
2. U++ uses slightly different approach to customizing controls than VB. This technology is called Chameleon.
The main idea is that control is assigned to the complex customization object, which is constructed from native OS drawing styles & colors. Complexity of this object is explained by the fact that modern operating systems have very complex rules for drawing widgets. These rules include many colors and many styling rules (which may include even opacity and gradients).
So when you want to change look&feel, you generally need to alter this complex customization Style object. Please be prepaired to alter a number of colors, not just one - if you want your custom widget to look great in a number of modern operating systems.

[Updated on: Sun, 29 March 2009 10:28]

Report message to a moderator

Re: DropList - Changing colors [message #20644 is a reply to message #20642] Sun, 29 March 2009 11:36 Go to previous messageGo to next message
kbyte is currently offline  kbyte
Messages: 87
Registered: July 2008
Member
I think i got it now.

I have to use styling to customize droplist colors. First i get the dfault style, then i change it and then i play that new style to the droplists i want to change.

Thanks



By the way, ok, operating systems today are very complex in terms of colors and rules for their appearance. So Upp uses a Stryle "engine" to "run" the controls. Ok, that is nice and i like upp very much and is more important for me than VB. But whay vb can made it using .SetForecolor and .SetBkColor even in the presence of a complex OS?

Alex
Re: DropList - Changing colors [message #20645 is a reply to message #20644] Sun, 29 March 2009 13:28 Go to previous messageGo to next message
andrei_natanael is currently offline  andrei_natanael
Messages: 262
Registered: January 2009
Experienced Member
It is possible to change the background or foreground of a control in U++ as easily as in VB but until now no one made such a method (setBackgroundColor or setForegroundColor) because you usually when you modify the skin of a control you modify more than it's background or foreground color and usually you modify look of all controls globally to have an uniform look not just one control. Because changing only background or foreground color is not used often it was not adopted in Upp "theming" API and one inconvenient is that Style structure didn't use a uniform notation in all controls, so you may have to implement setBackground/ForegroundColor differently in some controls.
Re: DropList - Changing colors [message #20646 is a reply to message #20645] Sun, 29 March 2009 15:34 Go to previous messageGo to next message
kbyte is currently offline  kbyte
Messages: 87
Registered: July 2008
Member
Ok, so Upp adopted a more uniform strategy and not "allows" to easy change some controls properties because that could easly cause negative visual effects, right?
I think it is like VC++. In vc++ it is not easy to change colors of controls... One must subclass and so one...

Ok, I think i got it and from day to day UPP is highy surprising me in the positive way.
It is really a very interesting and competitive tool.

Thank you

Alex
Re: DropList - Changing colors [message #20681 is a reply to message #20646] Tue, 31 March 2009 14:32 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kbyte wrote on Sun, 29 March 2009 09:34

Ok, so Upp adopted a more uniform strategy and not "allows" to easy change some controls properties because that could easly cause negative visual effects, right?



Well, I think it is a little bit more complicated than that:

In DropList, there are two 'visuals' to be considered:

- how the droplist "stable" parts look - means e.g. appearance of frame or that drop down button. This part can be altered by chameleon Style. Default Style attempts to imitate typical host platform appearance.

- how the value (content) looks like. This is much more common and you can do it using Display. See e.g.:

http://www.ultimatepp.org/reference$Display.html

Mirek
Previous Topic: Bug on DropList?
Next Topic: Holding a Button down
Goto Forum:
  


Current Time: Thu Mar 28 19:24:11 CET 2024

Total time taken to generate the page: 0.01617 seconds