Rapid-Q Documentation by William Yu (c)1999-2000 Appendix A: QPOPUPMENU

QPOPUPMENU Component

QPopupMenu provides a popup menu selection control. Note the menu does not disappear if the user clicks outside of the menu. there is no way to tell if the QPopupMenu loses focus. To close the QPopupMenu, use the .DelItems method to clear all menu items.

QPopupMenu Properties
FieldTypeR/WDefault




AlignmentINTEGERRWpaLeft
Alignment determines where the pop-up menu appears when the user clicks the right mouse button.
0 = paLeft - Pop-up menu appears with its top left corner under the mouse pointer
1 = paRight = Pop-up menu appears with its top right corner under the mouse pointer
2 = paCenter - Pop-up menu appears with the top center of the menu under the mouse pointer
AutoPopupINTEGERRWTrue
AutoPopup determines whether the pop-up menu appears automatically when the user clicks the right mouse button.
HandleINTEGERR
Handle is the Windows menu handle for the menu.
TagINTEGERRW
Tag stores an integer value, but is not used internally.
WindowHandleINTEGERRW
WindowHandle is the handle of the window that uses the menu.


QPopupMenu Methods
MethodTypeDescriptionParams




AddItemsSUBIAdd Item to MenuQMENUITEMs, Infinite
DelIndexSUB (index AS LONG)Delete items, by index, from menu1
DelItemsSUBIDelete items from menuQMENUITEMs, Infinite
InsertSUB (I%, Item AS QMENUITEM)Insert an item2
PopupSUB (X%, Y%)Popup menu at (X,Y)2


QPopupMenu Events
EventTypeOccurs when...Params




OnPopupVOIDJust before the pop-up menu appears0


QPopupMenu Examples
  DIM PopupMenu AS QPopupMenu
  DIM Item1 AS QMenuItem
  DIM Item2 AS QMenuItem

  Item1.Caption = "Item 1"
  Item2.Caption = "Item 2"
  PopupMenu.AddItems(Item1, Item2)

  PopupMenu.Popup(100,100)

Prev Component Contents Next Component