xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

MRow()

Determines the screen row position of the mouse cursor.

Syntax

MRow() --> nMouseRow

Return

The function returns the row position of the mouse cursor as a numeric value.

Description

MRow() is used in full screen or console window applications to determine the current screen row position of the mouse cursor. The top screen row has number zero, while the bottom screen row has number MaxRow().

Note  to obtain proper mouse input from the user, function Inkey() should be called including mouse events.

Info

See also:Inkey(), MCol(), MDblClk(), MHide(), MLeftDown(), MRightDown(), MSetCursor(), MShow(), SET EVENTMASK
Category: Mouse functions
Source:rtl\mouseapi.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example changes the event mask for Inkey() to ALL events
// and displays the mouse cursor position when the left button is pressed.

   #include "Inkey.ch"

   PROCEDURE Main
      LOCAL nEvent, nRow, nCol, cPos
      CLS
      MShow()

      ? "Click with left mouse button (press ESC to quit)"
      SET EVENTMASK TO INKEY_ALL

      DO WHILE Lastkey() <> K_ESC
         nEvent := Inkey(0)

         IF nEvent == K_LBUTTONDOWN
            nRow := MRow()
            nCol := MCol()
            cPos := LTrim( Str(nRow) ) + "," + LTrim( Str(nCol) )
            // display current mouse cursor position
            @ nRow, nCol SAY cPos
         ENDIF
      ENDDO

   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe