RButtonDown

The RButtonDown event has different arguments for different objects:

Object

See

Controls and windows, except RichTextEdit

Syntax 1 For controls and windows, except RichTextEdit

RichTextEdit control

Syntax 2 For RichTextEdit controls


Syntax 1 For controls and windows, except RichTextEdit

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:

  • 1 – Left mouse button

  • 2 – Right mouse button

  • 4 – Shift key

  • 8 – Ctrl key

  • 16 – Middle mouse button

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).

Returns

Long. Return code choices (specify in a RETURN statement):

Examples

Example 1

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)

Example 2

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


Syntax 2 For RichTextEdit controls

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

Event ID

Objects

pbm_renrbuttondown

RichTextEdit

Arguments

None

Returns

Long. Return code choices (specify in a RETURN statement):

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