X11workbench Toolkit
1.0
|
Data Structures | |
struct | tagWBMenuBarWindow |
structure for defining a menu bar window More... | |
Typedefs | |
typedef struct tagWBMenuBarWindow | WBMenuBarWindow |
structure for defining a menu bar window More... | |
Functions | |
int | MBInitGlobal (void) |
Initialize global resources for Menu Bar windows. More... | |
WB_FONTC | MBGetDefaultMenuFont (void) |
Get a pointer to the default 'Menu Bar' font structure. More... | |
static __inline__ WBMenuBarWindow * | MBGetMenuBarWindowStruct (Window wID) |
Obtain a pointer to the WBMenuBarWindow structure from a Window ID of a Menu Bar window. More... | |
WBMenuBarWindow * | MBCreateMenuBarWindow (Window wIDParent, const char *pszResource, int iFlags) |
Create a Menu Bar windows and its associated WBMenuBarWindow structure. More... | |
WBMenuBarWindow * | MBFindMenuBarWindow (WBMenu *pMenu) |
Locate the first WBMenuBarWindow that is using a WBMenu structure. More... | |
void | MBReCalcMenuBarWindow (WBMenuBarWindow *pMenuBar) |
Cause a 'layout recalculation' for a Menu Bar window. More... | |
void | MBDestroyMenuBarWindow (WBMenuBarWindow *pMenuBar) |
Destroy a 'Menu Bar' window. More... | |
static __inline__ WBMenu * | MBGetMenuBarMenu (WBMenuBarWindow *pMenuBar) |
Get the current WBMenu for a Menu Bar window. More... | |
static __inline__ WBMenu * | MBSetMenuBarMenu (WBMenuBarWindow *pMenuBar, WBMenu *pMenu) |
Assign a new WBMenu for a Menu Bar window. More... | |
void | MBSetMenuBarMenuResource (WBMenuBarWindow *pMenuBar, const char *pszMenuResource) |
Assign a new WBMenu for a Menu Bar window. More... | |
Variables | |
Atom | aMENU_RESIZE |
Internal Client Message Atom for 'RESIZE' notification (tells menu bar to resize itself) More... | |
Atom | aMENU_ACTIVATE |
Internal Client Message Atom for 'ACTIVATE' notification. More... | |
Atom | aMENU_DISPLAY_POPUP |
Internal Client Message Atom for 'DISPLAY POPUP' action. More... | |
XColor | clrMenuFG |
menu foreground color | |
XColor | clrMenuBG |
menu background color | |
XColor | clrMenuActiveFG |
menu 'active' foreground color | |
XColor | clrMenuActiveBG |
menu 'active' background color | |
XColor | clrMenuBorder1 |
menu border color 1 | |
XColor | clrMenuBorder2 |
menu border color 2 | |
XColor | clrMenuBorder3 |
menu border color 3 | |
XColor | clrMenuDisabledFG |
menu 'disabled' foreground color | |
XColor | clrMenuActiveDisabledFG |
menu 'disabled but active' foreground color | |
Structures and API functions for managing and working with menu bar windows. A menu bar is a window that contains one or more text menu items, usually displaying a popup menu whenever a text menu item is activated. The popup menu is displayed as needed (normally hidden).
Normally a menu bar will be part of a frame window, and will appear at the top.
WBMenuBarWindow* MBCreateMenuBarWindow | ( | Window | wIDParent, |
const char * | pszResource, | ||
int | iFlags | ||
) |
Create a Menu Bar windows and its associated WBMenuBarWindow structure.
wIDParent | The Window ID for the owning window |
pszResource | a 0-byte terminated string resource that defines the menu |
iFlags | Additional binary flags |
Use this function to create a Menu Bar windows and its associated WBMenuBarWindow structure. You must call MBDestroyMenuBarWindow() for any non-NULL return value.
Header File: menu_bar.h
Definition at line 343 of file menu_bar.c.
void MBDestroyMenuBarWindow | ( | WBMenuBarWindow * | pMenuBar | ) |
Destroy a 'Menu Bar' window.
pMenuBar | A pointer to the WBMenuBarWindow structure associated with a Menu Bar window |
Use this function to destroy a WBMenuBarWindow structure and the associated Menu Bar window, as created using WBCreateMenBarWindow()
Header File: menu_bar.h
Definition at line 511 of file menu_bar.c.
WBMenuBarWindow* MBFindMenuBarWindow | ( | WBMenu * | pMenu | ) |
Locate the first WBMenuBarWindow that is using a WBMenu structure.
pMenu | A pointer to a WBMenu structure |
Use this function to locate the first 'Menu Bar' window that is using a specific WBMenu structure
Header File: menu_bar.h
Definition at line 492 of file menu_bar.c.
WB_FONTC MBGetDefaultMenuFont | ( | void | ) |
Get a pointer to the default 'Menu Bar' font structure.
Use this function to obtain a pointer to the default 'Menu Bar' font structure
Header File: menu_bar.h
Definition at line 338 of file menu_bar.c.
|
static |
Get the current WBMenu for a Menu Bar window.
pMenuBar | A pointer to the WBMenuBarWindow structure associated with a Menu Bar window |
Use this function to safely obtain the current WBMenu for a specified Menu Bar window.
Header File: menu_bar.h
Definition at line 269 of file menu_bar.h.
|
static |
Obtain a pointer to the WBMenuBarWindow structure from a Window ID of a Menu Bar window.
wID | The Window ID for a 'Menu Bar' window |
Use this function to obtain the WBMenuBarWindow struct pointer for a 'Menu Bar' window.
Header File: menu_bar.h
Definition at line 191 of file menu_bar.h.
int MBInitGlobal | ( | void | ) |
Initialize global resources for Menu Bar windows.
Use this function to initialize the 'Menu Bar' support.
Header File: menu_bar.h
Definition at line 177 of file menu_bar.c.
void MBReCalcMenuBarWindow | ( | WBMenuBarWindow * | pMenuBar | ) |
Cause a 'layout recalculation' for a Menu Bar window.
pMenuBar | A pointer to the WBMenuBarWindow structure associated with a Menu Bar window |
Use this function to re-calculate the layout of a Menu Bar window. Typically this will be done as a result of a re-size on the owning window, or as a result of re-assigning a new WBMenu.
Header File: menu_bar.h
Definition at line 504 of file menu_bar.c.
|
static |
Assign a new WBMenu for a Menu Bar window.
pMenuBar | A pointer to the WBMenuBarWindow structure associated with a Menu Bar window |
pMenu | A pointer to a new WBMenu to be assigned to the Menu Bar window. Can be NULL. |
Use this function to safely assign a new WBMenu to a Menu Bar window. This resource will be destroyed when the Menu Bar window is destroyed, so if you keep a cached copy and maintain it outside of the Menu Bar, be sure and assign a WBMenu of 'NULL' before destroying the menu bar.
Header File: menu_bar.h
Definition at line 292 of file menu_bar.h.
void MBSetMenuBarMenuResource | ( | WBMenuBarWindow * | pMenuBar, |
const char * | pszMenuResource | ||
) |
Assign a new WBMenu for a Menu Bar window.
pMenuBar | A pointer to the WBMenuBarWindow structure associated with a Menu Bar window |
pszMenuResource | A pionter to a 'menu resource' (const) character string that will be used to replace the current menu |
Use this function to safely replace the menu resource for a Menu Bar window. The existing WBMenu will be destroyed. If you want to preserve the existing WBMenu, use MBSetMenuBarMenu() instead, after constructing the replacement WBMenu from the resource.
Header File: menu_bar.h
Definition at line 530 of file menu_bar.c.
Atom aMENU_ACTIVATE |
Internal Client Message Atom for 'ACTIVATE' notification.
Atom for 'ACTIVATE' client event.
XClientMessageEvent members: window = menu bar window ID message_type = aMENU_ACTIVATE format = 32
To activate a specific menu item: data.l[0] = Hashed pointer to WBMenuItem - see WBGetPointerFromHash() data.l[1] = the index for menu item
To move to the previous or next menu item in the list: data.l[0] = 0 data.l[1] = 1 or -1; 1 moves 'next', -1 'previous', 0 'first'. others undefined.
Definition at line 150 of file menu_bar.c.
Atom aMENU_DISPLAY_POPUP |
Internal Client Message Atom for 'DISPLAY POPUP' action.
Atom for 'DISPLAY POPUP' client event.
XClientMessageEvent members: window = menu bar window ID message_type = aMENU_DISPLAY_POPUP format = 32 data.l[0] = popup menu identifier data.l[1] = X coordinate for popup 'left' side data.l[2] = X coordinate for popup 'right' side (left side plus text extent)
Definition at line 165 of file menu_bar.c.
Atom aMENU_RESIZE |
Internal Client Message Atom for 'RESIZE' notification (tells menu bar to resize itself)
Atom for 'RESIZE' client event.
XCLientMessageEvent members: window = menu bar window ID message_type = aMENU_RESIZE format = 32
(no data members)
Definition at line 130 of file menu_bar.c.