PMWindow

Extends PMNonCopyable as public

Base window class.

The PMWindow class is the base window class and provides behaviour common to all windows. Although this class contains behaviour requiring the existence of a presentation window, you must construct the presentation window itself using a derived class.

You can construct and destruct objects of this class.

Note: Although you can construct objects of this class directly, you do not generally do so.


 * Source: pm_window.h:49
 * Author: Dmitry A.Steklenev
 * Version: 1.1

constructor PMWindow
Wraps the window object around an existing presentation window handle.

The wrapped window object usually have a limited functionality. You can query and set the window attributes, size, position and visibility status.


 * Source: pm_window.h:61

public PMWindow ( HWND handle )
 * Code:

constructor PMWindow
Wraps the window object around an existing child window with the specified identity.

The wrapped window object usually have a limited functionality. You can query and set the window attributes, size, position and visibility status.


 * Source: pm_window.h:75
 * Params:
 * hparent: Specifies the parent-window handle.
 * id : Specifies the identity of the child window.

public PMWindow ( HWND hparent,       	          SHORT id )
 * Code:

constructor PMWindow
Constructs the presentation window.


 * Source: pm_window.h:107


 * Params :
 * id : Specifies the window identifier.
 * text : Specifies the window text.
 * hparent : Specifies the parent-window handle.
 * howner : Specifies the owner-window handle.
 * x,y,cx,cy : Specifies the window rectangle.
 * style : Specifies the window style:


 * WS_CLIPCHILDREN : Prevents a window from painting over its child windows.
 * WS_CLIPSIBLINGS : Prevents a window from painting over its sibling windows.
 * WS_DISABLED : Used by an application to disable a window.
 * WS_GROUP : Specifies the first control of a group of controls.
 * WS_MAXIMIZED : Enlarges a window to the maximum size.
 * WS_MINIMIZED : Reduces a window to the size of an icon.
 * WS_PARENTCLIP : Extends a window's visible region to include that of its parent window.
 * WS_SAVEBITS : Saves the screen area under a window as a bit map.
 * WS_SYNCPAINT : Causes a window to receive WM_PAINT messages immediately after a part of the window becomes invalid.
 * WS_TABSTOP : Specifies one of any number of controls through which the user can move by tabbing.
 * WS_VISIBLE : Makes a window visible.
 * WS_DLGPOINTS : The window rectangle is specified in dialog units.

public PMWindow ( SHORT id,       	      	  const char * text ,        	      	  HWND hparent ,        	      	  HWND howner ,        	      	  LONG x ,        	      	  LONG y ,        	      	  LONG cx ,        	      	  LONG cy ,        	      	  ULONG style )
 * Code:

constructor PMWindow
Constructs the presentation window from the dialog template.


 * Source: pm_window.h:120


 * Params:
 * hparent : Specifies the parent-window handle.
 * howner : Specifies the owner-window handle.
 * res_id :Dialog-template identity within the resource file. It is also used as the identity of the created window.
 * hmodule :Module handle referencing a dynamic link library containing the resource or NULLHANDLE for the application's module.

public PMWindow (	HWND hparent,       	HWND howner ,        	SHORT res_id ,        	HMODULE hmodule )
 * Code:

constructor PMWindow
Constructs the presentation window of the specified class.


 * Source: pm_window.h:138


 * Params:
 * classname: 	Specifies the registered-class name.
 * id: 	Specifies the window identifier.
 * text: 	Specifies the window text.
 * hparent: 	Specifies the parent-window handle.
 * howner: 	Specifies the owner-window handle.
 * x,y,cx,cy: 	Specifies the window shape.
 * style: 	Specifies the window style.
 * classdata: 	Specifies the pointer to control data.

protected PMWindow ( const char * classname,       	SHORT id ,        	const char * text ,        	HWND hparent ,        	HWND howner ,        	LONG x ,        	LONG y ,        	LONG cx ,        	LONG cy ,        	ULONG style ,        	PVOID classdata = NULL )
 * Code:

destructor ~PMWindow
Destructs the window object.

