- Main Page
- Namespaces
- Classes
- Files
- Directories

- Class List
- Class Hierarchy
- Class Members

# TreePropSheet::CPropPageFrame Class Reference

`#include <PropPageFrame.h>`

Inheritance diagram for TreePropSheet::CPropPageFrame:

List of all members.

## Public Member Functions
| CPropPageFrame ()
virtual | ~CPropPageFrame ()
virtual BOOL | Create (DWORD dwWindowStyle, const RECT &rect, CWnd *pwndParent, UINT nID)=0
virtual CWnd * | GetWnd ()=0
virtual void | ShowCaption (BOOL bEnable)
BOOL | GetShowCaption () const
virtual void | SetCaptionHeight (int nCaptionHeight)
int | GetCaptionHeight () const
virtual void | SetCaption (LPCTSTR lpszCaption, HICON hIcon=NULL)
CString | GetCaption (HICON *pIcon=NULL) const
virtual void | SetMsgText (LPCTSTR lpszMsg)
CString | GetMsgText () const
virtual void | SetMsgFormat (DWORD dwFormat)
DWORD | GetMsgFormat () const
## Protected Member Functions
virtual void | Draw (CDC *pDc)
virtual CRect | CalcMsgArea ()
virtual void | DrawMsg (CDC *pDc, CRect rect, LPCTSTR lpszMsg, DWORD dwFormat)
virtual CRect | CalcCaptionArea ()
virtual void | DrawCaption (CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon)
void | SafeUpdateWindow (LPCRECT lpRect=NULL)

## Detailed Description

An object of an CPropertyPageFrame-derived class is used by CTreePropSheet to display a frame for the property pages.

Derived classes have to implement at least the Create() and the GetWnd() method, which returns a pointer to the CWnd-obect of the window, that has been created by the call to the Create() method. An implementation can provide the CWnd-object by using it as a property or by deriving from CWnd or a more specialiced class. This way has been choosen instead of deriving CPropPageFrame from CWnd, to allow derived class to derive from more specialized classes than CWnd (i.e. CStatic, etc.). From the WM_PAINT-handler of your derived class you have to call the Draw()-method.

Most implementations will also implement the DrawCaption() and DrawMsg() methods, to provide custom drawing functionality.

Author:
  Sven Wiegand

Definition at line 53 of file PropPageFrame.h.

## Member Function Documentation

CRect TreePropSheet::CPropPageFrame::CalcCaptionArea | ( |  | ) | `[protected, virtual]`

| Calculates the caption area. The caption area is the rectangular range, the current page's caption should be drawn in. The caption can be enabled or disabled using the ShowCaption() method. This method should return an empty rect, if the caption is disabled. If the caption is enabled the height of the rect should be as large, as specified by the latest call to the SetCaptionHeight() method. The rectangle, returned by this method will be passed to the DrawCaption() method to draw the caption. If the caption is enabled currently, this default implementation returns a rectangle, that has the width of the client area and the height, specified by the latest call to SetCaptionHeight(), starting and y-position 0. If the caption is disabled at the moment, this method returns an empty rectangle with the width of the client area. Reimplemented in TreePropSheet::CPropPageFrameDefault. Definition at line 161 of file PropPageFrame.cpp. References GetCaptionHeight(), GetShowCaption(), and GetWnd(). Referenced by Draw(), SetCaption(), SetCaptionHeight(), and ShowCaption().

CRect TreePropSheet::CPropPageFrame::CalcMsgArea | ( |  | ) | `[protected, virtual]`

| Calculates the area, the message, set by SetMsgText() should be displayed in. The returned rectangle (client coordinates) will be passed to DrawMsg(). This default implementation calls the CalcCaptionArea() method, substracts the returned rectangle from the client area and returns the result. Reimplemented in TreePropSheet::CPropPageFrameDefault. Definition at line 136 of file PropPageFrame.cpp. References GetCaptionHeight(), GetShowCaption(), and GetWnd(). Referenced by Draw(), SetMsgFormat(), and SetMsgText().

