wxAUI with Doc/View MDI add toolbar to wxchildframe problem
yk wen
ykwen2006 at gmail.com
Sat Feb 3 01:49:14 PST 2007
hi,
I've a question to Implementation of the MDI windows with wxAuiManager. I've
to create a MDI application using wxWidgets 2.8 , Add wxAuiManager to
wxDocParentFrame for manage the main frame layout, and the child frame of
this application have its own toolbar . when I add toolbar to the
wxDocMDIChildFrame,
the toolbar does not show right.
I would be very grateful , thanks
wxWidgets:
wxMDIChildFrame * GUIApp::CreateChildFrame(wxDocument *pdoc, wxView *pview)
{
//// Make a child frame
GUIChildFrame *psubframe =3D
new GUIChildFrame(pdoc, pview, m_pframe, wxID_ANY, _T("Child Frame"),
wxPoint(10, 10), wxSize(300, 300),
wxDEFAULT_FRAME_STYLE |
wxNO_FULL_REPAINT_ON_RESIZE);
wxToolBar* tb1 =3D new wxToolBar(psubframe, wxID_ANY, wxDefaultPosition,
wxDefaultSize,
wxTB_FLAT | wxTB_NODIVIDER);
tb1->SetToolBitmapSize(wxSize(16,16));
wxBitmap tb1_bmp1 =3D wxArtProvider::GetBitmap(wxART_QUESTION, wxART_OTHER,
wxSize(16,16));
//tb1->AddTool(ID_REG_EMPLOY, wxT("Test"), tb1_bmp1);
tb1->AddTool(101, wxT("Test"), tb1_bmp1);
tb1->AddTool(101, wxT("Test"), tb1_bmp1);
tb1->AddTool(101, wxT("Test"), tb1_bmp1);
tb1->AddSeparator();
tb1->AddTool(101, wxT("Test"), tb1_bmp1);
tb1->AddTool(101, wxT("Test"), tb1_bmp1);
tb1->AddSeparator();
wxString choices[] =3D
{
wxT("50%"),
wxT("100%"),
wxT("200%")
};
tb1->AddControl(new
wxComboBox(tb1,wxID_ANY,wxT("50%"),wxDefaultPosition,wxDefaultSize,3,choice=
s));
tb1->Realize();
//////////////////////////////////////////////////////////////////////////
return psubframe;
}
////////////////////////////////////////////////////////
class GUIChildFrame : public wxDocMDIChildFrame
{
public:
GUIChildFrame(wxDocument* doc, wxView* view, wxMDIParentFrame* parent,
wxWindowID id, const wxString& title,
const wxPoint& pos =3D wxDefaultPosition,
const wxSize& size =3D wxDefaultSize,
long style =3D wxDEFAULT_FRAME_STYLE);
~GUIChildFrame();
void OnSize(wxSizeEvent& event);
protected:
DECLARE_CLASS( GUIChildFrame )
DECLARE_EVENT_TABLE()
};
scott wen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wxwidgets.org/pipermail/wx-dev/attachments/20070203/254a9=
5f9/attachment.htm
More information about the wx-dev
mailing list