Set RADIO Theme OFF

Set RADIO Theme OFF

Postby Jimmy » Sat Apr 29, 2023 6:07 am

hi,

this CODE work with Dark-Mode when have NO Manifest for visual Style
Code: Select all  Expand view
#include "Fivewin.CH"

PROCEDURE MAIN
LOCAL oPickList
LOCAL oUSERDD
LOCAL oDELONOFF
LOCAL aDelOnOff, lisOnOff
LOCAL nWide, nUSERDD := 1, nDELONOFF := 1, nWidth := 550
LOCAL oCursor, ii, iMax, oObj, hDC, acItems := {}
LOCAL aOptions, nItems
LOCAL oRI01,oRI02,oRI03,oRI04,oRI05,oRI06,oRI10,oRI11

   aDelOnOff := { "SET DELETED ON", "SET DELETED OFF" }
   IF hb_OSIS64BIT()
      aOptions := { "CLIPPER", "COMIX", "VFP", "HB32", "HB64", "NTXOBJ2" }
      nItems := 7
   ELSE
      aOptions := { "CLIPPER", "COMIX", "VFP", "HB32", "NTXOBJ2" }
      nItems := 6
   ENDIF
   nWide := ( nWidth - 2 ) / nItems

   DEFINE DIALOG oPickList ;
         SIZE nWidth, 420 PIXEL TRUEPIXEL ;
         TITLE "Picklist" ;
         COLOR CLR_HCYAN, CLR_BLACK

      @ 290,  0 RADIO oUSERDD   VAR nUSERDD SIZE nWide, 30 PIXEL ;
              OF oPickList ;
              COLOR CLR_HCYAN, CLR_BLACK  ;
              ITEMS "DEFAULT" UPDATE ;
              ON CHANGE nil

*     @ 290, ( 0 * nWide ) RADIOITEM oRI01 PROMPT "DEFAULT" OF oPickList SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK
      @ 290, ( 1 * nWide ) RADIOITEM oRI02 PROMPT "CLIPPER" OF oPickList SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK
      @ 290, ( 2 * nWide ) RADIOITEM oRI03 PROMPT "COMIX"   OF oPickList SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK
      @ 290, ( 3 * nWide ) RADIOITEM oRI04 PROMPT "VFP"     OF oPickList SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK
      @ 290, ( 4 * nWide ) RADIOITEM oRI05 PROMPT "HB32"    OF oPickList SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK

      IF hb_OSIS64BIT()
         @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "HB64"    RADIOMENU oUSERDD OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK
         @ 290, ( 6 * nWide ) RADIOITEM oRI06 PROMPT "NTXOBJ2" RADIOMENU oUSERDD OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK
      ELSE
         @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "NTXOBJ2" RADIOMENU oUSERDD OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK
      ENDIF

      @ 350,  0 RADIO oDELONOFF VAR nDELONOFF SIZE nWidth/2, 30 PIXEL ;
              OF oPickList ;
              COLOR CLR_HCYAN, CLR_BLACK  ;
              ITEMS aDelOnOff[1] UPDATE ;
              ON CHANGE nil

*      @ 350,  0            RADIOITEM oRI10 PROMPT aDelOnOff[1] RADIOMENU oDELONOFF OF oPickList SIZE nWidth / 2, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK
      @ 350, ( nWidth / 2 ) RADIOITEM oRI11 PROMPT aDelOnOff[2] RADIOMENU oDELONOFF OF oPickList SIZE nWidth / 2, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK

      lisOnOff := SET( _SET_DELETED )
      IF( lisOnOff, nDELONOFF := 1, nDELONOFF := 2 )

      /******* switch OFF Theme *******/

*      SetWindowTheme( oRI01:hWnd, "", "" )
      SetWindowTheme( oRI02:hWnd, "", "" )
      SetWindowTheme( oRI03:hWnd, "", "" )
      SetWindowTheme( oRI04:hWnd, "", "" )
      SetWindowTheme( oRI05:hWnd, "", "" )