Cleans up as this window object and destroying the associated presentation window for this object if the object was not created from an existing window handle.


 * Source: pm_window.h:149

public virtual ~ PMWindow
 * Code:

method destroy
Destroys the presentation window.

Destroying the associated presentation window for this object.


 * Source: pm_window.h:158

public virtual void destroy
 * Code:

method handle
Returns the presentation window handle.


 * Source: pm_window.h:161

public HWND handle const
 * Code:

method id
Returns the window identifier.


 * Source: pm_window.h:163

public SHORT id const
 * Code:

method id
Sets the window identifier.


 * Source: pm_window.h:165

public virtual void id ( SHORT new_id )
 * Code:

method style
Returns the window style.


 * Source: pm_window.h:167

public virtual ULONG style const
 * Code:

method pid
Returns the process identifier that created the window.


 * Source: pm_window.h:169

public PID pid const
 * Code:

method tid
Returns the thread identifier that created the window.


 * Source: pm_window.h:171

public TID tid const
 * Code:

method parent
Returns the parent window handle.

The parent window provides the coordinate system used for positioning a child window. A window whose parent is the desktop window, is called a top-level or overlapped window.


 * Source: pm_window.h:181

public HWND parent (	) const
 * Code:

method owner
Returns the owner window handle.

Windows that send messages send them to their owner. When an owner window is destroyed, all windows owned by it are also destroyed. The owner window must belong to the current thread.


 * Source: pm_window.h:192

public HWND owner const
 * Code:

method child
Returns the handle of the child window with the specified identity.


 * Source: pm_window.h:203


 * Param:
 * id : Identifier of the child window.


 * Returns: Child-window handle or NULLHANDLE if no child window of the specified identity exists.

public HWND child ( SHORT id ) const
 * Code:

method parent
Sets the parent window.

The parent window provides the coordinate system used for positioning a child window. A window whose parent is the desktop window, is called a top-level or overlapped window.


 * Source: pm_window.h:227
 * Params:
 * hparent : New parent window handle.
 * This cannot be a descendant of this window.
 * If this parameter is a desktop window handle or HWND_DESKTOP, window becomes a main window.
 * If this parameter is not equal to HWND_OBJECT, it must be a descendant of the same desktop window as this window.
 * If this parameter is HWND_OBJECT or a window handle returned by WinQueryObjectWindow, window becomes an object window.


 * redraw : Redraw indicator.

public virtual void parent ( HWND hparent,       	                     BOOL redraw = TRUE )
 * Code:

method owner
Sets the owner window.

Windows that send messages send them to their owner. When an owner window is destroyed, all windows owned by it are also destroyed. The owner window must belong to the current thread.


 * Source: pm_window.h:240


 * Param:
 * howner 	New owner window handle.

public virtual void owner ( HWND howner )
 * Code:

method frame
Return the handle of the first frame window associated with this window.


 * Source: pm_window.h:246

public virtual HWND frame const
 * Code:

method text
Sets the window text.


 * Source: pm_window.h:249

public virtual void text ( const char * text )
 * Code:

method rectangle
Sets the window's position and size.


 * Source: pm_window.h:251

public virtual void rectangle (	const PMRect & rect )
 * Code:

method center_at
Centers the window concerning his owner window.


 * Source: pm_window.h:253

public virtual void center_at (	)
 * Code:

method font
Sets a new font to be used by the window.


 * Source: pm_window.h:255

public virtual void font ( const char * font )
 * Code:

method font
Sets a new system font to be used by the window.


 * Source: pm_window.h:276


 * Param:
 * id : Font identity:

SYSFNT_WINDOWTEXT System font for window text. SYSFNT_WINDOWTITLES System font for window title text. SYSFNT_MENU System font for menu text. SYSFNT_ICONTEXT System font for icon text. SYSFNT_PREFORMATTED System-fixed width font for preformatted text. public virtual void font (int id )
 * Code:

method translate
Translates the window text.

Translates the window text and all the child texts using for this purpose the current instance of the messages management object.


 * Source: pm_window.h:286

public virtual void translate
 * Code:

