How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Discussions about product bugs & problems!
Note: This is no replacement for the Official ETM Support!
7 posts • Page 1 of 1
Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by Heinrich »

Hi,

to get the RGB-Value of a PVSS-Color like "red", "ETM", "STD_used" I use the http_color-function.

#uses "http.ctl"
DebugN(http_color("red"));
>> "#FF0000"

But for systemcolors like "_3DFace" it doesn't work. "_3DFace" is not in the color-DB-files and depends on the OS and the selected designs ...

DebugN(http_color("_3DFace"));
>> ""

Yes, I work with 3.12 an I know since 3.13 is the function colorToRgb available :-(

Someone an idea to solve this in 3.12?

many Thanks
Uwe Heinrich
Department ELBAS, Section Studies and Development
SIGNON Germany GmbH, Dresden

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by mkoller »

You need to check the system color names in your own code and return an RGB value you are comfortable with.
System color names are:
"_3DFace",
"_3DText",
"_Button",
"_ButtonText",
"_ButtonShadow",
"_Window",
"_WindowText"

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by Heinrich »

Thanks a lot,

But how can I get the RGB-Values in 3.12 ?

Best Regards
Uwe Heinrich
Department ELBAS, Section Studies and Development
SIGNON Germany GmbH, Dresden

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by mkoller »

I'm confused.
You said you are using 3.12 and http_color() to get the RGB value, which you said works for you except the system colors like _3DFace.
I listed the system color names and told you you have to handle these separately by returning whatever RGB color you like.
The idea was: you write your own getRGB() function, checking for the system color names or else using http_color().
What is unclear ?

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by Heinrich »

Sorry for confusion.

>>returning whatever RGB color you like.
That's the point. I must know which values I have to return for red, green and blue.

"_3DFace" is dynamic and depends on the OS and its settings (active Windows-style).

>>The idea was: you write your own getRGB() function, checking for the system color names

In QT I can query the values like this:

DWORD color = GetSysColor(COLOR_3DFACE);
printf ("%2X%2X%2X", GetRValue(color), GetGValue(color), GetBValue(color));

Is there a way in CONTROL SCRIPT?

Best regards
Uwe Heinrich

mkoller
Posts:741
Joined: Fri Sep 17, 2010 9:03 am

Re: How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by mkoller »

GetSysColor() is not Qt.
My suggestion was to return fixed RGB values, independant of the current users schema.
If that is not possible you only have 2 options:
1.) upgrade to 3.13 and use colorToRGB()
2.) write your own CTRL extension (either using QColor or GetSysColor() if you want to limit yourself to windoze)
With Qt you can do it like this:
_3DFace => QApplication::palette().color(QPalette::Active, QPalette::Window)
_3DText => QPalette::WindowText
_Button => QPalette::Button
_ButtonText => QPalette::ButtonText
_ButtonShadow => QPalette::Shadow
_Window => QPalette::Base
_WindowText => QPalette::Text

Heinrich
Posts:22
Joined: Wed Mar 23, 2011 11:27 am

Re: How to get the RGB-Values of the PVSS-Color \"-3DFace\" in WinCCOA 3.12

Post by Heinrich »

Perfect. I will test it.

Thank you very much.
Uwe Heinrich

7 posts • Page 1 of 1