*     SetWindowTheme( oRI10:hWnd, "", "" )
      SetWindowTheme( oRI11:hWnd, "", "" )

      iMax := LEN(oUSERDD:aItems)
      FOR ii := 1 TO iMax
         oObj := oUSERDD:aItems[ii]
         SetWindowTheme( oObj:hWnd, "", "" )
         hDC := GetDC(oObj:hWnd)
         SetTextColor(hDC, CLR_HCYAN)
         SetBkColor(hDC, CLR_BLACK)
         ReleaseDC(hDC)
         INVALIDATERECT( oObj:hWnd )
      NEXT

      iMax := LEN(oDELONOFF:aItems)
      FOR ii := 1 TO iMax
         oObj := oDELONOFF:aItems[ii]
         SetWindowTheme( oObj:hWnd, "", "" )
         hDC := GetDC(oObj:hWnd)
         SetTextColor(hDC, CLR_HCYAN)
         SetBkColor(hDC, CLR_BLACK)
         ReleaseDC(hDC)
         INVALIDATERECT( oObj:hWnd )
      NEXT

#IFDEF __HMG__
      END DIALOG
#ENDIF

   ACTIVATE DIALOG oPickList CENTER

RETURN

when using Manifest i got BLACK Font Color on BLACK Background
i also try to "switch" Theme of RADIOITEM but it does not help :(

who can help me please :idea:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Set RADIO Theme OFF

Postby karinha » Sun Apr 30, 2023 3:43 pm

Hi Jimmy,

Code: Select all  Expand view

// C:\FWH..\SAMPLES\JIMMRAD2.PRG

#include "Fivewin.CH"

#define CLR_PretoDark        RGB(   0,   0,   0 )
#define CLR_SombrioDark      RGB(  29,  29,  29 )
#define CLR_CinzaDarkP       RGB(  34,  34,  34 ) // dark Plus
#define CLR_Cinza_Dark       RGB(  51,  51,  51 )
#define CLR_CinzentoDark     RGB(  85,  85,  85 )

FUNCTION Main()

   LOCAL aOptions, nItems, oBtnPict, nColor := 1
   LOCAL oFont, oPickList, oUSERDD, oDELONOFF, aDelOnOff, lisOnOff
   LOCAL nWide, nUSERDD := 1, nDELONOFF := 1, nWidth := 550
   LOCAL oCursor, II, iMax, oObj, hDC, acItems := {}
   LOCAL oRI01, oRI02, oRI03, oRI04, oRI05, oRI06, oRI10, oRI11

   SkinButtons()

   aDelOnOff := { "SET DELETED ON", "SET DELETED OFF" }

   // OS() +" - "+ Iif( IsWin64()," (64 bits)", " (32 bits)" )
   // IF hb_osIs64bit() // Harbour
   If( IsWin64() ) // Harbour/xHarbour

      aOptions := { "CLIPPER", "COMIX", "VFP", "HB32", "HB64", "NTXOBJ2" }

      nItems := 7

   ELSE

      aOptions := { "CLIPPER", "COMIX", "VFP", "HB32", "HB32", "NTXOBJ2" }

      nItems := 7

   ENDIF

   nWide := ( nWidth - 2 ) / nItems

   DEFINE FONT oFont NAME "COURIER NEW" SIZE 0, -14 BOLD

   DEFINE DIALOG oPickList SIZE nWidth, 420 PIXEL TRUEPIXEL TITLE "Picklist" ;
      COLOR CLR_CinzentoDark, CLR_CinzaDarkP TRANSPARENT FONT oFont

   oPickList:lHelpIcon := .F.

   @ 290, 000 RADIO oUSERDD VAR nUSERDD SIZE nWide, 30 PIXEL                 ;
      OF oPickList COLOR CLR_HCYAN, CLR_BLACK ITEMS "DEFAULT" UPDATE         ;
      ON CHANGE nil

   /*
   @ 290, ( 0 * nWide ) RADIOITEM oRI01 PROMPT "DEFAULT" OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK
   */


   @ 290, ( 1 * nWide ) RADIOITEM oRI02 PROMPT "CLIPPER" OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK

   @ 290, ( 2 * nWide ) RADIOITEM oRI03 PROMPT "COMIX"   OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK

   @ 290, ( 3 * nWide ) RADIOITEM oRI04 PROMPT "VFP"     OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK

   @ 290, ( 4 * nWide ) RADIOITEM oRI05 PROMPT "HB32"    OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_HCYAN, CLR_BLACK

   // OS() +" - "+ Iif( IsWin64()," (64 bits)", " (32 bits)" )
   // IF hb_osIs64bit() // Harbour
   If( IsWin64() ) // Harbour/xHarbour

      @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "HB64"    RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK

      @ 290, ( 6 * nWide ) RADIOITEM oRI06 PROMPT "NTXOBJ2" RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK

   ELSE

      @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "NTXOBJ2" RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK

   ENDIF

   @ 350, 000 RADIO oDELONOFF VAR nDELONOFF SIZE nWidth / 2, 30 PIXEL         ;
      OF oPickList COLOR CLR_HCYAN, CLR_BLACK ITEMS aDelOnOff[ 1 ] UPDATE     ;
      ON CHANGE nil

   /*
   @ 350,  0            RADIOITEM oRI10 PROMPT aDelOnOff[1] RADIOMENU         ;
      oDELONOFF OF oPickList SIZE nWidth / 2, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK
   */


   @ 350, ( nWidth / 2 ) RADIOITEM oRI11 PROMPT aDelOnOff[ 2 ] RADIOMENU     ;
      oDELONOFF OF oPickList SIZE nWidth / 2, 30 PIXEL COLOR CLR_HCYAN, CLR_BLACK

   lisOnOff := Set( _SET_DELETED )

   IF( lisOnOff, nDELONOFF := 1, nDELONOFF := 2 )

      /******* switch OFF Theme *******/

      // SetWindowTheme( oRI01:hWnd, "", "" )
      SetWindowTheme( oRI02:hWnd, "", "" )
      SetWindowTheme( oRI03:hWnd, "", "" )
      SetWindowTheme( oRI04:hWnd, "", "" )
      SetWindowTheme( oRI05:hWnd, "", "" )

      // SetWindowTheme( oRI10:hWnd, "", "" )
      SetWindowTheme( oRI11:hWnd, "", "" )

      iMax := Len( oUSERDD:aItems )

      FOR ii := 1 TO iMax

         oObj := oUSERDD:aItems[ ii ]

         SetWindowTheme( oObj:hWnd, "", "" )

         hDC := GetDC( oObj:hWnd )

         SetTextColor( hDC, CLR_HCYAN )

         SetBkColor( hDC, CLR_BLACK )

         ReleaseDC( hDC )

         INVALIDATERECT( oObj:hWnd )

      NEXT

      iMax := Len( oDELONOFF:aItems )

      FOR ii := 1 TO iMax

         oObj := oDELONOFF:aItems[ ii ]

         SetWindowTheme( oObj:hWnd, "", "" )

         hDC := GetDC( oObj:hWnd )

         SetTextColor( hDC, CLR_HCYAN )

         SetBkColor( hDC, CLR_BLACK )

         ReleaseDC( hDC )

         INVALIDATERECT( oObj:hWnd )

      NEXT

   @ 6,  5 BUTTON oBtnPict PROMPT "&Color" OF oPickList SIZE 80, 20          ;
      ACTION SET_COLOR( oPickList, nColor ) DEFAULT

   #ifdef __HMG__
      END DIALOG
   #endif

   ACTIVATE DIALOG oPickList CENTERED ON INIT( CTRLS_COLORS( oPickList ) )

   oFont:End()

RETURN NIL

FUNCTION SET_COLOR( oPickList, nColor )

   LOCAL oIni, oBrush, oBmp
   LOCAL nTipo, cStyle, cFile, cLogo, nRow, nCol, lSelect

   nColor := ChooseColor()

   oPickList:SetColor( CLR_WHITE, nColor )
   oPickList:Refresh()

RETURN( nColor )
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )

   LOCAL lc_aCtrls := {}, lc_iFor := 0
   LOCAL lc_aItemsRadio := {}

   lc_aCtrls := f_oDlgContainer:aControls

   FOR lc_iFor := 1 TO Len( lc_aCtrls )

      IF ValType( lc_aCtrls[lc_iFor] ) == "O"

         IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"

            aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems,                 ;
                   {|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
                   _oRadId:SetColor( CLR_HMAGENTA, CLR_WHITE ) } } )
                   
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

            // SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )

            // lc_aCtrls[lc_iFor]:SetColor( G_COLOR_SYS( 31 ), G_COLOR_SYS( 1 ) )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Set RADIO Theme OFF

