ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Standard functions / Windows management functions / Mouse functions
  • Limits in browser code
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
Used in an linked event with the mouse or stylus (click code, hover code, left or right button pressed code, ...) returns the vertical position (Y) of the mouse cursor in relation to the control or the window considered.
You can find out:
  • the position of the mouse (or the stylus) when left clicking in an Image control (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 - Browser code Used in a browser event (of an Control or a page), returns the vertical (Y) position of the mouse cursor to the specified cue point.
Remarks:
    Example
    WEBDEV - Browser code
    // "Drawing" page hovered by the mouse
    // Optional code of the page
    // Mouse moved (onmousemove)
    Message("Position of the mouse: X: " + MouseXPos(mpPage) + "Y: " + MouseYPos(mpPage))
    Syntax
    WEBDEV - Browser code

    Retrieving the mouse position in a page Hide the details

    <Result> = MouseYPos([<Marker>])
    <Result>: Integer or real
    • Vertical position (or Y coordinate) of mouse cursor in relation to the specified marker (in pixels),
    • 0 if the information is not available (depending on the browser used and on the control).
    <Marker>: Optional integer constant
    Indicates the marker used to calculate the position:
    mpControl
    (Default value)
    Mouse position in relation to the top left corner of control (or page if the event occurs on the page).
    If this constant is selected, MouseYPos must be used in the "OnClick" code of control.
    mpScreenMouse position in the screen (in relation to the top left corner of screen).
    mpPageMouse position in relation to the top left corner of page (while taking the page "scrolling" into account).
    Remarks
    WEBDEV - Browser code

    Limits in browser code

    MouseYPos is not available:
    • in the browser procedures.
    • in the events directly or indirectly called from a browser procedure (via ExecuteProcess for example).
    Related Examples:
    The drawing functions Unit examples (WINDEV): The drawing functions
    [ + ] Using the main drawing functions of WINDEV to:
    - Initialize an Image control for drawing
    - Draw simple shapes
    - Write a text into a drawing
    - Change the color in a drawing
    Component: wd260obj.dll
    Minimum version required
    • Version 9
    This page is also available for…
    Comments
    Click [Add] to post a comment

    Last update: 01/04/2021

    Send a report | Local help