📄 bcgpvisualmanager.h
字号:
// BCGPVisualManager.h: interface for the CBCGPPVisualManager class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_BCGPVISUALMANAGER_H__8070C021_60CE_11D5_A304_8B7130518C10__INCLUDED_)
#define AFX_BCGPVISUALMANAGER_H__8070C021_60CE_11D5_A304_8B7130518C10__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "BCGCBPro.h"
class CBCGPBaseControlBar;
class CBCGPPopupMenu;
class CBCGPBaseToolBar;
class CBCGPToolBar;
class CBCGPToolbarButton;
class CBCGPToolbarMenuButton;
class CBCGPCaptionButton;
class CBCGPCaptionMenuButton;
class CBCGPBaseTabWnd;
class CBCGPToolbarComboBoxButton;
class CBCGPStatusBar;
class CBCGPButton;
class CBCGPMiniFrameWnd;
class CBCGPCaptionBar;
class CBCGPHeaderCtrl;
class CBCGPToolbarEditBoxButton;
class CBCGPDockingControlBar;
class CBCGPTask;
class CBCGPTasksGroup;
class CBCGPSlider;
class CBCGPCalendarBar;
class CBCGPCalendarButton;
class CBCGPSplitterWnd;
class CBCGPAutoHideButton;
#define SPIN_PRESSEDUP 0x1
#define SPIN_PRESSEDDOWN 0x2
#define SPIN_HIGHLIGHTED 0x4
#define SPIN_DISABLED 0x8
#ifndef _UXTHEME_H_
// From uxtheme.h:
typedef HANDLE HTHEME; // handle to a section of theme data for class
#endif // THEMEAPI
typedef HTHEME (__stdcall * OPENTHEMEDATA)(HWND hwnd, LPCWSTR pszClassList);
typedef HRESULT (__stdcall * CLOSETHEMEDATA)(HTHEME hTheme);
typedef HRESULT (__stdcall * DRAWTHEMEBACKGROUND)(HTHEME hTheme, HDC hdc,
int iPartId, int iStateId, const RECT *pRect,
OPTIONAL const RECT *pClipRect);
typedef HRESULT (__stdcall * GETTHEMECOLOR)(HTHEME hTheme, int iPartId,
int iStateId, int iPropId, OUT COLORREF *pColor);
typedef COLORREF (__stdcall * GETTHEMESYSCOLOR)(HTHEME hTheme, int iColorId);
typedef HRESULT (__stdcall * GETCURRENTTHEMENAME)(
OUT LPWSTR pszThemeFileName, int cchMaxNameChars,
OUT OPTIONAL LPWSTR pszColorBuff, int cchMaxColorChars,
OUT OPTIONAL LPWSTR pszSizeBuff, int cchMaxSizeChars);
typedef HTHEME (__stdcall * GETWINDOWTHEME)(HWND hWnd);
class BCGCBPRODLLEXPORT CBCGPWinXPThemeManager
{
public:
CBCGPWinXPThemeManager ();
virtual ~CBCGPWinXPThemeManager ();
virtual BOOL DrawPushButton (CDC* pDC, CRect rect, CBCGPButton* pButton, UINT uiState);
virtual BOOL DrawStatusBarProgress (CDC* pDC, CBCGPStatusBar* pStatusBar,
CRect rectProgress, int nProgressTotal, int nProgressCurr,
COLORREF clrBar, COLORREF clrProgressBarDest, COLORREF clrProgressText,
BOOL bProgressText);
protected:
void UpdateSystemColors ();
void CleanUpThemes ();
HTHEME m_hThemeToolBar;
HTHEME m_hThemeRebar;
HTHEME m_hThemeButton;
HTHEME m_hThemeStatusBar;
HTHEME m_hThemeWindow;
HTHEME m_hThemeComboBox;
HTHEME m_hThemeProgress;
HTHEME m_hThemeHeader;
HTHEME m_hThemeScrollBar;
HTHEME m_hThemeExplorerBar;
HTHEME m_hThemeTree;
HTHEME m_hThemeStartPanel;
HTHEME m_hThemeTaskBand;
HTHEME m_hThemeTaskBar;
HINSTANCE m_hinstUXDLL;
OPENTHEMEDATA m_pfOpenThemeData;
CLOSETHEMEDATA m_pfCloseThemeData;
DRAWTHEMEBACKGROUND m_pfDrawThemeBackground;
GETTHEMECOLOR m_pfGetThemeColor;
GETTHEMESYSCOLOR m_pfGetThemeSysColor;
GETCURRENTTHEMENAME m_pfGetCurrentThemeName;
GETWINDOWTHEME m_pfGetWindowTheme;
};
class BCGCBPRODLLEXPORT CBCGPVisualManager : public CObject
{
friend class CBCGPSkinManager;
DECLARE_DYNCREATE (CBCGPVisualManager)
public:
CBCGPVisualManager(BOOL bTemporary = FALSE);
virtual ~CBCGPVisualManager();
static void SetDefaultManager (CRuntimeClass* pRTI);
// Operations:
public:
static void RedrawAll ();
// Overrides:
public:
virtual void OnUpdateSystemColors () {};
virtual void OnFillBarBackground (CDC* pDC, CBCGPBaseControlBar* pBar,
CRect rectClient, CRect rectClip,
BOOL bNCArea = FALSE);
virtual void OnDrawBarBorder (CDC* pDC, CBCGPBaseControlBar* pBar, CRect& rect);
virtual void OnDrawMenuBorder (CDC* pDC, CBCGPPopupMenu* pMenu, CRect rect);
virtual void OnDrawMenuShadow (CDC* pDC, const CRect& rectClient, const CRect& rectExclude,
int nDepth, int iMinBrightness, int iMaxBrightness,
CBitmap* pBmpSaveBottom, CBitmap* pBmpSaveRight);
virtual void OnDrawBarGripper (CDC* pDC, CRect rectGripper, BOOL bHorz, CBCGPBaseControlBar* pBar);
virtual void OnDrawSeparator (CDC* pDC, CBCGPBaseControlBar* pBar, CRect rect, BOOL bIsHoriz);
virtual COLORREF OnDrawControlBarCaption (CDC* pDC, CBCGPDockingControlBar* pBar,
BOOL bActive, CRect rectCaption, CRect rectButtons);
virtual void OnDrawCaptionButton (CDC* pDC, CBCGPCaptionButton* pButton, BOOL bActive, BOOL bHorz,
BOOL bMaximized, BOOL bDisabled, int nImageID = -1);
virtual void OnDrawMenuSystemButton (CDC* pDC, CRect rect, UINT uiSystemCommand,
UINT nStyle, BOOL bHighlight);
virtual void OnDrawStatusBarPaneBorder (CDC* pDC, CBCGPStatusBar* pBar,
CRect rectPane, UINT uiID, UINT nStyle);
virtual void OnDrawStatusBarProgress (CDC* pDC, CBCGPStatusBar* /*pStatusBar*/,
CRect rectProgress, int nProgressTotal,
int nProgressCurr,
COLORREF clrBar,
COLORREF clrProgressBarDest,
COLORREF clrProgressText,
BOOL bProgressText);
virtual void OnDrawStatusBarSizeBox (CDC* pDC, CBCGPStatusBar* pStatBar,
CRect rectSizeBox);
virtual void OnDrawComboDropButton (CDC* pDC, CRect rect,
BOOL bDisabled,
BOOL bIsDropped,
BOOL bIsHighlighted,
CBCGPToolbarComboBoxButton* pButton);
virtual void OnDrawComboBorder (CDC* pDC, CRect rect,
BOOL bDisabled,
BOOL bIsDropped,
BOOL bIsHighlighted,
CBCGPToolbarComboBoxButton* pButton);
virtual void OnDrawEditBorder (CDC* pDC, CRect rect,
BOOL bDisabled,
BOOL bIsHighlighted,
CBCGPToolbarEditBoxButton* pButton);
virtual void OnDrawTearOffCaption (CDC* pDC, CRect rect, BOOL bIsActive);
virtual void OnDrawSpinButtons(CDC* pDC, const CRect& rectSpin, int bState, BOOL bOrientation);
enum BCGBUTTON_STATE
{
ButtonsIsRegular,
ButtonsIsPressed,
ButtonsIsHighlighted,
};
virtual void OnFillButtonInterior (CDC* pDC,
CBCGPToolbarButton* pButton, CRect rect, CBCGPVisualManager::BCGBUTTON_STATE state);
virtual void OnDrawButtonBorder (CDC* pDC,
CBCGPToolbarButton* pButton, CRect rect, CBCGPVisualManager::BCGBUTTON_STATE state);
virtual void OnDrawButtonSeparator (CDC* pDC,
CBCGPToolbarButton* pButton, CRect rect, CBCGPVisualManager::BCGBUTTON_STATE state,
BOOL bHorz);
virtual void OnHighlightMenuItem (CDC *pDC, CBCGPToolbarMenuButton* pButton,
CRect rect, COLORREF& clrText);
virtual void OnHighlightRarelyUsedMenuItems (CDC* pDC, CRect rectRarelyUsed);
virtual COLORREF GetToolbarButtonTextColor (CBCGPToolbarButton* pButton,
CBCGPVisualManager::BCGBUTTON_STATE state);
// Caption bar:
virtual COLORREF GetCaptionBarTextColor (CBCGPCaptionBar* pBar);
virtual void OnDrawCaptionBarBorder (CDC* pDC, CBCGPCaptionBar* pBar, CRect rect, COLORREF clrBarBorder, BOOL bFlatBorder);
// Outlook bar page buttons:
virtual void OnFillOutlookPageButton (CDC* pDC, const CRect& rect,
BOOL bIsHighlighted, BOOL bIsPressed,
COLORREF& clrText);
virtual void OnDrawOutlookPageButtonBorder (CDC* pDC, CRect& rectBtn, BOOL bIsHighlighted, BOOL bIsPressed);
// Tab overrides:
virtual void OnEraseTabsArea (CDC* pDC, CRect rect, const CBCGPBaseTabWnd* pTabWnd);
virtual void OnDrawTab (CDC* pDC, CRect rectTab,
int iTab, BOOL bIsActive, const CBCGPBaseTabWnd* pTabWnd);
virtual void OnDrawTabContent (CDC* pDC, CRect rectTab,
int iTab, BOOL bIsActive, const CBCGPBaseTabWnd* pTabWnd,
COLORREF clrText);
virtual void OnEraseTabsButton (CDC* pDC, CRect rect, CBCGPButton* pButton,
CBCGPBaseTabWnd* pWndTab);
virtual void OnDrawTabsButtonBorder (CDC* pDC, CRect& rect,
CBCGPButton* pButton, UINT uiState, CBCGPBaseTabWnd* pWndTab);
virtual void GetTabFrameColors (const CBCGPBaseTabWnd* pTabWnd,
COLORREF& clrDark,
COLORREF& clrBlack,
COLORREF& clrHighlight,
COLORREF& clrFace,
COLORREF& clrDarkShadow,
COLORREF& clrLight,
CBrush*& pbrFace,
CBrush*& pbrBlack);
virtual BOOL OnEraseTabsFrame (CDC* pDC, CRect rect, const CBCGPBaseTabWnd* pTabWnd);
virtual BOOL IsHighlightOneNoteTabs () const { return FALSE; }
// Customization dialog:
virtual COLORREF OnFillCommandsListBackground (CDC* pDC, CRect rect, BOOL bIsSelected = FALSE);
virtual void OnDrawMenuArrowOnCustomizeList (CDC* pDC, CRect rectCommand, BOOL bSelected);
virtual CSize GetButtonExtraBorder () const
{
return CSize (0, 0);
}
virtual CSize GetCaptionButtonExtraBorder () const
{
return CSize (0, 0);
}
virtual COLORREF OnFillMiniFrameCaption (CDC* pDC, CRect rectCaption,
CBCGPMiniFrameWnd* pFrameWnd,
BOOL bActive);
virtual void OnDrawMiniFrameBorder (CDC* pDC, CBCGPMiniFrameWnd* pFrameWnd,
CRect rectBorder, CRect rectBorderSize);
virtual void OnDrawFloatingToolbarBorder ( CDC* pDC, CBCGPBaseToolBar* pToolBar,
CRect rectBorder, CRect rectBorderSize);
// Header control:
virtual void OnFillHeaderCtrlBackground (CBCGPHeaderCtrl* pCtrl, CDC* pDC, CRect rect);
virtual void OnDrawHeaderCtrlBorder (CBCGPHeaderCtrl* pCtrl, CDC* pDC,
CRect& rect, BOOL bIsPressed, BOOL bIsHighlighted);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -