1 #ifndef CARDBUTTON_INCLUDED
2 #define CARDBUTTON_INCLUDED
4 #define MAXBUTTONTEXT 64
8 friend class CardWindow
;
11 // Constructor is PRIVATE - only a
12 // CardWindow can create buttons!
14 CardButton(CardWindow
&parent
, int id
, TCHAR
*szText
, UINT style
, bool visible
,
15 int x
, int y
, int width
, int height
);
21 void SetStyle(UINT uStyle
);
24 void SetText(TCHAR
*fmt
, ...);
25 void SetFont(HFONT font
);
27 void SetPlacement(UINT xJustify
, UINT yJustify
, int xAdjust
, int yAdjust
);
29 void SetForeColor(COLORREF cr
);
30 void SetBackColor(COLORREF cr
);
32 void Move(int x
, int y
, int width
, int height
);
33 void Show(bool fShow
);
37 void SetIcon(HICON hicon
, bool fRedraw
);
39 void SetButtonProc(pButtonProc proc
);
41 CardWindow
&GetCardWindow() { return parentWnd
; }
46 static COLORREF
GetHighlight(COLORREF crBase
);
47 static COLORREF
GetShadow(COLORREF crBase
);
48 static COLORREF
GetFace(COLORREF crBase
);
53 // Private member functions
55 void AdjustPosition(int winwidth
, int winheight
);
57 void DrawRect(HDC hdc
, RECT
*rect
, bool fNormal
);
58 void Draw(HDC hdc
, bool fNormal
);
61 int OnLButtonDown(HWND hwnd
, int x
, int y
);
62 int OnMouseMove(HWND hwnd
, int x
, int y
);
63 int OnLButtonUp(HWND hwnd
, int x
, int y
);
68 CardWindow
&parentWnd
;
83 TCHAR szText
[MAXBUTTONTEXT
];
96 pButtonProc ButtonCallback
;
99 #endif /* CARDBUTTON_INCLUDED */