-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyboardDialog.h
More file actions
61 lines (47 loc) · 1.41 KB
/
Copy pathKeyboardDialog.h
File metadata and controls
61 lines (47 loc) · 1.41 KB
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
56
57
58
59
60
61
//////////////////////////////////////////////////////////////////////////////
// Configuration dialog for keyboard input
//////////////////////////////////////////////////////////////////////////////
#ifndef __HEADER_KEYBOARDDIALOG__
#define __HEADER_KEYBOARDDIALOG__
#include <wx/wx.h>
#include "Input.h"
// Declaration of the keyboard dialog class
class CKeyboardDialog : public wxDialog
{
private:
DECLARE_EVENT_TABLE();
public:
// Constructor and destructor
CKeyboardDialog(wxWindow *parent, CInput* pInput);
virtual ~CKeyboardDialog();
private:
void OnClose(wxCloseEvent& event);
// Click on the Ok button, check and save config
void OnOk(wxCommandEvent& event);
// Click on the cancel button closes the dialog, changes are lost
void OnCancel(wxCommandEvent& event);
// Clicked on button to configure a key
void OnButton(wxCommandEvent& event);
// Pressed a key
void OnKey(wxKeyEvent& event);
// Get the formatted text to display on the button
wxString GetLabelString(int iButtonId);
// Controls of the dialog
private:
// Labels for direction
wxStaticText* m_pLabels[8];
// Button for key selection
wxButton* m_pButton[8];
// Assigned values
wxKeyCode m_pKeys[8];
// Input object
CInput* m_pInput;
// Current key
int m_iKey;
enum
{
ID_BUTTONOK = 1010,
ID_BUTTONCANCEL
};
};
#endif