1 #ifndef CARDBUTTON_INCLUDED
2 #define CARDBUTTON_INCLUDED
4 #define MAXBUTTONTEXT 64
10 friend class CardWindow
;
13 // Constructor is PRIVATE - only a
14 // CardWindow can create buttons!
16 CardButton(CardWindow
&parent
, int id
, TCHAR
*szText
, UINT style
, bool visible
,
17 int x
, int y
, int width
, int height
);
23 void SetStyle(UINT uStyle
);
26 void SetText(TCHAR
*fmt
, ...);
27 void SetFont(HFONT font
);
29 void SetPlacement(UINT xJustify
, UINT yJustify
, int xAdjust
, int yAdjust
);
31 void SetForeColor(COLORREF cr
);
32 void SetBackColor(COLORREF cr
);
34 void Move(int x
, int y
, int width
, int height
);
35 void Show(bool fShow
);
39 void SetIcon(HICON hicon
, bool fRedraw
);
41 void SetButtonProc(pButtonProc proc
);
43 CardWindow
&GetCardWindow() { return parentWnd
; }
48 static COLORREF
GetHighlight(COLORREF crBase
);
49 static COLORREF
GetShadow(COLORREF crBase
);
50 static COLORREF
GetFace(COLORREF crBase
);
55 // Private member functions
57 void AdjustPosition(int winwidth
, int winheight
);
59 void DrawRect(HDC hdc
, RECT
*rect
, bool fNormal
);
60 void Draw(HDC hdc
, bool fNormal
);
63 int OnLButtonDown(HWND hwnd
, int x
, int y
);
64 int OnMouseMove(HWND hwnd
, int x
, int y
);
65 int OnLButtonUp(HWND hwnd
, int x
, int y
);
70 CardWindow
&parentWnd
;
85 TCHAR szText
[MAXBUTTONTEXT
];
98 pButtonProc ButtonCallback
;