Postby Jimmy » Sun Apr 30, 2023 8:49 pm

hi,

thx for Sample CODE

when i click on a Radio-Button than "other" Radio-Button disappear :shock:

but it work with Manifest so i have to look into CODE how you do it
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Set RADIO Theme OFF

Postby karinha » Mon May 01, 2023 12:54 am

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Set RADIO Theme OFF

Postby Jimmy » Mon May 01, 2023 1:58 pm

hi,

thx for Answer

i got it now :D

Question : is there a Way to change FONT of RADIO / RADIOITEM :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Set RADIO Theme OFF

Postby karinha » Mon May 01, 2023 2:33 pm

Yes, SETFONT() .or. CHooseFont()

Code: Select all  Expand view

// C:\FWH..\SAMPLES\JIMMRAD2.PRG

#include "Fivewin.CH"

#define CLR_PretoDark        RGB(   0,   0,   0 )
#define CLR_SombrioDark      RGB(  29,  29,  29 )
#define CLR_CinzaDarkP       RGB(  34,  34,  34 ) // dark Plus
#define CLR_Cinza_Dark       RGB(  51,  51,  51 )
#define CLR_CinzentoDark     RGB(  85,  85,  85 )
#Define CLR_GOLD1      nRGB( 255, 215, 000 ) //-> Gold1  - Ouro 1
#Define CLR_GOLD2      nRGB( 238, 201, 000 ) //-> Gold2  - Ouro 2
#Define CLR_GOLD3      nRGB( 205, 173, 000 ) //-> Gold3  - Ouro 3
#Define CLR_GOLD4      nRGB( 139, 117, 000 ) //-> Gold4  - Ouro 4
#Define CLR_MSPURPLE   nRGB( 0,   120, 215 ) //-> Purpura.
#Define CLR_MSRED      nRGB( 232,  17,  35 )
#Define CLR_MSGRAY     nRGB( 229, 229, 229 )
#Define CLR_LGRAY      nRGB( 230, 230, 230 )

