PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
  • Limits in browser code
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Returns the horizontal position (X) of the mouse cursor relative to the specified window or control. Used in a mouse or stylus process (click, hover, left or right button down, etc.).
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 - Browser code Returns the horizontal position (X) of the mouse cursor according to the specified marker. Used in a browser event of a control or page.
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> = MouseXPos([<Marker>])
    <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).
    <Marker>: Optional integer constant
    Marker used to calculate the 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).
    Remarks
    WEBDEV - Browser code

    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..
    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: wd270obj.dll
    Minimum version required
    • Version 9
    This page is also available for…
    Comments
    Click [Add] to post a comment