Main Page | Class Hierarchy | Data Structures | Directories | Data Fields

CWindow Class Reference

#include <utui.h>

Inheritance diagram for CWindow:

CDocumentClient CLayout CDialog CLabel CListbox CRootWindow CMenu CMessageBox CButton CMenuItem CMenuBar

Public Member Functions

 CWindow (void)
 Default constructor.
virtual ~CWindow (void)
 Virtual destructor.
virtual void OnCreate (void)
 Initializes the window.
virtual void OnDestroy (void)
 Uninitializes the window.
virtual void OnKey (wchar_t)
 Routes key down the focus path.
virtual void OnCommand (cmd_t cmd)
 Handles command cmd by forwarding it to child windows.
virtual void OnUpdateCommandUI (rcmd_t cmd) const
 Updates the state of command cmd.
virtual void OnResize (rcrect_t wr)
 Sets the window rect to wr.
virtual void SizeHints (rrect_t wr) const
 Returns the recommended area of the window when r is the total available area.
rcrect_t WindowRect (void) const
void AddChild (CWindow *pw)
 Adds pw to the (owning) child window list.
void RemoveChild (CWindow *pw)
 Removes pw from internal list of children without deleting it.
void DeleteAllChildren (void)
 Deletes all child windows.
void Close (void)
rcpos_t CaretPos (void) const
void Paint (void)
 Draws the window and its children onto the internal gc.
bool SeenCWRect (Rect &r, const CWindow *pw) const

Protected Types

typedef vector< CWindow * > winvec_t
typedef winvec_t & rwinvec_t
typedef const winvec_t & rcwinvec_t
typedef CWindowrwin_t
typedef const CWindowrcwin_t
typedef vector< SCommandKeycmdkvec_t
enum  EFlags {
  f_Created = CDocumentClient::f_Last,
 Miscellaneous flags; pass to SetFlag or Flag. More...

Protected Member Functions

rwinvec_t Children (void)
rcwinvec_t Children (void) const
rwin_t CW (uoff_t i)
rcwin_t CW (uoff_t i) const
template<typename T>
T & TCW (uoff_t i)
template<typename T>
const T & TCW (uoff_t i) const
CGC & GC (void)
const CGC & GC (void) const
Rect WindowArea (void) const
void SetCommandKeys (const SCommandKey *pCmds, size_t nCmds)
void AddCommandKey (wchar_t key, wchar_t cmd)
bool HasFocus (void) const
uint32_t Focus (void) const
void SetFocus (uoff_t f)
 Sets f as the focused child window.
uint32_t GetNextFocus (int dir=1) const
 Finds the next focus if the current one gives it up.
virtual void OnDraw (CGC &gc)
void CaretTo (rcpos_t pt)
 Moves the caret to pt.
void CaretTo (coord_t x, coord_t y)
void CaretOff (void)
void Close (int32_t code)
virtual void OnGainFocus (void)
 Called when this window loses focus.
virtual void OnLoseFocus (void)
 Called when this window gains focus.
virtual void OnIdle (void)
 Called on every event loop iteration.
virtual void OnChildClose (uoff_t i)
 Called whenever a child window closes itself.

Static Protected Attributes

static const Point2d pos_CaretOff

Data Structures

struct  SCommandKey
 Command key table element. More...

Detailed Description

A window object. Derive your window classes from this to obtain output and event-handling capabilities. Each window may have child windows of its own, which can be laid out manually or by use of layout objects.

Member Enumeration Documentation

enum CWindow::EFlags [protected]

Miscellaneous flags; pass to SetFlag or Flag.

f_Created  OnCreate has been called.
f_Resized  OnResize has been called.
f_HasFocus  Has input focus.
f_OffersFocus  Doesn't want the focus any more.
f_NoTabOrder  Can't be focused by the user.
f_Closed  Should be closed by parent.

Member Function Documentation

bool CWindow::SeenCWRect Rect &  r,
const CWindow pw

Returns in r the area of window pw in this window's coordinates. false is returned if pw is not in this window's subtree.

void CWindow::SetCommandKeys const SCommandKey pCmds,
size_t  nCmds
[inline, protected]

Used to set key-command mappings for this window.

Create a static array of SCommandKeys and pass it here, which links an internal vector to it. That vector is then automatically processed in OnKey, dispatching commands as needed. Ensure pCmds continues its existence until the window is destroyed.

The documentation for this class was generated from the following files:
Generated on Sat Nov 18 11:53:53 2006 for UltraTextUI by 1.4.4 Doxygen Hosted on