FUNCTION Main()

   LOCAL aOptions, nItems, oBtnPict, nColor := 1
   LOCAL oFont, oFont2, oPickList, oUSERDD, oDELONOFF, aDelOnOff, lisOnOff
   LOCAL nWide, nUSERDD := 1, nDELONOFF := 1, nWidth := 550
   LOCAL oCursor, II, iMax, oObj, hDC, acItems := {}
   LOCAL oRI01, oRI02, oRI03, oRI04, oRI05, oRI06, oRI10, oRI11

   SkinButtons()

   aDelOnOff := { "SET DELETED ON", "SET DELETED OFF" }

   // OS() +" - "+ Iif( IsWin64()," (64 bits)", " (32 bits)" )
   // IF hb_osIs64bit() // Harbour
   If( IsWin64() ) // Harbour/xHarbour

      aOptions := { "CLIPPER", "COMIX  ", "VFP    ", "HB32   ", "HB64   ", "NTXOBJ2" }

      nItems := 7

   ELSE

      aOptions := { "CLIPPER", "COMIX  ", "VFP    ", "HB32   ", "HB32   ", "NTXOBJ2" }

      nItems := 7

   ENDIF

   nWide := ( nWidth - 2 ) / nItems + 12.50

   DEFINE FONT oFont  NAME "COURIER NEW" SIZE 0, -14 BOLD
   DEFINE FONT oFont2 NAME "Ms Sans Serif"  SIZE 00, -14 BOLD


   DEFINE DIALOG oPickList SIZE nWidth, 420 PIXEL TRUEPIXEL TITLE "Picklist"  ;
      COLOR CLR_PretoDark, CLR_CinzaDarkP FONT oFont // SIN TRANSPARENT

   oPickList:lHelpIcon := .F.

   @ 290, 000 RADIO oUSERDD VAR nUSERDD SIZE nWide, 30 PIXEL                  ;
      OF oPickList COLOR CLR_WHITE, CLR_BLACK ITEMS "&DEFAULT" UPDATE         ;
      ON CHANGE nil

   oUSERDD:SetFont( oFont2 )

   @ 290, ( 1 * nWide ) RADIOITEM oRI02 PROMPT "&CLIPPER" OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_WHITE, CLR_BLACK

   oRI02:SetFont( oFont2 )
                                               
   @ 290, ( 2 * nWide ) RADIOITEM oRI03 PROMPT "COMI&X  "   OF oPickList      ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_WHITE, CLR_BLACK

   oRI03:SetFont( oFont2 )
                                               
   @ 290, ( 3 * nWide ) RADIOITEM oRI04 PROMPT "&VFP    "     OF oPickList    ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_WHITE, CLR_BLACK

   oRI04:SetFont( oFont2 )
                                               
   @ 290, ( 4 * nWide ) RADIOITEM oRI05 PROMPT "&HB32   "    OF oPickList     ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_WHITE, CLR_BLACK

   oRI05:SetFont( oFont2 )

   // OS() +" - "+ Iif( IsWin64()," (64 bits)", " (32 bits)" )
   // IF hb_osIs64bit() // Harbour
   If( IsWin64() ) // Harbour/xHarbour
                                                 
      @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "HB64   " RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_WHITE, CLR_BLACK

      oRI05:SetFont( oFont2 )

      @ 290, ( 6 * nWide ) RADIOITEM oRI06 PROMPT "NTXOBJ2" RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_WHITE, CLR_BLACK

      oRI06:SetFont( oFont2 )

   ELSE

      @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "&NTXOBJ2" RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_WHITE, CLR_BLACK

      oRI05:SetFont( oFont2 )

   ENDIF

   @ 350, 000 RADIO oDELONOFF VAR nDELONOFF SIZE nWidth / 2, 30 PIXEL         ;
      OF oPickList COLOR CLR_WHITE, CLR_BLACK ITEMS aDelOnOff[ 1 ] UPDATE     ;
      ON CHANGE nil

   oDELONOFF:SetFont( oFont2 )

   @ 350, ( nWidth / 2.04 ) RADIOITEM oRI11 PROMPT aDelOnOff[ 2 ] RADIOMENU     ;
      oDELONOFF OF oPickList SIZE nWidth / 2, 30 PIXEL COLOR CLR_WHITE, CLR_BLACK

   oRI11:SetFont( oFont2 )

   lisOnOff := Set( _SET_DELETED )

   IF( lisOnOff, nDELONOFF := 1, nDELONOFF := 2 )

      /******* switch OFF Theme *******/

