X11workbench Toolkit
1.0
|
Child Frame API functions. More...
Go to the source code of this file.
Macros | |
#define | CHILD_FRAME_TAG (*((const unsigned int * const)"FWCF")) |
TAG for the WBChildFrame structure. | |
#define | CHILD_FRAME_UI_TAG ((WB_UINT32)'F' | ((WB_UINT32)'W' << 8) | ((WB_UINT32)'C' << 16) | ((WB_UINT32)'U' << 24)) /* FWCU */ |
TAG for the WBChildFrameUI structure. | |
#define | FW_FILE_NEW_MENU "IDM_FILE_NEW" |
#define | FW_FILE_CLOSE_MENU "IDM_FILE_CLOSE" |
#define | FW_FILE_OPEN_MENU "IDM_FILE_OPEN" |
#define | FW_FILE_SAVE_MENU "IDM_FILE_SAVE" |
#define | FW_FILE_SAVE_AS_MENU "IDM_FILE_SAVE_AS" |
#define | FW_FILE_SAVE_ALL_MENU "IDM_FILE_SAVE_ALL" |
#define | FW_EDIT_CUT_MENU "IDM_EDIT_CUT" |
#define | FW_EDIT_COPY_MENU "IDM_EDIT_COPY" |
#define | FW_EDIT_PASTE_MENU "IDM_EDIT_PASTE" |
#define | FW_EDIT_DELETE_MENU "IDM_EDIT_DELETE" |
#define | FW_EDIT_SELECT_ALL_MENU "IDM_EDIT_SELECT_ALL" |
#define | FW_EDIT_SELECT_NONE_MENU "IDM_EDIT_SELECT_NONE" |
#define | FW_EDIT_UNDO_MENU "IDM_EDIT_UNDO" |
#define | FW_EDIT_REDO_MENU "IDM_EDIT_REDO" |
#define | FW_EDIT_PROPERTIES_MENU "IDM_EDIT_PROPERTIES" |
#define | FW_FILE_NEW_ACCEL "Ctrl+N" |
#define | FW_FILE_CLOSE_ACCEL "Ctrl+F4" |
#define | FW_FILE_OPEN_ACCEL "Ctrl+O" |
#define | FW_FILE_SAVE_ACCEL "Ctrl+S" |
#define | FW_FILE_SAVE_AS_ACCEL "Ctrl+Shift+S" |
#define | FW_FILE_SAVE_ALL_ACCEL "Ctrl+Shift+L" |
#define | FW_EDIT_CUT_ACCEL "Ctrl+X" |
#define | FW_EDIT_COPY_ACCEL "Ctrl+C" |
#define | FW_EDIT_PASTE_ACCEL "Ctrl+V" |
#define | FW_EDIT_SELECT_ALL_ACCEL "Ctrl+A" |
#define | FW_EDIT_SELECT_NONE_ACCEL "Ctrl+Shift+A" |
#define | FW_EDIT_UNDO_ACCEL "Ctrl+Z" |
#define | FW_EDIT_REDO_ACCEL "Ctrl+Shift+Z" |
#define | FW_EDIT_PROPERTIES_ACCEL "Alt+Enter" |
Functions | |
int | FWInitChildFrame (WBChildFrame *pChildFrame, WBFrameWindow *pOwner, WB_FONTC pFont, const char *szFocusMenu, const WBFWMenuHandler *pHandlerArray, WBWinEvent pUserCallback, int fFlags) |
Initialize a child frame (assumed to be a base 'class' for the window) More... | |
void | FWDestroyChildFrame (WBChildFrame *pChildFrame) |
Destroy an Child Frame. More... | |
void | FWSetChildFrameMenu (WBChildFrame *pChildFrame, const char *szFocusMenu) |
Function to assign the menu resource to a Child Frame. More... | |
void | FWSetChildFrameContextMenuID (WBChildFrame *pChildFrame, int nID) |
Function to assign the context menu ID (from the menu resource) to a Child Frame. More... | |
void | FWSetChildFrameMenuHandlers (WBChildFrame *pChildFrame, const WBFWMenuHandler *pHandlerArray) |
Function to assign menu handlers to a Child Frame. More... | |
void | FWSetChildFrameDisplayName (WBChildFrame *pChildFrame, const char *szDisplayName) |
Assign the display name. More... | |
void | FWSetChildFrameImageAtom (WBChildFrame *pChildFrame, Atom aImage) |
Assign the image atom for the child frame. the image appears in the tab associated with the child frame. More... | |
void | FWSetChildFrameExtent (WBChildFrame *pChildFrame, int iXExtent, int iYExtent) |
Set the X,Y extent for the child frame (notifies everything) More... | |
void | FWSetChildFrameScrollInfo (WBChildFrame *pChildFrame, int iRow, int iMaxRow, int iCol, int iMaxCol, int iRowHeight, int iColWidth) |
Set the X,Y extent for the child frame (notifies everything) More... | |
void | FWChildFrameRecalcLayout (WBChildFrame *pChildFrame) |
Child frame notification callback (called by frame window) More... | |
void | FWChildFrameStatusChanged (WBChildFrame *pChildFrame) |
Notify Child Frame to update status text in Frame Window. More... | |
int | FWChildFrameQueryClose (WBChildFrame *pChildFrame) |
Returns if it's safe to close the child frame; prompts user as needed. More... | |
int | FWChildFrameEvent (Window wID, XEvent *pEvent) |
Default event handler for Child Frame window. More... | |
static __inline__ WBChildFrame * | FWGetChildFrameStruct (Window wID) |
Obtain the associated WBChildFrame structure pointer for a Window ID. More... | |
Child Frame API functions.
Child Frames are child windows that display a tab in the Frame window, and have specialized menus and menu handlers associated with them.
The Child Frame also provides for horizontal and vertical scrolling of the display surface, as needed, varying the display region.
A derived window will need to register the appropriate callbacks, and have the 'WBChildFrame' structure as the first member of its own structure. When the derived window creates the structure, it must initialize its own structure first, and then call FWInitChildFrame() to complete the process. And when the drived window is destroyed, it must call FWDestroyChildFrame() to complete the 'destruction' process.
The behavior of a Child Frame is like a 'base class' in C++, with a kind of polymorphism and abstraction used by the containing WBFrameWindow to manage focus, tabs, and layout changes.
The Child Frame then handles scrolling and 'menu change on focus change', so that each type of Child Frame can have its own menu. The Frame Window will change the displayed menu according to the Child Frame that has the current focus, and display a default menu when there is no Child Frame.
A derived Child Frame maintains its own data as well as handling events. So, rather than abstracting the data from the Child Frame, this toolkit combines them (as it is simpler to do so). If you need extra levels of abstraction, just create more 'derived' versions from your own designs, and abstract the 'next level up'.
Definition in file child_frame.h.