forked from d-j-hirst/aus-polling-analyser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathColourInput.cpp
More file actions
16 lines (13 loc) · 721 Bytes
/
ColourInput.cpp
File metadata and controls
16 lines (13 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "ColourInput.h"
ColourInput::ColourInput(wxWindow* parent, wxWindowID colourCtrlId, std::string labelText, wxColour initialColour,
wxPoint topLeft, ColourChangeFunc colourChangeFunc, int labelWidth, int textInputWidth)
: colourChangeFunc(colourChangeFunc), parent(parent)
{
staticText = new wxStaticText(parent, 0, labelText, topLeft, wxSize(labelWidth, Height));
colourCtrl = new wxColourPickerCtrl(parent, colourCtrlId, initialColour, topLeft + wxSize(labelWidth, 0), wxSize(textInputWidth, Height));
parent->Bind(wxEVT_COLOURPICKER_CHANGED, &ColourInput::updateColour, this, colourCtrl->GetId());
}
void ColourInput::updateColour(wxColourPickerEvent & event)
{
colourChangeFunc(event.GetColour());
}