return pt;
}
+
+void wxFrameBase::SendSizeEvent()
+{
+ wxSizeEvent event( GetSize(), GetId() );
+ event.SetEventObject( this );
+ GetEventHandler()->AddPendingEvent( event );
+}
+
+
// ----------------------------------------------------------------------------
// misc
// ----------------------------------------------------------------------------
if (!item->IsEnabled())
return true;
+ if ((item->GetKind() == wxITEM_RADIO) && item->IsChecked() )
+ return true;
+
if (item->IsCheckable())
{
item->Toggle();
void wxFrameBase::OnMenuClose(wxMenuEvent& WXUNUSED(event))
{
// do we have real status text to restore?
- if ( m_oldStatusText.length() > 1 || m_oldStatusText[0u] )
+ if ( !m_oldStatusText.empty() )
{
if ( m_statusBarPane >= 0 )
{
wxCHECK_MSG( !m_frameStatusBar, (wxStatusBar *)NULL,
wxT("recreating status bar in wxFrame") );
- m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
- if ( m_frameStatusBar )
- PositionStatusBar();
+ SetStatusBar(OnCreateStatusBar(number, style, id, name));
return m_frameStatusBar;
}
DoGiveHelp(helpString, show);
- return !helpString.IsEmpty();
+ return !helpString.empty();
#else // !wxUSE_MENUS
return false;
#endif // wxUSE_MENUS/!wxUSE_MENUS
}
+void wxFrameBase::SetStatusBar(wxStatusBar *statBar)
+{
+ bool hadBar = m_frameStatusBar != NULL;
+ m_frameStatusBar = statBar;
+
+ if ( (m_frameStatusBar != NULL) != hadBar )
+ {
+ PositionStatusBar();
+
+ DoLayout();
+ }
+}
+
#endif // wxUSE_STATUSBAR
void wxFrameBase::DoGiveHelp(const wxString& text, bool show)
style = wxBORDER_NONE | wxTB_HORIZONTAL | wxTB_FLAT;
}
- m_frameToolBar = OnCreateToolBar(style, id, name);
+ SetToolBar(OnCreateToolBar(style, id, name));
return m_frameToolBar;
}
wxWindowID id,
const wxString& name)
{
+#if defined(__WXWINCE__) && defined(__POCKETPC__)
+ return new wxToolMenuBar(this, id,
+ wxDefaultPosition, wxDefaultSize,
+ style, name);
+#else
return new wxToolBar(this, id,
wxDefaultPosition, wxDefaultSize,
style, name);
+#endif
+}
+
+void wxFrameBase::SetToolBar(wxToolBar *toolbar)
+{
+ bool hadBar = m_frameToolBar != NULL;
+ m_frameToolBar = toolbar;
+
+ if ( (m_frameToolBar != NULL) != hadBar )
+ {
+ PositionToolBar();
+
+ DoLayout();
+ }
}
#endif // wxUSE_TOOLBAR
}
#endif // wxUSE_MENUS
+
+#if WXWIN_COMPATIBILITY_2_2
+
+bool wxFrameBase::Command(int winid)
+{
+ return ProcessCommand(winid);
+}
+
+#endif // WXWIN_COMPATIBILITY_2_2