Consultor Eletrônico



Kbase P8351: Button color: Why does MS-Windows ignore color changes?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   23/11/2005
Status: Unverified

GOAL:

Button color: Why does MS-Windows ignore color changes?

GOAL:

Is it possible to put foreground and background colors on Progress Button Widgets?

FACT(s) (Environment):

Windows

FIX:

While running in the UIB and creating buttons, you will see that the button property sheet allows for foreground and background colors. Yet, when you run this code, the button will NOT change colors when running MS-Windows.

The reason for this restriction on the MS-Windows platform is that the MS-Windows toolkit dictates that all buttons must have the same color. The only way that MS-Windows allows users to change this color is via the Control Panel and the Colors interface. In ignoring color changes in MS-Windows, PROGRESS is only adhering to this standard. This limitation will no change in the future unless MS-Windows changes the standard.

The reason that the UIB and PROGRESS allows users to select foreground and background colors for buttons is that under MOTIF this is supported. The fact that we allow it on all platforms and just ignore it when it is not supported, makes it easier for application developers to produce portable code.

If users insist on working around this limitation, the way to do so is to load a bitmap to the button which consists of a solid background in the desired color along with the label text. (It will not be possible to maintain label text using the :LABEL attribute since the bitmap will override it.)