// USE ONLY WINDOWS MANIFEST:

      // SetWindowTheme( oRI01:hWnd, "", "" )
//    SetWindowTheme( oRI02:hWnd, "", "" )
//    SetWindowTheme( oRI03:hWnd, "", "" )
//    SetWindowTheme( oRI04:hWnd, "", "" )
//    SetWindowTheme( oRI05:hWnd, "", "" )

      // SetWindowTheme( oRI10:hWnd, "", "" )
//    SetWindowTheme( oRI11:hWnd, "", "" )

      iMax := Len( oUSERDD:aItems )

      FOR ii := 1 TO iMax

         oObj := oUSERDD:aItems[ ii ]

//       SetWindowTheme( oObj:hWnd, "", "" )

         hDC := GetDC( oObj:hWnd )

         SetTextColor( hDC, CLR_WHITE )

         SetBkColor( hDC, CLR_BLACK )

         ReleaseDC( hDC )

         INVALIDATERECT( oObj:hWnd )

      NEXT

      iMax := Len( oDELONOFF:aItems )

      FOR ii := 1 TO iMax

         oObj := oDELONOFF:aItems[ ii ]

//       SetWindowTheme( oObj:hWnd, "", "" )

         hDC := GetDC( oObj:hWnd )

         SetTextColor( hDC, CLR_WHITE )

         SetBkColor( hDC, CLR_BLACK )

         ReleaseDC( hDC )

         INVALIDATERECT( oObj:hWnd )

      NEXT

   @ 6, 05 BUTTON oBtnPict PROMPT "&Color" OF oPickList SIZE 80, 20          ;
      ACTION SET_COLOR( oPickList, nColor ) DEFAULT

   @ 6, 70 BUTTON oBtnPict PROMPT "&Exit" OF oPickList SIZE 80, 20           ;
      ACTION ( oPickList:End() ) CANCEL

   #ifdef __HMG__
      END DIALOG
   #endif

   ACTIVATE DIALOG oPickList CENTERED ON INIT( CTRLS_COLORS( oPickList ) )

   oFont:End()

RETURN NIL

FUNCTION SET_COLOR( oPickList, nColor )

   LOCAL oIni, oBrush, oBmp
   LOCAL nTipo, cStyle, cFile, cLogo, nRow, nCol, lSelect

   nColor := ChooseColor()

   oPickList:SetColor( CLR_WHITE, nColor )
   oPickList:Refresh()

