Thanks for the tips, I decided to use SpinCtrl. I constructed a function which takes the value in the SpinCtrl and sets it as the step size. For some odd reason im getting an error saying that SpinCtrl1 is undefined on VS2017 but in code blocks the code runs fine. Any tips?
this is a snippet of my class:
Code: Select all
int stepsize = 1;
myDoubleSlider::myDoubleSlider(wxWindow *parent,
wxWindowID id,
int leftValue, int rightValue, int minValue, int maxValue,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& val,
const wxString& name) : wxControl(parent, id, pos, size, wxBORDER_NONE)
{
wxSpinCtrl* SpinCtrl1 = new wxSpinCtrl(this, wxID_ANY, _T("1"), wxPoint(1200, 200), wxDefaultSize, 0, 0, 100, 0, _T("ID_SPINCTRL1"));
SpinCtrl1->SetValue(_T("1"));
Connect(wxID_ANY, wxEVT_COMMAND_SPINCTRL_UPDATED, (wxObjectEventFunction)&myDoubleSlider::OnSpinCtrl1Change);
}
this is the function:
Code: Select all
void myDoubleSlider::OnSpinCtrl1Change(wxSpinEvent& event)
{
stepsize = SpinCtrl1->GetValue(); //error here "SpinCtrl1" is undefined
}