if( menubar->GetMenuCount() == 1 )
{
autoMenu = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(menubar->GetMenu(0));
- SetRightMenu(wxID_ANY, menubar->GetLabelTop(0), autoMenu);
+ SetRightMenu(wxID_ANY, menubar->GetMenuLabel(0), autoMenu);
}
else
{
for( size_t n = 0; n < menubar->GetMenuCount(); n++ )
{
wxMenu *item = menubar->GetMenu(n);
- wxString label = menubar->GetLabelTop(n);
+ wxString label = menubar->GetMenuLabel(n);
wxMenu *new_item = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(item);
autoMenu->Append(wxID_ANY, label, new_item);
}
}
#endif // wxUSE_TOOLBAR
+#if wxUSE_MENUS
if (m_fsStyle & wxFULLSCREEN_NOMENUBAR)
{
WXHMENU menu = m_hMenu;
::SetMenu(GetHwnd(), (HMENU)menu);
}
}
+#endif // wxUSE_MENUS
#if wxUSE_STATUSBAR
wxStatusBar *theStatusBar = GetStatusBar();
void wxFrame::PositionToolBar()
{
- int x = 0, y = 0;
+ // TODO: we want to do something different in WinCE, because the toolbar
+ // should be associated with the commandbar, instead of being
+ // independent window.
+#if !defined(WINCE_WITHOUT_COMMANDBAR)
wxToolBar *toolbar = GetToolBar();
if ( toolbar && toolbar->IsShown() )
{
-#if defined(WINCE_WITHOUT_COMMANDBAR)
- // We want to do something different in WinCE, because
- // the toolbar should be associated with the commandbar,
- // and not an independent window.
- // TODO
-#else
// don't call our (or even wxTopLevelWindow) version because we want
// the real (full) client area size, not excluding the tool/status bar
int width, height;
toolbar->GetPosition( &tx, &ty );
toolbar->GetSize( &tw, &th );
+ int x = 0, y = 0;
if ( toolbar->HasFlag(wxTB_BOTTOM) )
{
x = 0;
if (tx != 0 || ty != 0 || widthChanging || heightChanging)
toolbar->SetSize(x, y, desiredW, desiredH, wxSIZE_NO_ADJUSTMENTS);
-#endif // __WXWINCE__
}
+#endif // !WINCE_WITH_COMMANDBAR
}
#endif // wxUSE_TOOLBAR
return false;
}
+#if wxUSE_MENUS
+
bool wxFrame::HandleMenuSelect(WXWORD nItem, WXWORD flags, WXHMENU hMenu)
{
int item;
// items opening popup menus (they don't have them anyhow) but do clear
// the status line - otherwise, we would be left with the help message
// for the previous item which doesn't apply any more
- DoGiveHelp(wxEmptyString, false);
+ DoGiveHelp(wxEmptyString, true);
return false;
}
return GetEventHandler()->ProcessEvent(event);
}
+bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu)
+{
+ wxMenu* menu = NULL;
+ if (GetMenuBar())
+ {
+ int nCount = GetMenuBar()->GetMenuCount();
+ for (int n = 0; n < nCount; n++)
+ {
+ if (GetMenuBar()->GetMenu(n)->GetHMenu() == hMenu)
+ {
+ menu = GetMenuBar()->GetMenu(n);
+ break;
+ }
+ }
+ }
+
+ wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu);
+ event.SetEventObject(this);
+
+ return GetEventHandler()->ProcessEvent(event);
+}
+
+#endif // wxUSE_MENUS
+
// ---------------------------------------------------------------------------
// the window proc for wxFrame
// ---------------------------------------------------------------------------
processed = HandlePaint();
break;
+#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
+#if wxUSE_MENUS
case WM_INITMENUPOPUP:
processed = HandleInitMenuPopup((WXHMENU) wParam);
break;
-#if !defined(__WXMICROWIN__) && !defined(__WXWINCE__)
case WM_MENUSELECT:
{
WXWORD item, flags;
case WM_EXITMENULOOP:
processed = HandleMenuLoop(wxEVT_MENU_CLOSE, (WXWORD)wParam);
break;
+#endif // wxUSE_MENUS
case WM_QUERYDRAGICON:
{
return rc;
}
-// handle WM_INITMENUPOPUP message
-bool wxFrame::HandleInitMenuPopup(WXHMENU hMenu)
-{
- wxMenu* menu = NULL;
- if (GetMenuBar())
- {
- int nCount = GetMenuBar()->GetMenuCount();
- for (int n = 0; n < nCount; n++)
- {
- if (GetMenuBar()->GetMenu(n)->GetHMenu() == hMenu)
- {
- menu = GetMenuBar()->GetMenu(n);
- break;
- }
- }
- }
-
- wxMenuEvent event(wxEVT_MENU_OPEN, 0, menu);
- event.SetEventObject(this);
-
- return GetEventHandler()->ProcessEvent(event);
-}
-
// ----------------------------------------------------------------------------
// wxFrame size management: we exclude the areas taken by menu/status/toolbars
// from the client area, so the client area is what's really available for the