RETURN( nColor )
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )

   LOCAL lc_aCtrls := {}, lc_iFor := 0
   LOCAL lc_aItemsRadio := {}

   lc_aCtrls := f_oDlgContainer:aControls

   FOR lc_iFor := 1 TO Len( lc_aCtrls )

      IF ValType( lc_aCtrls[lc_iFor] ) == "O"

         IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"

            aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems,                 ;
                   {|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
                   _oRadId:SetColor( CLR_WHITE, CLR_BLACK ) } } )
                   
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

            // SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )

            // lc_aCtrls[lc_iFor]:SetColor( G_COLOR_SYS( 31 ), G_COLOR_SYS( 1 ) )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN / END
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Set RADIO Theme OFF

Postby Jimmy » Mon May 01, 2023 4:22 pm

hi,
karinha wrote:Yes, SETFONT() .or. CHooseFont()

thx for Answer

i have put SetFont() into INIT and it work like i want :D

---

btw.
i have try disable Theme before but it does not work at that place
when do same at INIT it does work ... what is it he Difference :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: Set RADIO Theme OFF

Postby karinha » Mon May 01, 2023 4:29 pm

Hi Jimmy. Small Corrections.

Code: Select all  Expand view

// C:\FWH..\SAMPLES\JIMMRAD2.PRG - Version: 3.1

#include "Fivewin.CH"

#define CLR_PretoDark    RGB(   0,   0,   0 )
#define CLR_SombrioDark  RGB(  29,  29,  29 )
#define CLR_CinzaDarkP   RGB(  34,  34,  34 ) // dark Plus
#define CLR_Cinza_Dark   RGB(  51,  51,  51 )
#define CLR_CinzentoDark RGB(  85,  85,  85 )
#Define CLR_GOLD1        RGB( 255, 215, 000 ) //-> Gold1  - Ouro 1
#Define CLR_GOLD2        RGB( 238, 201, 000 ) //-> Gold2  - Ouro 2
#Define CLR_GOLD3        RGB( 205, 173, 000 ) //-> Gold3  - Ouro 3
#Define CLR_GOLD4        RGB( 139, 117, 000 ) //-> Gold4  - Ouro 4
#Define CLR_MSPURPLE     RGB(   0, 120, 215 ) //-> Purpura.
#Define CLR_MSRED        RGB( 232,  17,  35 )
#Define CLR_MSGRAY       RGB( 229, 229, 229 )
#Define CLR_LGRAY        RGB( 230, 230, 230 )

