I've run into a few problems of course. This is the constructor of the frame :
Code: Select all
wxGrid* grid = new wxGrid(this, -1);
wxBoxSizer* s_layout = new wxBoxSizer(wxHORIZONTAL);
//{
s_layout->Add(grid, 1, wxEXPAND, 0);
wxBoxSizer* s_buttons = new wxBoxSizer(wxVERTICAL);
//{
s_buttons->Add(new wxButton(this, SET_Settings, _T("Apply")), 1, wxLEFT | wxRIGHT | wxBOTTOM, 30);
s_buttons->Add(new wxStaticText(this, -1, _T("X-Axis:")), 0, wxALIGN_CENTER_HORIZONTAL, 0);
wxTextCtrl* xAxis = new wxTextCtrl(this, -1); //Declared in private section of class in header. wxTextCtrl* xAxis
s_buttons->Add(xAxis, 0, wxALIGN_CENTER_HORIZONTAL, 0);
s_buttons->Add(new wxStaticText(this, -1, _T("Y-Axis:")), 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 30);
wxTextCtrl* yAxis = new wxTextCtrl(this, -1); //Declared in private section of class in header wxTextCtrl* yAxis
s_buttons->Add(yAxis, 0, wxALIGN_CENTER_HORIZONTAL, 0);
//}
s_layout->Add(s_buttons, 0, wxALIGN_CENTER_HORIZONTAL, 0);
//}
SetSizer(s_layout);
Here's the OnApply function:
Code: Select all
grid->CreateGrid( wxAtoi(xAxis->GetValue()), wxAtoi(yAxis->GetValue()) );