我是wxWigets库的初学者。我无法在wxToolbar中添加一个comboBox。谁能帮我?代码编译很好,但是当我将wxComboBox添加到容器窗口时,容器窗口正确显示。
CFrame* itemCMultiFrame1 = this;
wxBitmap* toolsBitmaps[1];
toolsBitmaps[0] = new wxBitmap(open_xpm);
wxToolBar* toolBar = new wxToolBar(this, 12423, wxDefaultPosition,
wxDefaultSize, wxTB_NODIVIDER | wxTB_FLAT | wxTB_HORIZONTAL);
wxArrayString strings;
strings.Add(wxT("1"));
strings.Add(wxT("2"));
strings.Add(wxT("3"));
strings.Add(wxT("4"));
wxComboBox* combo = new wxComboBox(this, 12322,wxT("1"), wxDefaultPosition, wxDefaultSize,strings, wxCB_DROPDOWN);
toolBar->AddTool(wxID_SAVE, wxT("open.xpm"), *toolsBitmaps[0], wxT("Select file"), wxITEM_CHECK);
toolBar->AddControl(combo);
toolBar->EnableTool(wxID_SAVE,true);
toolBar->EnableTool(12322, true);
toolBar->SetMargins(0, 0);
wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
itemBoxSizer10->Add(toolBar, 0, wxEXPAND, 0);
toolBar->Realize();
itemCMultiFrame1->SetToolBar(toolBar);