FUNCTION Main()

   LOCAL aOptions, oBtnPict, oBtnExit, nItems, nColor := 1, oSay, cText
   LOCAL oFont, oFont2, oFont3, oPickList, oUSERDD, oDELONOFF, aDelOnOff, ;
         lisOnOff, nWide, nUSERDD := 1, nDELONOFF := 1, nWidth := 550
   LOCAL oCursor, II, iMax, oObj, hDC, acItems := {}
   LOCAL oRI01, oRI02, oRI03, oRI04, oRI05, oRI06, oRI10, oRI11

   SkinButtons()

   aDelOnOff := { "SET DELETED ON", "SET DELETED OFF" }

   // OS() +" - "+ Iif( IsWin64()," (64 bits)", " (32 bits)" )
   // IF hb_osIs64bit() // Harbour
   If( IsWin64() ) // Harbour/xHarbour

      aOptions := { "CLIPPER", "COMIX  ", "VFP    ", "HB32   ", "HB64   ", "NTXOBJ2" }

      nItems := 7

   ELSE

      aOptions := { "CLIPPER", "COMIX  ", "VFP    ", "HB32   ", "HB32   ", "NTXOBJ2" }

      nItems := 7

   ENDIF

   Iif( IsWin64(), cText := "CHOICE AN OPTION(64 bits)",                     ;
                   cText := "CHOICE AN OPTION(32 bits)" )

   nWide := ( nWidth - 2 ) / nItems + 12.50

   oCursor := TCursor():New(, 'HAND' )

   DEFINE FONT oFont  NAME "COURIER NEW"   SIZE 00, -14 BOLD
   DEFINE FONT oFont2 NAME "Ms Sans Serif" SIZE 00, -14 BOLD
   DEFINE FONT oFont3 NAME "Ms Sans Serif" SIZE 00, -34 BOLD

   DEFINE DIALOG oPickList SIZE nWidth, 420 PIXEL TRUEPIXEL TITLE "Picklist"  ;
      COLOR CLR_PretoDark, CLR_CinzaDarkP FONT oFont // SIN TRANSPARENT

   oPickList:lHelpIcon := .F.

   @ 190, 000 SAY oSay VAR cText SIZE 547, 044 PIXEL OF oPickList ;
      COLOR CLR_GOLD3, CLR_BLACK UPDATE CENTER FONT oFont3

   @ 290, 000 RADIO oUSERDD VAR nUSERDD SIZE nWide, 30 PIXEL                  ;
      OF oPickList COLOR CLR_GOLD3, CLR_BLACK ITEMS "&DEFAULT" UPDATE         ;
      ON CHANGE nil

   oUSERDD:aItems[1]:cTooltip := "Choose an option"

   oUSERDD:SetFont( oFont2 )

   oUSERDD:aItems[1]:oCursor := oCursor

   @ 290, ( 1 * nWide ) RADIOITEM oRI02 PROMPT "&CLIPPER" OF oPickList        ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_GOLD3, CLR_BLACK

   oRI02:SetFont( oFont2 )

   oRI02:cTooltip := "Choose Clipper"

   oRI02:oCursor := oCursor
                                               
   @ 290, ( 2 * nWide ) RADIOITEM oRI03 PROMPT "COMI&X  "   OF oPickList      ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_GOLD3, CLR_BLACK

   oRI03:SetFont( oFont2 )

   oRI03:cTooltip := "Choose Comix"

   oRI03:oCursor := oCursor
                                               
   @ 290, ( 3 * nWide ) RADIOITEM oRI04 PROMPT "&VFP    "     OF oPickList    ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_GOLD3, CLR_BLACK

   oRI04:SetFont( oFont2 )

   oRI04:cTooltip := "Choose Vfp"

   oRI04:oCursor := oCursor
                                               
   @ 290, ( 4 * nWide ) RADIOITEM oRI05 PROMPT "&HB32   "    OF oPickList     ;
      SIZE nWide, 30 PIXEL RADIOMENU oUSERDD COLOR CLR_GOLD3, CLR_BLACK

   oRI05:SetFont( oFont2 )

   oRI05:cTooltip := "Choose Harbour 32 bits"

   oRI05:oCursor := oCursor

   // OS() +" - "+ Iif( IsWin64()," (64 bits)", " (32 bits)" )
   // IF hb_osIs64bit() // Harbour
   If( IsWin64() ) // Harbour/xHarbour
                                                 
      @ 290, ( 5 * nWide ) RADIOITEM oRI05 PROMPT "&HB64   " RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_GOLD3, CLR_BLACK

      oRI05:SetFont( oFont2 )

      oRI05:cTooltip := "Choose Harbour 64 bits"

      oRI05:oCursor := oCursor

      @ 290, ( 6 * nWide ) RADIOITEM oRI06 PROMPT "&NTXOBJ2" RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_GOLD3, CLR_BLACK

      oRI06:SetFont( oFont2 )

      oRI06:cTooltip := "Choose RDD .NTX"

      oRI06:oCursor := oCursor

   ELSE

      @ 290, ( 5 * nWide ) RADIOITEM oRI06 PROMPT "&NTXOBJ2" RADIOMENU oUSERDD ;
         OF oPickList SIZE nWide, 30 PIXEL COLOR CLR_GOLD3, CLR_BLACK

      oRI06:SetFont( oFont2 )

      oRI06:cTooltip := "Choose RDD .NTX"

      oRI06:oCursor := oCursor

   ENDIF

   @ 350, 000 RADIO oDELONOFF VAR nDELONOFF SIZE nWidth / 2, 30 PIXEL         ;
      OF oPickList COLOR CLR_GOLD3, CLR_BLACK ITEMS aDelOnOff[ 1 ] UPDATE     ;
      ON CHANGE nil

   oDELONOFF:SetFont( oFont2 )

   oDELONOFF:aItems[1]:cTooltip := "Choose Set Deleted On"

   oDELONOFF:aItems[1]:oCursor := oCursor

   @ 350, ( nWidth / 2.04 ) RADIOITEM oRI11 PROMPT aDelOnOff[ 2 ] RADIOMENU     ;
      oDELONOFF OF oPickList SIZE nWidth / 2, 30 PIXEL COLOR CLR_GOLD3, CLR_BLACK

   oRI11:SetFont( oFont2 )

   oRI11:cTooltip := "Choose Set Deleted Off"

   oRI11:oCursor := oCursor

   lisOnOff := Set( _SET_DELETED )

   IF( lisOnOff, nDELONOFF := 1, nDELONOFF := 2 )

      /******* switch OFF Theme *******/

      // SetWindowTheme( oRI01:hWnd, "", "" )
