OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Device-independent bitmaps (DIBs) are often used to enhance and decorate a user interface.
To make your interface consistent with your application user's system, you should use TDib::MapUIColors function, which replaces standard interface colors with the user's own system colors. Here is the syntax for MapUIColors:
The mapColors parameter should be an OR'ed combination of five flags: TDib::MapFace, TDib::MapText, TDib::MapShadow, TDib::MapHighlight, and TDib::MapFrame. Each of these values causes a different color substitution to take place, as shown in the following table:
This flag | Replaces... | With... |
TDib::MapText | TColor::Black | COLOR_BTNTEXT |
TDib::MapFace | TColor::LtGray | COLOR_BTNFACE |
TDib::MapFace | TColor::Gray | COLOR_BTNSHADOW |
TDib::MapFace | TColor::White | COLOR_BTNHIGHLIGHT |
TDib::MapFrame | TColor::LtMagenta | COLOR_WINDOWFRAME |
The bkColor parameter, if specified, causes the color TColor::LtYellow to be replaced by the color bkColor.
Because MapUIColors searches for and replaces TColor table entries, this function is useful only with a DIB in RGB mode. Furthermore, because it replaces particular colors, you must design your interface using the standard system colors. For example, your button text should be black (TColor::Black), button faces should be light gray (TColor::LtGray), and so on. This should be fairly simple, since these objects are specifically designed so that they are equivalent to the standard default colors for each interface element.
You should also call the MapUIColors function before you modify any of the colors modified by MapUIColors. If you do not do this, MapUIColors will not be able to find the attribute color for which it is searching, and that part of the interface will not match the system colors.