merged 2.2 branch

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@7748 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Bryan Petty
2000-07-15 19:51:35 +00:00
parent 8a693e6e04
commit f6bcfd974e
1835 changed files with 237729 additions and 67990 deletions

View File

@@ -284,29 +284,7 @@ void wxFrameBase::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
void wxFrameBase::OnMenuHighlight(wxMenuEvent& event)
{
#if wxUSE_STATUSBAR
if ( GetStatusBar() )
{
// if no help string found, we will clear the status bar text
wxString helpString;
int menuId = event.GetMenuId();
if ( menuId != wxID_SEPARATOR && menuId != -2 /* wxID_TITLE */ )
{
wxMenuBar *menuBar = GetMenuBar();
if ( menuBar )
{
// it's ok if we don't find the item because it might belong
// to the popup menu
wxMenuItem *item = menuBar->FindItem(menuId);
if ( item )
helpString = item->GetHelp();
}
}
// set status text even if the string is empty - this will at least
// remove the string from the item which was previously selected
SetStatusText(helpString);
}
(void)ShowMenuHelp(GetStatusBar(), event.GetMenuId());
#endif // wxUSE_STATUSBAR
}
@@ -372,6 +350,34 @@ void wxFrameBase::SetStatusWidths(int n, const int widths_field[] )
PositionStatusBar();
}
bool wxFrameBase::ShowMenuHelp(wxStatusBar *statbar, int menuId)
{
if ( !statbar )
return FALSE;
// if no help string found, we will clear the status bar text
wxString helpString;
if ( menuId != wxID_SEPARATOR && menuId != -2 /* wxID_TITLE */ )
{
wxMenuBar *menuBar = GetMenuBar();
if ( menuBar )
{
// it's ok if we don't find the item because it might belong
// to the popup menu
wxMenuItem *item = menuBar->FindItem(menuId);
if ( item )
helpString = item->GetHelp();
}
}
// set status text even if the string is empty - this will at least
// remove the string from the item which was previously selected
statbar->SetStatusText(helpString);
return !helpString.IsEmpty();
}
#endif // wxUSE_STATUSBAR
// ----------------------------------------------------------------------------