Control under the Mouse
Moderator: Rathinagiri
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Control under the Mouse
Eres un mago
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Control under the Mouse
My two cents:
Code: Select all
#define WM_SETCURSOR 32
#define WM_PARENTNOTIFY 528
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Control under the Mouse
Hola DR. Claudio Soto
Saludos
No se como utilizar sus "Dos centavos", alguna idea?, Como se manejan o ...srvet_claudio wrote:Re: Control under the Mouse
My two cents:
Code:
#define WM_SETCURSOR 32
#define WM_PARENTNOTIFY 528
Saludos
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Control under the Mouse
Hola Javier,
son los nombres de los mensajes de Windows interceptados por la rutina, es solo por cuestión de claridad.
son los nombres de los mensajes de Windows interceptados por la rutina, es solo por cuestión de claridad.
Code: Select all
#define WM_SETCURSOR 32
#define WM_PARENTNOTIFY 528
Function TestMove()
Local hWnd := EventHWND()
Local nMsg:= EventMsg()
Local wParam:= EventWPARAM ()
Local cNom, cForm
if nMsg == WM_SETCURSOR .and. wParam <> w_test.HANDLE
GetControlNameByHandle(wParam,@cNom, @cForm)
msgbox("Event " + str( nMsg,3,0) + " / " + str(wParam,8,0) + " / " + cNom + " / " + cForm )
endif
Return Nil
Function SelectCtrl()
Local hWnd := EventHWND()
Local nMsg:= EventMsg()
Local wParam:= EventWPARAM ()
Local cNom,cForm
Static ctrlselect:= ""
if wParam <> w_test.HANDLE
if nMsg == WM_PARENTNOTIFY .and. !empty(ctrlselect)
msgbox("ctrl selected " + ctrlselect )
else
if nMsg == WM_SETCURSOR
GetControlNameByHandle(wParam,@cNom, @cForm)
ctrlselect:= HMG_UPPER (cNom)
else
ctrlselect:= ""
endif
endif
endif
Return Nil
-
- Posts: 1275
- Joined: Tue Sep 03, 2013 4:22 am
- Location: Tecámac, México
Re: Control under the Mouse
Hola Dr. Claudio Soto,
Gracias por aclarar, vi un poco Microsoft sobre #define WM_SETCURSOR 32 y #define WM_PARENTNOTIFY 528 y todo sobre las API's y es un mundo de información.
Saludos!
Gracias por aclarar, vi un poco Microsoft sobre #define WM_SETCURSOR 32 y #define WM_PARENTNOTIFY 528 y todo sobre las API's y es un mundo de información.
Saludos!
Re: Control under the Mouse
hi,
first thanks for ure answers.
A the begining my purpose was to write an ide to save time for designing forms.
( thats why i wanted to know the control's name under the mouse ).
After a cup of day, i realised that foxpro had a good ide ...
As all the form and it's controls are stored into an scx/sct file ( a simple dbf/ftp file ) which is very simple to read with dbu ( rdd dbf/cdx ).
now, it's very simple to convert ur's prg form design to foxpro properties ( as they are quite similar ) and after the foxpro designer, back to hmg prg !
For the moment i've written the first stage ( hmg->foxpro ) and it's very successfull !!!
I will post something when i'll finish the next stage ...
Jpp
first thanks for ure answers.
A the begining my purpose was to write an ide to save time for designing forms.
( thats why i wanted to know the control's name under the mouse ).
After a cup of day, i realised that foxpro had a good ide ...
As all the form and it's controls are stored into an scx/sct file ( a simple dbf/ftp file ) which is very simple to read with dbu ( rdd dbf/cdx ).
now, it's very simple to convert ur's prg form design to foxpro properties ( as they are quite similar ) and after the foxpro designer, back to hmg prg !
For the moment i've written the first stage ( hmg->foxpro ) and it's very successfull !!!
I will post something when i'll finish the next stage ...
Jpp
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Control under the Mouse
Wow very nice!!!jpp wrote:hi,
first thanks for ure answers.
A the begining my purpose was to write an ide to save time for designing forms.
( thats why i wanted to know the control's name under the mouse ).
After a cup of day, i realised that foxpro had a good ide ...
As all the form and it's controls are stored into an scx/sct file ( a simple dbf/ftp file ) which is very simple to read with dbu ( rdd dbf/cdx ).
now, it's very simple to convert ur's prg form design to foxpro properties ( as they are quite similar ) and after the foxpro designer, back to hmg prg !
For the moment i've written the first stage ( hmg->foxpro ) and it's very successfull !!!
I will post something when i'll finish the next stage ...
Jpp
Re: Control under the Mouse
Hola
Aqui les dejo una variante del ejemplo de jpp y Pablo Cesar.
-----------------------------------------------------------------------
Hello
Here 'example of a variant of jpp and Pablo Cesar.
Aqui les dejo una variante del ejemplo de jpp y Pablo Cesar.
-----------------------------------------------------------------------
Hello
Here 'example of a variant of jpp and Pablo Cesar.
Code: Select all
#include <hmg.ch>
#define BLUE1 { 218,229,243 }
#define BLUE2 { 000,120,187 }
STATIC cCtrlAnt:="", lProp:=.F.
Function Main
DEFINE WINDOW w_test AT 000 , 000 WIDTH 230 HEIGHT 380 BACKCOLOR BLUE1 TITLE "SIMULATE A MOUSE OVER --- BY AGL" MAIN
ON KEY ESCAPE ACTION Thiswindow.Release()
@ 030,010 LABEL LB_1 VALUE "Opcion 1" OF w_test WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR WHITE BACKCOLOR BLUE2 CENTERALIGN ACTION MsgInfo( "Opcion 1" )
@ 055,010 LABEL LB_2 VALUE "Opcion 2" OF w_test WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR WHITE BACKCOLOR BLUE2 CENTERALIGN ACTION MsgInfo( "Opcion 2" )
@ 080,010 LABEL LB_3 VALUE "Opcion 3" OF w_test WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR WHITE BACKCOLOR BLUE2 CENTERALIGN ACTION MsgInfo( "Opcion 3" )
@ 105,010 LABEL LB_4 VALUE "Opcion 4" OF w_test WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR WHITE BACKCOLOR BLUE2 CENTERALIGN ACTION MsgInfo( "Opcion 4" )
@ 130,010 LABEL LB_5 VALUE "Opcion 5" OF w_test WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR WHITE BACKCOLOR BLUE2 CENTERALIGN ACTION MsgInfo( "Opcion 5" )
@ 155,010 LABEL LB_6 VALUE "Opcion 6" OF w_test WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR WHITE BACKCOLOR BLUE2 CENTERALIGN ACTION MsgInfo( "Opcion 6" )
@ 250,000 LABEL LB_7 VALUE "" WIDTH 200 HEIGHT 20 FONT 'Verdana' SIZE 9 FONTCOLOR BLACK CENTERALIGN TRANSPARENT
END WINDOW
CREATE EVENT PROCNAME SELECTCTRL( EventWPARAM() ) // HWND W_test.HANDLE
CENTER WINDOW w_test
ACTIVATE WINDOW w_test
RETURN Nil
FUNCTION SelectCtrl( wParam )
LOCAL cCtrl, cForm, cTemp
GetControlNameByHandle( wParam, @cCtrl, @cForm )
cTemp:=ALLTRIM( cForm )+ALLTRIM( cCtrl )
w_test.LB_7.VALUE := cTemp // **** Display cForn, cCtrl
IF cTemp==cForm
IF lProp
// La intencion es hacer que la Funcion acepte cualquier nombre de Ventana, pero de esta forma no se ejecuta el ACTION del LABEL !
// The intention is to make the function accepts any window name, but this way the ACTION of LABEL is not running!
*SETPROPERTY( cForm, cCtrlAnt, "FONTBOLD" , .F. )
*SETPROPERTY( cForm, cCtrlAnt, "FONTSIZE" , 9 )
*SETPROPERTY( cForm, cCtrlAnt, "BACKCOLOR", BLUE2 )
w_test.&cCtrlAnt..FONTBOLD := .F.
w_test.&cCtrlAnt..FONTSIZE := 9
w_test.&cCtrlAnt..BACKCOLOR := BLUE2
lProp:=.F.
ENDIF
ELSE
IF ! empty(cCtrl)
IF ! lProp
w_test.&cCtrl..FONTBOLD := .T.
w_test.&cCtrl..FONTSIZE := 12
w_test.&cCtrl..BACKCOLOR := BLUE
cCtrlAnt:=cCtrl
lProp:=.T.
ENDIF
ENDIF
ENDIF
RETURN Nil
- Attachments
-
- OnMouseOver.jpg (46.12 KiB) Viewed 3965 times
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- srvet_claudio
- Posts: 2193
- Joined: Thu Feb 25, 2010 8:43 pm
- Location: Uruguay
- Contact:
Re: Control under the Mouse
Muy buen ejemplo Andrés!!!
- danielmaximiliano
- Posts: 2612
- Joined: Fri Apr 09, 2010 4:53 pm
- Location: Argentina
- Contact:
Re: Control under the Mouse
Espectacular Andres, gracias por compartir.
*´¨)
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO
¸.·´¸.·*´¨) ¸.·*¨)
(¸.·´. (¸.·` *
.·`. Harbour/HMG : It's magic !
(¸.·``··*
Saludos / Regards
DaNiElMaXiMiLiAnO
Whatsapp. := +54901169026142
Telegram Name := DaNiElMaXiMiLiAnO