[Classes] [Prev] [Next] [Methods]


Methods Index

Protected Data Members
Private Data Members
Public Methods
Constructor and Initializer Methods
Message Passing Methods
Window Setup and Closing
Window Background Methods
Window Scrollbar Methods
Inherited Utility Methods
MenuBar Methods
Event Methods (called by event handlers only)
Mouse Handler Methods
Keyboard Navigation Methods
Queue Methods
E_SIZE Queue Methods
Protected Methods
Operator and Destructor
Scrolling Events
Factory Methods



Superclass: CSubview

Subclasses: CAttachmentWindow, CTaskWin


CWindow objects consist of a physical window displayed on the screen. CWindow is a special type of CSubview and thus may contain other CView objects. The CWindow object is the top-most view in the nesting of views; it is the link between the views and the documents. A CWindow object can be of any XVT Portability Toolkit type and receives all window events. Most of the window management, such as moving and sizing, is done by the window manager or the XVT-Power++ desktop. Possible XVT Portability Toolkit window types are shown in the following table. For further information, see the XVT Portability Toolkit Guide.

W_DOC Document window
W_PLAIN Single-bordered window
W_DBL Double-bordered window
W_NO_BORDER No border
w_Modal Modal window


This is a class from which application-specific derived classes are built. To use it, it is sufficient to derive a new class, create it, and add subviews or native views. For information on managing windows and thier layout on the screen, see CDesktop.

Protected Data Members

WINDOW itsXVTWindow; The window's XVT Portability Toolkit window handle
CDocument* itsDocument; The window's boss
new short itIsQueuedUpdate Window updates are being queued.
new static long itsCreationIcon Only used when minimized.
CDocument* itsDocument Window's document.
NWinScrollBar* itsHScrollBar Window scrollbar (when WSF_HSCROLL is set)
new CMouseManager* itsMouseManager Manager of CMouseHandlers for the window.
new CNavigator* itsNavigator Keyboard navigator for the window
new RCT itsQueuedRect Region of queued updates
NWinScrollBar* itsVScrollBar Window scrollbar (when WSF_VSCROLL is set)

Private Data Members

BOOLEAN itDrawsBackground; Whether the window has a background
BOOLEAN itIsClosable; Whether the window can be closed
BOOLEAN itIsSizable; Whether the window can be sized
WIN_TYPE itsWindowType; The window type
int itsMenuBarId; The window's URL menubar ID
CMenuBar* itsMenuBar; The window's menubar ID
long itsAttributes; The window's XVT Portability Toolkit attributes
TXEDIT itsHiddenXVTTextEdit; A hidden text edit object used to hide the caret
static BOOLEAN SwitchBoardDelete Allows deleting only through the switchboard
WINDOWHandler; The default global event handler, usually the switchboard object


friend class CSwitchBoard; Allows access to window event methods
friend class CTaskWin; Allows access to itsXVTWindow
friend class CView; Allows access for speed
friend class CNativeTextEdit; Allows access to itsHiddenXVTTextEdit
friend class CResourceWindow; Allows access to the resource manager

Public Methods

Constructor and Initializer Methods

CWindow(CDocument* theDocument, 
const CRect& theRegion,
const CStringRW& theTitle = NULLString,
long theWindowAttributes = WSF_NONE,
WIN_TYPE theWindowType = W_DOC,
int theMenuBarId = MENU_BAR_RID,
WINDOW theEnclosure = TASK_WIN);

WSF_NONE No flags set
WSF_SIZE Is user-sizeable
WSF_CLOSE Is user-closeable
WSF_HSCROLL Has horizontal scrollbar outside client area
WSF_VSCROLL Has vertical scrollbar outside client area
WSF_DECORATED All of above four flags are set
WSF_INVISIBLE Is initially invisible
WSF_DISABLED Is initially disabled
WSF_ICONIZABLE Is iconizable
WSF_ICONIZED Is initially iconized
WSF_NO_MENUBAR Has no menubar of its own
WSF_MAXIMIZED Initially maximized

CWindow(CDocument* theDocument, WINDOW theXVTWindow);
CWindow(CDocument* theDocument,
long theId,
BOOLEAN isCreatedViews,
WINDOW theParent = TASK_WIN);
CWindow(const CWindow& theWindow);
BOOLEAN isBackgroundDrawn = FALSE,
const CStringRW& theTitle = NULLString,
BOOLEAN isVisible = TRUE);

Message Passing Methods

virtual void DoCommand(long theCommand, 
void* theData = NULL);
virtual void UpdateMenus(CMenuBar* theMenuBar);

Window Setup and Closing

virtual BOOLEAN Close(void);
virtual WINDOW GetXVTWindow(void) const;
virtual long GetAttributes(void) const;
virtual int GetMenuBarId(void) const;
virtual BOOLEAN IsClosable(void) const;
virtual BOOLEAN IsSizable(void) const;
virtual CDocument* GetDocument(void);

Window Background Methods

virtual BOOLEAN IsBackgroundDrawn(void) const;
virtual void SetBackgroundDrawing(
BOOLEAN isBackgroundDrawn);

Window Scrollbar Methods

virtual NWinScrollBar* GetVScrollBar(void) const;
virtual NWinScrollBar* GetHScrollBar(void) const;

Inherited Utility Methods

CWindow overrides the following basic inherited event methods.

virtual void Key(const CKey& theKey);
virtual void Size(const CRect& theNewSize);
virtual void Draw(const CRect& theClippingRegion);	
virtual void Hide(void);
virtual void Show(void);
virtual void Enable(void);
virtual void Disable(void);
virtual void DoDisable(void);
virtual void DoEnable(void); 
static void SetCreationIcon(long theId);
virtual void SetEnclosure(CSubview* theEnclosure);
virtual void SetTitle(const CStringRW& theNewTitle);
virtual void SetSelectedView(CView *theSubview);
virtual CRect GetClippedFrame(void) const;
virtual const CEnvironment* GetEnvironment(void) const;
virtual void DoMenuCommand(MENU_TAG theMenuItem, BOOLEAN isShiftKey, BOOLEAN isControlKey);
virtual void ChangeFont(const CFont &theFont);
virtual void DoModal(void);

MenuBar Methods

void SetMenuBar(CMenuBar* theMenuBar, 
BOOLEAN isDeleteOld = TRUE);
CMenuBar* GetMenuBar(void);

Event Methods (called by event handlers only)

virtual void SizeWindow(int theWidth, int theHeight);
virtual void DoControl(int theControlID,
CONTROL_INFO theControlInfo);
virtual void DoActivateWindow(void);
virtual void DoDeactivateWindow(void);
virtual void DoTimer(long theTimerId);
virtual void DoUser(long theUserId, void* theData);
TXEDdIT GetHiddenXVTTextEdit(void) const;

Mouse Handler Methods

virtual CMouseManager* GetMouseManager(void);
virtual void SetMouseManager(CMouseManager* theMouseManager);

Keyboard Navigation Methods

virtual CNavigator* GetNavigator(void);
virtual void SetNavigator(CNavigator* theNavigator);

Queue Methods

CWindow provides four methods for queuing screen updates for more efficient flicker-free redrawing. Each update request unions the requested rectangle with all other requested update rectangles. Flushing the update queue then makes an update call using the unioned update rectangle. Notice that the union operation is a rectangular union, not a complex union that would result in non-rectangular update regions.

BOOLEAN IsQueuedUpdate(void) const;
void QueueUpdates(void);
void UnionQueuedUpdates(RCT &theRect);
void FlushQueuedUpdates(void);

E_SIZE Queue Methods

BOOLEAN QueueSize(int theWidth, int theHeight);
void SuspendSizing();
void ResumeSizing();

Protected Methods

Operator and Destructor

CWindow& operator=(const CWindow& theWindow);
virtual ~CWindow(void);

Scrolling Events

void DoHScroll(SCROLL_CONTROL theEvent, short thePos);
void DoVScroll(SCROLL_CONTROL theEvent, short thePos);
virtual void UpdateUnits(CUnits* theUnits);
virtual void CreateWindow(WINDOW the Enclosure);
virtual void InitWindow(void);

Factory Methods

virtual CMouseManager* ConstructMouseManager();
virtual CNavigator* ConstructNavigator

[Classes] [Prev] [Next] [Methods]


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.