El ejemplo desarrollado por Roberto Lopez definido en Adavance - User Components en C:/hmg.3.0.46/doc/data/index.htm
nos deja una posibilidad de crear nuestros propios controles.
este ejemplo viene arrastrando errores que no permiten compilar, Pablo Cesár corrigio estos problemas, ahora se puede compilar desde HMG.3.0.46
hice una pequeña correccion al ejemplo propuesto por Pablo.
recuerde leer Readme.txt que viene acompañado en la carpeta del ejemplo.
Translate Google :
The example developed by Roberto Lopez defined in Adavance - User Components
In C:/hmg.3.0.46/doc/data/index.htm
gives us a chance to create our own controls.
This example has been dragging compile errors that prevent, Pablo Cesár corrected these problems, now can be compiled from
HMG.3.0.46
I made a small correction to the example given by Pablo.
remember to read Readme.txt that comes with the folder of the example.
C:\hmg.3.0.46\SAMPLES\USER.COMPONENTS
Code: Select all
/*
* HMG User Components Demo
* (c) 2006 Roberto Lopez
*/
#include "hmg.ch"
*Set Procedure To mybutton.prg
Function Main
DEFINE WINDOW Win1 ;
AT 0,0 ;
WIDTH 400 ;
HEIGHT 300 ;
TITLE 'Custom Component Demo' ;
MAIN
DEFINE MAIN MENU
DEFINE POPUP 'Test'
MENUITEM 'Custom Method: SetFocus' ACTION Win1.Test2.SetFocus
MENUITEM 'Custom Method: Disable' ACTION Win1.Test2.Enabled:= .F.
MENUITEM 'Custom Method: Enable' ACTION Win1.Test2.EnableD:= .T.
MENUITEM 'Custom Property: Handle (Get)' ACTION MsgInfo( Str( GetProperty( "Win1" , "Test2" , "Handle" ) ) )
MENUITEM 'Custom Property: Handle (Set)' ACTION SetProperty( "Win1" , "Test2" , "Handle" , 1 )
MENUITEM 'Custom Property: Caption (Get)' ACTION MsgInfo ( Win1.Test2.Caption )
MENUITEM 'Custom Property: Caption (Set)' ACTION Win1.Test2.Caption := 'New Caption'
END POPUP
END MENU
@ 10 , 10 MYBUTTON test2 ;
OF Win1 ;
CAPTION 'Custom Button' ;
ACTION MsgInfo('Click!')
@ 50 , 10 Label Thanks;
AUTOSIZE ;
VALUE 'Thanks Pablo César '
@ 70 , 10 Label Thanks1;
AUTOSIZE ;
VALUE 'for the contribution to the example'
@ 90 , 10 Label Thanks2;
AUTOSIZE ;
VALUE ' MYBUTTON in UCI ' ;
ACTION msginfo('Test UCI')
END WINDOW
CENTER WINDOW Win1
ACTIVATE WINDOW Win1
Return