TreePropSheet::CPropPageFrameDefault Class Reference

#include <PropPageFrameDefault.h>

Inheritance diagram for TreePropSheet::CPropPageFrameDefault:

TreePropSheet::CPropPageFrame List of all members.

Public Member Functions

 CPropPageFrameDefault ()
virtual ~CPropPageFrameDefault ()
virtual BOOL Create (DWORD dwWindowStyle, const RECT &rect, CWnd *pwndParent, UINT nID)
virtual CWnd * GetWnd ()
virtual void SetCaption (LPCTSTR lpszCaption, HICON hIcon=NULL)

Protected Member Functions

virtual CRect CalcMsgArea ()
virtual CRect CalcCaptionArea ()
virtual void DrawCaption (CDC *pDc, CRect rect, LPCTSTR lpszCaption, HICON hIcon)
void FillGradientRectH (CDC *pDc, const RECT &rect, COLORREF clrLeft, COLORREF clrRight)
BOOL ThemeSupport () const
afx_msg void OnPaint ()
afx_msg BOOL OnEraseBkgnd (CDC *pDC)

Protected Attributes

CImageList m_Images

Detailed Description

An implementation of CPropPageFrame, that works well for Windows XP styled systems and older windows versions (without themes).

Author:
Sven Wiegand

Definition at line 42 of file PropPageFrameDefault.h.


Member Function Documentation

CRect TreePropSheet::CPropPageFrameDefault::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 from TreePropSheet::CPropPageFrame.

Definition at line 258 of file PropPageFrameDefault.cpp.

References TreePropSheet::CThemeLib::CloseThemeData, TreePropSheet::CPropPageFrame::GetCaptionHeight(), TreePropSheet::CPropPageFrame::GetShowCaption(), TreePropSheet::CThemeLib::GetThemeBackgroundContentRect, TreePropSheet::CThemeLib::IsAvailable(), TreePropSheet::CThemeLib::IsThemeActive(), and TreePropSheet::CThemeLib::OpenThemeData().

CRect TreePropSheet::CPropPageFrameDefault::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 from TreePropSheet::CPropPageFrame.

Definition at line 231 of file PropPageFrameDefault.cpp.

References TreePropSheet::CThemeLib::CloseThemeData, TreePropSheet::CPropPageFrame::GetCaptionHeight(), TreePropSheet::CPropPageFrame::GetShowCaption(), TreePropSheet::CThemeLib::GetThemeBackgroundContentRect, TreePropSheet::CThemeLib::IsAvailable(), TreePropSheet::CThemeLib::IsThemeActive(), and TreePropSheet::CThemeLib::OpenThemeData().

BOOL TreePropSheet::CPropPageFrameDefault::Create DWORD  dwWindowStyle,
const RECT &  rect,
CWnd *  pwndParent,
UINT  nID
[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.

Implements TreePropSheet::CPropPageFrame.

Definition at line 190 of file PropPageFrameDefault.cpp.

void TreePropSheet::CPropPageFrameDefault::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 from TreePropSheet::CPropPageFrame.

Definition at line 292 of file PropPageFrameDefault.cpp.

References FillGradientRectH(), and m_Images.

void TreePropSheet::CPropPageFrameDefault::FillGradientRectH CDC *  pDc,
const RECT &  rect,
COLORREF  clrLeft,
COLORREF  clrRight
[protected]
 

Fills a rectangular area with a gradient color starting at the left side with the color clrLeft and ending at the right sight with the color clrRight.

Parameters:
pDc Device context to draw the rectangle in.
rect Rectangular area to fill.
clrLeft Color on the left side.
clrRight Color on the right side.

Definition at line 336 of file PropPageFrameDefault.cpp.

Referenced by DrawCaption().

CWnd * TreePropSheet::CPropPageFrameDefault::GetWnd  )  [virtual]
 

Returns a pointer to the window object, that represents the frame.

Implements TreePropSheet::CPropPageFrame.

Definition at line 198 of file PropPageFrameDefault.cpp.

void TreePropSheet::CPropPageFrameDefault::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 from TreePropSheet::CPropPageFrame.

Definition at line 203 of file PropPageFrameDefault.cpp.

References m_Images, and TreePropSheet::CPropPageFrame::SetCaption().

BOOL TreePropSheet::CPropPageFrameDefault::ThemeSupport  )  const [protected]
 

Returns TRUE if Windows XP theme support is available, FALSE otherwise.


Member Data Documentation

CImageList TreePropSheet::CPropPageFrameDefault::m_Images [protected]
 

Image list that contains only the current icon or nothing if there is no icon.

Definition at line 107 of file PropPageFrameDefault.h.

Referenced by DrawCaption(), SetCaption(), and ~CPropPageFrameDefault().


The documentation for this class was generated from the following files:
Generated on Tue Dec 13 14:49:46 2005 for guliverkli by  doxygen 1.4.5