]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/menu.cpp
one more minor wxLogWindow fix (I try to get it really right...)
[wxWidgets.git] / src / gtk / menu.cpp
index 752968ab3f1051a6b915d7901ec24e747306f7dd..93bc49891bd0fb0c2430bd1c92e1d12193332d25 100644 (file)
@@ -15,6 +15,7 @@
 
 #include "wx/menu.h"
 #include "wx/log.h"
 
 #include "wx/menu.h"
 #include "wx/log.h"
+#include "wx/intl.h"
 
 //-----------------------------------------------------------------------------
 // wxMenuBar
 
 //-----------------------------------------------------------------------------
 // wxMenuBar
@@ -122,19 +123,31 @@ wxMenuItem* wxMenuBar::FindMenuItemById( int id ) const
   return result;
 }
 
   return result;
 }
 
-bool wxMenuBar::IsChecked( int id ) const
+void wxMenuBar::Check( int id, bool check )
+{
+  wxMenuItem* item = FindMenuItemById( id );
+  if (item) item->Check(check);
+};
+
+bool wxMenuBar::Checked( int id ) const
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsChecked();
   return FALSE;
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsChecked();
   return FALSE;
-}
+};
 
 
-bool wxMenuBar::IsEnabled( int id ) const
+void wxMenuBar::Enable( int id, bool enable )
+{
+  wxMenuItem* item = FindMenuItemById( id );
+  if (item) item->Enable(enable);
+};
+
+bool wxMenuBar::Enabled( int id ) const
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsEnabled();
   return FALSE;
 {
   wxMenuItem* item = FindMenuItemById( id );
   if (item) return item->IsEnabled();
   return FALSE;
-}
+};
 
 //-----------------------------------------------------------------------------
 // wxMenu
 
 //-----------------------------------------------------------------------------
 // wxMenu
@@ -171,6 +184,7 @@ wxMenuItem::wxMenuItem()
 
 void wxMenuItem::SetText(const wxString& str)
 {
 
 void wxMenuItem::SetText(const wxString& str)
 {
+  m_text = "";
   for ( const char *pc = str; *pc != '\0'; pc++ ) {
     if ( *pc == '&' )
       pc++; // skip it
   for ( const char *pc = str; *pc != '\0'; pc++ ) {
     if ( *pc == '&' )
       pc++; // skip it
@@ -181,7 +195,7 @@ void wxMenuItem::SetText(const wxString& str)
 
 void wxMenuItem::Check( bool check )
 {
 
 void wxMenuItem::Check( bool check )
 {
-  wxCHECK_RET( IsCheckable(), "can't check uncheckable item!" )
+  wxCHECK_RET( IsCheckable(), _("Can't check uncheckable item!") )
 
   m_isChecked = check;
   gtk_check_menu_item_set_state( (GtkCheckMenuItem*)m_menuItem, (gint)check );
 
   m_isChecked = check;
   gtk_check_menu_item_set_state( (GtkCheckMenuItem*)m_menuItem, (gint)check );
@@ -343,7 +357,7 @@ wxMenuItem *wxMenu::FindItem(int id) const
     node = node->Next();
   };
 
     node = node->Next();
   };
 
-  wxLogDebug("wxMenu::FindItem: item %d not found.", id);
+  wxLogDebug(_("wxMenu::FindItem: item %d not found."), id);
 
   return NULL;
 }
 
   return NULL;
 }