Hola
Alguien sabe si existe alguna función que me permita saber si se oprimió el
Botón derecho del ratón en algún control ?
( Quizás HMG_GetLastMouseMessage( ) ? )
--------------------------------------------------------------------------
Hello
Anyone know if there is any function that will let me know if you pressed the
right mouse button on a control?
( Maybe HMG_GetLastMouseMessage( ) ? )
Acabo de encontrar este post del 2012, pero parece que no hubo respuestas...
---------------------------------------------------------------------------------------------------
I just found this post in 2012, but it seems that no answers ...
See: viewtopic.php?f=5&t=2353
Right click mouse button on a control
Moderator: Rathinagiri
Right click mouse button on a control
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
- dragancesu
- Posts: 921
- Joined: Mon Jun 24, 2013 11:53 am
- DBs Used: DBF, MySQL, Oracle
- Location: Subotica, Serbia
Re: Right click mouse button on a control
Maybe DEFINE CONTROL CONTEXTMENU?
like this
...
@ 30,30 BROWSE Browse_1_5 ;
WIDTH 400 ;
HEIGHT 300 ;
VALUE 0 ;
WIDTHS {130,120,120} ;
HEADERS {'DBF','In dictionary','On disk'} ;
WORKAREA _SELECT ;
FIELDS {'dbf_name','dbf_dict','dbf_disk'} ;
FONT "Arial" ;
SIZE 10
DEFINE CONTROL CONTEXTMENU Browse_1_5 OF Win_1_5
ITEM "Update" ACTION upd_dbf_1()
ITEM "Delete" ACTION del_dbf_1()
END MENU
...
like this
...
@ 30,30 BROWSE Browse_1_5 ;
WIDTH 400 ;
HEIGHT 300 ;
VALUE 0 ;
WIDTHS {130,120,120} ;
HEADERS {'DBF','In dictionary','On disk'} ;
WORKAREA _SELECT ;
FIELDS {'dbf_name','dbf_dict','dbf_disk'} ;
FONT "Arial" ;
SIZE 10
DEFINE CONTROL CONTEXTMENU Browse_1_5 OF Win_1_5
ITEM "Update" ACTION upd_dbf_1()
ITEM "Delete" ACTION del_dbf_1()
END MENU
...
Re: Right click mouse button on a control
Gracias por tu respuesta Dragancesu.
Pero mas bien, la idea es hacerlo de la siguiente manera ya que se
desconoce que controles puede haber.
------------------------------------------------------------------------------------
Thanks for your answer Dragancesu.
But rather, the idea is to do as follows as it
unaware that controls may have.
Pero mas bien, la idea es hacerlo de la siguiente manera ya que se
desconoce que controles puede haber.
------------------------------------------------------------------------------------
Thanks for your answer Dragancesu.
But rather, the idea is to do as follows as it
unaware that controls may have.
Code: Select all
#include "hmg.ch"
FUNCTION Main()
DEFINE WINDOW FormMOver AT 0,0 WIDTH 800 HEIGHT 600 BACKCOLOR BLACK MAIN
@ 020,020 LABEL LB_PCTRL01 VALUE "1" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,050 LABEL LB_PCTRL02 VALUE "2" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,080 LABEL LB_PCTRL03 VALUE "3" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,105 LABEL LB_PCTRL04 VALUE "4" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,130 LABEL LB_PCTRL05 VALUE "5" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
CREATE EVENT PROCNAME On_M_Over( EventWPARAM(), HMG_GetLastMouseMessage( ) ) HWND FormMOver.HANDLE
END WINDOW
CENTER WINDOW FormMOver
ACTIVATE WINDOW FormMOver
RETURN
*---------------------------------------------------------------------
FUNCTION On_M_Over( hWnd, nMsg )
LOCAL cControl := "", cForm := ""
GetControlNameByHandle( hWnd, @cControl, @cForm )
IF HMG_LEN( cControl ) > 0
*IF HMG_GetLastMouseMessage( ) = "pressed the right mouse button" // something like this
MSGINFO( cForm + " - " + cControl + STR( nMsg, 3 ) )
*ENDIF
ENDIF
RETURN
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: Right click mouse button on a control
See this demo:
Code: Select all
#include "hmg.ch"
FUNCTION Main()
DEFINE WINDOW FormMOver AT 0,0 WIDTH 800 HEIGHT 600 BACKCOLOR BLACK MAIN
@ 020,020 LABEL LB_PCTRL01 VALUE "1" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,050 LABEL LB_PCTRL02 VALUE "2" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,080 LABEL LB_PCTRL03 VALUE "3" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,105 LABEL LB_PCTRL04 VALUE "4" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
@ 020,130 LABEL LB_PCTRL05 VALUE "5" FONT 'Verdana' SIZE 15 WIDTH 22 HEIGHT 22 FONTCOLOR WHITE TRANSPARENT
CREATE EVENT PROCNAME On_M_Over()
END WINDOW
CENTER WINDOW FormMOver
ACTIVATE WINDOW FormMOver
RETURN
FUNCTION On_M_Over()
LOCAL hWnd := EventHWND()
LOCAL cControl := "", cForm := ""
GetControlNameByHandle( hWnd, @cControl, @cForm )
IF HMG_LEN( cControl ) > 0
IF HMG_GetLastMouseMessage() == WM_RBUTTONDOWN
MSGINFO( cForm + " - " + cControl )
ENDIF
ENDIF
RETURN
Re: Right click mouse button on a control
Great Thank you for Right Click Event example
BPD
Convert Dream into Reality through HMG
Convert Dream into Reality through HMG
Re: Right click mouse button on a control
Muchas Gracias Dr. Soto, funciona perfecto !
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: Right click mouse button on a control
See also:
Code: Select all
- SET CONTROL <ControlName> OF <FormName> ONMOUSEEVENT <FuncName> | NIL
Note: the following function is a complement to SET ONMOUSEEVENT
- HMG_GetOnMouseControlIndex ( [ @nSubIndex ] ) --> nIndex