B.4 Accessing Windows Colours

Colours may be created from their X11 names. The X11 name-table is in <pcehome>/lib/rgb.md. In the Windows API, all colours described as RGB (Red, Green, Blue) tuples. This is no problem as XPCE also provides RGB colours. Note however that Win32 intensity is ranged 0..255, where the XPCE intensity is ranged 0..65535. This is true on all XPCE's platforms.

To provide access to the window-system colours as they can be obtained using the Win32 API function GetSysColor(), XPCE binds these colours to named colour objects. These colour objects are normally used in the XPCE resource file (<pcehome>/Defaults) to colour XPCE's controller objects according to the user's preferences.

If the name of the Windows API colours are COLOR_SOMETHING, the XPCE name is win_something. The full list is in table 10.

win_3ddkshadow Dark shadow for three-dimensional display elements.
win_3dface
win_btnface Face color for three-dimensional display elements.
win_3dhilight
win_3dhighlight
win_btnhilight
win_btnhighlight Highlight color for three-dimensional display elements
win_3dlight Light color for three-dimensional display elements
win_3dshadow
win_btnshadow Shadow color for three-dimensional display elements
win_activeborder Active window border.
win_activecaption Active window title bar.
win_appworkspace Background color of MDI applications.
win_background
win_desktop Desktop.
win_btntext Text on push buttons.
win_captiontext Text in caption, size box, and scroll bar arrow box.
win_gradientactivecaption Right side color of an active window's title bar.
win_activecaption specifies the left side color.
win_gradientinactivecaption Right side color of an inactive window's title bar.
win_inactivecaption specifies the left side color.
win_graytext Grayed (disabled) text.
win_highlight Item(s) selected in a control.
win_highlighttext Text of item(s) selected in a control.
win_hotlight Color for a hot-tracked item.
win_inactiveborder Inactive window border.
win_inactivecaption Inactive window caption.
win_inactivecaptiontext Color of text in an inactive caption.
win_infobk Background color for tooltip controls.
win_infotext Text color for tooltip controls.
win_menu Menu background.
win_menutext Text in menus.
win_scrollbar Scroll bar gray area.
win_window Window background.
win_windowframe Window frame.
win_windowtext Text in windows
Table 10 : Windows colour name mapping