method text
Returns the window text.


 * Source: pm_window.h:297
 * Params:
 * result 	A buffer in which the window text is returned.
 * size 	This is the size of the buffer specified by the result parameter. If the call is successful, this is overwritten with the number of bytes copied into the buffer.

public virtual char * text ( char * result,       	                     int size ) const
 * Code:

method text_len
Returns the length of the window text. public virtual int text_len (	) const
 * Source: pm_window.h:306
 * Returns: The length of the window text, excluding any null termination character.
 * Code:

method color
Returns the specified color value.


 * Source: pm_window.h:371
 * Param:
 * type : Specify one of window's colors:


 * CCI_FOREGROUND

Foreground color.
 * CCI_FOREGROUNDREADONLY

Read-only text foreground color.
 * CCI_BACKGROUND

Background color.
 * CCI_BACKGROUNDDIALOG

Background color (in dialog).
 * CCI_DISABLEDFOREGROUND

Disabled foreground color.
 * CCI_DISABLEDFOREGROUNDREADONLY

Disabled read-only text foreground color.
 * CCI_DISABLEDBACKGROUND

Disabled background color.
 * CCI_DISABLEDBACKGROUNDDIALOG

Disabled background color (in dialog).
 * CCI_HIGHLIGHTFOREGROUND

Highlight text foreground color.
 * CCI_HIGHLIGHTBACKGROUND

Highlight background color.
 * CCI_HIGHLIGHTBACKGROUNDDIALOG

Highlight background color (in dialog).
 * CCI_INACTIVEFOREGROUND

Inactive foreground color.
 * CCI_INACTIVEFOREGROUNDDIALOG

Inactive foreground color (in dialog).
 * CCI_INACTIVEBACKGROUND

Inactive background color.
 * CCI_INACTIVEBACKGROUNDTEXT

Inactive text background color.
 * CCI_ACTIVEFOREGROUND

Active foreground color.
 * CCI_ACTIVEFOREGROUNDDIALOG

Active foreground color (in dialog).
 * CCI_ACTIVEBACKGROUND

Active background color.
 * CCI_ACTIVEBACKGROUNDTEXT

Active text background color.
 * CCI_PAGEBACKGROUND

Page background color.
 * CCI_PAGEFOREGROUND

Page foreground color.
 * CCI_EDITBACKGROUND

Edit area background color.
 * CCI_EDITFOREGROUND

Edit area foreground color.
 * CCI_FIELDBACKGROUND

Edge (or status line) window color.
 * CCI_BORDER

Thin border color.
 * CCI_BORDERLIGHT

Light border color.
 * CCI_BORDERDARK

Dark border color.
 * CCI_BORDER2

Disabled border, new notebook border or container record emphasis color.
 * CCI_BORDER2LIGHT

Light border 2 color.
 * CCI_BORDER2DARK

Dark border 2 color.
 * CCI_BORDERDEFAULT

Outer button border color.
 * CCI_BUTTONBACKGROUND

Sub-button background color.
 * CCI_BUTTONBORDERLIGHT

Sub-button light border color.
 * CCI_BUTTONBORDERDARK

Sub-button dark border color.
 * CCI_ARROW

Arrow color.
 * CCI_DISABLEDARROW

Disabled arrow color.
 * CCI_ARROWBORDERLIGHT

Arrow light border color.
 * CCI_ARROWBORDERDARK

Arrow dark border color.
 * CCI_CHECKLIGHT

Light check mark color.
 * CCI_CHECKMIDDLE

Middle check mark color.
 * CCI_CHECKDARK

Dark check mark color.
 * CCI_ICONFOREGROUND

Icon text color.
 * CCI_ICONBACKGROUND

Icon text background color.
 * CCI_ICONBACKGROUNDDESKTOP

Icon text background color (in desktop).
 * CCI_ICONHILITEFOREGROUND

Icon text highlight color.
 * CCI_ICONHILITEBACKGROUND

Icon text highlight background color.
 * CCI_MAJORTABFOREGROUND

Major tab text color.
 * CCI_MAJORTABBACKGROUND

Major tab background color.
 * CCI_MINORTABFOREGROUND

