-
Notifications
You must be signed in to change notification settings - Fork 0
/
GeneralSettingsFrame.h
55 lines (38 loc) · 1.2 KB
/
GeneralSettingsFrame.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
#pragma once
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWidgets headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#endif
class TextInput;
struct GeneralSettingsData {
GeneralSettingsData(std::string electionName) :
electionName(electionName) {}
std::string electionName;
};
// *** EditPollFrame ***
// Frame that allows the user to edit an already-existing poll
// or create a new one
class GeneralSettingsFrame : public wxDialog
{
public:
typedef std::function<void(GeneralSettingsData)> OkCallback;
GeneralSettingsFrame(OkCallback okCallback, GeneralSettingsData data);
private:
void createControls(int& y);
void createElectionNameInput(int& y);
void createOkCancelButtons(int& y);
void setFinalWindowHeight(int y);
// Calls upon the window to send its data to the parent frame and close.
void OnOK(wxCommandEvent& WXUNUSED(event));
GeneralSettingsData data;
std::unique_ptr<TextInput> electionNameInput;
wxButton* okButton;
wxButton* cancelButton;
OkCallback okCallback;
};