The RButtonDown event has different arguments for different objects:
Description
For a window, occurs when the right mouse button is pressed in an unoccupied area of the window (any area with no visible, enabled object). The window event will occur if the cursor is over an invisible or disabled control.
For a control, occurs when the right mouse button is pressed on the control.
Event ID
Event ID |
Objects |
---|---|
pbm_rbuttondown |
Windows and controls that can be placed on a window, except RichTextEdit |
Arguments
Argument |
Description |
---|---|
flags |
UnsignedLong by value (the modifier keys and mouse buttons that are pressed). Values are:
In the RButtonDown event, the right mouse button is always pressed, so 2 is always summed in the value of flags. For an explanation of flags, see Syntax 2 of MouseMove. |
xpos |
Integer by value (the distance of the pointer from the left edge of the window's workspace in pixels). |
ypos |
Integer by value (the distance of the pointer from the top of the window's workspace in pixels). |
Return Values
Long.
Return code choices (specify in a RETURN statement):
0 -- Continue processing
Examples
These statements in the RButtonDown script for the window display a pop-up menu at the cursor position. Menu4 was created in the Menu painter and includes a menu called m_language. Menu4 is not the menu for the active window and therefore needs to be created. NewMenu is an instance of Menu4 (datatype Menu4):
Menu4 NewMenu NewMenu = CREATE Menu4 NewMenu.m_language.PopMenu(xpos, ypos)
In a Multiple Document Interface (MDI) application, the arguments for PopMenu need to specify coordinates relative to the MDI frame:
NewMenu.m_language.PopMenu( & w_frame.PointerX(), w_frame.PointerY())
See also
Description
Occurs when the user presses the right mouse button on the RichTextEdit control and the control's PopMenu property is set to false.
Event ID
Arguments
None
Return Values
Long.
Return code choices (specify in a RETURN statement):
0 -- Continue processing
Usage
If the control's PopMenu property is true, the standard RichTextEdit pop-up menu is displayed instead, and the RButtonDown event does not occur.
You can use the RButtonDown event to implement your own pop-up menu.
See also