ReactOS  0.4.13-dev-563-g0561610
cardbutton.h
Go to the documentation of this file.
1 #ifndef CARDBUTTON_INCLUDED
2 #define CARDBUTTON_INCLUDED
3 
4 #define MAXBUTTONTEXT 64
5 
6 class CardButton
7 {
8  friend class CardWindow;
9 
10  //
11  // Constructor is PRIVATE - only a
12  // CardWindow can create buttons!
13  //
14  CardButton(CardWindow &parent, int id, TCHAR *szText, UINT style, bool visible,
15  int x, int y, int width, int height);
16 
17  ~CardButton();
18 
19 public:
20 
21  void SetStyle(UINT uStyle);
22  UINT GetStyle();
23 
24  void SetText(TCHAR *fmt, ...);
25  void SetFont(HFONT font);
26 
27  void SetPlacement(UINT xJustify, UINT yJustify, int xAdjust, int yAdjust);
28 
29  void SetForeColor(COLORREF cr);
30  void SetBackColor(COLORREF cr);
31 
32  void Move(int x, int y, int width, int height);
33  void Show(bool fShow);
34  void Redraw();
35  int Id();
36 
37  void SetIcon(HICON hicon, bool fRedraw);
38 
40 
42 
43  bool Lock();
44  bool UnLock();
45 
46  static COLORREF GetHighlight(COLORREF crBase);
47  static COLORREF GetShadow(COLORREF crBase);
48  static COLORREF GetFace(COLORREF crBase);
49 
50 private:
51 
52  //
53  // Private member functions
54  //
55  void AdjustPosition(int winwidth, int winheight);
56 
57  void DrawRect(HDC hdc, RECT *rect, bool fNormal);
58  void Draw(HDC hdc, bool fNormal);
59  void Clip(HDC hdc);
60 
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);
64 
65  //
66  // Private members
67  //
69 
71  int id;
73  bool fVisible;
74 
75  int xadjust;
76  int xjustify;
77  int yadjust;
78  int yjustify;
79 
82 
84 
90 
91  bool fMouseDown;
93 
95 
97 };
98 
99 #endif /* CARDBUTTON_INCLUDED */
void SetForeColor(COLORREF cr)
Definition: cardbutton.cpp:398
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
bool Lock()
Definition: cardbutton.cpp:458
GLint GLint GLsizei width
Definition: gl.h:1546
static HICON
Definition: imagelist.c:84
void Move(int x, int y, int width, int height)
Definition: cardbutton.cpp:380
HFONT hFont
Definition: cardbutton.h:81
RECT rect
Definition: cardbutton.h:70
void SetPlacement(UINT xJustify, UINT yJustify, int xAdjust, int yAdjust)
Definition: cardbutton.cpp:431
int OnLButtonUp(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:301
Definition: mk_font.cpp:20
static COLORREF GetFace(COLORREF crBase)
Definition: cardbutton.cpp:426
static COLORREF GetHighlight(COLORREF crBase)
Definition: cardbutton.cpp:415
void AdjustPosition(int winwidth, int winheight)
Definition: cardbutton.cpp:208
static HDC
Definition: imagelist.c:92
bool fVisible
Definition: cardbutton.h:73
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
int OnMouseMove(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:278
UINT uStyle
Definition: cardbutton.h:72
static HANDLE proc()
Definition: pdb.c:32
COLORREF crText
Definition: cardbutton.h:86
HICON hIcon
Definition: cardbutton.h:80
void SetStyle(UINT uStyle)
Definition: cardbutton.cpp:476
void Redraw()
Definition: cardbutton.cpp:385
bool fMouseDown
Definition: cardbutton.h:91
int yadjust
Definition: cardbutton.h:77
int OnLButtonDown(HWND hwnd, int x, int y)
Definition: cardbutton.cpp:253
pButtonProc ButtonCallback
Definition: cardbutton.h:96
void DrawRect(HDC hdc, RECT *rect, bool fNormal)
Definition: cardbutton.cpp:46
void Clip(HDC hdc)
Definition: cardbutton.cpp:102
static COLORREF GetShadow(COLORREF crBase)
Definition: cardbutton.cpp:421
COLORREF crHighlight
Definition: cardbutton.h:87
int xjustify
Definition: cardbutton.h:76
#define MAXBUTTONTEXT
Definition: cardbutton.h:4
char TCHAR
Definition: xmlstorage.h:189
r parent
Definition: btrfs.c:2708
void SetFont(HFONT font)
Definition: cardbutton.cpp:447
TCHAR szText[MAXBUTTONTEXT]
Definition: cardbutton.h:83
DWORD COLORREF
Definition: windef.h:285
bool fButtonDown
Definition: cardbutton.h:92
COLORREF crShadow2
Definition: cardbutton.h:89
void SetBackColor(COLORREF cr)
Definition: cardbutton.cpp:403
HDC hdc
Definition: main.c:9
void SetButtonProc(pButtonProc proc)
Definition: cardbutton.cpp:453
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
COLORREF crShadow
Definition: cardbutton.h:88
COLORREF crBack
Definition: cardbutton.h:85
void Draw(HDC hdc, bool fNormal)
Definition: cardbutton.cpp:109
bool UnLock()
Definition: cardbutton.cpp:468
int xadjust
Definition: cardbutton.h:75
CardButton(CardWindow &parent, int id, TCHAR *szText, UINT style, bool visible, int x, int y, int width, int height)
Definition: cardbutton.cpp:15
int yjustify
Definition: cardbutton.h:78
unsigned int UINT
Definition: ndis.h:50
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
UINT GetStyle()
Definition: cardbutton.cpp:481
CardWindow & parentWnd
Definition: cardbutton.h:68
void Show(bool fShow)
Definition: cardbutton.cpp:375
void SetText(TCHAR *fmt,...)
Definition: cardbutton.cpp:359
Arabic default style
Definition: afstyles.h:93
void(CARDLIBPROC * pButtonProc)(CardButton &pButton)
Definition: cardlib.h:94
Definition: dsound.c:943
void SetIcon(HICON hicon, bool fRedraw)
Definition: cardbutton.cpp:439
CardWindow & GetCardWindow()
Definition: cardbutton.h:41
HANDLE mxlock
Definition: cardbutton.h:94