X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/acfd422afac254f4356904275656c0c15685fa1e..a533f5c122c27b44a80b4eef2bd907a44bec8b70:/src/gtk1/choice.cpp diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index 41ef1aba6f..bd63c5e3f8 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -14,6 +14,8 @@ #include "wx/choice.h" +#if wxUSE_CHOICE + #include "gdk/gdk.h" #include "gtk/gtk.h" @@ -38,7 +40,7 @@ static void gtk_choice_clicked_callback( GtkWidget *WXUNUSED(widget), wxChoice * { if (g_isIdle) wxapp_install_idle_handler(); - if (!choice->HasVMT()) return; + if (!choice->m_hasVMT) return; if (g_blockEventsOnDrag) return; @@ -71,7 +73,9 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, PreCreation( parent, id, pos, size, style, name ); +#if wxUSE_VALIDATORS SetValidator( validator ); +#endif m_widget = gtk_option_menu_new(); @@ -99,9 +103,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, } gtk_option_menu_set_menu( GTK_OPTION_MENU(m_widget), menu ); - m_parent->AddChild( this ); - - (m_parent->m_insertCallback)( m_parent, this ); + m_parent->DoAddChild( this ); PostCreation(); @@ -253,7 +255,7 @@ int wxChoice::FindString( const wxString &string ) const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - if (string == label->label) + if (string == wxString(label->label,*wxConvCurrent)) return count; child = child->next; @@ -306,7 +308,7 @@ wxString wxChoice::GetString( int n ) const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - return label->label; + return wxString(label->label,*wxConvCurrent); } child = child->next; count++; @@ -314,7 +316,7 @@ wxString wxChoice::GetString( int n ) const wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); - return ""; + return _T(""); } wxString wxChoice::GetStringSelection() const @@ -325,7 +327,7 @@ wxString wxChoice::GetStringSelection() const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - return label->label; + return wxString(label->label,*wxConvCurrent); } int wxChoice::Number() const @@ -390,3 +392,4 @@ void wxChoice::ApplyWidgetStyle() } } +#endif