//    SetWindowTheme( oRI02:hWnd, "", "" )
//    SetWindowTheme( oRI03:hWnd, "", "" )
//    SetWindowTheme( oRI04:hWnd, "", "" )
//    SetWindowTheme( oRI05:hWnd, "", "" )

      // SetWindowTheme( oRI10:hWnd, "", "" )
//    SetWindowTheme( oRI11:hWnd, "", "" )

      iMax := Len( oUSERDD:aItems )

      FOR ii := 1 TO iMax

         oObj := oUSERDD:aItems[ ii ]

//       SetWindowTheme( oObj:hWnd, "", "" )

         hDC := GetDC( oObj:hWnd )

         SetTextColor( hDC, CLR_GOLD3 )

         SetBkColor( hDC, CLR_BLACK )

         ReleaseDC( hDC )

         INVALIDATERECT( oObj:hWnd )

      NEXT

      iMax := Len( oDELONOFF:aItems )

      FOR ii := 1 TO iMax

         oObj := oDELONOFF:aItems[ ii ]

//       SetWindowTheme( oObj:hWnd, "", "" )

         hDC := GetDC( oObj:hWnd )

         SetTextColor( hDC, CLR_GOLD3 )

         SetBkColor( hDC, CLR_BLACK )

         ReleaseDC( hDC )

         INVALIDATERECT( oObj:hWnd )

      NEXT

   @ 6, 05 BUTTON oBtnPict PROMPT "&Color" OF oPickList SIZE 80, 20          ;
      ACTION SET_COLOR( oPickList, nColor ) DEFAULT

   oBtnPict:cTooltip := "Choose Color Of Dialog"

   oBtnPict:oCursor := oCursor

   oBtnPict:lTransparent = .T.

   @ 6, 70 BUTTON oBtnExit PROMPT "&Exit" OF oPickList SIZE 80, 20           ;
      ACTION ( oPickList:End() ) CANCEL

   oBtnExit:cTooltip := "Exit - Cancel"

   oBtnExit:oCursor := oCursor

   oBtnExit:lTransparent = .T.

   #ifdef __HMG__
      END DIALOG
   #endif

   ACTIVATE DIALOG oPickList CENTERED ON INIT( CTRLS_COLORS( oPickList ) )

   oFont:End()
   oFont2:End()
   oFont3:End()

RETURN NIL

FUNCTION SET_COLOR( oPickList, nColor )

   LOCAL oIni, oBrush, oBmp
   LOCAL nTipo, cStyle, cFile, cLogo, nRow, nCol, lSelect

   nColor := ChooseColor()

   oPickList:SetColor( CLR_GOLD3, nColor )
   oPickList:Refresh()

RETURN( nColor )
// By Giovanny Vecchi
FUNCTION CTRLS_COLORS( f_oDlgContainer )

   LOCAL lc_aCtrls := {}, lc_iFor := 0
   LOCAL lc_aItemsRadio := {}

   lc_aCtrls := f_oDlgContainer:aControls

   FOR lc_iFor := 1 TO Len( lc_aCtrls )

      IF ValType( lc_aCtrls[lc_iFor] ) == "O"

         IF lc_aCtrls[lc_iFor]:ClassName() == "TRADIO"

            aEval( lc_aCtrls[lc_iFor]:oRadMenu:aItems,                 ;
                   {|_oRadId|{ SetWindowTheme( _oRadId:hWnd, "", "" ), ;
                   _oRadId:SetColor( CLR_GOLD3, CLR_BLACK ) } } )
                   
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

            // SetWindowTheme( lc_aCtrls[lc_iFor]:hWnd, "", "" )

            // lc_aCtrls[lc_iFor]:SetColor( G_COLOR_SYS( 31 ), G_COLOR_SYS( 1 ) )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN / END - kapiabafwh@gmail.com
 


Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Set RADIO Theme OFF

Postby karinha » Mon May 01, 2023 4:36 pm

I love playing with FIVEWIN. hahahahahaha.

https://imgur.com/mIqauzW

Image

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7826
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Set RADIO Theme OFF

Postby Jimmy » Mon May 01, 2023 5:09 pm

hi,
karinha wrote:I love playing with FIVEWIN. hahahahahaha.

hi,

that is nice using GOLD Font :)

at that place, above RADIO Buttpn, i have 2 x Listbox() to "pick" FIELD
Image
i will release Picklist() in other Thread
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 81 guests