]> git.saurik.com Git - wxWidgets.git/blobdiff - samples/menu/menu.cpp
COmpilation fix.
[wxWidgets.git] / samples / menu / menu.cpp
index ebe58946daf60cff976d38680ff29730f94da4d9..8f7118d094f7e5e6f780639dd6c9c137ca6aaad5 100644 (file)
@@ -94,7 +94,7 @@ protected:
     void OnTestCheck(wxCommandEvent& event);
     void OnTestRadio(wxCommandEvent& event);
 
     void OnTestCheck(wxCommandEvent& event);
     void OnTestRadio(wxCommandEvent& event);
 
-#ifdef __WXMSW__
+#if defined( __WXMSW__ ) || defined( __WXMAC__ )
     void OnContextMenu(wxContextMenuEvent& event)
         { ShowContextMenu(ScreenToClient(event.GetPosition())); }
 #else
     void OnContextMenu(wxContextMenuEvent& event)
         { ShowContextMenu(ScreenToClient(event.GetPosition())); }
 #else
@@ -244,7 +244,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
 
     EVT_UPDATE_UI(Menu_Menu_Check, MyFrame::OnUpdateCheckMenuItemUI)
 
 
     EVT_UPDATE_UI(Menu_Menu_Check, MyFrame::OnUpdateCheckMenuItemUI)
 
-#ifdef __WXMSW__
+#if defined( __WXMSW__ ) || defined( __WXMAC__ )
     EVT_CONTEXT_MENU(MyFrame::OnContextMenu)
 #else
     EVT_RIGHT_UP(MyFrame::OnRightUp)
     EVT_CONTEXT_MENU(MyFrame::OnContextMenu)
 #else
     EVT_RIGHT_UP(MyFrame::OnRightUp)
@@ -584,7 +584,7 @@ void MyFrame::OnFindMenu(wxCommandEvent& WXUNUSED(event))
                      (
                         _T("Enter label to search for: "),
                         _T("Find menu"),
                      (
                         _T("Enter label to search for: "),
                         _T("Find menu"),
-                        "",
+                        _T(""),
                         this
                      );
 
                         this
                      );
 
@@ -622,7 +622,7 @@ void MyFrame::OnAppendSubMenu(wxCommandEvent& WXUNUSED(event))
 {
     wxMenuBar *menubar = GetMenuBar();
 
 {
     wxMenuBar *menubar = GetMenuBar();
 
-    wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 1);
+    wxMenu *menu = menubar->GetMenu(menubar->GetMenuCount() - 2);
 
     menu->Append(Menu_Dummy_Last, _T("&Dummy sub menu"),
                  CreateDummyMenu(NULL), _T("Dummy sub menu help"));
 
     menu->Append(Menu_Dummy_Last, _T("&Dummy sub menu"),
                  CreateDummyMenu(NULL), _T("Dummy sub menu help"));
@@ -798,7 +798,7 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event))
                      (
                         _T("Enter label to search for: "),
                         _T("Find menu item"),
                      (
                         _T("Enter label to search for: "),
                         _T("Find menu item"),
-                        "",
+                        _T(""),
                         this
                      );
 
                         this
                      );
 
@@ -817,8 +817,8 @@ void MyFrame::OnFindMenuItem(wxCommandEvent& WXUNUSED(event))
         }
         else
         {
         }
         else
         {
-            wxLogMessage(wxT("Menu item %d in menu %d has label '%s'"),
-                         index, menuindex, label.c_str());
+            wxLogMessage(wxT("Menu item %d in menu %lu has label '%s'"),
+                         index, (unsigned long)menuindex, label.c_str());
         }
     }
 }
         }
     }
 }