#include <cascade/app/CascadeWindow.h>
Inheritance diagram for CascadeWindow:
Public Types | |
typedef bool() | EnumProc (CascadeWindow *pWindow, void *pClientData) |
enum | Plane { kBottomMost = 0, kTopMost = 2, kAppNormal = 1 } |
Public Member Functions | |
CascadeWindow () | |
virtual | ~CascadeWindow () |
void | Materialize (Plane plane=kAppNormal) |
void | Vanish () |
void | Redraw () |
void | Redraw (const CascadeRect &rect) |
CascadeRect | GetRectRelative () const |
CascadeRect | GetRectAbsolute () const |
void | SetRectRelative (const CascadeRect &rect) |
void | SetRectAbsolute (const CascadeRect &rect) |
CascadeWindow * | GetParent () |
CascadeWindow * | GetFirstChild () |
CascadeWindow * | GetFirstSibling () |
void | AddChild (CascadeWindow *pWndChild) |
void | RemoveChild (CascadeWindow *pWndChild) |
bool | IsParentOf (CascadeWindow *pWindow) |
bool | IsChildOf (CascadeWindow *pWindow) |
bool | IsSiblingOf (CascadeWindow *pWindow) |
CascadeWindow * | GetTopLevelWindow () |
bool | EnumerateTree (EnumProc *pEnumProc, void *pClientData) |
virtual void | OnPaint (CascadeBitmap &bitmap) |
void | PaintTree (CascadeBitmap &bitmap) |
bool | IsVisible () |
virtual void | OnMaterialize () |
virtual void | OnMaterialized () |
virtual void | OnVanish () |
virtual void | OnClearFocus () |
virtual void | OnSetFocus () |
virtual bool | OnKeyDown (u32 nKey) |
virtual bool | OnKeyUp (u32 nKey) |
virtual bool | OnNavKey (u32 nKey, CascadeWindow *&pProposedNewFocusWnd) |
virtual bool | WillAcceptFocus () |
bool | IsActiveFocus () |
bool | IsInactiveFocus () |
bool | IsFocus () |
void | SetFocus (bool bRedraw=true) |
void | ClearFocus (bool bRedraw=true) |
Static Public Member Functions | |
static void | RedrawScreen () |
static CascadeWindow * | GetFocus () |
Friends | |
class | CascadeApp |
CascadeWindow is the heart of the windowing system for CascadeApps. CascadeWindow is both the data structure for a window and the implementation of the windowing system. As a data structure, CascadeWindows are simple and small. They simply contain a rectangle that defines their coordinates and 3 pointers which enable them to be Nodes in a tree of CascadeWindows, of which there may be many.
|
callback function for enumerating child windows Clients provide their own EnumProc to the EnumerateTree() function. Your custom EnumProc will get called back by the EnumerateTree() function, one for each child window of this window.
|
|
a type representing z-plane in the windowing system Plane is used as an argument to the Materialize function. Top-level windows (those without parents) are displayed in 1 of 3 planes: bottom-most, top-most, and app-normal. The bottom-most plane is for windows that are always kept below the windows of the app-normal plane. The top-most plane is for windows that are always kept on top of the app-normal plane. The app-normal plane is for normal windows that the applications display. The app-normal plane is special in that the z-order of windows within it is managed carefully. Within the app-normal plane, windows displayed by apps have their z-order automatically changed cohesively as a group as the app becomes activated and deactivated. When an application becomes active, all of its top level displayed (materialized) windows move as a group to the front of the app-normal plane. When an app becomes deactivated, the newly activated app's windows replace the deactivated app's windows as the window-group at the front of the app-normal plane - as a result the deactivated app's windows fall behind the activated app's windows.
|
|
The CascadeWindow constructor - lightweight. This base class constructor is lightweight. It simply nullifies its pointer member variables. |
|
Destructor. This destructor is lightweight.
|
|
adds a child window to the window
|
|
clears the focus window ClearFocus() clears the focus window for this process' application.
|
|
Enumerates child windows. EnumerateTree() will call *pEnumProc for each child window of this window.
|
|
gets the window's first child window
|
|
gets the window's first sibling window
|
|
returns the focus window GetFocus() returns the window (within this process' application) that has focus or NULL if no window (within this process' application) has focus.
|
|
gets the window's parent window
|
|
gets the window's rectangle relative to the screen GetRectAbsolute() returns the rectangle coordinates in absolute screen coordinates.
|
|
gets the window's rectangle relative to its parent GetRectRelative() returns the rectangle coordinates of the window relative to its parent.
|
|
gets this window's top-level window
|
|
determines if this window is the active focus window IsActiveFocus() returns true if the current window has focus *and* the application that owns (created) the window is the active application.
|
|
determines if this is a child window of another window
|
|
determines if the window is the focus window for this application IsFocus() returns true if the current window has focus within the process' application regardless of whether or not the application is the active application.
|
|
determines if the window is an inactive focus window IsInactiveFocus() returns true if the current window has focus within the process' application but the application is not the active application.
|
|
determines if this is a parent window of another window
|
|
determines if this is a sibling of another window
|
|
Determines whether or not a window is visible IsVisible() returns true if the window is materialized or if the window is a child of a materialized window.
|
|
causes the window to materialize onto the screen Materialize() causes a window to materialize (be displayed) on screen. Materialize() only works on top-level windows (those without parents or siblings). The Materialize() function is asynchronous - a call to Materialize() merely instructs the windowing system to materialize the window. When materialization is complete the window's OnMaterialize() virtual member function is invoked.
|
|
notifies the window that has lost focus OnClearFocus() gets called when the window has lost its focus. The window will be redrawn automatically (after OnClearFocus()). Clients should not redraw in OnClearFocus() but they may update member variables if desired before painting occurs.
|
|
called to handle a key down CK_KEY message OnKeyDown() gets called to handle a key down message. return true to indicate you have processed the message; false to allow the message to continue to be dispatched. NOTE that navigation keys (CK_NORTH, etc.) do not get dispatched to OnKeyDown(), they get dispatched to OnNavKey().
Reimplemented in CascadeMessageBox, CascadeDirBrowser, CascadeDirBrowser::BrowserButton, CascadeButtonWidget, CascadeSpinnerWidget, and CascadeVesselPanel. |
|
called to handle a key down CK_KEY message OnKeyDown() gets called to handle a key up message. return true to indicate you have processed the message; false to allow the message to continue to be dispatched. NOTE that navigation key up messages don't get dispatched to CascadeWindows. CascadeWindows only receive Nav key down messages to their OnNavKey() procedures.
Reimplemented in CascadeMessageBox. |
|
notifies the window when it has been materialized on screen OnMaterialize() gets called when the window has been materialized, before it has been painted.
Reimplemented in CascadeDirBrowser. |
|
notifies the window materialization is complete and the window is painted OnMaterialize() gets called when the window has been materialized, after it has been painted.
|
|
called to handle a navigation key message OnNavKey() gets called to handle a navigation key message. pProposedNewFocusWnd is the proposed new focus window. Clients who override this function may examine pProposedNewFocusWnd and change it if they want. OnNavKey() will be successively be called on a window and its parents until someone returns true, indicating they wish message dispatch to stop. At that point the pProposedNewFocusWnd (if non-NULL) will be set as the new focus window. The base class implementation returns false to allow its parent a chance to change the pProposedNewFocusWnd. If at the end of this business, pProposedNewFocusWnd doesn't point to a new focus window, then the focus will not change and the nav key will get dispatched to your CascadeApp's OnKeyDown() handler.
Reimplemented in CascadeDirBrowser, CascadeSpinnerWidget, and CascadeVesselPanel. |
|
Called to instruct this window to paint OnPaint() is called by the Cascade Windowing system to instruct your window to paint (on the bitmap passed in). Higher system performance will result if you manually clip your painting to the bitmap's clipRect (bitmap.GetClipRect()), though this is not required. It IS required to manually clip your painting to the window's absolute rect (since the graphics library doesn't yet support clipping). OnPaint() will only be called by the Cascade windowing system if some portion of the window's absolute rect intersects with the bitmap's clipRect. clients can manually call OnPaint to instruct the window to paint to an arbitrary bitmap outside of the context of the Cascade windowing system. Note that OnPaint() is a paint handling function for a single window. To cause a window and all of its child windows to paint, call PaintTree() instead.
Reimplemented in CascadeMessageBox, CascadeDirBrowser, CascadeDirBrowser::BrowserButton, CascadeButtonWidget, CascadeLabelWidget, CascadePictureWidget, CascadeSpinnerWidget, and CascadeVesselPanel. |
|
notifies the window when it has gained focus OnSetFocus() gets called when the window has gained focus. The window will be redrawn automatically (after OnSetFocus()). Clients should not redraw in OnSetFocus() but they may update member variables if desired before painting occurs.
Reimplemented in CascadeDirBrowser. |
|
notifies the window that it has vanished from the screen OnVanish() gets called when the window has vanished, before the screen has been updated. Reimplemented in CascadeDirBrowser. |
|
Instructs a window to paint itself and its child windows PaintTree() causes this window's OnPaint() function to be called to paint this window first, then calls OnPaint() on all child windows (and their children, etc.) in proper order. Note that in all cases OnPaint() will only be called on windows whose absolute rectangle intersects with bitmap.GetClipRect();
|
|
causes a portion of a visible window to be redrawn This version of Redraw() works the same way as the simple Redraw(), but sets the screen's clipping rect to rect before painting is dispatched.
|
|
causes a visible window to be redrawn Redraw() causes this window and all windows on top of it that intersect with it to be intellegently redrawn. Clients should never directly call PaintTree() or OnPaint() with the screen directly, they should always call Redraw() if they want to force manual redrawing of their window. Redraw() will cause all involved windows' OnPaint handlers to be called with a proper clipping rect set.
|
|
causes the entire screen to be redrawn RedrawScreen causes the entire screen to be redrawn. |
|
removes a child window from the window
|
|
sets this window to be the focus window SetFocus() sets this to be the window (within process' application) that has focus. Each application has at all times zero or one window that is in focus.
|
|
sets the window's rectangle relative to to the screen SetRectAbsolute() sets the rectangle coordinates of the window relative to the screen.
|
|
sets the window's rectangle relative to its parent SetRectRelative() sets the rectangle coordinates of the window relative to its parent.
|
|
causes the window to vanish from the screen Vanish() causes a materialized window to vanish from the screen. Vanish() only works on top-level windows that are materialized. Like Materialize(), Vanish() is asynchronous. When vanishing is complete, the window's OnVanish() virtual member function is invoked.
|
|
called to ask the window if it will accept focus WillAcceptFocus() is called during navigation allow the window to indicate whether or not it will accept the focus at the current point in time.
Reimplemented in CascadeDirBrowser, CascadeLabelWidget, CascadePictureWidget, CascadeVesselPanel, and CascadeWidget. |
|
Reimplemented in CascadeWidget. |