Question Setting Fgcolor Attribute Not Working Under Windows 7 Basic Theme

altair

Member
Hi,

I have an issue while using some GUI control in Progress

I have a radio-set widget in , for which I would like to change the font color (rdo:FGCOLOR).

Here is an example of source code of what we try to achieve

Code:
DEFINE VARIABLE RDO-option        AS WIDGET-HANDLE.

DEFINE VARIABLE m-status      AS LOGICAL .
DEFINE VARIABLE m-choose-opt  AS INTEGER .

    DEFINE FRAME FRM-maintenance WITH SIZE 28.2 BY 6.7 TITLE "Special Option ..." NO-LABELS
                                 OVERLAY VIEW-AS DIALOG-BOX KEEP-TAB-ORDER SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE FGCOLOR 1 FONT 4.

    DISPLAY " " AT ROW 3.50  col 05  FGCOLOR 12 WITH FRAME frm-maintenance .

    CREATE RADIO-SET RDO-option
       ASSIGN ROW = 1.6
       COLUMN     = 3.2               
       WIDTH      = 20
       RADIO-BUTTONS = "option 1  ,  1 , " +  "option 2  ,  2 , " + "option 3  ,  3   "
       FRAME = FRAME FRM-maintenance:HANDLE
       SENSITIVE = TRUE
       VISIBLE   = TRUE
       HEIGHT    = 2.9
       BGCOLOR   = 07
       FGCOLOR   = 14
       triggers :
           ON MOUSE-SELECT-DBLCLICK DO :
               message "TOTO" view-as alert-box .
           END.
       end triggers.

WAIT-FOR GO OF FRAME FRM-maintenance.

The code at line 21 is supposed to change the font color in the radio widget, but it is not applying.

We are running OpenEdge 11.5.1 under Windows 7 and using the Windows 7 Basic desktop theme.
It works fine on an other computer under Windows 7 which i using Windows Classic theme.
Due to security right access, we cannot change the Windows theme, so we need to handle this in the code

We have tried using the setWindowTheme function from the uxtheme.dll API in order to not apply the current OS theme to this widget, but it is not working either.

Do you have any idea on how to set the FGCOLOR attribute ?

Version used : OpenEdge 11.5.1
OS : Windows 7 64b
 

altair

Member
Hi,
Will be there any other impact if we delete (or rename) this .manifest file ?
Looking forward on this, I've learned that there is a disableTheming option for the .manisfest which can be added used like this :
<disableTheming>true</disableTheming>
But untill now, I did not succeed to use it (we have error message, or it does not change anything).

For information, an other solution found is to use the SetThemeAppProperties API function from uxtheme.dll.
If I keep my previous example it becomes like this (line 6 and 32):
Code:
DEFINE VARIABLE RDO-option        AS WIDGET-HANDLE.

DEFINE VARIABLE m-status      AS LOGICAL .
DEFINE VARIABLE m-choose-opt  AS INTEGER .

RUN SetThemeAppProperties(0).

    DEFINE FRAME FRM-maintenance WITH SIZE 28.2 BY 6.7 TITLE "Special Option ..." NO-LABELS
                                 OVERLAY VIEW-AS DIALOG-BOX KEEP-TAB-ORDER SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE FGCOLOR 1 FONT 4.


    DISPLAY " " AT ROW 3.50  col 05  FGCOLOR 12 WITH FRAME frm-maintenance .

    CREATE RADIO-SET RDO-option
       ASSIGN ROW = 1.6
       COLUMN     = 3.2            
       WIDTH      = 20
       RADIO-BUTTONS = "option 1  ,  1 , " +  "option 2  ,  2 , " + "option 3  ,  3   "
       FRAME = FRAME FRM-maintenance:HANDLE
       SENSITIVE = TRUE
       VISIBLE   = TRUE
       HEIGHT    = 2.9
       BGCOLOR   = 07
       FGCOLOR   = 3
       triggers :
           ON MOUSE-SELECT-DBLCLICK DO :
               message "TOTO" view-as alert-box .
           END.
       end triggers.
WAIT-FOR GO OF FRAME FRM-maintenance.

PROCEDURE SetThemeAppProperties EXTERNAL "uxtheme.dll" :
DEFINE INPUT PARAMETER ipi-bool AS LONG     NO-UNDO.
END PROCEDURE.


You can also pass value 1 to SetThemeAppProperties in order to restore the theme (be aware that it does not restore the theme entirely, button are still not themed).
Alternative way (without modifying the code), is to change your executable setup : Right-click on your executable (e.g. prowin32.exe), "Properties", go to "Compatibility" tab and then tick the "Disable visual themes" option

The drawback of this is that your application will look like if you were using the Classic theme (and ugly, depending on your taste...), but it does the job.
 
Top