Minor tab text color.
 * CCI_MINORTABBACKGROUND

Minor tab background color.


 * Returns: The RGB color value. If you have not set the specified color, the default color value CLR_DEFAULT is returned.

public LONG color ( LONG type ) const
 * Code:

method color
Sets the specified color value.


 * Source: pm_window.h:426


 * Params:
 * type: Specifies one of window's color.


 * color : The RGB color value or one of the SYSCLR_* index values:


 * SYSCLR_SHADOWHILITEBGND

System color for shadow highlighted background.
 * SYSCLR_SHADOWHILITEFGND

System color for shadow highlighted foreground.
 * SYSCLR_SHADOWTEXT

System color for shadow text.
 * SYSCLR_ENTRYFIELD

System color for entry field.
 * SYSCLR_MENUDISABLEDTEXT

System color for disabled menu text.
 * SYSCLR_MENUHILITE

System color for highlighted menu text.
 * SYSCLR_MENUHILITEBGND

System color for highlighted menu background.
 * SYSCLR_PAGEBACKGROUND

System color for page background.
 * SYSCLR_FIELDBACKGROUND

System color for field background.
 * SYSCLR_BUTTONLIGHT

System color for light button.
 * SYSCLR_BUTTONMIDDLE

System color for middle button.
 * SYSCLR_BUTTONDARK

System color for dark button.
 * SYSCLR_BUTTONDEFAULT

System color for default button.
 * SYSCLR_TITLEBOTTOM

System color for title bottom.
 * SYSCLR_SHADOW

System color for shadow.
 * SYSCLR_ICONTEXT

System color for icon text.
 * SYSCLR_DIALOGBACKGROUND

System color for dialog background.
 * SYSCLR_HILITEFOREGROUND

System color for highlighted foreground.
 * SYSCLR_HILITEBACKGROUND

System color for highlighted background.
 * SYSCLR_TITLETEXT

System color for title text.
 * SYSCLR_INACTIVETITLETEXTBGND

System color for inactive title text background.
 * SYSCLR_ACTIVETITLETEXTBGND

System color for active title text background.
 * SYSCLR_INACTIVETITLETEXT

System color for inactive title text.
 * SYSCLR_ACTIVETITLETEXT

System color for active title text.
 * SYSCLR_OUTPUTTEXT

System color for output text.
 * SYSCLR_WINDOWSTATICTEXT

System color for static window text.
 * SYSCLR_SCROLLBAR

System color for scroll bar.
 * SYSCLR_BACKGROUND

System color for background.
 * SYSCLR_ACTIVETITLE

System color for active title.
 * SYSCLR_INACTIVETITLE

System color for inactive title.
 * SYSCLR_MENU

System color for a menu.
 * SYSCLR_MENUTEXT

System color for menu text.
 * SYSCLR_WINDOW

System color for a window.
 * SYSCLR_WINDOWTEXT

System color for window text.
 * SYSCLR_WINDOWFRAME

System color for a window frame.
 * SYSCLR_ACTIVEBORDER

System color for active border.
 * SYSCLR_INACTIVEBORDER

System color for inactive border.
 * SYSCLR_APPWORKSPACE

System color for application work space.
 * SYSCLR_HELPBACKGROUND

System color for help background.
 * SYSCLR_HELPTEXT

System color for help text.
 * SYSCLR_HELPHILITE

System color for help highlighting..


 * See Also: PMWindow::color

public void color ( LONG type,       	            LONG color )
 * Code:

method rectangle
Returns the window rectangle.


 * Source: pm_window.h:429

public virtual PMRect rectangle const
 * Code:

static method rectangle
Returns the window rectangle.


 * Source: pm_window.h:431

public static PMRect rectangle ( HWND hwnd )
 * Code:

method show
Makes the window visible.


 * Source: pm_window.h:433

public virtual void show ( BOOL state = TRUE )
 * Code:

method hide
Makes the window invisible.


 * Source: pm_window.h:435

public virtual void hide
 * Code:

method is_visible
Is the window visible.

