wxStaticBoxSizer的标签在gui启动时截断

时间:2017-10-22 15:18:44

标签: wxwidgets

我在GUI启动时显示wxStaticBoxSizer标签已完成,这是重要的代码:

wxFrame(NULL, wxID_ANY, title) ...
const int BORDER_WIDTH = 10;
wxBoxSizer* frameSizer = new wxBoxSizer(wxVERTICAL);
wxPanel *mainPanel = new wxPanel(this, wxID_ANY);
wxBoxSizer* mainSizer = new wxBoxSizer(wxHORIZONTAL);
wxStaticBoxSizer* sbSizerConf = new wxStaticBoxSizer(wxVERTICAL, mainPanel, _("Configuration"));
m_sb_panel = new wxPanel(sbSizerConf->GetStaticBox());
wxBoxSizer* miniSizer = new wxBoxSizer(wxVERTICAL);
m_notify_check = new wxCheckBox(m_sb_panel, wxID_ANY, _("Enable notifications"));
m_notify_check->SetValue(true);
m_sound_check = new wxCheckBox(m_sb_panel, wxID_ANY, _("Enable sound alarm"));
m_sound_check->SetValue(true);
m_front_check = new wxCheckBox(m_sb_panel, wxID_ANY, _("Show main window at timeout"));
m_front_check->SetValue(true);
wxSlider *m_min_slider = new wxSlider(m_sb_panel, wxID_ANY, 0, 0, 120, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS);
m_min_slider->SetToolTip(_("Minute value"));
wxSlider *m_sec_slider = new wxSlider(m_sb_panel, wxID_ANY, 0, 0, 59, wxDefaultPosition, wxDefaultSize, wxSL_AUTOTICKS|wxSL_HORIZONTAL|wxSL_LABELS);
m_sec_slider->SetToolTip(_("Second value"));
m_action_button = new wxButton(sbSizerConf->GetStaticBox(), ID_ACTION_BUTTON, _("&Start"));
m_action_button->Enable(false);
//
wxBoxSizer* RightSizer = new wxBoxSizer(wxVERTICAL);
wxStaticBoxSizer* sbSizerDisplay = new wxStaticBoxSizer(wxVERTICAL, mainPanel, _("Display"));
m_time_label = new wxStaticText(sbSizerDisplay->GetStaticBox(), wxID_ANY, _("00:00"));
wxStaticBoxSizer* sbSizerMsg = new wxStaticBoxSizer(wxVERTICAL, mainPanel, _("A message to remember"));
wxTextCtrl* m_textCtrl1 = new wxTextCtrl(sbSizerMsg->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxTE_MULTILINE);
miniSizer->Add(m_notify_check, 0, wxALL|wxEXPAND, BORDER_WIDTH);
miniSizer->Add(m_sound_check, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, BORDER_WIDTH);
miniSizer->Add(m_front_check, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, BORDER_WIDTH);
miniSizer->Add(m_min_slider, 0, wxLEFT|wxRIGHT|wxBOTTOM|wxEXPAND, BORDER_WIDTH);
miniSizer->Add(m_sec_slider, 0, wxLEFT|wxRIGHT|wxEXPAND, BORDER_WIDTH);
m_sb_panel->SetSizer(miniSizer);
sbSizerConf->Add(m_sb_panel, 0, wxLEFT|wxRIGHT|wxBOTTOM, BORDER_WIDTH);
sbSizerConf->Add(m_action_button, 0, wxLEFT|wxRIGHT|wxBOTTOM, BORDER_WIDTH);
mainSizer->Add(sbSizerConf, 0, wxALL|wxEXPAND, 0);
sbSizerDisplay->Add(m_time_label, 0, wxALL|wxEXPAND, BORDER_WIDTH);
RightSizer->Add(sbSizerDisplay, 0, wxEXPAND, BORDER_WIDTH);
sbSizerMsg->Add(m_textCtrl1, 1, wxALL|wxEXPAND, BORDER_WIDTH);
RightSizer->Add(sbSizerMsg, 1, wxTOP|wxEXPAND, BORDER_WIDTH); // truncated
mainSizer->Add(RightSizer, 1, wxLEFT|wxEXPAND, BORDER_WIDTH);
mainPanel->SetSizer(mainSizer);
frameSizer->Add(mainPanel, 1, wxALL|wxEXPAND, BORDER_WIDTH);
SetSizerAndFit(frameSizer);

看看screencaptures我拥有什么,我期待什么,任何想法? what I'm having What I want

0 个答案:

没有答案