MouseOverTBbutton

Syntax:

MouseOverTBbutton( [#ButtonID] )

Parameters:

#ButtonID

=

optional: your ButtonNumber (ID)


Return Values:

#false

=

mouse cursor is not over button

true

=

mouse cursor over button.


If you didnt specify the optional [#ButtonID],

the return value is the ButtonID of the

Button where the mouse cursor is over.


Description:

Check if the MouseCursor is over a button.


This is 2 commands in 1, see the two examples below.


Example:

  ; The first usage for this command is with 1 argument:
  ;
  ; When you specify the #ButtonID as the argument,
  ; the command checks if the MouseCursor is over
  ; _this_ Button.
  ; If the MouseCursor is over the Button, the command
  ; returns a NONZERO (TRUE) value. Otherwise it returns 0.
  ;
  ; This is good for displaying Infos or a picture when
  ; the MouseCursor is over a button.
  ;
  ; You use it this way:

  If MouseOverTBbutton(500) ; check for Button with ID 500
    Beep_(1400,10)
  Endif

  ; The seconds usage is without any Argument specified:
  ;
  ; When you dont specify an argument for MouseOverTBbutton(),
  ; the command returns 0 when the MouseCursor isnt over a
  ; TB-Button.
  ; If the MouseCursor is over a Button, this command returns
  ; the #ButtonID of the Button.
  ;
  ; Useful if you have many Toolbar-Buttons and want to
  ; select over wich Button the MouseCursor is.

  Select MouseOverTBbutton()
         Case 500
              SetWindowText_(hWnd,"#ButtonID 500")
         Case 501
              SetWindowText_(hWnd,"#ButtonID 501")
         Case 502
              SetWindowText_(hWnd,"#ButtonID 502")
         Default
              SetWindowText_(hWnd,"Default")
  EndSelect

Remarks:

MouseOverTBbutton() can only check the buttons when

the Toolbar has the #TBpro_FLAT style (default).



Supported OS:   Windows