-
Notifications
You must be signed in to change notification settings - Fork 0
/
wWxTextControl.h
56 lines (39 loc) · 1.11 KB
/
wWxTextControl.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef _WWX_TEXT_CONTROL_H_
#define _WWX_TEXT_CONTROL_H_
#include "wx/wxprec.h"
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
#if wxUSE_FILE
#include "wx/file.h"
#endif
#include "wx/colordlg.h"
#include "wx/fontdlg.h"
#include "wx/numdlg.h"
#include "wx/tokenzr.h"
#ifndef wxHAS_IMAGES_IN_RESOURCES
#include "../sample.xpm"
#endif
class wWxTextControl : public wxTextCtrl
{
public:
wWxTextControl(wxWindow* parent, wxWindowID id, const wxString& value,
const wxPoint& pos, const wxSize& size, int style = 0)
: wxTextCtrl(parent, id, value, pos, size, style)
{
m_hasCapture = false;
}
void OnKeyDown(wxKeyEvent& event);
void OnKeyUp(wxKeyEvent& event);
void OnChar(wxKeyEvent& event);
void OnText(wxCommandEvent& event);
void OnTextEnter(wxCommandEvent& event);
void OnTextMaxLen(wxCommandEvent& event);
void OnSetFocus(wxFocusEvent& event);
void OnKillFocus(wxFocusEvent& event);
private:
static inline wxChar GetChar(bool on, wxChar c) { return on ? c : '-'; }
bool m_hasCapture;
wxDECLARE_EVENT_TABLE();
};
#endif //_WWX_TEXT_CONTROL_H_