Kirix Support Forums

wxControl on Toolbar - How do I?

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

wxControl on Toolbar - How do I?

Postby Radzi on Wed Feb 08, 2006 3:51 am

Hi,

I'm trying to convert my application to use wxAUI. As a start, just trying with the toolbar. Stumbled upon the toolbar that contain wxComboBox. Code is as below:

wxToolBar *tBar2 = new wxToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTB_NODIVIDER | wxTB_FLAT | wxTB_DOCKABLE | wxTB_TEXT);
tBar2->AddControl(new wxStaticText(tBar2, wxID_ANY, wxT(" Database ")));
m_comboBox = new wxComboBox(tBar2, ID_COMBO, wxT(""), wxDefaultPosition, wxSize(200,wxDefaultCoord) );
tBar2->AddControl(m_comboBox);
tBar2->Realize();
m_frameManager.AddPane(tBar2, wxPaneInfo().Name(wxT("Toolbar2")).Caption(wxT("ToolBar")).ToolbarPane() .Top().LeftDockable(false).RightDockable(false)
);


what shown on the toolbar is just first 2 character of the "Database".

Any way around this?

Thank you in advance. Hoping to experience the 'wow' of this great interface.


best regards,
Radzi.
Radzi
Registered User
 
Posts: 1
Joined: Wed Feb 08, 2006 3:46 am
Location: Singapore

Re: wxControl on Toolbar - How do I?

Postby abligh on Wed Feb 08, 2006 2:10 pm

Radzi wrote:Hi,
I'm trying to convert my application to use wxAUI. As a start, just trying with the toolbar. Stumbled upon the toolbar that contain wxComboBox. Code is as below:


Whilst it's probably possible to do this using a wxToolbar, I had lots of problems with them. Why not just create a wxPanel containing a wxBoxSizer of the orientation you want, and put your controls in that? Then wxAUI will make sure it docks correctly.

Alex
abligh
Registered User
 
Posts: 59
Joined: Sun Jan 01, 2006 2:31 pm

Postby Ben on Thu Feb 09, 2006 5:10 am

The problem is that the toolbar size measurement gets messed up with controls are added to it. As far as I know, this is wxToolBar's fault.

I, too, recommend that you try out a panel. We are working on a different toolbar solution internally. Maybe it will appear in one of the upcoming versions. :-)
User avatar
Ben
Kirix Support Team
 
Posts: 525
Joined: Mon Dec 19, 2005 6:29 am

Re: wxControl on Toolbar - How do I?

Postby EhLtUd on Tue Sep 15, 2009 3:26 am

I can't add wxFrame to Toolbar.
EhLtUd
Registered User
 
Posts: 4
Joined: Fri Sep 11, 2009 3:24 am

Return to wxAUI Questions, Thoughts & Feedback