In my application, I'd like to give the user to change some colors
(like the text color of a invalid row...). Everything's fine. But PB also
offers some standard colors like WndBkRnd, ButtonFace, WndText or
even Transparent (for fonts). Do anyone knows the RGB values of
these colors or another way to change the datawindow properties to this
colors ?
TIA
mig
miguel...@telindus.lu
The others have slipped my mind. But you can determine them by making a
datawindow with WndText and Transparent columns and use 'Describe'.
HTH
Marleen.
>Hi,
>
>In my application, I'd like to give the user to change some colors
>(like the text color of a invalid row...). Everything's fine. But PB also
>offers some standard colors like WndBkRnd, ButtonFace, WndText or
>even Transparent (for fonts). Do anyone knows the RGB values of
>these colors or another way to change the datawindow properties to this
>colors ?
>
>TIA
>mig
>miguel...@telindus.lu
The system colors aren't actually represented as RGB values. Instead,
they are a 32-bit word with a special code in the first byte. The
other three bytes are automatically filled with the RGB codes
corresponding to the current value of the system color.
The ones I have are:
Button Face: 0x04000000 Decimal value = 67108864
Window Text: 0x02000000 Decimal value 33554432
Window Background: 0x40000000 Decimal Value 1073741824
App Work Space: 0x10000000 Decimal value 2684354546
Don't you wish we could use hexadecimal constants in PowerScript?
--
Tim Slattery
Slatt...@bls.gov
>Hi,
>
>In my application, I'd like to give the user to change some colors
>(like the text color of a invalid row...). Everything's fine. But PB also
>offers some standard colors like WndBkRnd, ButtonFace, WndText or
>even Transparent (for fonts). Do anyone knows the RGB values of
>these colors or another way to change the datawindow properties to this
>colors ?
>
>TIA
>mig
>miguel...@telindus.lu
>
Hi,
Below is an explination I got out of some of the newsgroups
archives. It explains a little more detail regarding the PB colors.
Has to do with the color being a 4 byte word and formatted as CBGR,
where C=custom, B=Blue, G=green, R=Red.
> Setting any of the bits in the Custom byte make PB ignore the specified
> color and use it's predefined color for that bit.
> 2^25 = Window Text
> 2^26 = buttonface
> 2^27 = scrollbar background
> 2^28 = app. wrokspace
> 2^29 = transparent
> 2^30 = Window Background
> 2^31 = unused - it's my guess that these two are used in combination
> 2^32 = unused - to select the four 'custom' colors you can specify
> in the painter.
I agree with with Tim's comment - Hex sure would be nice, however,
there is another shorthand that actually makes sense at a glance (at
least more sense than the seemingly arbitrary base 10 numbers) PB
does support exponents thus if you have a static text object that you
want to be Application Workspace color you do the following:
st_1.BackColor = 2^28 // 2exp28
// ButtonFace: sets bit 28 of the color code.
Hope this helps.
=================
Scott Arrowood
Disclaimer:
Comments herein do not necessarily
reflect those of my employer (or anyone
else, for that matter)
>> Setting any of the bits in the Custom byte make PB ignore the specified
>> color and use it's predefined color for that bit.
>> 2^25 = Window Text
>> 2^26 = buttonface
>> 2^27 = scrollbar background
>> 2^28 = app. wrokspace
>> 2^29 = transparent
>> 2^30 = Window Background
>> 2^31 = unused - it's my guess that these two are used in combination
>> 2^32 = unused - to select the four 'custom' colors you can specify
>> in the painter.
>
>I agree with with Tim's comment - Hex sure would be nice, however,
>there is another shorthand that actually makes sense at a glance (at
>least more sense than the seemingly arbitrary base 10 numbers) PB
>does support exponents thus if you have a static text object that you
>want to be Application Workspace color you do the following:
>
>st_1.BackColor = 2^28 // 2exp28
> // ButtonFace: sets bit 28 of the color code.
>
>Hope this helps.
>=================
>Scott Arrowood
EXCELLENT! Thanks for the complete list of special color codes and an
extremely good way to specify them in code!
--
Tim Slattery
Slatt...@bls.gov
>Hi,
>
>In my application, I'd like to give the user to change some colors
>(like the text color of a invalid row...). Everything's fine. But PB also
>offers some standard colors like WndBkRnd, ButtonFace, WndText or
>even Transparent (for fonts). Do anyone knows the RGB values of
>these colors or another way to change the datawindow properties to this
>colors ?
>
>TIA
>mig
>miguel...@telindus.lu
>
The system colors in PB are flagged by the high-order byte of the
color attribute. The three low-order bytes contain RGB values:
High Blue Green Red
0 255 255 255 = 1677215 = white
0 0 0 255 = 255 = red
etc.
I've found the following values for the high byte:
1 = flags custom color, color in RGB bytes
2 = WindowText
4 = Buttonface
8 = ?
16 = Application Workspace color
32 = transparent
64 = Window Background
multiply these values with 1677216 and add them to a normal RGB value.
HTH
Jean-Marc.
+------------------------------------------------------------+
|Jean-Marc.van.Leerdam@| All opinions expressed are just ... |
|ingbank.com | opinions (and my personal ones!). |
+-- (AntiSpam:note the xxremovexx in the reply-to address) --+