Fix fc2dconfig minimum window size

This commit is contained in:
Epicalert 2021-07-13 17:25:39 +08:00
parent ad23fb6a1e
commit 6ced9f4d67
No known key found for this signature in database
GPG key ID: CAA46F858D0979BD

View file

@ -52,16 +52,14 @@ ConfigurationFrame::ConfigurationFrame() : wxFrame(NULL, wxID_ANY, "Configure "
}
wxPanel* panel = new wxPanel(this, wxID_ANY);
// define all controls and labels
useHaarCheckBox = new wxCheckBox(panel, wxID_ANY, "Disable DNN face detection");
showCameraCheckBox = new wxCheckBox(panel, wxID_ANY, "Show camera feed");
noEyesCheckBox = new wxCheckBox(panel, wxID_ANY, "Disable eye tracking");
wxStaticText* modelNameText = new wxStaticText(panel, wxID_ANY, "Model name:");
modelNameChoice = new wxChoice(panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, modelVec.size(), modelArray);
wxStaticText* cameraText = new wxStaticText(panel, wxID_ANY, "Camera ID:");
cameraSpinCtrl = new wxSpinCtrl(panel);
useHaarCheckBox = new wxCheckBox(this , wxID_ANY, "Disable DNN face detection");
showCameraCheckBox = new wxCheckBox(this , wxID_ANY, "Show camera feed");
noEyesCheckBox = new wxCheckBox(this , wxID_ANY, "Disable eye tracking");
wxStaticText* modelNameText = new wxStaticText(this, wxID_ANY, "Model name:");
modelNameChoice = new wxChoice(this , wxID_ANY, wxDefaultPosition, wxDefaultSize, modelVec.size(), modelArray);
wxStaticText* cameraText = new wxStaticText(this , wxID_ANY, "Camera ID:");
cameraSpinCtrl = new wxSpinCtrl(this);
wxBoxSizer* modelSizer = new wxBoxSizer(wxHORIZONTAL); // need to put label next to dropdown
modelSizer->Add(modelNameText, 0, wxALIGN_CENTER | wxALL, 5);
@ -80,19 +78,19 @@ ConfigurationFrame::ConfigurationFrame() : wxFrame(NULL, wxID_ANY, "Configure "
// General section
wxStaticBoxSizer* generalBoxSizer = new wxStaticBoxSizer(new wxStaticBox(panel, wxID_ANY, "General"), wxVERTICAL);
wxStaticBoxSizer* generalBoxSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, "General"), wxVERTICAL);
generalBoxSizer->Add(modelSizer, 0, wxALL, 5);
generalBoxSizer->Add(cameraSizer, 0, wxALL, 5);
generalBoxSizer->Add(showCameraCheckBox, 0, wxALL, 5);
// Performance section
wxStaticBoxSizer* performanceBoxSizer = new wxStaticBoxSizer(new wxStaticBox(panel, wxID_ANY, "Performance"), wxVERTICAL);
wxStaticBoxSizer* performanceBoxSizer = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, "Performance"), wxVERTICAL);
performanceBoxSizer->Add(useHaarCheckBox, 0, wxALL, 5);
performanceBoxSizer->Add(noEyesCheckBox, 0, wxALL, 5);
// define bottom buttons (Cancel and Apply) and their sizer
wxButton* cancelButton = new wxButton(panel, wxID_CANCEL, "Cancel");
wxButton* applyButton = new wxButton(panel, wxID_APPLY, "Apply settings");
wxButton* cancelButton = new wxButton(this, wxID_CANCEL, "Cancel");
wxButton* applyButton = new wxButton(this, wxID_APPLY, "Apply settings");
wxBoxSizer* bottomButtonSizer = new wxBoxSizer(wxHORIZONTAL);
bottomButtonSizer->Add(cancelButton, 0, wxALL, 5);
bottomButtonSizer->Add(applyButton, 0, wxALL, 5);
@ -104,7 +102,7 @@ ConfigurationFrame::ConfigurationFrame() : wxFrame(NULL, wxID_ANY, "Configure "
sizer->AddStretchSpacer(1);
sizer->Add(bottomButtonSizer, 0, wxALIGN_RIGHT | wxALL, 10);
panel->SetSizerAndFit(sizer);
SetSizerAndFit(sizer);
Bind(wxEVT_BUTTON, &ConfigurationFrame::OnApply, this, wxID_APPLY);
Bind(wxEVT_BUTTON, &ConfigurationFrame::OnExit, this, wxID_CANCEL);