Hi friends!
I
Combobox (or any control) inside a toolbar on linux Topic is solved
Combobox (or any control) inside a toolbar on linux
Last edited by riruilo on Fri Jul 20, 2007 9:01 pm, edited 1 time in total.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.
Excuse me, the source code was not completed.
// the generic toolbar doesn't really support this
#if wxUSE_TOOLBAR_NATIVE && !defined(__WXX11__) || defined(__WXUNIVERSAL__)
// adding a combo to a vertical toolbar is not very smart
if ( !( toolBar->IsVertical() ) )
{
wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(100,-1),0, NULL, wxCB_READONLY ,wxDefaultValidator, _T("comboBox") );
combo->Append(_T("This"));
combo->Append(_T("is a"));
combo->Append(_T("combobox"));
combo->Append(_T("in a"));
combo->Append(_T("toolbar"));
combo->SetSelection(0);
toolBar->AddControl(combo);
wxSpinCtrl *spin = new wxSpinCtrl( toolBar, ID_SPIN, wxT("0"), wxDefaultPosition, wxSize(80,wxDefaultCoord), 0, 0, 100 );
toolBar->AddControl( spin );
wxTextCtrl *text = new wxTextCtrl( toolBar, -1, wxT("text"), wxDefaultPosition, wxSize(80,wxDefaultCoord) );
toolBar->AddControl( text );
wxSearchCtrl *srch = new wxSearchCtrl( toolBar, -1, wxT("xx"), wxDefaultPosition, wxSize(80,wxDefaultCoord), wxSUNKEN_BORDER );
toolBar->AddControl( srch );
}
#endif // toolbars which don't support controls
What I dont understand is why the code says "the generic toolbar doesn't really support this". And the define "#if wxUSE_TOOLBAR_NATIVE && !defined(__WXX11__) || defined(__WXUNIVERSAL__) ".
Thank you.
// the generic toolbar doesn't really support this
#if wxUSE_TOOLBAR_NATIVE && !defined(__WXX11__) || defined(__WXUNIVERSAL__)
// adding a combo to a vertical toolbar is not very smart
if ( !( toolBar->IsVertical() ) )
{
wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(100,-1),0, NULL, wxCB_READONLY ,wxDefaultValidator, _T("comboBox") );
combo->Append(_T("This"));
combo->Append(_T("is a"));
combo->Append(_T("combobox"));
combo->Append(_T("in a"));
combo->Append(_T("toolbar"));
combo->SetSelection(0);
toolBar->AddControl(combo);
wxSpinCtrl *spin = new wxSpinCtrl( toolBar, ID_SPIN, wxT("0"), wxDefaultPosition, wxSize(80,wxDefaultCoord), 0, 0, 100 );
toolBar->AddControl( spin );
wxTextCtrl *text = new wxTextCtrl( toolBar, -1, wxT("text"), wxDefaultPosition, wxSize(80,wxDefaultCoord) );
toolBar->AddControl( text );
wxSearchCtrl *srch = new wxSearchCtrl( toolBar, -1, wxT("xx"), wxDefaultPosition, wxSize(80,wxDefaultCoord), wxSUNKEN_BORDER );
toolBar->AddControl( srch );
}
#endif // toolbars which don't support controls
What I dont understand is why the code says "the generic toolbar doesn't really support this". And the define "#if wxUSE_TOOLBAR_NATIVE && !defined(__WXX11__) || defined(__WXUNIVERSAL__) ".
Thank you.
I've seen things you people wouldn't believe. Attack ships on fire off the shoulder of Orion. I watched C-beams glitter in the dark near the Tannhauser gate. All those moments will be lost in time, like tears in rain. Time to die.