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:
@@ -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" );
|
||||
|
Reference in New Issue
Block a user