Added menu_highlight behaviour as in wxMSW (statusbar)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
1999-02-05 13:25:40 +00:00
parent 341c92a8b4
commit 342b6a2fe4
10 changed files with 115 additions and 45 deletions

View File

@@ -105,6 +105,7 @@ static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventC
BEGIN_EVENT_TABLE(wxFrame, wxWindow)
EVT_SIZE(wxFrame::OnSize)
EVT_CLOSE(wxFrame::OnCloseWindow)
EVT_MENU_HIGHLIGHT_ALL(wxFrame::OnMenuHighlight)
END_EVENT_TABLE()
IMPLEMENT_DYNAMIC_CLASS(wxFrame,wxWindow)
@@ -564,6 +565,29 @@ wxMenuBar *wxFrame::GetMenuBar() const
return m_frameMenuBar;
}
void wxFrame::OnMenuHighlight(wxMenuEvent& event)
{
if (GetStatusBar())
{
if (event.GetMenuId() == -1)
{
SetStatusText("");
}
else
{
wxMenuBar *menuBar = GetMenuBar();
if (menuBar)
{
int menuId = event.GetMenuId();
wxString helpString;
helpString = menuBar->GetHelpString(menuId);
if (helpString != "")
SetStatusText(helpString);
}
}
}
}
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );