home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
uicldd.zip
/
IWINDOW.HPP
< prev
next >
Wrap
Text File
|
1993-08-23
|
43KB
|
806 lines
#ifndef _IWINDOW_
#define _IWINDOW_
/*******************************************************************************
* FILE NAME: iwindow.hpp *
* *
* DESCRIPTION: *
* Declaration of the class(es): *
* IWindow - Abstract base class for all GUI window classes. *
* *
* COPYRIGHT: *
* Licensed Materials - Property of IBM *
* (C) Copyright IBM Corporation 1992, 1993 *
* All Rights Reserved *
* US Government Users Restricted Rights - Use, duplication, or disclosure *
* restricted by GSA ADP Schedule Contract with IBM Corp. *
* *
*$Log: I:/IBMCLASS/IBASEAPP/VCS/IWINDOW.HPV $
//
// Rev 1.47 23 Aug 1993 14:30:28 FWBROWN
// Updated descriptions of clipChildren and clipSiblibs styles.
//
// Rev 1.46 18 Aug 1993 12:41:56 law
// Added functions required for direct manipulation.
//
// Rev 1.45 16 Aug 1993 17:39:26 FWBROWN
// Updated the comments for IWindow, IWindow::ChildCursor, and
// IWindow::ExceptionFn to match the Reference book.
//
// Rev 1.44 12 Jul 1993 13:22:08 unknown
// No change.
//
// Rev 1.43 13 May 1993 03:13:38 tsuji
// Rename childFontChanged to fontPropogated.
//
// Rev 1.42 09 May 1993 19:18:16 tsuji
// Remove old versions of setLayoutDistorted, isLayoutDistorted. Also
// update the Layout flags.
//
// Rev 1.41 27 Apr 1993 14:29:28 HARPERSP
// Made IFileDialog and IFontDialog friends of IWindow.
// This was lost when setDefaultProcedure() had to be re-put.
//
// Rev 1.40 27 Apr 1993 01:55:42 BOBLOVE
// Added new setLayoutDistorted support
//
// Rev 1.39 27 Apr 1993 00:41:36 BOBLOVE
// Added ExceptionFn dtor
//
// Rev 1.38 26 Apr 1993 15:25:32 HARPERSP
// Put setDefaultProcedure() on top of most recent revisions.
// defaultPushbutton() and matchForMnemonic() updates had been lost.
//
// Rev 1.37 26 Apr 1993 02:08:46 tsuji
// P515, P535: Add defaultPushbutton() and matchForMnemonic()
// functions for use primarily by ICanvas and ICanvasHandler.
//
// Rev 1.36 23 Apr 1993 10:27:58 law
// Added code to ensure destroyed handlers get detached from windows.
//
// Rev 1.35 18 Apr 1993 22:12:42 BOBLOVE
// Added new private "states"
//
// Rev 1.34 18 Apr 1993 12:18:22 tsuji
// P597: Add more words to color(), setColor().
//
// Rev 1.33 15 Apr 1993 03:23:48 tsuji
// P568: Add isTabStop function, change layoutDistorted functions to virtual.
//
// Rev 1.32 12 Apr 1993 03:07:10 tsuji
// P487: Move addHandler/removeHandler from public to protected. Also
// remove "ul" from send/post default values.
//
// Rev 1.31 05 Apr 1993 17:24:50 BOBLOVE
// Added optional color function that takes a defaultColor
//
// Rev 1.30 08 Mar 1993 03:19:30 BOBLOVE
// Doc change
//
// Rev 1.29 05 Mar 1993 02:56:40 BOBLOVE
// Added canvas sizing functions
// Added send/postEvent(EventType)
//
*******************************************************************************/
#ifndef _IVBASE_
#include <ivbase.hpp>
#endif
// Forward declarations for other classes:
class IColor;
class IException;
class IHandler;
class IHandlerList;
class IRectangle;
class IString;
class IDMItemProvider;
#ifndef _IBITFLAG_
#include <ibitflag.hpp>
#endif
#ifndef _IEVENT_
#include <ievent.hpp>
#endif
#ifndef _IHANDLE_
#include <ihandle.hpp>
#endif
#ifndef _IPOINT_
#include <ipoint.hpp>
#endif
class IWindow : public IVBase {
typedef IVBase
Inherited;
/*******************************************************************************
* The IWindow class is the base window class and provides behavior common to *
* all windows. While this class contains behavior that requires the *
* existence of a presentation window, the presentation window itself must be *
* constructed by the subclass. *
* *
* NOTE: You cannot construct members of this class directly. *
* *
* Example: *
* *
* The following example demonstrates the required behavior of the constructor *
* of an IWindow subclass, by actually using an IControl subclass. *
* *
* // *
* // Constructor to create a super control *
* // *
* SuperControl::SuperControl(unsigned long ulId, *
* IWindow* pwndParent, *
* IWindow* pwndOwner, *
* const IRectangle& rectInit, *
* Style efsStyle) *
* { *
* // Create the control using a call to Presentation Manager *
* IWindowHandle whSuperControl = *
* WinCreateWindow(pwndParent->handle(), *
* WC_SUPERCONTROL, 0, *
* efsStyle.asUnsignedLong(), *
* rectInit.left(), rectInit.bottom(), *
* rectInit.width(), rectInit.height(), *
* (pwndOwner==0)?0:pwndOwner->handle(), *
* HWND_TOP, ulId, 0, 0); *
* *
* if (whSuperControl == 0) *
* { *
* // indicates an error so throw an exception *
* } *
* // tell IWindow to start processing events for the window *
* startHandlingEvent(whSuperControl); *
* } *
* *
*******************************************************************************/
public:
/*-------------------------------- Destructor ----------------------------------
| You cannot construct IWindow objects publicly. However, you can destroy an |
| IWindow subclass using the following virtual destructor. |
------------------------------------------------------------------------------*/
virtual
~IWindow ( );
/*---------------------------------- Style -------------------------------------
| The following functions provide a means to set and query window styles: |
| |
| Style - Nested class that provides static members that define the set of |
| valid window styles. For example, you could define an instance |
| of the IWindow::Style class and initialize it like: |
| IWindow::Style |
| style = visible | clipChildren | saveBits; |
| An object of this type is provided when the window is created. A |
| customizable default is used if no styles are specified. Once |
| the object is constructed, you can use IWindow member functions |
| to set or query the object's style. |
| |
| The declaration of the IWindow::Style nested class is generated |
| by the INESTEDBITFLAGCLASSDEF0 macro. |
| |
| The valid window styles are: |
| noStyle - Sets all styles off. |
| visible - Causes the window to be visible. In general, controls |
| are constructed as visible and frame windows as invisible. |
| disabled - Specifies that keyboard and mouse input are no longer |
| dispatched to the window, preventing the window from |
| being used. |
| clipChildren - Excludes the area occupied by the children of the window |
| when drawing in the window. Child windows are always |
| "clipped" to their parent window. When a parent window |
| is painted, the clipChildren style controls whether the |
| invalidated region of the parent window includes the area |
| occupied by its children, thus preventing a window from |
| painting over its child windows. |
| clipSiblings - Controls which sibling window is displayed on top when |
| multiple siblings are displayed. Sibling windows are |
| windows that share the same parent window. Assign the |
| clipSiblings style to the sibling window that should be |
| displayed on top of the other siblings, in Z-order. |
| clipToParent - Restricts a window from painting over its parent window. |
| saveBits - Optimizes the painting of a window by saving the screen |
| image of the area under the window as a bit map, and then |
| using the bit map to redraw the window when necessary. |
| synchPaint - Synchronously repaints the window. Without this style, |
| painting only occurs if there are no other events waiting |
| to be processed. |
------------------------------------------------------------------------------*/
INESTEDBITFLAGCLASSDEF0(Style, IWindow);
static const Style
noStyle,
visible,
disabled,
clipChildren,
clipSiblings,
clipToParent,
saveBits,
synchPaint;
/*------------------------------ Related Types ---------------------------------
| The following enumeration is defined: |
| EventType - Enumeration that specifies windowing system message |
| identifiers. Valid values are: |
| command - The event type is user command. |
| systemCommand - The event type is system command. |
| help - The event type is help. |
| character - The event type is key character. |
------------------------------------------------------------------------------*/
enum EventType { command=1, systemCommand, help, character };
/*---------------------------- Window Positioning ------------------------------
| These functions are used to set and query the size and position of windows: |
| moveTo - Changes the position of the window. |
| sizeTo - Changes the size of the window. |
| moveSizeTo - Changes the position and size of the window. |
| position - Returns the window position. |
| size - Returns the size of the window in window coordinates. |
| NOTE: This function will return ISize(0,0) for a frame |
| window if it is constructed using the shell position |
| and the window has not been shown. |
| rect - Returns a rectangle that represents the position and size of |
| the window. |
| NOTE: This function will return IRectangle(0,0,0,0) for a |
| frame window if it is constructed using the shell |
| position and the window has not been shown. |
------------------------------------------------------------------------------*/
virtual IWindow
&moveTo ( const IPoint& aPoint ),
&sizeTo ( const ISize& newSize ),
&moveSizeTo ( const IRectangle& aRectangle );
IPoint
position ( ) const;
ISize
size ( ) const;
IRectangle
rect ( ) const;
/*-------------------------------- Accessors -----------------------------------
| These functions provide a means of getting and setting the accessible |
| attributes of instances of this class: |
| enable - Enables the window to accept keyboard and mouse input. |
| disable - Prevents keyboard and mouse input from being sent to |
| the window. |
| isDisabled - Returns true if the window is not sent mouse and |
| keyboard input. |
| setFocus - Sets the input focus to the window. |
| hasFocus - Returns true if the window has the input focus. |
| setParent - Changes the window parent. |
| parent - Returns the window's parent. |
| setOwner - Changes the window owner. |
| owner - Returns the window's owner. |
| isValid - Returns true if this object represents a valid |
| Presentation Manager window. It returns false if the |
| window has yet to be created or has already been |
| destroyed. |
| isFrameWindow - Returns true if this object represents a frame window. |
| desktopWindow - Returns the instance of the object that represents the |
| system desktop window. |
| objectWindow - Returns the instance of the object that represents the |
| system object. |
| handle - Returns the window handle. |
| windowWithHandle - Static function to return the IWindow instance in the |
| current thread for the passed window handle. |
| windowWithId - Static function to return the IWindow instance in the |
| current thread for the ID and owner. |
| id - Returns the window ID. |
| messageQueue - Returns the handle for the window's message queue. |
------------------------------------------------------------------------------*/
virtual IWindow
&enable ( Boolean enableWindow=true ),
&disable ( ),
&setFocus ( ),
&setParent ( const IWindow* newParent ),
&setOwner ( const IWindow* newOwner );
IWindow
*parent ( ) const,
*owner ( ) const;
Boolean
isDisabled ( ) const,
hasFocus ( ) const,
isValid ( ) const,
isFrameWindow ( ) const;
static IWindow
*desktopWindow ( ),
*objectWindow ( );
virtual IWindowHandle
handle ( ) const;
static IWindow
*windowWithHandle ( const IWindowHandle& windowHandle ),
*windowWithId ( unsigned long id,
const IWindow* owner );
unsigned long
id ( ) const;
IMessageQueueHandle
messageQueue ( ) const;
/*----------------------------- Event Send/Post --------------------------------
| These functions provide a simplified means of sending or posting an IEvent |
| to a window: |
| postEvent - Posts an event constructed from the arguments to the window. |
| If an EventType is used, an event will be constructed with |
| the appropriate message identifier. |
| sendEvent - Sends an event constructed from the arguments to the window. |
| If an EventType is used, an event will be constructed with |
| the appropriate message identifier. |
------------------------------------------------------------------------------*/
void
postEvent ( unsigned long eventId,
const IEventParameter1 &parm1 = 0,
const IEventParameter2 &parm2 = 0 ) const;
IEventResult
sendEvent ( unsigned long eventId,
const IEventParameter1 &parm1 = 0,
const IEventParameter2 &parm2 = 0 ) const;
void
postEvent ( EventType eventType,
const IEventParameter1 &parm1 = 0,
const IEventParameter2 &parm2 = 0 ) const;
IEventResult
sendEvent ( EventType eventType,
const IEventParameter1 &parm1 = 0,
const IEventParameter2 &parm2 = 0 ) const;
/*----------------------------- Window Painting --------------------------------
| These functions are used in displaying a window and determining the |
| visibility of a window. |
| show - Makes the window visible. |
| hide - Hides the window. |
| refresh - Has the following implementations: |
| - Invalidates and redraws the entire window. If |
| the refreshChildren argument is true, the |
| children are updated as well. |
| - Invalidates and redraws a given window rectangle. |
| showSourceEmphasis - Called by a pop-up menu handler to notify the window |
| to draw pop-up menu emphasis. The default behavior |
| of IWindow is to do nothing. |
| hideSourceEmphasis - Called by a pop-up menu handler to notify the window |
| to remove pop-up menu emphasis. The default |
| behavior of IWindow is to do nothing. |
| isVisible - Returns true if the windows style is visible. |
| NOTE: A window can have a style of visible and yet |
| not be showing if it is covered by another |
| window. |
| isShowing - Returns true if any part of the window is showing. |
| NOTE: A window can be visible and yet not be showing |
| if it is covered by another window. |
| presSpace - Acquires and returns the presentation space handle |
| for the window. |
| releasePresSpace - Releases the window's presentation space handle. |
| setLayoutDistorted - Indicates that changes have occurred in the window |
| that will cause the layout of the window in a canvas |
| to be updated. |
| isLayoutDistorted - Determines whether changes have been made in a |
| window that will require updating the layout of the |
| window in a canvas. |
| setMinimumSize - Sets the minimum allowable size of the window. In |
| the library, this applies to windows on a canvas |
| only. |
| minimumSize - Returns the minimum allowable size set by the user's |
| class. |
------------------------------------------------------------------------------*/
virtual IWindow
&show ( Boolean showWindow=true ),
&hide ( ),
&refresh ( Boolean refreshChildren=false ),
&refresh ( const IRectangle& invalidRectangle ),
&showSourceEmphasis ( Boolean show=true ),
&hideSourceEmphasis ( );
Boolean
isVisible ( ) const,
isShowing ( ) const;
IPresSpaceHandle
presSpace ( ) const;
void
releasePresSpace ( const IPresSpaceHandle& aPresentationSpaceHandle ) const;
enum Layout { windowCreated=1, colorChanged=2, sizeChanged=4,
minimumSizeChanged=8, childMinimumSizeChanged=16,
fontChanged=32, fontPropogated=64, layoutChanged=128,
immediateUpdate=256 };
virtual IWindow
&setLayoutDistorted ( unsigned long layoutAttributeOn,
unsigned long layoutAttributeOff );
virtual Boolean
isLayoutDistorted ( unsigned long layoutAttribute ) const;
IWindow
&setMinimumSize ( const ISize& sizMin );
ISize
minimumSize ( ) const;
/*------------------------- Object Deletion ------------------------------------
| These functions provide a means of managing the window object: |
| setAutoDeleteObject - Determines whether the IWindow instance should be |
| deleted when the presentation window is destroyed. |
| The deletion will occur when the Presentation |
| Manager dispatches a destroy event to the window. |
| By default, the instance is not deleted. |
| setAutoDestroyWindow - Determines whether the presentation window should |
| be destroyed when the IWindow instance is deleted. |
| This is used in cases where an IWindow is a |
| wrapper for a presentation window whose creation |
| and destruction are handled outside the C++ object. |
| isAutoDeleteObject - Returns true if the window instance will be |
| deleted when a destroy event is dispatched to the |
| window. |
| isAutoDestroyWindow - Returns true if the presentation window will be |
| destroyed when the window instance is deleted. |
------------------------------------------------------------------------------*/
IWindow
&setAutoDeleteObject ( Boolean autoDelete=true ),
&setAutoDestroyWindow ( Boolean autoDestroy=false );
Boolean
isAutoDeleteObject ( ) const,
isAutoDestroyWindow ( ) const;
/*------------------------------ Drag/Drop Support -----------------------------
| These functions provide means of getting and setting the accessible |
| attributes of instances of this class: |
| itemProvider - Returns pointer to drag item provider for this window |
| setItemProvider - Sets pointer to drag item provider for this window. |
------------------------------------------------------------------------------*/
IDMItemProvider
*itemProvider ( ) const;
IWindow
&setItemProvider ( IDMItemProvider *dragProvider );
class ChildCursor : public IVBase {
/*******************************************************************************
* The IWindow::ChildCursor class is a nested cursor class used to iterate *
* over the children of any window. The children are accessed in Z-order, *
* from top to bottom. *
* *
* Example: *
* // Iterate over children of frame... *
* IFrameWindow *
* frame; *
* IFrameWindow::ChildCursor *
* cursor ( frame ); *
* for ( cursor.setToFirst(); cursor.isValid(); cursor.setToNext() ) *
* { // Do something with each child... *
* IWindowHandle *
* child = frame.childAt( cursor ); *
* ... *
* } *
*******************************************************************************/
public:
/*-------------------------- Constructor/Destructor ----------------------------
| You can construct objects of this class from a reference to the window |
| whose child windows will be iterated over. |
------------------------------------------------------------------------------*/
ChildCursor ( IWindow &parent );
~ChildCursor ( );
/*-------------------------------- Overrides -----------------------------------
| The nested ChildCursor class overrides the following functions to |
| provide the appropriate cursor behavior: |
| setToFirst - Resets the cursor position to the first child window (in |
| Z-order). |
| setToNext - Advances the cursor position to the next child window (in |
| Z-order). |
| isValid - Returns true if the cursor is in a valid area. |
| invalidate - Marks the cursor as invalid. |
------------------------------------------------------------------------------*/
virtual Boolean
setToFirst ( ),
setToNext ( ),
isValid ( ) const;
virtual void
invalidate ( );
private:
/*--------------------------------- Private ----------------------------------*/
friend class IWindow;
IEnumHandle
enumHandle;
IWindowHandle
windowHandle,
parentHandle;
ChildCursor
&operator = ( const ChildCursor & );
ChildCursor ( const ChildCursor & );
}; // IWindow::ChildCursor
/*------------------------------ ChildCursor Support ---------------------------
| childAt - Returns the window handle of the child window at the current |
| position of the argument cursor. |
------------------------------------------------------------------------------*/
IWindowHandle
childAt ( const ChildCursor &aCursor ) const;
/*------------------------------ Canvas Support --------------------------------
| These functions are used by the canvas classes to provide dialog-like |
| behavior (minimal implementations are provided here): |
| isTabStop - Returns true if the user can tab to the window. |
| defaultPushbutton - Returns the first child window that is a default push |
| button, if one exists. |
| matchForMnemonic - Returns the first child window that uses the |
| specified character as a mnemonic. |
------------------------------------------------------------------------------*/
virtual Boolean
isTabStop ( ) const;
virtual IWindowHandle
defaultPushbutton ( ) const,
matchForMnemonic ( unsigned short character ) const;
/*------------------------------ Miscellaneous ---------------------------------
| This function is used to map coordinates from one window to another: |
| mapPoint - Static function to map a point from one window's coordinate |
| space to another's, such as mapping from screen coordinates to |
| window coordinates. |
------------------------------------------------------------------------------*/
static IPoint
mapPoint ( const IPoint &aPoint,
const IWindowHandle &from,
const IWindowHandle &to );
/*------------------------------- Diagnostics ----------------------------------
| The following functions are used to output information for the window: |
| asString - Returns a string that contains the window handle and ID. |
| asDebugInfo - Returns a string that contains detailed information about |
| the window, including the information provided by asString. |
------------------------------------------------------------------------------*/
virtual IString
asString ( ) const,
asDebugInfo ( ) const;
class ExceptionFn : public IVBase {
typedef IVBase
Inherited;
/*******************************************************************************
* The IWindow::ExceptionFn nested class is used to process exceptions that *
* occur when events are dispatched by the IWindow dispatcher. *
* *
* Example: *
* *
* class MyFrameWindow : public IFrameWindow, public IWindow::ExceptionFn { *
* virtual Boolean *
* handleException (IException& exception, IEvent& event) { *
* return true; // ignore the exception and continue dispatching *
* }; *
* *
* MyFrameWindow :: MyFrameWindow () { *
* setExceptionFunction(this); *
* *
* *
*******************************************************************************/
public:
~ExceptionFn ( );
/*--------------------------- Exception Processing -----------------------------
| The following function is used to process C++ exceptions in the IWindow |
| dispatcher: |
| handleException - If an exception object is registered with IWindow, this |
| function will be called when an uncaught exception |
| occurs while dispatching events. This function should |
| return true if the exception situation was handled and |
| it is safe to continue dispatching events. If false is |
| returned, the exception will be thrown again. |
------------------------------------------------------------------------------*/
virtual Boolean
handleException ( IException& dispatcherException,
IEvent& exceptionEvent ) = 0;
}; // IWindow::ExceptionFn
/*----------------------------- Exception Processing ---------------------------
| The following functions are used to process C++ exceptions in the IWindow |
| dispatcher: |
| setExceptionFunction - Stores an IWindow::ExceptionFn object to be called |
| when an uncaught exception is detected while |
| dispatching window events. If an object has |
| already been registered, it is returned; |
| otherwise, 0 is returned. |
| exceptionFunction - Returns a pointer to the current exception |
| function, or 0 if one has not been registered. |
| handleException - Called when an exception is detected during the |
| dispatch of an event. The default behavior is to |
| determine if an IWindow::ExceptionFn object has |
| been registered and call it. Otherwise, false is |
| returned and the exception is thrown again. |
------------------------------------------------------------------------------*/
static IWindow::ExceptionFn
*setExceptionFunction ( IWindow::ExceptionFn* exceptionObject ),
*exceptionFunction ( );
virtual Boolean
handleException ( IException& dispatcherException,
IEvent& exceptionEvent );
protected:
/*------------------------------ Implementation --------------------------------
| This function provides utilities used to implement this class: |
| addHandler - Adds an instance of a handler class to the window. |
| removeHandler - Removes a previously added handler. |
| setColor - Sets the window area to the indicated color. The |
| window area is identified by a system-defined |
| presentation parameter value. |
| setStyle - Sets the window style using the masking bits defined by |
| the OS/2 Presentation Manager Toolkit. |
| color - Returns the color value of the window area, or the |
| passed default if no color for the area has been set. |
| The window area is identified by a system-defined |
| presentation parameter value. |
| style - Returns an unsigned long representing the window's |
| style, as defined by the OS/2 Presentation Manager |
| Toolkit. |
| isPrimaryWindow - Returns true if this window has no owner and the parent |
| is the desktop window. |
| windowUShort - Returns the given window word (as an unsigned short). |
| windowULong - Returns the given window word (as an unsigned long). |
| setWindowData - Sets the given window word (as an unsigned short or |
| unsigned long). The result indicates whether it was |
| successful. |
------------------------------------------------------------------------------*/
IWindow
&addHandler ( IHandler* newHandler ),
&removeHandler ( IHandler* oldHandler );
IWindow
&setColor ( unsigned long colorArea,
const IColor& color );
virtual IWindow
&setStyle ( unsigned long style );
IColor
color ( unsigned long colorArea ) const,
color ( unsigned long colorArea,
const IColor& defaultColor ) const;
unsigned long
style ( ) const;
Boolean
isPrimaryWindow ( ) const;
unsigned short
windowUShort ( long index ) const;
unsigned long
windowULong ( long index ) const;
IWindow
&setWindowData ( long index, unsigned short ushort ),
&setWindowData ( long index, unsigned long ulong );
/*------------------------------- Constructor ----------------------------------
| The only way to construct instances of this class is by using the protected |
| default constructor, which initializes the IWindow data. The presentation |
| window associated with a window is created by an IWindow subclass. |
------------------------------------------------------------------------------*/
IWindow ( );
/*---------------------------------- Layout ------------------------------------
| The following function is used return the layout size: |
| calcMinimumSize - Returns the recommended minimum size for this IWindow |
| object. This size is used by the canvas layout routine. |
| A default operation returns the minimum size set by |
| users. The size is based on the text and the current |
| font setting. |
------------------------------------------------------------------------------*/
virtual ISize
calcMinimumSize ( ) const;
/*---------------------- Event Handling Implementation -------------------------
| These functions provide the implementation of the event handling mechanism: |
| startHandlingEvent - Starts processing events for the window. This is a |
| combination of subclassing the window procedure and |
| storing the window in the current thread's |
| collection of windows. You can only invoke this |
| function once per window, typically during |
| construction of the window. |
| addToWindowSet - Adds a window to the current thread's collection of |
| windows. A valid window handle must be provided. |
| removeFromWindowSet - Removes a window from the current thread's |
| collection of windows. |
| dispatch - Dispatches events to the handlers associated with a |
| window. If the event is not processed by a handler |
| or no handlers exist for the window, |
| defaultProcedure is called to process the event. |
| defaultProcedure - Provides default processing behavior for a window |
| event. This function calls the window procedure |
| that was returned from the window subclass during |
| the call to startHandlingEvent. |
| deleteIsInProcess - Returns true if either the IWindow instance |
| destructor has been called or the presentation |
| window is being destroyed. |
------------------------------------------------------------------------------*/
IWindow
&startHandlingEvent ( const IWindowHandle& windowHandle );
static void
addToWindowSet ( IWindow* window,
const IWindowHandle& windowHandle ),
removeFromWindowSet ( IWindow* window );
Boolean
dispatch ( IEvent& event );
IWindow
&defaultProcedure ( IEvent& event );
Boolean
deleteIsInProcess ( ) const;
private:
/*--------------------------------- Private ----------------------------------*/
/* IWindow Flags */
enum State { autoDeleteObject=1, autoDestroyWindow=2, deleteInProcess=4,
primaryWindow=8, addedToList=16, dispatchInProcess=32,
needsDelete=64 };
IWindow
&setDeleteInProcess ( ),
&cleanUp ( );
// setDefaultProcedure() is used by IFileDialog and IFontDialog
// since they can't use startHandlingEvent().
// These two classes are granted friendship below.
IWinProc
*setDefaultProcedure ( IWinProc *newDefProc );
static void
cleanUpHandler ( IHandler & );
IWindow ( const IWindow& );
IWindow
&operator= ( const IWindow& );
IWinProc
*pClDefWinProc;
unsigned long
wndhCl,
ulClId,
ulClState,
ulClLayoutChange;
IHandlerList*
pcolHandler;
ISize
sizClMin;
static IWindow::ExceptionFn
*pexcClCurrent;
/* friend functions */
friend void* _System _pfnwpICWinProc ( unsigned long hwnd, unsigned long ulMsg, void* mp1, void* mp2 );
friend unsigned long const& key ( IWindow* const& pwin );
/* friend classes */
friend class IHandler;
friend class IFileDialog;
friend class IFontDialog;
}; // IWindow
/*----------------------------- Inline Functions -----------------------------*/
#ifndef I_NO_INLINES
#include <iwindow.inl>
#endif
#endif /* _IWINDOW_ */