RADIO ( TRADMENU() ) have no hWnd ?

RADIO ( TRADMENU() ) have no hWnd ?

Postby Jimmy » Fri Apr 14, 2023 12:00 pm

hi,

i get no hWnd of RADIO :shock:

Code: Select all  Expand view  RUN
  @ 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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: RADIO ( TRADMENU() ) have no hWnd ?

Postby karinha » Fri Apr 14, 2023 3: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: Select all  Expand view  RUN

// 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
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RADIO ( TRADMENU() ) have no hWnd ?

Postby Jimmy » Fri Apr 14, 2023 5: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
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Re: RADIO ( TRADMENU() ) have no hWnd ?

Postby karinha » Fri Apr 14, 2023 6:47 pm

So, help Jimmy?

Code: Select all  Expand view  RUN

// 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
User avatar
karinha
 
Posts: 7831
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: RADIO ( TRADMENU() ) have no hWnd ?

Postby Jimmy » Sat Apr 15, 2023 3:58 pm

hi,

thx for Answer

interesting Solution
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: Google [Bot] and 105 guests