virtual BOOL TreePropSheet::CPropPageFrame::Create | ( | DWORD | dwWindowStyle,
|  | const RECT & | rect,
|  | CWnd * | pwndParent,
|  | UINT | nID
| ) | `[pure virtual]`

  | Has to create a window with the specified properties. Parameters:
  | dwWindowStyle | Standard window styles, to apply to the window to create.
  | rect | Position and size of the window to create.
  | pwndParent | Parent window. (Never be NULL).
  | nID | Window id.
Returns: TRUE on success, FALSE otherwise. Implemented in TreePropSheet::CPropPageFrameDefault.

void TreePropSheet::CPropPageFrame::Draw | ( | CDC * | pDc | ) | `[protected, virtual]`

  | Draws the whole frame including caption (if enabled) and message. This method calculates the rectangles for the message area and the caption area using the CalcMsgArea() and the CalcCaptionArea() methods, draws then the caption calling the DrawCaption() method (only if caption is enabled) and afterwards the message calling the DrawMsg() method. You should call this method from the WM_PAINT-handler of your derived class. Parameters:
  | pDc | Device context to draw in.
Definition at line 128 of file PropPageFrame.cpp. References CalcCaptionArea(), CalcMsgArea(), DrawCaption(), DrawMsg(), and GetShowCaption(). Referenced by TreePropSheet::CPropPageFrameDefault::OnPaint().

void TreePropSheet::CPropPageFrame::DrawCaption | ( | CDC * | pDc,
|  | CRect | rect,
|  | LPCTSTR | lpszCaption,
|  | HICON | hIcon
| ) | `[protected, virtual]`

  | Draws the caption. This default implementation draws nothing. Parameters:
  | pDc | Device context to draw in.
  | rect | Rectangle to draw the caption in.
  | lpszCaption | Text to display in the caption.
  | hIcon | Icon to display in the caption.
Reimplemented in TreePropSheet::CPropPageFrameDefault. Definition at line 176 of file PropPageFrame.cpp. Referenced by Draw().

void TreePropSheet::CPropPageFrame::DrawMsg | ( | CDC * | pDc,
|  | CRect | rect,
|  | LPCTSTR | lpszMsg,
|  | DWORD | dwFormat
| ) | `[protected, virtual]`

  | Draws the message with the specified format. This default implementation draws the given msg using the specified properties. Parameters:
  | pDc | Device context to draw in.
  | rect | Rectangle to draw the message in.
  | lpszMsg | Message to draw.
  | dwFormat. | Combination of the DT_* flags, specified by the Win32 function DrawText() to draw the message with.
Definition at line 149 of file PropPageFrame.cpp. References GetMsgFormat(), and GetMsgText(). Referenced by Draw().

CString TreePropSheet::CPropPageFrame::GetCaption | ( | HICON * | pIcon = `NULL` | ) | const

  | Returns the caption, that has been set most recently using the SetCaption() method. Parameters:
  | pIcon | Pointer to a HICON variable, that should receive the handle of the currently set icon or NULL, if there is no icon or a NULL pointer, if the caller is not interested in the icon.
Returns: The text that has been set most recently using the SetCaption() method. Definition at line 78 of file PropPageFrame.cpp.

int TreePropSheet::CPropPageFrame::GetCaptionHeight | ( |  | ) | const

| Returns the caption height, that has been most recently set by a call to the SetCaptionHeight() method. Definition at line 93 of file PropPageFrame.cpp. Referenced by TreePropSheet::CPropPageFrameDefault::CalcCaptionArea(), CalcCaptionArea(), TreePropSheet::CPropPageFrameDefault::CalcMsgArea(), and CalcMsgArea().

DWORD TreePropSheet::CPropPageFrame::GetMsgFormat | ( |  | ) | const

| Returns the format to draw the text with, set by SetMsgText(). See also: SetMsgFormat() Definition at line 119 of file PropPageFrame.cpp. Referenced by DrawMsg(), and TreePropSheet::CTreePropSheet::SetEmptyPageTextFormat().

CString TreePropSheet::CPropPageFrame::GetMsgText | ( |  | ) | const

| Returns the text currently displayed. Definition at line 106 of file PropPageFrame.cpp. Referenced by DrawMsg().

BOOL TreePropSheet::CPropPageFrame::GetShowCaption | ( |  | ) | const

