AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Este contenido se ha traducido automáticamente.  Haga clic aquí  para ver la versión en inglés.
Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de Windows / Funciones del cursor del ratón
  • Error
  • Miscellaneous
  • Limits in browser code
WINDEV
WindowsLinuxJavaReportes y ConsultasCódigo de Usuario (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Código Navegador
WINDEV Mobile
AndroidWidget Android iPhone/iPadIOS WidgetApple WatchMac Catalyst
Otros
Procedimientos almacenados
Used in a mouse or stylus event (click code, hover code, left or right button pressed code, etc.) returns the horizontal position (X) of the mouse cursor in relation to the field or window in question.
You can get:
  • the position of the mouse (or stylus) when an Image control is clicked (function used in the "Click" event of the Image control).
  • the position of the mouse (or stylus) when hovering over a window (function used in the optional "Mouse hover" event of a window).
WEBDEV - Código Navegador Used in a browser event (field or page), returns the horizontal position (X) of the mouse cursor at the specified origin.
Remarks:
  • WINDEV The mouse position can also be obtained with CursorPos. CursorPos should only be used to modify the mouse position.
  • AndroidJava This function should only be used in the events of controls hovered with the mouse.
  • Android MouseXPos returns the last known position of the finger on the screen.
Ejemplo
WINDEVReportes y ConsultasJavaCódigo de Usuario (UMC)
// "WIN_Drawing" window hovered by the mouse
// Optional code of the window
Message("Mouse position: X: " + MouseXPos() + "Y: " + MouseYPos())
WINDEVReportes y ConsultasAndroidiPhone/iPadIOS WidgetMac CatalystJavaCódigo de Usuario (UMC)
// Displays a different message according to the location clicked
IF MouseXPos() > 25 THEN
	Info("To the right")
ELSE
	Info("To the left")
END
WEBDEV - Código Navegador
// "Drawing" page hovered by the mouse
// Optional code of the page
// Mouse moved (onmousemove)
Message("Mouse position: X: " + MouseXPos(mpPage) + " Y: " + MouseYPos(mpPage))
Sintaxis
WINDEVReportes y ConsultasAndroidiPhone/iPadIOS WidgetMac CatalystJavaCódigo de Usuario (UMC)

Retrieving the mouse position in a window Ocultar los detalles

<Result> = MouseXPos([<Origine>])
<Result>: Integer
  • Horizontal position (X-coordinate) of the mouse or stylus, in pixels. By default, this position is relative to the upper-left corner of the control on which the left mouse button was pressed.
  • -1 if an error occurred.
<Origine>: Optional Integer constant
Origin used to calculate position:
mpControl
(Default value)
Mouse position relative to the upper-left corner of the hovered control or window, depending on where the event occurs.
mpImageMouse position in the Image control (relative to the upper-left corner).

This constant should only be used when MouseXPos is called in an event associated with an Image control. Otherwise, MouseXPos will return -1.
mpScreenMouse position in the screen (relative to the upper-left corner).
mpWindowMouse position relative to the upper-left corner of the window.
WEBDEV - Código Navegador

Retrieving the mouse position in a page Ocultar los detalles

<Result> = MouseXPos([<Origine>])
<Result>: Integer or real
  • Horizontal position (X-coordinate) of the mouse cursor relative to the specified marker (in pixels)
  • 0 if the information is not available (depending on the browser used and on the control).
<Origine>: Optional integer constant
Origin used to calculate position:
mpControl
(Default value)
Mouse position relative to the upper-left corner of the hovered control or page, depending on where the event occurs.
If this constant is selected, MouseXPos must be used in the "OnClick" code of the control.
mpPageMouse position relative to the upper-left corner of the page (taking into account the position of the page if it has been scrolled).
mpScreenMouse position in the screen (relative to the upper-left corner).
Observaciones
WINDEVReportes y ConsultasAndroidiPhone/iPadIOS WidgetMac CatalystJavaCódigo de Usuario (UMC)

Error

The main error codes are as follows:
  • No window is opened.
  • No mouse click is performed.
  • MouseXPos is not called in a mouse event.
  • The click code is executed by Execute or ExecuteProcess.
WINDEVReportes y ConsultasAndroidiPhone/iPadIOS WidgetMac CatalystJavaCódigo de Usuario (UMC)

Miscellaneous

  • You can get the vertical position of the mouse or stylus with MouseYPos.
  • MouseXPos used in the selection code of row or table always returns 0.
  • AndroidJava This function should only be used in WLanguage events of controls hovered with the mouse.
WEBDEV - Código Navegador

Limits in browser code

MouseXPos is not available:
  • in browser procedures.
  • in the events directly or indirectly called from a browser procedure (via ExecuteProcess for example).
  • in the browser code of a Button or Link control..
Componente: wd300obj.dll
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 27/03/2025

Señalar un error o enviar una sugerencia | Ayuda local