1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Question Setting Fgcolor Attribute Not Working Under Windows 7 Basic Theme

Discussion in 'Development' started by altair, Nov 6, 2017.

  1. altair

    altair New 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 (progress):
    1. DEFINE VARIABLE RDO-option        AS WIDGET-HANDLE.
    2.  
    3. DEFINE VARIABLE m-status      AS LOGICAL .
    4. DEFINE VARIABLE m-choose-opt  AS INTEGER .
    5.  
    6.     DEFINE FRAME FRM-maintenance WITH SIZE 28.2 BY 6.7 TITLE "Special Option ..." NO-LABELS
    7.                                  OVERLAY VIEW-AS DIALOG-BOX KEEP-TAB-ORDER SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE FGCOLOR 1 FONT 4.
    8.  
    9.     DISPLAY " " AT ROW 3.50  col 05  FGCOLOR 12 WITH FRAME frm-maintenance .
    10.  
    11.     CREATE RADIO-SET RDO-option
    12.        ASSIGN ROW = 1.6
    13.        COLUMN     = 3.2              
    14.        WIDTH      = 20
    15.        RADIO-BUTTONS = "option 1  ,  1 , " +  "option 2  ,  2 , " + "option 3  ,  3   "
    16.        FRAME = FRAME FRM-maintenance:HANDLE
    17.        SENSITIVE = TRUE
    18.        VISIBLE   = TRUE
    19.        HEIGHT    = 2.9
    20.        BGCOLOR   = 07
    21.        FGCOLOR   = 14
    22.        triggers :
    23.            ON MOUSE-SELECT-DBLCLICK DO :
    24.                message "TOTO" view-as alert-box .
    25.            END.
    26.        end triggers.
    27.  
    28. 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
     
  2.  
  3. Osborne

    Osborne Active Member

  4. altair

    altair New 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 (progress):
    1. DEFINE VARIABLE RDO-option        AS WIDGET-HANDLE.
    2.  
    3. DEFINE VARIABLE m-status      AS LOGICAL .
    4. DEFINE VARIABLE m-choose-opt  AS INTEGER .
    5.  
    6. RUN SetThemeAppProperties(0).
    7.  
    8.     DEFINE FRAME FRM-maintenance WITH SIZE 28.2 BY 6.7 TITLE "Special Option ..." NO-LABELS
    9.                                  OVERLAY VIEW-AS DIALOG-BOX KEEP-TAB-ORDER SIDE-LABELS NO-UNDERLINE THREE-D SCROLLABLE FGCOLOR 1 FONT 4.
    10.  
    11.  
    12.     DISPLAY " " AT ROW 3.50  col 05  FGCOLOR 12 WITH FRAME frm-maintenance .
    13.  
    14.     CREATE RADIO-SET RDO-option
    15.        ASSIGN ROW = 1.6
    16.        COLUMN     = 3.2            
    17.        WIDTH      = 20
    18.        RADIO-BUTTONS = "option 1  ,  1 , " +  "option 2  ,  2 , " + "option 3  ,  3   "
    19.        FRAME = FRAME FRM-maintenance:HANDLE
    20.        SENSITIVE = TRUE
    21.        VISIBLE   = TRUE
    22.        HEIGHT    = 2.9
    23.        BGCOLOR   = 07
    24.        FGCOLOR   = 3
    25.        triggers :
    26.            ON MOUSE-SELECT-DBLCLICK DO :
    27.                message "TOTO" view-as alert-box .
    28.            END.
    29.        end triggers.
    30. WAIT-FOR GO OF FRAME FRM-maintenance.
    31.  
    32. PROCEDURE SetThemeAppProperties EXTERNAL "uxtheme.dll" :
    33. DEFINE INPUT PARAMETER ipi-bool AS LONG     NO-UNDO.
    34. END PROCEDURE.
    35.  

    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.
     
  5. Osborne

    Osborne Active Member

Share This Page