| Returns TRUE if captions are enabled, FALSE otherwise. Definition at line 64 of file PropPageFrame.cpp. Referenced by TreePropSheet::CPropPageFrameDefault::CalcCaptionArea(), CalcCaptionArea(), TreePropSheet::CPropPageFrameDefault::CalcMsgArea(), CalcMsgArea(), Draw(), and TreePropSheet::CTreePropSheet::UpdateCaption().

virtual CWnd* TreePropSheet::CPropPageFrame::GetWnd | ( |  | ) | `[pure virtual]`

| Returns a pointer to the window object, that represents the frame. Implemented in TreePropSheet::CPropPageFrameDefault. Referenced by CalcCaptionArea(), CalcMsgArea(), and SafeUpdateWindow().

void TreePropSheet::CPropPageFrame::SafeUpdateWindow | ( | LPCRECT | lpRect = `NULL` | ) | `[protected]`

  | If the m_hWnd property of the CWnd-object returend by GetWnd() specifies a valid window, this method will invalidate the specified rectangle, to schedule it for repaint, otherwise the method will return without doing anything. Parameters:
  | lpRect | Pointer to the rectangular area, that should be marked for repainting or NULL, if the whole client area should be marked for repainting.
Definition at line 185 of file PropPageFrame.cpp. References GetWnd(). Referenced by SetCaption(), SetCaptionHeight(), SetMsgFormat(), SetMsgText(), and ShowCaption().

void TreePropSheet::CPropPageFrame::SetCaption | ( | LPCTSTR | lpszCaption,
|  | HICON | hIcon = `NULL`
| ) | `[virtual]`

  | Sets caption text an icon. This default implementation calls the SafeUpdateWindow() method with the caption rectangle, to force it to be redrawn. Parameters:
  | lpszCaption | Text to display for the caption.
  | hIcon | Icon to display for the caption.
Reimplemented in TreePropSheet::CPropPageFrameDefault. Definition at line 70 of file PropPageFrame.cpp. References CalcCaptionArea(), and SafeUpdateWindow(). Referenced by TreePropSheet::CPropPageFrameDefault::SetCaption(), and TreePropSheet::CTreePropSheet::UpdateCaption().

void TreePropSheet::CPropPageFrame::SetCaptionHeight | ( | int | nCaptionHeight | ) | `[virtual]`

| Sets the height of the caption in pixels. This value is ignored until the caption is enabled by ShowCaption(TRUE). This default implementation calls the SafeUpdateWindow() method with the caption rectangle, to force it to be redrawn. Definition at line 86 of file PropPageFrame.cpp. References CalcCaptionArea(), and SafeUpdateWindow().

void TreePropSheet::CPropPageFrame::SetMsgFormat | ( | DWORD | dwFormat | ) | `[virtual]`

  | Specifies the format to draw the text with, set by SetMsgText(). This default implementation calls the SafeUpdateWindow() method with the message rectangle, to force it to be redrawn. Parameters:
  | dwFormat | Combination of the DT_* flags, specified by the Win32 function DrawText().
Definition at line 112 of file PropPageFrame.cpp. References CalcMsgArea(), and SafeUpdateWindow(). Referenced by TreePropSheet::CTreePropSheet::SetEmptyPageTextFormat().

void TreePropSheet::CPropPageFrame::SetMsgText | ( | LPCTSTR | lpszMsg | ) | `[virtual]`

| Sets the text to display. This default implementation calls the SafeUpdateWindow() method with the message rectangle, to force it to be redrawn. Definition at line 99 of file PropPageFrame.cpp. References CalcMsgArea(), and SafeUpdateWindow(). Referenced by TreePropSheet::CTreePropSheet::UpdateCaption().

void TreePropSheet::CPropPageFrame::ShowCaption | ( | BOOL | bEnable | ) | `[virtual]`

| Enables or disables page caption. This default implementation calls the SafeUpdateWindow() method with the caption rectangle, to force it to be redrawn. Definition at line 57 of file PropPageFrame.cpp. References CalcCaptionArea(), and SafeUpdateWindow().

The documentation for this class was generated from the following files:

- C:/guliverkli/src/ui/TreePropSheet/PropPageFrame.h
- C:/guliverkli/src/ui/TreePropSheet/PropPageFrame.cpp