Siempre publique el ejemplo completo Silvio, como en el siguiente ejemplo:
Code: Select all
#include "fivewin.ch"
#include "inkey.ch"
static oWnd
FUNCTION Main()
LOCAL oMenu, oBar
MENU oMenu
MenuItem "From Code" action FromCode( oWnd )
// MenuItem "From Resource" action FromrES( oWnd )
endmenu
DEFINE WINDOW oWnd TITLE "3D objects" MENU oMenu pixel
DEFINE BUTTONBAR oBar _3D OF oWnd
DEFINE BUTTON OF oBar ACTION FromCode( oWnd )
SET MESSAGE OF oWnd TO "3D Objects" NOINSET CLOCK DATE KEYBOARD
ACTIVATE WINDOW oWnd MAXIMIZED
RETURN oWnd
FUNCTION FromCode( oWnd )
LOCAL oDlg
LOCAL oGet1, oGet2, oGet3, oGet4
LOCAL cVar1, cVar2, cVar3, cVar4
LOCAL lActive := .F.
LOCAL cArchiv := SPACE( 40 )
cVar1 := 0
cVar2 := 0
cVar3 := 0
cVar4 := 0
define dialog oDlg title "From Code" pixel size 300, 300
@ 10, 10 GET oGet1 VAR cArchiv bitmap "C:\FWH1905\bitmaps\on.bmp" ;
ACTION( msginfo( "Un día aprendo FiveWin. I love FiveWin." ) ) ;
of oDlg pixel size 60, 12 ;
VALID( OBBLIGATORIO_SILVIO( cArchiv, oGet1, oDlg ) )
@ 40, 10 GET oGet2 VAR cVar2 bitmap "C:\FWH1905\bitmaps\on.bmp" action( msginfo( "Without Transparent" ) ) of oDlg pixel size 60, 12
@ 70, 10 GET oGet3 VAR cVar3 bitmap "C:\FWH1905\bitmaps\chkyes.bmp" action( msginfo( "With Adjust-Transparent" ) ) of oDlg pixel size 120, 12
@ 100, 10 GET oGet4 VAR cVar4 bitmap "C:\FWH1905\bitmaps\chkyes.bmp" ;
action( if( lActive,oGet3:disable(),oGet3:enable() ), lActive := !lActive, oDlg:update() ) of oDlg pixel size 120, 12
oGet1:lBtnTransparent := .T. // transparent button get oGet1
oGet3:disable()
oGet3:lBtnTransparent := .T. // transparent button get oGet3
oGet3:lAdjustBtn := .T. // Button Get Adjust Witdh oGet3
oGet3:lDisColors := .F. // Deactive disable color
oGet3:nClrTextDis := CLR_WHITE // Color text disable status
oGet3:nClrPaneDis := CLR_BLUE // Color Pane disable status
oGet4:lAdjustBtn := .T.
activate dialog oDlg centered
RETURN nil
FUNCTION OBBLIGATORIO_SILVIO( cArchiv, oGet1, oDlg )
IF( .NOT. EMPTY( RTrim( cArchiv ) ) ) // full
MsgInfo( "Perfecto Silvio - OOP -> POO - Hay dados." )
ELSE // vacio
MsgInfo( "E' obbligatorio introdurre un nome per l'archivio.", "Attenzione Hombre de Dios." )
RETURN( .F. )
ENDIF
RETURN( .T. )
// FIN - kapiabafwh@gmail.com
Regards, saludos.