forked from d-j-hirst/aus-polling-analyser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCheckInput.cpp
More file actions
17 lines (14 loc) · 695 Bytes
/
CheckInput.cpp
File metadata and controls
17 lines (14 loc) · 695 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "CheckInput.h"
CheckInput::CheckInput(wxWindow* parent, wxWindowID checkCtrlId, std::string labelText, int initialChoice, wxPoint topLeft,
CheckChangeFunc checkChangeFunc, int labelWidth, int textInputWidth)
: checkChangeFunc(checkChangeFunc), parent(parent)
{
staticText = new wxStaticText(parent, 0, labelText, topLeft, wxSize(labelWidth, Height));
checkBox = new wxCheckBox(parent, checkCtrlId, "", topLeft + wxSize(labelWidth, 0), wxSize(textInputWidth, Height));
checkBox->SetValue(initialChoice);
parent->Bind(wxEVT_CHECKBOX, &CheckInput::updateCheck, this, checkBox->GetId());
}
void CheckInput::updateCheck(wxCommandEvent & event)
{
checkChangeFunc(event.GetInt());
}