gtk_check_menu_item_set_state( (GtkCheckMenuItem*)m_menuItem, (gint)check );
}
+void wxMenuItem::Enable( bool enable )
+{
+ gtk_widget_set_sensitive( m_menuItem, enable );
+ m_isEnabled = enable;
+}
+
bool wxMenuItem::IsChecked() const
{
wxCHECK( IsCheckable(), FALSE ); // can't get state of uncheckable item!
}
}
+void wxMenu::SetTitle( const wxString& title )
+{
+ // Waiting for something better.
+ m_title = title;
+}
+
+const wxString wxMenu::GetTitle() const
+{
+ return m_title;
+}
+
void wxMenu::AppendSeparator()
{
wxMenuItem *mitem = new wxMenuItem();
wxMenuItem *mitem = new wxMenuItem();
mitem->SetId(id);
mitem->SetText(item);
- mitem->SetHelpString(helpStr);
+ mitem->SetHelp(helpStr);
mitem->SetCheckable(checkable);
const char *text = mitem->GetText();
GtkWidget *menuItem = checkable ? gtk_check_menu_item_new_with_label(text)
: gtk_menu_item_new_with_label(text);
+
mitem->SetMenuItem(menuItem);
gtk_signal_connect( GTK_OBJECT(menuItem), "activate",
mitem->SetText(text);
GtkWidget *menuItem = gtk_menu_item_new_with_label(mitem->GetText());
- mitem->SetHelpString(helpStr);
+ mitem->SetHelp(helpStr);
mitem->SetMenuItem(menuItem);
mitem->SetSubMenu(subMenu);
void wxMenu::SetLabel( int id, const wxString &label )
{
wxMenuItem *item = FindItem(id);
- if ( item )
+ if (item)
item->SetText(label);
}
+wxString wxMenu::GetLabel( int id ) const
+{
+ wxMenuItem *item = FindItem(id);
+ if (item) return item->GetText();
+ return "";
+}
+
+void wxMenu::SetHelpString( int id, const wxString& helpString )
+{
+ wxMenuItem *item = FindItem(id);
+ if (item) item->SetHelp( helpString );
+}
+
+wxString wxMenu::GetHelpString( int id ) const
+{
+ wxMenuItem *item = FindItem(id);
+ if (item) return item->GetHelp();
+ return "";
+}
+
int wxMenu::FindMenuIdByMenuItem( GtkWidget *menuItem ) const
{
wxNode *node = m_items.First();