If the window's style is set to visible, TRUE is returned. Otherwise, FALSE is returned. A window can have the style visible and yet not be showing if it is covered by another window.


 * Source: pm_window.h:445

public virtual BOOL is_visible (	)
 * Code:

method enable
Enables the window to accept keyboard and mouse input.


 * Source: pm_window.h:448

public virtual void enable ( BOOL state = TRUE )
 * Code:

method disable
Prevents keyboard and mouse input from being sent to the window.


 * Source: pm_window.h:450

public virtual void disable (	)
 * Code:

method is_enabled
Is the window enabled.


 * Source: pm_window.h:452

public virtual BOOL is_enabled const
 * Code:

enum drop_type
Use these enumerators to specify various object types that can be dropped to window.


 * Source: pm_window.h:460

public enum drop_type {	drop_none = 0x0000 , drop_os2file = 0x0001 }
 * Code:

method enable_drop
Enables the window to accept dropped objects.


 * Source: pm_window.h:463

public virtual void enable_drop (	LONG type )
 * Code:

method is_valid
Is the window valid.

If this object represents a valid window in the window system, TRUE is returned. If the window has yet to be created or has already been destroyed, FALSE is returned.


 * Source: pm_window.h:473

public virtual BOOL is_valid (	) const
 * Code:

method set_focus
Sets the input focus to the window.


 * Source: pm_window.h:476

public virtual void set_focus (	)
 * Code:

method has_focus
Has focus.

If the window has the input focus, TRUE is returned. Otherwise, FALSE is returned.


 * Source: pm_window.h:485

public virtual BOOL has_focus (	) const
 * Code:

method invalidate
This method adds a rectangle to a window's update region.

The update region is a subregion of a window that is deemed "invalid" or incorrect in visual terms and is in need of redrawing.


 * Source: pm_window.h:495

public virtual void invalidate ( const PMRect & rect,       	BOOL include_children = TRUE )
 * Code:

method invalidate
This method adds the whole window to a window's update region.

The update region is a subregion of a window that is deemed "invalid" or incorrect in visual terms and is in need of redrawing.


 * Source: pm_window.h:505

public virtual void invalidate ( BOOL include_children = TRUE )
 * Code:

method validate
This method subtracts a rectangle from a window's update region.

The update region is a subregion of a window that is deemed "invalid" or incorrect in visual terms and is in need of redrawing.


 * Source: pm_window.h:515

public virtual void validate (	const PMRect & rect,       	BOOL include_children = TRUE )
 * Code:

method validate
This method subtracts the whole window from a window's update region.

The update region is a subregion of a window that is deemed "invalid" or incorrect in visual terms and is in need of redrawing.


 * Source: pm_window.h:525

public virtual void validate (	BOOL include_children = TRUE )
 * Code:

method capture_pointer
Captures mouse pointer.

If capture is true, pointer events are sent only to this window even if the pointer is outside of this window. If capture is false, the window releases the pointer capture. If you attempt to capture the pointer when another window currently is capturing the pointer, an exception is thrown.


 * Source: pm_window.h:537

public virtual void capture_pointer (	BOOL capture = TRUE )
 * Code:

method release_pointer
Release mouse pointer.

Causes the window to release the pointer capture (pointer capture is set with the function capture_pointer).

This function causes mouse events to again be dispatched to the window underneath the mouse pointer.


 * Source: pm_window.h:549

public virtual void release_pointer
 * Code:

method has_pointer_captured
Has pointer captured.

If this window is currently capturing pointer events, true is returned. Otherwise, false is returned.


 * Source: pm_window.h:558

public virtual BOOL has_pointer_captured const
 * Code:

method pointer
Sets the appearance used by the mouse pointer when it is over the window.


 * Source: pm_window.h:589


 * Param:
 * id : System-pointer identifier.

