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
This commit is contained in:
Ove Kaaven
1999-06-14 14:51:25 +00:00
parent 627fe5e8ab
commit 002f42185d
8 changed files with 26 additions and 22 deletions

View File

@@ -662,6 +662,8 @@ int wxEntry( int argc, char *argv[] )
{ {
gtk_set_locale(); gtk_set_locale();
if (!wxOKlibc()) wxConv_current = &wxConv_local;
gtk_init( &argc, &argv ); gtk_init( &argc, &argv );
wxSetDetectableAutoRepeat( TRUE ); wxSetDetectableAutoRepeat( TRUE );

View File

@@ -50,9 +50,9 @@ bool wxCheckListBox::IsChecked( int index ) const
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); 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")); wxFAIL_MSG(_T("wrong checklistbox index"));
@@ -69,7 +69,7 @@ void wxCheckListBox::Check( int index, bool check )
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str = label->label; wxString str = wxString(label->label,*wxConv_current);
if (check == (str[1] == _T('X'))) return; if (check == (str[1] == _T('X'))) return;

View File

@@ -251,7 +251,7 @@ int wxChoice::FindString( const wxString &string ) const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
if (string == label->label) if (string == wxString(label->label,*wxConv_current))
return count; return count;
child = child->next; child = child->next;
@@ -304,7 +304,7 @@ wxString wxChoice::GetString( int n ) const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label; return wxString(label->label,*wxConv_current);
} }
child = child->next; child = child->next;
count++; count++;
@@ -312,7 +312,7 @@ wxString wxChoice::GetString( int n ) const
wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
return ""; return _T("");
} }
wxString wxChoice::GetStringSelection() const wxString wxChoice::GetStringSelection() const
@@ -323,7 +323,7 @@ wxString wxChoice::GetStringSelection() const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label; return wxString(label->label,*wxConv_current);
} }
int wxChoice::Number() const int wxChoice::Number() const

View File

@@ -387,7 +387,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str(GET_REAL_LABEL(label->label)); wxString str(GET_REAL_LABEL(label->label),*wxConvCurrent);
deletedLabels.Add(str); deletedLabels.Add(str);
// save data // save data
@@ -649,7 +649,7 @@ int wxListBox::FindString( const wxString &item ) const
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); 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) if (str == item)
return count; return count;
@@ -718,7 +718,7 @@ wxString wxListBox::GetString( int n ) const
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str = GET_REAL_LABEL(label->label); wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent);
return str; return str;
} }
@@ -738,7 +738,7 @@ wxString wxListBox::GetStringSelection() const
GtkBin *bin = GTK_BIN( selection->data ); GtkBin *bin = GTK_BIN( selection->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str = GET_REAL_LABEL(label->label); wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent);
return str; return str;
} }

View File

@@ -662,6 +662,8 @@ int wxEntry( int argc, char *argv[] )
{ {
gtk_set_locale(); gtk_set_locale();
if (!wxOKlibc()) wxConv_current = &wxConv_local;
gtk_init( &argc, &argv ); gtk_init( &argc, &argv );
wxSetDetectableAutoRepeat( TRUE ); wxSetDetectableAutoRepeat( TRUE );

View File

@@ -50,9 +50,9 @@ bool wxCheckListBox::IsChecked( int index ) const
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); 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")); wxFAIL_MSG(_T("wrong checklistbox index"));
@@ -69,7 +69,7 @@ void wxCheckListBox::Check( int index, bool check )
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str = label->label; wxString str = wxString(label->label,*wxConv_current);
if (check == (str[1] == _T('X'))) return; if (check == (str[1] == _T('X'))) return;

View File

@@ -251,7 +251,7 @@ int wxChoice::FindString( const wxString &string ) const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
if (string == label->label) if (string == wxString(label->label,*wxConv_current))
return count; return count;
child = child->next; child = child->next;
@@ -304,7 +304,7 @@ wxString wxChoice::GetString( int n ) const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label; return wxString(label->label,*wxConv_current);
} }
child = child->next; child = child->next;
count++; count++;
@@ -312,7 +312,7 @@ wxString wxChoice::GetString( int n ) const
wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
return ""; return _T("");
} }
wxString wxChoice::GetStringSelection() const wxString wxChoice::GetStringSelection() const
@@ -323,7 +323,7 @@ wxString wxChoice::GetStringSelection() const
wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label; return wxString(label->label,*wxConv_current);
} }
int wxChoice::Number() const int wxChoice::Number() const

View File

@@ -387,7 +387,7 @@ void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str(GET_REAL_LABEL(label->label)); wxString str(GET_REAL_LABEL(label->label),*wxConvCurrent);
deletedLabels.Add(str); deletedLabels.Add(str);
// save data // save data
@@ -649,7 +649,7 @@ int wxListBox::FindString( const wxString &item ) const
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); 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) if (str == item)
return count; return count;
@@ -718,7 +718,7 @@ wxString wxListBox::GetString( int n ) const
GtkBin *bin = GTK_BIN( child->data ); GtkBin *bin = GTK_BIN( child->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str = GET_REAL_LABEL(label->label); wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent);
return str; return str;
} }
@@ -738,7 +738,7 @@ wxString wxListBox::GetStringSelection() const
GtkBin *bin = GTK_BIN( selection->data ); GtkBin *bin = GTK_BIN( selection->data );
GtkLabel *label = GTK_LABEL( bin->child ); GtkLabel *label = GTK_LABEL( bin->child );
wxString str = GET_REAL_LABEL(label->label); wxString str = wxString(GET_REAL_LABEL(label->label),*wxConvCurrent);
return str; return str;
} }