Jump to content
Fivewin Brasil

Radio com Imagem


maudruidas

Recommended Posts

// C:\FWH\SAMPLES\RADTRANS.PRG - Inclua o MANIFEST e o TRANSPARENT no DIALOGO.

// Testing some radio buttons

#include "FiveWin.ch"

STATIC oDlg

FUNCTION Main()

   LOCAL nValue := 3, oRadio

   SET _3DLOOK ON

   // SET HELPFILE TO "Test.hlp"

   DEFINE DIALOG oDlg TRANSPARENT ;
      TITLE "Testing a Radio Buttons Menu" COLOR "N/W"

   oDlg:lHelpIcon := .F.

   @ 1, 1 BUTTON "&Test" SIZE 70, 20 ;
      ACTION ( MsgInfo( nValue ), oRadio:aItems[ 2 ]:SetText( "&Changed!" ) )

   @ 3, 2 RADIO oRadio VAR nValue ;
      ITEMS "&Kapiaba", "&Maudruidas", "T&hotokos" _3D SIZE 150, 25 ;
      HELPID 100, 101, 102 ;
      ON CHANGE MsgBeep()

   // adding an extra radio item at a different location
   @ 5, 25 RADIOITEM "Fiv&win" RADIOMENU oRadio OF oDlg SIZE 150, 25

   // INCLUA O MANIFEST DO WINDOWS -> WINDOWS10.MANIFEST
   ACTIVATE DIALOG oDlg CENTERED ;                 // color in Radio/Checkbox
      ON INIT( oDlg:SetSize( 600, 400 ), IsAppThemed(), CTRLS_COLORS( oDlg ) )

RETURN NIL
// 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( METRO_ORANGE, CLR_WHITE ) } } )
					
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

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

            lc_aCtrls[lc_iFor]:SetColor( METRO_ORANGE, CLR_WHITE )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN / END - kapiabafwh@gmail.com 

Esse novo forum tá de laskar() PQP. kkkkkkkkk

Link to comment
Share on other sites

Melhorando...

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

// Testing some radio buttons

#include "FiveWin.ch"

FUNCTION Main()

   LOCAL oDlg, nValue := 3, oRadio, oBrush, oFont, cTitle

   SET _3DLOOK ON

   cTitle := "Testing a Radio Buttons Menu"

   DEFINE BRUSH oBrush FILE "..\bitmaps\sea.bmp" STRETCH // RESIZE

   DEFINE FONT oFont NAME "Verdana" SIZE 0,-18 BOLD

   DEFINE DIALOG oDlg SIZE 600, 450 BRUSH oBrush TITLE cTitle  FONT oFont ;
      TRANSPARENT

   oDlg:lHelpIcon := .F.

   @ 1, 1 BUTTON "&Test" SIZE 70, 20 ;
      ACTION ( MsgInfo( nValue ), oRadio:aItems[ 2 ]:SetText( "&Changed!" ) )

   @ 3, 2 RADIO oRadio VAR nValue ;
      ITEMS "&Kapiaba", "&Maudruidas", "T&hotokos" _3D SIZE 150, 25 ;
      HELPID 100, 101, 102 ;
      ON CHANGE MsgBeep()

   // adding an extra radio item at a different location
   @ 5, 25 RADIOITEM "Five&win" RADIOMENU oRadio OF oDlg SIZE 150, 25

   // INCLUA O MANIFEST DO WINDOWS -> WINDOWS10.MANIFEST
   ACTIVATE DIALOG oDlg CENTERED ;
      ON INIT( IsAppThemed(), CTRLS_COLORS( oDlg ) ) // color in Radio/Checkbox

   oBrush:End()

RETURN NIL
// 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( METRO_ORANGE, CLR_WHITE ) } } )
					
         ELSEIF lc_aCtrls[lc_iFor]:ClassName() == "TCHECKBOX"

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

            lc_aCtrls[lc_iFor]:SetColor( METRO_ORANGE, CLR_WHITE )

         ENDIF

      ENDIF

   NEXT

RETURN NIL

// FIN / END - kapiabafwh@gmail.com

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...