FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour RADIO ( TRADMENU() ) have no hWnd ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
RADIO ( TRADMENU() ) have no hWnd ?
Posted: Fri Apr 14, 2023 12:00 PM
hi,

i get no hWnd of RADIO :shock:
Code (fw): Select all Collapse
   @ 10, 10 RADIO oRadio VAR nRadio ;
      ITEMS "Button", "CheckBox", "Group", "Bitmaps", "ComboBox", "Dialog",;
      "Get", "Icon", "ListBox", "MdiChild", "MdiFrame", "Meter",;
      "MGet", "Radio", "Say", "Scrollbar","Video", "WBrowse", "Window"  ;
      COLOR BFcolor, BGcolor ;
      OF oWnd  SIZE 180, 25 PIXEL

5297   SetWindowTheme( oRadio:hWnd, "", "" )
Error occurred at: 14.04.2023, 13:54:47
Error description: Error BASE/1004 Message not found: TRADMENU:HWND
Args:
[ 1] = O TRADMENU
how can i remove "visual Style" from RADIO :?:
greeting,

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: RADIO ( TRADMENU() ) have no hWnd ?
Posted: Fri Apr 14, 2023 03:18 PM
Jimmy, whenever possible, post the full example. What do you not like about this model?

Jimmy, siempre que sea posible, publica el ejemplo completo. ¿Qué no te gusta de este modelo?
Code (fw): Select all Collapse
// C:\FWH..\SAMPLES\JIMMYRAD.PRG

#include "FiveWin.ch"

STATIC oWnd

FUNCTION Main()

   LOCAL oBar

   SkinButtons()

   DEFINE WINDOW oWnd MDI

   DEFINE BUTTONBAR oBar OF oWnd _3D

   DEFINE BUTTON OF oBar NOBORDER               ;
      FILENAME "..\bitmaps\16x16\Help.bmp"      ;
      ACTION BuildChild()

   ACTIVATE WINDOW oWnd CENTERED                ;
      ON INIT( SetWindowTheme( oWnd:hWnd, "", "" ) )

RETURN NIL

FUNCTION BuildChild()

   LOCAL oWndChild, nValue := 3, oRad

   SET _3DLOOK ON

   DEFINE WINDOW oWndChild MDICHILD ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   @ 1, 5 BUTTON "&Test" SIZE 70, 20 ACTION MsgInfo( nValue )

   @ 3, 2 RADIO oRad VAR nValue _3D SIZE 150, 25  ;
      ITEMS "Button", "CheckBox", "Group", "Bitmaps", "ComboBox", "Dialog",  ;
      "Get", "Icon", "ListBox", "MdiChild", "MdiFrame", "Meter",             ;
      "MGet", "Radio", "Say", "Scrollbar","Video", "WBrowse", "Window"       ;
      HELPID 100, 101, 102                                                   ;
      COLOR CLR_HGREEN, CLR_WHITE ;
      ON CHANGE MsgBeep()

   ACTIVATE WINDOW oWndChild

RETURN NIL

// FIN / END
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: RADIO ( TRADMENU() ) have no hWnd ?
Posted: Fri Apr 14, 2023 05:41 PM
hi,

thx for Answer

i´m still a Newbie and try RADIO Control

i want to use "Dark-Mode" so i´m playing with Control to "paint it black"
for this i need hWnd of Control and was surprise that RADIO does not give me hWnd :o
greeting,

Jimmy
Posts: 8515
Joined: Tue Dec 20, 2005 07:36 PM
Re: RADIO ( TRADMENU() ) have no hWnd ?
Posted: Fri Apr 14, 2023 06:47 PM
So, help Jimmy?
Code (fw): Select all Collapse
// C:\FWH..\SAMPLES\JIMMYRAD.PRG

#include "FiveWin.ch"

#define CLR_PretoDark        RGB(       0, 0, 0 ) // black
#define CLR_SombrioDark      RGB(    29, 29, 29 )
#define CLR_CinzaDark+       RGB(    34, 34, 34 )
#define CLR_Cinza_Dark       RGB(    51, 51, 51 )
#define CLR_CinzentoDark     RGB(    85, 85, 85 )
#define CLR_CinzaWhite       RGB( 153, 153, 153 )
#define CLR_IsqueiroDark     RGB( 238, 238, 238 )
#define CLR_BrancoWhite      RGB( 255, 255, 255 )

STATIC oWnd

FUNCTION Main()

   LOCAL oBar

   SkinButtons()

   DEFINE WINDOW oWnd MDI

   DEFINE BUTTONBAR oBar OF oWnd _3D

   DEFINE BUTTON OF oBar NOBORDER               ;
      FILENAME "..\bitmaps\16x16\Help.bmp"      ;
      ACTION BuildChild()

   ACTIVATE WINDOW oWnd CENTERED                ;
      ON INIT( SetWindowTheme( oWnd:hWnd, "", "" ) )

RETURN NIL

FUNCTION BuildChild()

   LOCAL oWndChild, nValue := 3, oRad

   SET _3DLOOK ON

   DEFINE WINDOW oWndChild MDICHILD ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   @ 1, 5 BUTTON "&Test" SIZE 70, 20 ACTION MsgInfo( nValue )

   @ 3, 2 RADIO oRad VAR nValue _3D SIZE 150, 25  ;
      ITEMS "Button", "CheckBox", "Group", "Bitmaps", "ComboBox", "Dialog",  ;
      "Get", "Icon", "ListBox", "MdiChild", "MdiFrame", "Meter",             ;
      "MGet", "Radio", "Say", "Scrollbar","Video", "WBrowse", "Window"       ;
      COLOR CLR_HRED, CLR_SombrioDark                                        ;
      HELPID 100, 101, 102                                                   ;
      ON CHANGE MsgBeep()

   ACTIVATE WINDOW oWndChild ;
      ON INIT( CTRLS_COLORS( oWndChild ) )

RETURN NIL
// By Giovanny Vecchi - TESTRAD.PRG aqui na minha pasta.
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_HRED, CLR_PretoDark ) } } )
                    
         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
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Re: RADIO ( TRADMENU() ) have no hWnd ?
Posted: Sat Apr 15, 2023 03:58 PM

hi,

thx for Answer

interesting Solution

greeting,

Jimmy

Continue the discussion