]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/frame.cpp
allow a - at the beginning of a menu item (would become a separator by default)
[wxWidgets.git] / src / msw / frame.cpp
index fd160920d6644d43240bb8c506fee7fe1516e0bf..e8890f42f2e7e629b5abac75da4f95a465f0f48f 100644 (file)
@@ -190,11 +190,15 @@ bool wxFrame::Create(wxWindow *parent,
                      const wxString& name)
 {
     if ( !wxTopLevelWindow::Create(parent, id, title, pos, size, style, name) )
-        return FALSE;
+        return false;
 
     SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_APPWORKSPACE));
 
-    return TRUE;
+#ifdef __SMARTPHONE__
+    SetLeftMenu(wxID_EXIT, _("Done"));
+#endif
+
+    return true;
 }
 
 wxFrame::~wxFrame()
@@ -319,17 +323,29 @@ void wxFrame::PositionStatusBar()
 void wxFrame::AttachMenuBar(wxMenuBar *menubar)
 {
 #if defined(__SMARTPHONE__)
-    wxMenu *autoMenu = new wxMenu;
 
-    for( size_t n = 0; n < menubar->GetMenuCount(); n++ )
+    wxMenu *autoMenu = NULL;
+
+    if( menubar->GetMenuCount() == 1 )
+    {
+        autoMenu = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(menubar->GetMenu(0));
+        SetRightMenu(wxID_ANY, menubar->GetLabelTop(0), autoMenu);
+    }
+    else
     {
-        wxMenu *item = menubar->GetMenu(n);
-        wxString label = menubar->GetLabelTop(n);
-        wxMenu *new_item = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(item);
-        autoMenu->Append(wxID_ANY, label, new_item);
+        autoMenu = new wxMenu;
+
+        for( size_t n = 0; n < menubar->GetMenuCount(); n++ )
+        {
+            wxMenu *item = menubar->GetMenu(n);
+            wxString label = menubar->GetLabelTop(n);
+            wxMenu *new_item = wxTopLevelWindowMSW::ButtonMenu::DuplicateMenu(item);
+            autoMenu->Append(wxID_ANY, label, new_item);
+        }
+
+        SetRightMenu(wxID_ANY, _("Menu"), autoMenu);
     }
 
-    SetRightMenu(wxID_ANY, _("Menu"), autoMenu);
 #elif defined(WINCE_WITHOUT_COMMANDBAR)
     if (!GetToolBar())
     {