From 002f42185d25472085d36a077d1428d71c781e5b Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Mon, 14 Jun 1999 14:51:25 +0000 Subject: [PATCH] The Unicode handling fixes my app seemed to need. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2786 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/app.cpp | 2 ++ src/gtk/checklst.cpp | 6 +++--- src/gtk/choice.cpp | 8 ++++---- src/gtk/listbox.cpp | 8 ++++---- src/gtk1/app.cpp | 2 ++ src/gtk1/checklst.cpp | 6 +++--- src/gtk1/choice.cpp | 8 ++++---- src/gtk1/listbox.cpp | 8 ++++---- 8 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/gtk/app.cpp b/src/gtk/app.cpp index 1af8165327..7f95b4c3ac 100644 --- a/src/gtk/app.cpp +++ b/src/gtk/app.cpp @@ -662,6 +662,8 @@ int wxEntry( int argc, char *argv[] ) { gtk_set_locale(); + if (!wxOKlibc()) wxConv_current = &wxConv_local; + gtk_init( &argc, &argv ); wxSetDetectableAutoRepeat( TRUE ); diff --git a/src/gtk/checklst.cpp b/src/gtk/checklst.cpp index 57bd258ee1..046020c6e0 100644 --- a/src/gtk/checklst.cpp +++ b/src/gtk/checklst.cpp @@ -50,9 +50,9 @@ bool wxCheckListBox::IsChecked( int index ) const GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = label->label; + wxString str = wxString(label->label,*wxConv_current); - return (str[1] == 'X'); + return (str[1] == _T('X')); } wxFAIL_MSG(_T("wrong checklistbox index")); @@ -69,7 +69,7 @@ void wxCheckListBox::Check( int index, bool check ) GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = label->label; + wxString str = wxString(label->label,*wxConv_current); if (check == (str[1] == _T('X'))) return; diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index f13d20eae3..742c29ecb7 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -251,7 +251,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,*wxConv_current)) return count; child = child->next; @@ -304,7 +304,7 @@ wxString wxChoice::GetString( int n ) const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - return label->label; + return wxString(label->label,*wxConv_current); } child = child->next; count++; @@ -312,7 +312,7 @@ wxString wxChoice::GetString( int n ) const wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); - return ""; + return _T(""); } wxString wxChoice::GetStringSelection() const @@ -323,7 +323,7 @@ wxString wxChoice::GetStringSelection() const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - return label->label; + return wxString(label->label,*wxConv_current); } int wxChoice::Number() const diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index d529cd1669..5fa2491aee 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -387,7 +387,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos) GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str(GET_REAL_LABEL(label->label)); + wxString str(GET_REAL_LABEL(label->label),*wxConvCurrent); deletedLabels.Add(str); // save data @@ -649,7 +649,7 @@ int wxListBox::FindString( const wxString &item ) const GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = GET_REAL_LABEL(label->label); + wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent); if (str == item) return count; @@ -718,7 +718,7 @@ wxString wxListBox::GetString( int n ) const GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = GET_REAL_LABEL(label->label); + wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent); return str; } @@ -738,7 +738,7 @@ wxString wxListBox::GetStringSelection() const GtkBin *bin = GTK_BIN( selection->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = GET_REAL_LABEL(label->label); + wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent); return str; } diff --git a/src/gtk1/app.cpp b/src/gtk1/app.cpp index 1af8165327..7f95b4c3ac 100644 --- a/src/gtk1/app.cpp +++ b/src/gtk1/app.cpp @@ -662,6 +662,8 @@ int wxEntry( int argc, char *argv[] ) { gtk_set_locale(); + if (!wxOKlibc()) wxConv_current = &wxConv_local; + gtk_init( &argc, &argv ); wxSetDetectableAutoRepeat( TRUE ); diff --git a/src/gtk1/checklst.cpp b/src/gtk1/checklst.cpp index 57bd258ee1..046020c6e0 100644 --- a/src/gtk1/checklst.cpp +++ b/src/gtk1/checklst.cpp @@ -50,9 +50,9 @@ bool wxCheckListBox::IsChecked( int index ) const GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = label->label; + wxString str = wxString(label->label,*wxConv_current); - return (str[1] == 'X'); + return (str[1] == _T('X')); } wxFAIL_MSG(_T("wrong checklistbox index")); @@ -69,7 +69,7 @@ void wxCheckListBox::Check( int index, bool check ) GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = label->label; + wxString str = wxString(label->label,*wxConv_current); if (check == (str[1] == _T('X'))) return; diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index f13d20eae3..742c29ecb7 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -251,7 +251,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,*wxConv_current)) return count; child = child->next; @@ -304,7 +304,7 @@ wxString wxChoice::GetString( int n ) const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - return label->label; + return wxString(label->label,*wxConv_current); } child = child->next; count++; @@ -312,7 +312,7 @@ wxString wxChoice::GetString( int n ) const wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); - return ""; + return _T(""); } wxString wxChoice::GetStringSelection() const @@ -323,7 +323,7 @@ wxString wxChoice::GetStringSelection() const wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); - return label->label; + return wxString(label->label,*wxConv_current); } int wxChoice::Number() const diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index d529cd1669..5fa2491aee 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -387,7 +387,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos) GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str(GET_REAL_LABEL(label->label)); + wxString str(GET_REAL_LABEL(label->label),*wxConvCurrent); deletedLabels.Add(str); // save data @@ -649,7 +649,7 @@ int wxListBox::FindString( const wxString &item ) const GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = GET_REAL_LABEL(label->label); + wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent); if (str == item) return count; @@ -718,7 +718,7 @@ wxString wxListBox::GetString( int n ) const GtkBin *bin = GTK_BIN( child->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = GET_REAL_LABEL(label->label); + wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent); return str; } @@ -738,7 +738,7 @@ wxString wxListBox::GetStringSelection() const GtkBin *bin = GTK_BIN( selection->data ); GtkLabel *label = GTK_LABEL( bin->child ); - wxString str = GET_REAL_LABEL(label->label); + wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent); return str; } -- 2.45.2