BBjPopupMenu
Creation Path
BBjAPI > BBjSysGui > BBjPopupMenu
Description
In BBj 4.00 and higher, the BBjPopupMenu object provides methods for manipulating a GUI popup menu associated with a control.
Creation
A BBjPopupMenu object is manipulated through the following BBjSysGui methods:
Return Value |
Method |
---|---|
BBjPopupMenu |
|
BBjPopupMenu |
BBjSysGui::createPopupMenu(int resHandle, int popupMenuID) |
BBjPopupMenu objects can also be manipulated through the following BBjControl methods, which are inherited by all control types except menus:
Return Value |
Method |
---|---|
BBjPopupMenu |
|
BBjPopupMenu |
|
BBjPopupMenu |
|
void |
BBjControl::setPopupMenu(BBjPopupMenu popupMenu!) |
Methods of BBjPopupMenu
Return Value |
Method |
---|---|
addCheckableMenuItem(int ID, string title) |
|
addCheckableMenuItem(int ID, string title, boolean checked) |
|
addMenu(int ID, string title) |
|
addMenuItem(int ID, string title) |
|
addMenuItem(int ID, string title, int action) |
|
addMenuItem(int ID, string title, boolean checkable, boolean checked) |
|
addMenuItem(int ID, string title, boolean checkable, boolean checked, int action) |
|
void |
|
boolean |
addStyle(string styleName) |
void |
|
string |
getAttribute(string attribute) |
getCheckableMenuItem(int ID) |
|
getCheckableMenuItemAt(int index) |
|
int |
|
string |
getClientProperty(Object key) |
string |
getComputedStyle(string property) |
getControl(int ID) |
|
getFont() |
|
int |
getID() |
int |
|
getMenu(int ID) |
|
getMenuAt(int index) |
|
getMenuItem(int ID) |
|
getMenuItemAt(int index) |
|
int |
getMenuItemIDAt(int index) |
string |
getName() |
string |
getStyle(string property) |
Object |
|
void |
hide() |
insertCheckableMenuItem(int index, int ID, string title) |
|
insertCheckableMenuItem(int index, int ID, string title, boolean checked) |
|
insertMenu(int index, int ID, string title) |
|
insertMenuItem(int index, int ID, string title) |
|
insertMenuItem(int index, int ID, string title, int action) |
|
insertMenuItem(int index, int ID, string title, boolean checkable, boolean checked) |
|
insertMenuItem(int index, int ID, string title, boolean checkable, boolean checked, int action) |
|
void |
insertSeparator(int index) |
boolean |
|
void |
putClientProperty(Object key, Object value) |
void |
removeMenu(BBjMenu menu!) |
void |
removeMenu(int ID) |
void |
removeMenuAt(int index) |
void |
removeMenuItem(BBjMenuItem item!) |
void |
removeMenuItem(int ID) |
void |
removeMenuItemAt(int index) |
void |
removeSeparator(int index) |
boolean |
removeStyle(string styleName) |
void |
setAttribute(string attribute, string value) |
void |
setFont(BBjFont font!) |
void |
setMaximumRowCount(int max) |
void |
setName(string name) |
void |
setStyle(string property, string value) |
void |
setUserData(Object object) |
void |
show(BBjControl control!, int x, int y) |
void |
show(int context, int ID, int x, int y) |
Events
Callback Code |
Object-oriented Event |
Read Record Event |
Code |
ON_POPUP_ITEM_SELECT |
P |
||
ON_POPUP_REQUEST |
r |
CSS
The visual appearance of BUI controls is defined using CSS (cascading style sheets) rules. Easily change the default colors, border, and other settings by customizing these rules, all without changing any application code. See CSS API for a high-level overview of BUI CSS.
The BBjPopupMenu defines the following style names:
.BBjPopupMenu (the top level control)
.BBjPopupMenu-menu (the vertical menu contained within the popup menu)
The BBjPopupMenu contains BBjMenu, BBjMenuItem, and BBjCheckableMenuItem elements. To style the BBjPopupMenu versions of these elements, specify the CSS selectors like this:
.BBjPopupMenu .BBjMenuItem { } |
Remarks
All ID values should be negative. If they are not specified as negative values, they will be converted to negative values internally.
All index values are zero-based.
BBjPopupMenu: The BBjPopupMenu appears when the user presses the appropriate mouse button (usually right-click) on a control that has an associated BBjPopupMenu. BBjMenus and/or BBjMenuItems are added to the BBjPopupMenu.
BBjMenu: A BBjMenu object is a menu that can have menu items and submenus within the object. BBjMenu objects can be added to the BBjMenuBar and to other BBjMenus. When they are added to other BBjMenus, an arrow will point from the title and when the arrow is rolled-over, the submenu will appear.
BBjMenuItem: A BBjMenuItem object is a menu item that is not a submenu. They can be added to a BBjMenu or directly to the BBjPopupMenu. A BBjMenuItem can be checkable. In this case, a check will appear next to the menu item's title. When the item is selected, the check will toggle.
The image below illustrates the structure of a popup menu with a submenu:
Constants inherited from BBjControl
Example
|
See Also
CALLBACK Verb - Register BBj Subroutine
DWC Component: dwc-popupmenu
See the BBj Object Diagram for an illustration of the relationship between BBj Objects.