X11workbench Toolkit
1.0
|
Macros and functions needed to set up a frame window's menu. More...
Data Structures | |
struct | tagWB_FW_MENU_HANDLER |
structure for managing menu callbacks More... | |
Macros | |
#define | FW_MENU_HANDLER_BEGIN(X) static const WBFWMenuHandler X[] = { |
Use this macro to begin definition of a WBFWMenuHandler array. More... | |
#define | FW_MENU_HANDLER_ENTRY(X, Y, Z) { (unsigned long)X, Y, Z }, |
Use this macro to define an entry for a WBFWMenuHandler array. More... | |
#define | FW_MENU_HANDLER_END {0, 0, 0} }; |
Use this macro to complete the definition of a WBFWMenuHandler array. | |
#define | FWGetFocusWindow(pFW) (FWGetNumContWindows(pFW) > 0 ? FWGetContainedWindowByIndex(pFW, -1) : NULL) |
A macro to aid code readability, returning the Window ID of the contained window that has the focus. More... | |
Typedefs | |
typedef struct tagWB_FW_MENU_HANDLER | WBFWMenuHandler |
structure for managing menu callbacks More... | |
Macros and functions needed to set up a frame window's menu.
Setting up a menu event handler for a frame window using the WBFWMenuHandler structures involves the use of set of macros to create the structure, and a call to FWSetMenuHandlers() to assign them to the Frame window.
Typical sample code follows:
#define FW_MENU_HANDLER_BEGIN | ( | X | ) | static const WBFWMenuHandler X[] = { |
Use this macro to begin definition of a WBFWMenuHandler array.
X | the name of the menu handler array variable |
Definition at line 893 of file frame_window.h.
#define FW_MENU_HANDLER_ENTRY | ( | X, | |
Y, | |||
Z | |||
) | { (unsigned long)X, Y, Z }, |
Use this macro to define an entry for a WBFWMenuHandler array.
X | A menu identifier expressed as an ASCII string or ID |
Y | A callback function pointer, or NULL - see WBFWMenuHandler::callback |
Z | A UI callback functino pointer, or NULL - see WBFWMenuHandler::UIcallback |
Definition at line 902 of file frame_window.h.
#define FWGetFocusWindow | ( | pFW | ) | (FWGetNumContWindows(pFW) > 0 ? FWGetContainedWindowByIndex(pFW, -1) : NULL) |
A macro to aid code readability, returning the Window ID of the contained window that has the focus.
pFW | The WBFrameWindow structure pointer |
Definition at line 942 of file frame_window.h.
structure for managing menu callbacks
The WBFWMenuHandler structure is designed to be initialized via macros, so that a set of callback functions can then be easily used to handle menu events. If no menu handler is present for a menu item, or if the menu UI handler is NOT NULL and returns a non-zero value, the menu item will be disabled and displayed accordingly. It will not be possible to use its hotkey nor select it. Otherwise, the menu will be displayed normally and be selectable, and its hotkey will be able to activate it.