X11workbench Toolkit  1.0
Popup Menus

Popup Menu windows and their associate structures and API functions. More...

Typedefs

typedef struct tagWBMenuPopupWindow WBMenuPopupWindow
 structure for managing a popup menu window More...
 

Functions

WBMenuPopupWindowMBCreateMenuPopupWindow (Window wIDBar, Window wIDOwner, WBMenu *pMenu, int iX, int iY, int iFlags)
 Create a WBMenuPopupWindow object and associated window. More...
 
int MBMenuDoModal (WBMenuPopupWindow *pMenuPopupWindow)
 display a Menu Popup window in a 'modal' loop More...
 
void MBDestroyMenuPopupWindow (WBMenuPopupWindow *pMenuPopupWindow)
 Destroy a WBMenuPopupWindow structure. More...
 
WBMenuPopupWindowMBFindMenuPopupWindow (WBMenu *pSubMenu)
 Find the first WBMenuPopupWindow that references a WBMenu. More...
 
static __inline__ WBMenuPopupWindowMBGetMenuPopupWindowStruct (Window wID)
 Get the associated WBMenuPopupWindow structure from a Menu Popup window's window ID. More...
 

Detailed Description

Popup Menu windows and their associate structures and API functions.

Typedef Documentation

◆ WBMenuPopupWindow

structure for managing a popup menu window

Definition for the structure that defines a popup menu window

typedef struct tagWBMenuPopupWindow
{
unsigned int ulTag; // tag indicating I'm a 'Menu Popup' window
Window wSelf; // window ID for the Menu Popup window
Window wBar; // window ID for the associated Menu Bar window
Window wOwner; // window ID for the owner window
WBMenu *pMenu; // a pointer to the associated WBMenu structure
int iX; // popup menu 'X' position within the owner's client area
int iY; // popup menu 'Y' position within the owner's client area
int iWidth; // popup menu width
int iHeight; // popup menu height
int iColumns; // total number of columns (currently 1)
int iVisible; // total number of visible menu items (including separators)
int iTop; // index of the 'top' visible menu item (zero-based) for scrolling menus
int iSelected; // currently selected menu (for display purposes)
int iFlags; // flags that determine behavior (reserved)
} WBMenuPopupWindow; // located at offset 0 in window data
See also
WBMenu

Function Documentation

◆ MBCreateMenuPopupWindow()

WBMenuPopupWindow* MBCreateMenuPopupWindow ( Window  wIDBar,
Window  wIDOwner,
WBMenu pMenu,
int  iX,
int  iY,
int  iFlags 
)

Create a WBMenuPopupWindow object and associated window.

Parameters
wIDBarThe Window ID of the associated menu bar
wIDOwnerThe Window ID of the 'owner' window. All coordinates are with respect to this window's client area
pMenuA pointer to the associated 'WBMenu'
iXThe X coordinate for the upper left corner of the menu popup with respect to the client area of wIDOwner
iYThe Y coordinate for the upper left corner of the menu popup with respect to the client area of wIDOwner
iFlagsVarious bit-flags associated with the popup menu
Returns
A pointer to an allocated WBMenuPopupWindow, or NULL on error. This function also creates the actual window.

Use this function to create a WBMenuPopupWindow structure and an associated window at the specified location with respect to the client area of 'wIDOwner'. Use of this function assumes that you will immediately call MBMenuDoModal() using the returned pointer. The call to MBMenuDoModal() will automatically free up the allocated structure and resources.

Header File: menu_popup.h

Definition at line 199 of file menu_popup.c.

◆ MBDestroyMenuPopupWindow()

void MBDestroyMenuPopupWindow ( WBMenuPopupWindow pMenuPopupWindow)

Destroy a WBMenuPopupWindow structure.

Parameters
pMenuPopupWindowA pointer to a WBMenuPopupWindow that was created by MBCreateMenuPopupWindow()
Returns
void

Use this function to destroy a WBMenuPopupWindow structure (and resources) created by MBCreateMenuPopupWindow()

Header File: menu_popup.h

Definition at line 476 of file menu_popup.c.

◆ MBFindMenuPopupWindow()

WBMenuPopupWindow* MBFindMenuPopupWindow ( WBMenu pSubMenu)

Find the first WBMenuPopupWindow that references a WBMenu.

Parameters
pSubMenuA pointer to a WBMenu structure that represents a 'sub menu' for a Menu Popup window
Returns
A pointer to a WBMenuPopupWindow structure, or NULL on error

Use this function to find the first WBMenuPopupWindow that references a WBMenu

Header File: menu_popup.h

Definition at line 456 of file menu_popup.c.

◆ MBGetMenuPopupWindowStruct()

static __inline__ WBMenuPopupWindow* MBGetMenuPopupWindowStruct ( Window  wID)
static

Get the associated WBMenuPopupWindow structure from a Menu Popup window's window ID.

Parameters
wIDA Window ID for a Menu Popup window
Returns
A pointer to the associated WBMenuPopupWindow structure, or NULL on error

Use this function to obtain the associated WBMenuPopupWindow structure from a Menu Popup window's window ID

Header File: menu_popup.h

Definition at line 201 of file menu_popup.h.

◆ MBMenuDoModal()

int MBMenuDoModal ( WBMenuPopupWindow pMenuPopupWindow)

display a Menu Popup window in a 'modal' loop

Parameters
pMenuPopupWindowA pointer to a WBMenuPopupWindow that was created by MBCreateMenuPopupWindow()
Returns
zero for 'ok', non-zero on error

Use this function to display a Menu Popup window created by MBCreateMenuPopupWindow() in a modal loop. On return, the WBMenuPopupWindow pointer will no longer be valid, and its resources will have been released.

Header File: menu_popup.h

Definition at line 468 of file menu_popup.c.