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 » A question of C++
Re: A question of C++ [message #20621 is a reply to message #20620] Fri, 27 March 2009 13:29 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
kbyte wrote on Fri, 27 March 2009 11:29

I am trying this:

#include "ColoringSystem.h"
...

class CChangeUnitsDlg : public WithChangeUnitsDlgLayout<TopWindow> , public CColoringSystem
{

}

and the CColoringSystem will store all needed colors and the paint of the CChangeUnitsDlg will paint every control 1 by one using the colors in the CColoringSystem class.


Alex



It doesn't work like that, Ctrls are respoionsible for drawing themselves.

You have several options here, but it depends on exactly what you are trying to do:
1- If you want to set colours globally (for all EditCtrls say) you can use EditField::StyleDefault().Write(). You can also do things like SColorFace_Write(Red()) to replace a particular colour.
2- If you need individual colouring for different ctrls of the same type (like username EditString is red, password is Blue) then you are going to have to do something more complicated. Unless you hard-code it this is going to be difficult to do, but possible.
One way would be to use your own version of the Layout macro that creates a string table from a .lay file and then use the table to read styling values from an Xml file. Or something.
3- Tell the user that they can set the colours themselves with ControlPanel->Display and that colours are deliberatley set to match the OS for a good reason Smile
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Custom Font
Next Topic: Questions about themeing plz
Goto Forum:
  


Current Time: Fri May 03 12:31:11 CEST 2024

Total time taken to generate the page: 0.02650 seconds