Description |
Parent class: XWindow
XFrameWindow is a window class which has a child and a frame. It supports menus and toolbars.
SetBackgroundColor |
XColor * theNewColor
With this function you set the color wich is used to fill the background in XFrameWindow::FillBackground(). Default color is black. If you change background color, you should do this before you start to insert client-windows.
XFrameWindow |
XResource * resource | a XResource contains two informations, an ID and a pointer to a XResourceLibrary. If you want to create a window out of a resourcefile you must specify the ID (otherwise it can be zero) and the XResourceLibrary which contains the window-resource. The window which is created always belongs to the process who owns the resource library, so if you work with multiple processes every process must have its own resource library. | ||||||||||||||||||||||||||||||||||||||||||
char * theTitle | The title of the window which is displayed in the titlebar | ||||||||||||||||||||||||||||||||||||||||||
ULONG style | You can specify the style of the window with the following defines,
which can be or-ed:
Default is defaultStyle. | ||||||||||||||||||||||||||||||||||||||||||
XRect * theRectangle | On default a window is created with length and hight of zero. Windows which are created with an resource template get the size of the template. Default is NULL. If theRectangle is specified, the window gets the size of it. | ||||||||||||||||||||||||||||||||||||||||||
XFrameWindow * parent | If parent is specified the window is a client of the parent. The behavior depends on the styles you have set. Default is NULL. | ||||||||||||||||||||||||||||||||||||||||||
BOOL buildFromResource | If this variable is set OOL try to build the window with a resource template which is identified by theResourceID. If the template is not found, an error ocurses. Default is FALSE. | ||||||||||||||||||||||||||||||||||||||||||
BOOL animate | Enable/disable animation on window creation. Default is FALSE |
Construct a frame-window Note that destructors of windows are called automaticaly when a window is closed! (see ~XFrameWindow)
If the method fails an exception of the type XException is thrown.
~XFrameWindow |
Destructors of windows are called automaticaly when the window is closed.
The destructor of XFrameWindow calles the destructor of every client window, menus and
toolbars. Also the destructors of handlers (derived classes of XHandler) which are
attached with it are called. If the last XFrameWindow of a process is closed, the process
will terminate.
If you want to close a window yourself, destruct the window with delete.
Activate |
Activate the window
Enable |
BOOL enable enables/disables the window (default is TRUE)
Enables/disables a window for user-input
InitMenu |
XMenu * theMenu
If a menu must be initialized this function is called. If you want to setup the menu dynamicaly, override this function.
ShowModal |
XFrameWindow * theOwnerWindow the window which is disabled until this window is closed
ShowModal displays a window modal for another window which is specified in the first parameter, that means that the user cannot perform any input with the specified window. WARNING: you should only use this function for windows which are constructed with a resource template! If you do so the operating system stops with executing the calling code until the window is closed, otherwise the calling code is executed while the window is displayed.
Draw |
This function is called if a window or a part of it must be redrawn. If you use a window which is not created from a resource template or you dont∩t have set a client with SetClient(), you must override this function and call FillBackground().
EnableWindowUpdate |
BOOL enable enable/disable window drawing (default is TRUE)
This function can stop drawing the window contents until you allow drawing.
For complex windows there can be some performance-advantages.
WARNING: If you disable drawing of a window and attach a XToolBar to it, the position
and size of the toolbar can not set correctly.
FillBackground |
FillBackground fills the background in the color you have set with SetBackgroundColor (default is black). Usualy you call this function when you have overridden XFrameWindow::Draw(). You don∩t have to call this function if a resource defined window is displayed or a window is set as client with XFrameWindow::SetClient().
GetHandle |
OOL_WINDOWHANDLE theSystemHandle
GetHandle returns the window-handle defined by the operating system. The handle is different from the ID of the window and the pointers used by the OOL. In XFrameWindow the function returns:
GetProcess |
XProcess * onwer process
Returns a pointer to the owning process (XApplication or XThread or derived class) of this window.
GetWindow |
ULONG theWindowID the ID of the client window
XWindow * thePointer the pointer to the window you have asked for. If you know the type of the window, you can make a typcast to the needed class.
With GetWindow you can get a pointer of a child-window of XFrameWindow.
Usualy it is used if the XFrameWindow is created with a resource template.
Also you can get a pointer to windows which are created dynamicaly if you have specified an
ID in the constructors of these windows. In this case you don∩t need to store the pointers
in your program.
QueryForClose |
BOOL canBeClosed return TRUE if the window can be closed, otherwise return FALSE
If the user trys to close a XFrameWindow this function is called. If you want to check if the window can be closed or not or to perform a security-check (for example with XMessageBox), override this function. This function is not called if you destroy the window with delete.
SetClient |
XWindow * theNewClient
SetClient is used to set a window, for example a control like a XMultiLineEdit, as a clientwindow of the XFrameWindow so sizing, moving and painting is automaticaly done. Moving/Sizing automaticaly may fail if the client is a frame-window.
SetIcon |
OOL_ICONHANDLE theNewIcon
Set the icon which is displayed in the button of the system menu.
GetClientSize |
XRect * rect buffer to hold the data
Query the size of the client area
GetSize |
XRect * buffer to hold data
Get the size and position of a window
SetBottom |
Set the window to the bottom (in z-order)
SetSize |
XRect * theNewSize
Set the size and/or position of a window
SetTop |
Set the window to the top (in z-order)
Show |
BOOL show TRUE=show, FALSE=hide
Displayes a window. The window wil be activated an be shown at the topmost position (in z-order). If the window is minimized the old position and size will be restored.
GetText |
XString * theBuffer theBuffer will contain the title of the window
Query the title of the window
SetText |
char * theNewText
Set the Text which is displayed in the titlebar
DoCommand |
LONG theCommandID the ID of the menuitem/toolbar-button
BOOL handled
If the user selected a menuitem (from XMenuBar or XPopupMenu) if the user pressed a button of a toolbar which is attached to it the framewindow, this function is called. To get the ID of the action the user requested, override this function. Return TRUE if you have handled the command, otherwise return FALSE.