+#if wxUSE_TOOLBAR
+
+wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
+{
+ if ( wxFrameBase::CreateToolBar(style, id, name) )
+ {
+ PositionToolBar();
+ }
+
+ return m_frameToolBar;
+}
+
+void wxFrame::PositionToolBar()
+{
+ if ( m_frameToolBar )
+ {
+ wxSize size = GetClientSize();
+ int tw, th, tx, ty;
+
+ tx = ty = 0;
+ m_frameToolBar->GetSize(&tw, &th);
+ if ( m_frameToolBar->GetWindowStyleFlag() & wxTB_VERTICAL )
+ {
+ tx = -tw;
+ th = size.y;
+ }
+ else
+ {
+ ty = -th;
+ tw = size.x;
+ }
+
+ m_frameToolBar->SetSize(tx, ty, tw, th);
+ }
+}
+#endif // wxUSE_TOOLBAR
+