00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #if !defined(AFX_SKINWINDOW_H__1FD170CD_1891_4A41_9ADF_50FCDB87CF7B__INCLUDED_)
00023 #define AFX_SKINWINDOW_H__1FD170CD_1891_4A41_9ADF_50FCDB87CF7B__INCLUDED_
00024
00025 #pragma once
00026
00027 class CXMLElement;
00028
00029
00030 class CSkinWindow
00031 {
00032
00033 public:
00034 CSkinWindow();
00035 virtual ~CSkinWindow();
00036
00037
00038 public:
00039 CString m_sTargets;
00040 CString m_sLanguage;
00041 CDC m_dcSkin;
00042 CBitmap m_bmSkin;
00043 CBitmap m_bmAlpha;
00044 CBitmap m_bmWatermark;
00045 HBITMAP m_hoSkin;
00046 public:
00047 BOOL* m_bPart;
00048 int* m_nPart;
00049 CRect* m_rcPart;
00050 BOOL* m_bAnchor;
00051 CRect* m_rcAnchor;
00052 CMapStringToPtr m_pPartList;
00053 CMapStringToPtr m_pAnchorList;
00054 public:
00055 CSize m_szMinSize;
00056 CRect m_rcMaximise;
00057 CRect m_rcResize;
00058 BOOL m_bCaption;
00059 BOOL m_bCaptionCaps;
00060 CRect m_rcCaption;
00061 CFont m_fnCaption;
00062 COLORREF m_crCaptionFill;
00063 COLORREF m_crCaptionText;
00064 COLORREF m_crCaptionInactive;
00065 COLORREF m_crCaptionShadow;
00066 COLORREF m_crCaptionOutline;
00067 int m_nCaptionAlign;
00068 protected:
00069 CXMLElement* m_pRegionXML;
00070 int m_nHoverAnchor;
00071 int m_nDownAnchor;
00072 int m_nMirror;
00073 CRect m_rcMirror;
00074
00075
00076 public:
00077 BOOL Parse(CXMLElement* pXML, const CString& strPath);
00078 void Prepare(CDC* pDC);
00079 void Paint(CWnd* pWnd, CDC& dc, BOOL bCaption, TRISTATE bActive = TS_UNKNOWN);
00080 void CalcWindowRect(RECT* pRect, BOOL bToClient = FALSE, BOOL bZoomed = FALSE);
00081 BOOL GetPart(LPCTSTR pszName, CRect& rcPart);
00082 BOOL GetAnchor(LPCTSTR pszName, CRect& rcAnchor);
00083 BOOL GetAnchor(LPCTSTR pszName, const CRect& rcClient, CRect& rcAnchor);
00084 BOOL PaintPartOnAnchor(CDC* pDC, const CRect& rcClient, LPCTSTR pszPart, LPCTSTR pszAnchor);
00085 BOOL PreBlend(CBitmap* pbmTarget, const CRect& rcTarget, const CRect& rcSource);
00086 public:
00087 void OnNcCalcSize(CWnd* pWnd, BOOL bCalcValidRects, NCCALCSIZE_PARAMS FAR* lpncsp);
00088 void OnGetMinMaxInfo(MINMAXINFO* lpMMI);
00089 UINT OnNcHitTest(CWnd* pWnd, CPoint point, BOOL bResizable = FALSE);
00090 void OnNcPaint(CWnd* pWnd);
00091 BOOL OnNcActivate(CWnd* pWnd, BOOL bActive);
00092 void OnSetText(CWnd* pWnd);
00093 void OnSize(CWnd* pWnd);
00094 BOOL OnEraseBkgnd(CWnd* pWnd, CDC* pDC);
00095 void OnNcMouseMove(CWnd* pWnd, UINT nHitTest, CPoint point);
00096 BOOL OnNcLButtonDown(CWnd* pWnd, UINT nHitTest, CPoint point);
00097 BOOL OnNcLButtonUp(CWnd* pWnd, UINT nHitTest, CPoint point);
00098 BOOL OnNcLButtonDblClk(CWnd* pWnd, UINT nHitTest, CPoint point);
00099 CSize GetRegionSize();
00100 protected:
00101 BOOL ParseRect(CXMLElement* pXML, CRect* pRect);
00102 BOOL ParseColour(const CString& str, COLORREF& cr);
00103 void ResolveAnchor(const CRect& rcClient, CRect& rcAnchor, int nAnchor);
00104 void SelectRegion(CWnd* pWnd);
00105
00106 };
00107
00108 enum
00109 {
00110 SKINPART_TOP_LEFT, SKINPART_TOP, SKINPART_TOP_RIGHT,
00111 SKINPART_IA_TOP_LEFT, SKINPART_IA_TOP, SKINPART_IA_TOP_RIGHT,
00112 SKINPART_LEFT_TOP, SKINPART_LEFT, SKINPART_LEFT_BOTTOM,
00113 SKINPART_RIGHT_TOP, SKINPART_RIGHT, SKINPART_RIGHT_BOTTOM,
00114 SKINPART_BOTTOM_LEFT, SKINPART_BOTTOM, SKINPART_BOTTOM_RIGHT,
00115
00116 SKINPART_SYSTEM, SKINPART_SYSTEM_HOT, SKINPART_SYSTEM_DOWN,
00117 SKINPART_MINIMISE, SKINPART_MINIMISE_HOT, SKINPART_MINIMISE_DOWN,
00118 SKINPART_MAXIMISE, SKINPART_MAXIMISE_HOT, SKINPART_MAXIMISE_DOWN,
00119 SKINPART_CLOSE, SKINPART_CLOSE_HOT, SKINPART_CLOSE_DOWN,
00120
00121 SKINPART_COUNT
00122 };
00123
00124 enum
00125 {
00126 SKINANCHOR_ICON, SKINANCHOR_SYSTEM,
00127 SKINANCHOR_MINIMISE, SKINANCHOR_MAXIMISE, SKINANCHOR_CLOSE,
00128
00129 SKINANCHOR_COUNT
00130 };
00131
00132 enum
00133 {
00134 SKINPARTMODE_TILE, SKINPARTMODE_STRETCH
00135 };
00136
00137 #endif // !defined(AFX_SKINWINDOW_H__1FD170CD_1891_4A41_9ADF_50FCDB87CF7B__INCLUDED_)