The RButtonDown event has different arguments for different objects:
Object |
See |
---|---|
Controls and windows, except RichTextEdit |
|
RichTextEdit control |
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 |
Objects |
---|---|
pbm_rbuttondown |
Windows and controls that can be placed on a window, except RichTextEdit |
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). |
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
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())
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 |
Objects |
---|---|
pbm_renrbuttondown |
RichTextEdit |
None
Long. Return code choices (specify in a RETURN statement):
0 Continue processing
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.