]> git.saurik.com Git - wxWidgets.git/blob - contrib/include/wx/gizmos/ledctrl.h
[#1472076] Fixes after stock gdi changes within core library.
[wxWidgets.git] / contrib / include / wx / gizmos / ledctrl.h
1 #ifndef _WX_LEDNUMBERCTRL_H_
2 #define _WX_LEDNUMBERCTRL_H_
3
4 #include "wx/gizmos/gizmos.h"
5
6 #include <wx/window.h>
7 #include <wx/control.h>
8
9 class wxEraseEvent;
10 class wxPaintEvent;
11 class wxSizeEvent;
12
13 // ----------------------------------------------------------------------------
14 // enum and styles
15 // ----------------------------------------------------------------------------
16
17 enum wxLEDValueAlign
18 {
19 wxLED_ALIGN_LEFT = 0x01,
20 wxLED_ALIGN_RIGHT = 0x02,
21 wxLED_ALIGN_CENTER = 0x04,
22
23 wxLED_ALIGN_MASK = 0x04
24 };
25
26 #define wxLED_DRAW_FADED 0x08
27
28 // ----------------------------------------------------------------------------
29 // wxLEDNumberCtrl
30 // ----------------------------------------------------------------------------
31
32 class WXDLLIMPEXP_GIZMOS wxLEDNumberCtrl : public wxControl
33 {
34 public:
35 // Constructors.
36 wxLEDNumberCtrl();
37 wxLEDNumberCtrl(wxWindow *parent, wxWindowID id = wxID_ANY,
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = wxLED_ALIGN_LEFT | wxLED_DRAW_FADED);
41
42 // Create functions.
43 bool Create(wxWindow *parent, wxWindowID id = wxID_ANY,
44 const wxPoint& pos = wxDefaultPosition,
45 const wxSize& size = wxDefaultSize,
46 long style = 0);
47
48 wxLEDValueAlign GetAlignment() const { return m_Alignment; }
49 bool GetDrawFaded() const { return m_DrawFaded; }
50 const wxString &GetValue() const { return m_Value; }
51
52 void SetAlignment(wxLEDValueAlign Alignment, bool Redraw = true);
53 void SetDrawFaded(bool DrawFaded, bool Redraw = true);
54 void SetValue(const wxString &Value, bool Redraw = true);
55
56 private:
57 // Members.
58 wxString m_Value;
59 wxLEDValueAlign m_Alignment;
60
61 int m_LineMargin;
62 int m_DigitMargin;
63 int m_LineLength;
64 int m_LineWidth;
65 bool m_DrawFaded;
66 int m_LeftStartPos;
67
68 // Functions.
69 void DrawDigit(wxDC &Dc, int Digit, int Column);
70 void RecalcInternals(const wxSize &CurrentSize);
71
72 // Events.
73 DECLARE_EVENT_TABLE()
74
75 void OnEraseBackground(wxEraseEvent &Event);
76 void OnPaint(wxPaintEvent &Event);
77 void OnSize(wxSizeEvent &Event);
78 };
79
80 #endif