description | title | ms.date | f1_keywords | helpviewer_keywords | ms.assetid | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: CMFCBaseVisualManager Class |
CMFCBaseVisualManager Class |
11/04/2016 |
|
|
d56f3afc-cdea-4de1-825a-a08999c571e0 |
A layer between derived visual managers and the Windows Theme API.
CMFCBaseVisualManager
loads UxTheme.dll, if available, and manages access to Windows Theme API methods.
This class is for internal use only.
class CMFCBaseVisualManager: public CObject
Name | Description |
---|---|
CMFCBaseVisualManager::CMFCBaseVisualManager | Constructs and initializes a CMFCBaseVisualManager object. |
CMFCBaseVisualManager::~CMFCBaseVisualManager |
Destructor. |
Name | Description |
---|---|
CMFCBaseVisualManager::DrawCheckBox | Draws a check box control by using the current Windows theme. |
CMFCBaseVisualManager::DrawComboBorder | Draws a combo box border using the current Windows theme. |
CMFCBaseVisualManager::DrawComboDropButton | Draws a combo box drop-down button using the current Windows theme. |
CMFCBaseVisualManager::DrawPushButton | Draws a push button using the current Windows theme. |
CMFCBaseVisualManager::DrawRadioButton | Draws a radio button control by using the current Windows theme. |
CMFCBaseVisualManager::DrawStatusBarProgress | Draws a progress bar on a status bar control ( CMFCStatusBar Class) using the current Windows theme. |
CMFCBaseVisualManager::FillReBarPane | Fills the background of the rebar control by using the current Windows theme. |
CMFCBaseVisualManager::GetStandardWindowsTheme | Gets the current Windows theme. |
Name | Description |
---|---|
CMFCBaseVisualManager::CleanUpThemes | Calls CloseThemeData for all handles obtained in UpdateSystemColors . |
CMFCBaseVisualManager::UpdateSystemColors | Calls OpenThemeData to obtain handles for drawing various controls: windows, toolbars, buttons, and so on. |
You do not have to instantiate objects of this class directly.
Because it is a base class for all visual managers, you can just call CMFCVisualManager::GetInstance, obtain a pointer to the current Visual Manager, and access the methods for CMFCBaseVisualManager
using that pointer. However, if you have to display a control by using the current Windows theme, it is better to use the CMFCVisualManagerWindows
interface.
Header: afxvisualmanager.h
Calls CloseThemeData
for all handles obtained in UpdateSystemColors
.
void CleanUpThemes();
For internal use only.
Constructs and initializes a CMFCBaseVisualManager
object.
CMFCBaseVisualManager();
Draws a check box control by using the current Windows theme.
virtual BOOL DrawCheckBox(
CDC* pDC,
CRect rect,
BOOL bHighlighted,
int nState,
BOOL bEnabled,
BOOL bPressed);
);
pDC
[in] A pointer to a device context
rect
[in] The bounding rectangle of the check box.
bHighlighted
[in] Specifies whether the check box is highlighted.
nState
[in] 0 for unchecked, 1 for checked normal,
2 for mixed normal.
bEnabled
[in] Specifies whether the check box is enabled.
bPressed
[in] Specifies whether the check box is pressed.
TRUE if Theme API is enabled; otherwise FALSE.
The values of nState correspond to the following check box styles.
nState | Check box style |
---|---|
0 | CBS_UNCHECKEDNORMAL |
1 | CBS_CHECKEDNORMAL |
2 | CBS_MIXEDNORMAL |
Draws the combo box border using the current Windows theme.
virtual BOOL DrawComboBorder(
CDC* pDC,
CRect rect,
BOOL bDisabled,
BOOL bIsDropped,
BOOL bIsHighlighted);
pDC
[in] A pointer to a device context.
rect
[in] Bounding rectangle of the combo box border.
bDisabled
[in] Specifies whether the combo box border is disabled.
bIsDropped
[in] Specifies whether the combo box border is dropped down.
bIsHighlighted
[in] Specifies whether the combo box border is highlighted.
TRUE if Theme API is enabled; otherwise FALSE.
Draws a combo box drop-down button using the current Windows theme.
virtual BOOL DrawComboDropButton(
CDC* pDC,
CRect rect,
BOOL bDisabled,
BOOL bIsDropped,
BOOL bIsHighlighted);
pDC
[in] A pointer to a device context.
rect
[in] The bounding rectangle of the combo box drop-down button.
bDisabled
[in] Specifies whether the combo box drop-down button is disabled.
bIsDropped
[in] Specifies whether the combo box drop-down button is dropped down.
bIsHighlighted
[in] Specifies whether the combo box drop-down button is highlighted.
TRUE if Theme API is enabled; otherwise FALSE.
Draws a push button using the current Windows theme.
virtual BOOL DrawPushButton(
CDC* pDC,
CRect rect,
CMFCButton* pButton,
UINT uiState);
pDC
[in] A pointer to a device context.
rect
[in] The bounding rectangle of the push button.
pButton
[in] A pointer to the CMFCButton Class object to draw.
uiState
[in] Ignored. The state is taken from pButton.
TRUE if Theme API is enabled; otherwise FALSE.
Draws a radio button control by using the current Windows theme.
virtual BOOL DrawRadioButton(
CDC* pDC,
CRect rect,
BOOL bHighlighted,
BOOL bChecked,
BOOL bEnabled,
BOOL bPressed);
pDC
[in] A pointer to a device context.
rect
[in] The bounding rectangle of the radio button.
bHighlighted
[in] Specifies whether the radio button is highlighted.
bChecked
[in] Specifies whether the radio button is checked.
bEnabled
[in] Specifies whether the radio button is enabled.
bPressed
[in] Specifies whether the radio button is pressed.
TRUE if Theme API is enabled; otherwise FALSE.
Draws progress bar on status bar control ( CMFCStatusBar Class) using the current Windows theme.
virtual BOOL DrawStatusBarProgress(
CDC* pDC,
CMFCStatusBar* pStatusBar,
CRect rectProgress,
int nProgressTotal,
int nProgressCurr,
COLORREF clrBar,
COLORREF clrProgressBarDest,
COLORREF clrProgressText,
BOOL bProgressText);
pDC
[in] A pointer to a device context.
pStatusBar
[in] A pointer to status bar. This value is ignored.
rectProgress
[in] The bounding rectangle of the progress bar in pDC coordinates.
nProgressTotal
[in] The total progress value.
nProgressCurr
[in] The current progress value.
clrBar
[in] The start color. CMFCBaseVisualManager
ignores this. Derived classes can use it for color gradients.
clrProgressBarDest
[in] The end color. CMFCBaseVisualManager
ignores this. Derived classes can use it for color gradients.
clrProgressText
[in] Progress text color. CMFCBaseVisualManager
ignores this. The text color is defined by afxGlobalData.clrBtnText
.
bProgressText
[in] Specifies whether to display progress text.
TRUE if Theme API is enabled; otherwise FALSE.
Fills the background of the rebar control by using the current Windows theme.
virtual void FillReBarPane(
CDC* pDC,
CBasePane* pBar,
CRect rectClient);
pDC
[in] A pointer to a device context.
pBar
[in] A pointer to a pane whose background should be drawn.
rectClient
[in] The bounding rectangle of the area to be filled.
TRUE if Theme API is enabled; otherwise FALSE.
Gets the current Windows theme.
virtual WinXpTheme GetStandardWindowsTheme();
The currently selected Windows Theme color. Can be one of the following enumerated values:
-
WinXpTheme_None
- there is no theme enabled. -
WinXpTheme_NonStandard
- non standard theme is selected (meaning a theme is selected, but none from the list below). -
WinXpTheme_Blue
- blue theme (Luna). -
WinXpTheme_Olive
- olive theme. -
WinXpTheme_Silver
- silver theme.
Calls OpenThemeData
to obtain handles for drawing various controls: windows, toolbars, buttons, and so on.
void UpdateSystemColors();
For internal use only.