]> git.saurik.com Git - wxWidgets.git/commitdiff
compilation fixes for wxUSE_ACCEL=0
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 11 Nov 2007 13:08:13 +0000 (13:08 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 11 Nov 2007 13:08:13 +0000 (13:08 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49830 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/frame.cpp
src/gtk/menu.cpp

index dfec0ddbaad3d504619a1295d51b329804197e31..3c1c9f91c3c2eec1f618c51d47f9db56c486c2d1 100644 (file)
@@ -110,7 +110,7 @@ void wxFrame::DoGetClientSize( int *width, int *height ) const
         *height = 0;
 }
 
-#if wxUSE_MENUS
+#if wxUSE_MENUS && wxUSE_ACCEL
 // Helper for wxCreateAcceleratorTableForMenuBar
 static void wxAddAccelerators(wxList& accelEntries, wxMenu* menu)
 {
@@ -166,21 +166,21 @@ static wxAcceleratorTable wxCreateAcceleratorTableForMenuBar(wxMenuBar* menuBar)
 
     return table;
 }
-#endif
+#endif // wxUSE_MENUS && wxUSE_ACCEL
 
 bool wxFrame::ShowFullScreen(bool show, long style)
 {
     if (!wxFrameBase::ShowFullScreen(show, style))
         return false;
 
-#if wxUSE_MENUS
+#if wxUSE_MENUS && wxUSE_ACCEL
     if (show && GetMenuBar())
     {
         wxAcceleratorTable table(wxCreateAcceleratorTableForMenuBar(GetMenuBar()));
         if (table.IsOk())
             SetAcceleratorTable(table);
     }
-#endif
+#endif // wxUSE_MENUS && wxUSE_ACCEL
 
     wxWindow* const bar[] = {
 #if wxUSE_MENUS
index aa3174cc8a3a04a329e3482d01cbaab9550c97d9..bfea8d89999b04a2b7521d4e4b313e9095f0423d 100644 (file)
@@ -798,11 +798,14 @@ void wxMenuItem::SetItemLabel( const wxString& str )
     oldLabel = wxStripMenuCodes(oldLabel);
     oldLabel.Replace(wxT("_"), wxT(""));
     wxString label1 = wxStripMenuCodes(str);
+#if wxUSE_ACCEL
     wxString oldhotkey = GetHotKey();    // Store the old hotkey in Ctrl-foo format
     wxCharBuffer oldbuf = wxGTK_CONV_SYS( GetGtkHotKey(*this) );  // and as <control>foo
+#endif // wxUSE_ACCEL
 
     DoSetText(str);
 
+#if wxUSE_ACCEL
     if (oldLabel == label1 &&
         oldhotkey == GetHotKey())    // Make sure we can change a hotkey even if the label is unaltered
         return;
@@ -877,6 +880,7 @@ void wxMenuItem::SetItemLabel( const wxString& str )
                                            accel_key,
                                            accel_mods );
     }
+#endif // wxUSE_FILECTRL
 }
 
 // NOTE: this function is different from the similar functions GTKProcessMnemonics()
@@ -1179,11 +1183,11 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
 
     }
 
+#if wxUSE_ACCEL
     guint accel_key;
     GdkModifierType accel_mods;
     wxCharBuffer buf = wxGTK_CONV_SYS( GetGtkHotKey(*mitem) );
 
-    // wxPrintf( wxT("item: %s hotkey %s\n"), mitem->GetItemLabel().c_str(), GetGtkHotKey(*mitem).c_str() );
     if (buf[(size_t)0] != '\0')
     {
         gtk_accelerator_parse( (const char*) buf, &accel_key, &accel_mods);
@@ -1208,6 +1212,7 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
                                         accel_mods,
                                         GTK_ACCEL_VISIBLE);
     }
+#endif // wxUSE_FILECTRL
 
     if (pos == -1)
         gtk_menu_shell_append(GTK_MENU_SHELL(m_menu), menuItem);