SPTR_DEFAULT Default pointer, that is chosen by Presentation Manager. SPTR_ARROW Arrow pointer SPTR_TEXT Text I-beam pointer SPTR_WAIT Hourglass pointer SPTR_SIZE Size pointer SPTR_MOVE Move pointer SPTR_SIZENWSE Downward-sloping, double-headed arrow pointer SPTR_SIZENESW Upward-sloping, double-headed arrow pointer SPTR_SIZEWE Horizontal, double-headed arrow pointer SPTR_SIZENS Vertical, double-headed arrow pointer SPTR_APPICON Standard application icon pointer SPTR_ICONINFORMATION Information icon pointer SPTR_ICONQUESTION Question mark icon pointer SPTR_ICONERROR Exclamation mark icon pointer SPTR_ICONWARNING Warning icon pointer SPTR_ILLEGAL Illegal operation icon pointer SPTR_FILE Single file icon pointer SPTR_MULTFILE Multiple files icon pointer SPTR_FOLDER Folder icon pointer SPTR_PROGRAM Application program icon pointer

public virtual void pointer (	LONG id )
 * Code:

method pointer
Returns the mouse pointer used when the mouse is over the window.


 * Source: pm_window.h:592

public virtual LONG pointer (	) const
 * Code:

method attach_accelerators
Replaces the accelerator keys used by the window.


 * Source: pm_window.h:603


 * Params:
 * res_id : Accelerator-table identifier, within the resource file.
 * hmodule : Module handle referencing a dynamic link library containing the resource or NULLHANDLE for the application's module.

public virtual void attach_accelerators ( SHORT res_id,       	                                  HMODULE hmodule )
 * Code:

method detach_accelerators
Detaches the accelerator keys used by the window.


 * Source: pm_window.h:609

public virtual void detach_accelerators
 * Code:

method send
Sends a message to window.

This method sends a message with identity msg to window, passing mp1 and mp2 as the parameters to the window.


 * Source: pm_window.h:619

public MRESULT send ( ULONG msg,       	MPARAM mp1 ,        	MPARAM mp2 )
 * Code:

method post
Posts a message to window.

This method posts a message to the message queue associated with the window.


 * Source: pm_window.h:630


 * Returns: Success indicator.

public BOOL post ( ULONG msg,       	MPARAM mp1 ,        	MPARAM mp2 )
 * Code:

method start_timer
This method starts a timer.

This method creates a timer identified by id, set to time out every timeout milliseconds. When a timer times out, a WM_TIMER message is posted.

A timeout value of zero causes the timer to timeout as fast as possible; generally, this is about 1/18 second.

A second call of this method, for a timer that already exists, resets that timer.


 * Source: pm_window.h:646

public virtual void start_timer ( ULONG id,       	                          ULONG timeout )
 * Code:

method stop_timer
This method stops a timer.

When this method is called, no further messages are received from the stopped timer, even if it has timed out.


 * Source: pm_window.h:655

public virtual void stop_timer ( ULONG id )
 * Code:

method auto_delete_object
Determines whether to delete the window object when the presentation window is destroyed.

The deletion occurs when the window system dispatches a destroy event to the window.


 * Source: pm_window.h:665

public virtual void auto_delete_object ( BOOL state = TRUE )
 * Code:

method is_auto_delete_object
If the window object is deleted when a destroy event is dispatched to the window, TRUE is returned.


 * Source: pm_window.h:672

public virtual BOOL is_auto_delete_object
 * Code:

method handle_events
Handle events.

Attaches the handler to the PMWindow object. The windows's dispatch function is called to process all events sent or posted to the window.


 * Source: pm_window.h:684

protected void handle_events (	)
 * Code:

method stop_handling_events
Stop handling events.

Detaches the handler from the PMWindow object. The window's dispatch function is no longer called to process events sent or posted to the window.


 * Source: pm_window.h:694


 * Code: protected void stop_handling_events (	)

method dispatch
Dispatch system native events.

PMWindow calls this function when a system native window event occurs.


 * Source: pm_window.h:703

protected virtual MRESULT dispatch (	ULONG msg,       	MPARAM mp1 ,        	MPARAM mp2 )
 * Code:

method dispatch_everything
Dispatch all not caught events.

A virtual method that provides default implementation for all events that occur on every window.


 * Source: pm_window.h:712

protected virtual MRESULT dispatch_everything (	ULONG msg,       	MPARAM mp1 ,        	MPARAM mp2 )
 * Code: