From 93c5dd39af2fb5eb12c5c837999be944543b21b0 Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Wed, 14 Apr 1999 21:53:47 +0000 Subject: [PATCH] These at least compiles in Unicode mode... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/checklst.cpp | 16 ++++----- src/gtk/choice.cpp | 42 +++++++++++------------ src/gtk/clipbrd.cpp | 33 ++++++++++-------- src/gtk/colour.cpp | 16 ++++----- src/gtk/combobox.cpp | 65 ++++++++++++++++++------------------ src/gtk/cursor.cpp | 8 ++--- src/gtk/data.cpp | 72 +++++++++++++++++++-------------------- src/gtk/dataobj.cpp | 14 ++++---- src/gtk/dcclient.cpp | 78 +++++++++++++++++++++---------------------- src/gtk/dnd.cpp | 16 ++++----- src/gtk1/checklst.cpp | 16 ++++----- src/gtk1/choice.cpp | 42 +++++++++++------------ src/gtk1/clipbrd.cpp | 33 ++++++++++-------- src/gtk1/colour.cpp | 16 ++++----- src/gtk1/combobox.cpp | 65 ++++++++++++++++++------------------ src/gtk1/cursor.cpp | 8 ++--- src/gtk1/data.cpp | 72 +++++++++++++++++++-------------------- src/gtk1/dataobj.cpp | 14 ++++---- src/gtk1/dcclient.cpp | 78 +++++++++++++++++++++---------------------- src/gtk1/dnd.cpp | 16 ++++----- 20 files changed, 364 insertions(+), 356 deletions(-) diff --git a/src/gtk/checklst.cpp b/src/gtk/checklst.cpp index e47e7bd805..fc439b68de 100644 --- a/src/gtk/checklst.cpp +++ b/src/gtk/checklst.cpp @@ -43,7 +43,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, bool wxCheckListBox::IsChecked( int index ) const { - wxCHECK_MSG( m_list != NULL, FALSE, "invalid checklistbox" ); + wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -56,13 +56,13 @@ bool wxCheckListBox::IsChecked( int index ) const return (str[1] == 'X'); } - wxFAIL_MSG("wrong checklistbox index"); + wxFAIL_MSG(_T("wrong checklistbox index")); return FALSE; } void wxCheckListBox::Check( int index, bool check ) { - wxCHECK_RET( m_list != NULL, "invalid checklistbox" ); + wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -72,19 +72,19 @@ void wxCheckListBox::Check( int index, bool check ) wxString str = label->label; - if (check == (str[1] == 'X')) return; + if (check == (str[1] == _T('X'))) return; if (check) - str.SetChar( 1, 'X' ); + str.SetChar( 1, _T('X') ); else - str.SetChar( 1, '-' ); + str.SetChar( 1, _T('-') ); - gtk_label_set( label, str ); + gtk_label_set( label, str.mbc_str() ); return; } - wxFAIL_MSG("wrong checklistbox index"); + wxFAIL_MSG(_T("wrong checklistbox index")); } int wxCheckListBox::GetItemHeight() const diff --git a/src/gtk/choice.cpp b/src/gtk/choice.cpp index 248123389a..2c1d4c702c 100644 --- a/src/gtk/choice.cpp +++ b/src/gtk/choice.cpp @@ -82,7 +82,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, m_clientDataList.Append( (wxObject*) NULL ); m_clientObjectList.Append( (wxObject*) NULL ); - GtkWidget *item = gtk_menu_item_new_with_label( choices[i] ); + GtkWidget *item = gtk_menu_item_new_with_label( choices[i].mbc_str() ); gtk_menu_append( GTK_MENU(menu), item ); gtk_widget_realize( item ); @@ -117,10 +117,10 @@ wxChoice::~wxChoice() void wxChoice::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ); - GtkWidget *menu_item = gtk_menu_item_new_with_label( item ); + GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() ); gtk_menu_append( GTK_MENU(menu), menu_item ); @@ -161,7 +161,7 @@ void wxChoice::Append( const wxString &item, wxClientData *clientData ) void wxChoice::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -171,7 +171,7 @@ void wxChoice::SetClientData( int n, void* clientData ) void* wxChoice::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -181,7 +181,7 @@ void* wxChoice::GetClientData( int n ) void wxChoice::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -194,7 +194,7 @@ void wxChoice::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxChoice::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -204,7 +204,7 @@ wxClientData* wxChoice::GetClientObject( int n ) void wxChoice::Clear() { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) ); GtkWidget *menu = gtk_menu_new(); @@ -224,12 +224,12 @@ void wxChoice::Clear() void wxChoice::Delete( int WXUNUSED(n) ) { - wxFAIL_MSG( "wxChoice:Delete not implemented" ); + wxFAIL_MSG( _T("wxChoice:Delete not implemented") ); } int wxChoice::FindString( const wxString &string ) const { - wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); // If you read this code once and you think you understand // it, then you are very wrong. Robert Roebling. @@ -244,7 +244,7 @@ int wxChoice::FindString( const wxString &string ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , "wxChoice: invalid label" ); + wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); if (string == label->label) return count; @@ -263,7 +263,7 @@ int wxChoice::GetColumns() const int wxChoice::GetSelection() { - wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -276,14 +276,14 @@ int wxChoice::GetSelection() count++; } - wxFAIL_MSG( "wxChoice: no selection" ); + wxFAIL_MSG( _T("wxChoice: no selection") ); return -1; } wxString wxChoice::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, "", "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -297,7 +297,7 @@ wxString wxChoice::GetString( int n ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , "wxChoice: invalid label" ); + wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); return label->label; } @@ -305,25 +305,25 @@ wxString wxChoice::GetString( int n ) const count++; } - wxFAIL_MSG( "wxChoice: invalid index in GetString()" ); + wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); return ""; } wxString wxChoice::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, "", "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , "wxChoice: invalid label" ); + wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); return label->label; } int wxChoice::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -342,7 +342,7 @@ void wxChoice::SetColumns( int WXUNUSED(n) ) void wxChoice::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); int tmp = n; gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp ); @@ -352,7 +352,7 @@ void wxChoice::SetSelection( int n ) void wxChoice::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); int n = FindString( string ); if (n != -1) SetSelection( n ); diff --git a/src/gtk/clipbrd.cpp b/src/gtk/clipbrd.cpp index 91048b86cb..2d056fc1ed 100644 --- a/src/gtk/clipbrd.cpp +++ b/src/gtk/clipbrd.cpp @@ -273,14 +273,19 @@ selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data wxString text = text_object->GetText(); - char *s = WXSTRINGCAST text; +#if wxUSE_UNICODE + const wxWX2MBbuf s = text.mbc_str(); + int len = strlen(s); +#else // more efficient in non-Unicode + const char *s = text.c_str(); int len = (int) text.Length(); +#endif gtk_selection_data_set( selection_data, GDK_SELECTION_TYPE_STRING, 8*sizeof(gchar), - (unsigned char*) s, + (unsigned char*) (const char*) s, len ); break; @@ -405,7 +410,7 @@ void wxClipboard::Clear() bool wxClipboard::Open() { - wxCHECK_MSG( !m_open, FALSE, "clipboard already open" ); + wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") ); m_open = TRUE; @@ -414,9 +419,9 @@ bool wxClipboard::Open() bool wxClipboard::SetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, "data is invalid" ); + wxCHECK_MSG( data, FALSE, _T("data is invalid") ); Clear(); @@ -425,9 +430,9 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, "data is invalid" ); + wxCHECK_MSG( data, FALSE, _T("data is invalid") ); /* if clipboard has been cleared before, create new data broker */ @@ -441,7 +446,7 @@ bool wxClipboard::AddData( wxDataObject *data ) GdkAtom format = data->GetFormat().GetAtom(); - wxCHECK_MSG( format, FALSE, "data has invalid format" ); + wxCHECK_MSG( format, FALSE, _T("data has invalid format") ); /* This should happen automatically, but to be on the safe side */ @@ -506,20 +511,20 @@ bool wxClipboard::AddData( wxDataObject *data ) void wxClipboard::Close() { - wxCHECK_RET( m_open, "clipboard not open" ); + wxCHECK_RET( m_open, _T("clipboard not open") ); m_open = FALSE; } bool wxClipboard::IsSupported( wxDataFormat format ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); /* store requested format to be asked for by callbacks */ m_targetRequested = format.GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); + wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); m_formatSupported = FALSE; @@ -547,7 +552,7 @@ bool wxClipboard::IsSupported( wxDataFormat format ) bool wxClipboard::GetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); /* is data supported by clipboard ? */ @@ -561,7 +566,7 @@ bool wxClipboard::GetData( wxDataObject *data ) m_targetRequested = data->GetFormat().GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); + wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); /* start query */ @@ -587,7 +592,7 @@ bool wxClipboard::GetData( wxDataObject *data ) /* this is a true error as we checked for the presence of such data before */ - wxCHECK_MSG( m_formatSupported, FALSE, "error retrieving data from clipboard" ); + wxCHECK_MSG( m_formatSupported, FALSE, _T("error retrieving data from clipboard") ); return TRUE; } diff --git a/src/gtk/colour.cpp b/src/gtk/colour.cpp index 72104a8843..9c9eef687d 100644 --- a/src/gtk/colour.cpp +++ b/src/gtk/colour.cpp @@ -89,10 +89,10 @@ void wxColour::InitFromName( const wxString &colourName ) else { m_refData = new wxColourRefData(); - if (!gdk_color_parse( colourName, &M_COLDATA->m_color )) + if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color )) { - wxFAIL_MSG( "wxColour: couldn't find colour" ); - printf( "Colourname %s.\n", WXSTRINGCAST colourName ); + wxFAIL_MSG( _T("wxColour: couldn't find colour") ); + wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName ); delete m_refData; m_refData = (wxObjectRefData *) NULL; @@ -138,21 +138,21 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue ) unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); } unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); } unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); } @@ -200,14 +200,14 @@ void wxColour::CalcPixel( GdkColormap *cmap ) int wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return M_COLDATA->m_color.pixel; } GdkColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" ); + wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") ); return &M_COLDATA->m_color; } diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index efbb27e187..54aea8e647 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -106,7 +106,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, for (int i = 0; i < n; i++) { - GtkWidget *list_item = gtk_list_item_new_with_label( choices[i] ); + GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() ); m_clientDataList.Append( (wxObject*)NULL ); m_clientObjectList.Append( (wxObject*)NULL ); @@ -165,11 +165,11 @@ wxComboBox::~wxComboBox() void wxComboBox::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; - GtkWidget *list_item = gtk_list_item_new_with_label( item ); + GtkWidget *list_item = gtk_list_item_new_with_label( item.mbc_str() ); gtk_signal_connect( GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this ); @@ -207,7 +207,7 @@ void wxComboBox::Append( const wxString &item, wxClientData *clientData ) void wxComboBox::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -217,7 +217,7 @@ void wxComboBox::SetClientData( int n, void* clientData ) void* wxComboBox::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -227,7 +227,7 @@ void* wxComboBox::GetClientData( int n ) void wxComboBox::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -240,7 +240,7 @@ void wxComboBox::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxComboBox::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -250,7 +250,7 @@ wxClientData* wxComboBox::GetClientObject( int n ) void wxComboBox::Clear() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; gtk_list_clear_items( GTK_LIST(list), 0, Number() ); @@ -269,7 +269,7 @@ void wxComboBox::Clear() void wxComboBox::Delete( int n ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list ); @@ -277,7 +277,7 @@ void wxComboBox::Delete( int n ) if (!child) { - wxFAIL_MSG("wrong index"); + wxFAIL_MSG(_T("wrong index")); return; } @@ -302,7 +302,7 @@ void wxComboBox::Delete( int n ) int wxComboBox::FindString( const wxString &item ) { - wxCHECK_MSG( m_widget != NULL, -1, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -323,7 +323,7 @@ int wxComboBox::FindString( const wxString &item ) int wxComboBox::GetSelection() const { - wxCHECK_MSG( m_widget != NULL, -1, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -340,14 +340,14 @@ int wxComboBox::GetSelection() const } } - wxFAIL_MSG( "wxComboBox: no selection" ); + wxFAIL_MSG( _T("wxComboBox: no selection") ); return -1; } wxString wxComboBox::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, "", "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -361,7 +361,7 @@ wxString wxComboBox::GetString( int n ) const } else { - wxFAIL_MSG( "wxComboBox: wrong index" ); + wxFAIL_MSG( _T("wxComboBox: wrong index") ); } return str; @@ -369,7 +369,7 @@ wxString wxComboBox::GetString( int n ) const wxString wxComboBox::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, "", "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -381,14 +381,14 @@ wxString wxComboBox::GetStringSelection() const return tmp; } - wxFAIL_MSG( "wxComboBox: no selection" ); + wxFAIL_MSG( _T("wxComboBox: no selection") ); - return ""; + return _T(""); } int wxComboBox::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -400,7 +400,7 @@ int wxComboBox::Number() const void wxComboBox::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; gtk_list_select_item( GTK_LIST(list), n ); @@ -408,7 +408,7 @@ void wxComboBox::SetSelection( int n ) void wxComboBox::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); int res = FindString( string ); if (res == -1) return; @@ -424,17 +424,17 @@ wxString wxComboBox::GetValue() const void wxComboBox::SetValue( const wxString& value ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; - wxString tmp = ""; + wxString tmp = _T(""); if (!value.IsNull()) tmp = value; - gtk_entry_set_text( GTK_ENTRY(entry), tmp ); + gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() ); } void wxComboBox::Copy() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -446,7 +446,7 @@ void wxComboBox::Copy() void wxComboBox::Cut() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -458,7 +458,7 @@ void wxComboBox::Cut() void wxComboBox::Paste() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -470,7 +470,7 @@ void wxComboBox::Paste() void wxComboBox::SetInsertionPoint( long pos ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_entry_set_position( GTK_ENTRY(entry), (int)pos ); @@ -478,7 +478,7 @@ void wxComboBox::SetInsertionPoint( long pos ) void wxComboBox::SetInsertionPointEnd() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); SetInsertionPoint( -1 ); } @@ -498,18 +498,19 @@ long wxComboBox::GetLastPosition() const void wxComboBox::Replace( long from, long to, const wxString& value ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + // FIXME: not quite sure how to do this method right in multibyte mode GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); if (value.IsNull()) return; gint pos = (gint)to; - gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos ); + gtk_editable_insert_text( GTK_EDITABLE(entry), value.mbc_str(), value.Length(), &pos ); } void wxComboBox::Remove(long from, long to) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); diff --git a/src/gtk/cursor.cpp b/src/gtk/cursor.cpp index 7c497e454c..3c22177973 100644 --- a/src/gtk/cursor.cpp +++ b/src/gtk/cursor.cpp @@ -84,7 +84,7 @@ wxCursor::wxCursor( int cursorId ) case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; */ default: - wxFAIL_MSG("unsupported cursor type"); + wxFAIL_MSG(_T("unsupported cursor type")); // will use the standard one case wxCURSOR_ARROW: @@ -148,7 +148,7 @@ void wxEndBusyCursor() return; wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(), - "calling wxEndBusyCursor() without wxBeginBusyCursor()?" ); + _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") ); wxSetCursor(*gs_savedCursor); delete gs_savedCursor; @@ -161,7 +161,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) return; wxASSERT_MSG( !gs_savedCursor, - "forgot to call wxEndBusyCursor, will leak memory" ); + _T("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = new wxCursor; if ( g_globalCursor && g_globalCursor->Ok() ) @@ -180,5 +180,3 @@ void wxSetCursor( const wxCursor& cursor ) { if (g_globalCursor) (*g_globalCursor) = cursor; } - - diff --git a/src/gtk/data.cpp b/src/gtk/data.cpp index ad7aff2b3a..37f4f0006c 100644 --- a/src/gtk/data.cpp +++ b/src/gtk/data.cpp @@ -134,44 +134,44 @@ wxColour wxNullColour; wxPalette wxNullPalette; /* Default window names */ -const char *wxButtonNameStr = "button"; -const char *wxCanvasNameStr = "canvas"; -const char *wxCheckBoxNameStr = "check"; -const char *wxChoiceNameStr = "choice"; -const char *wxComboBoxNameStr = "comboBox"; -const char *wxDialogNameStr = "dialog"; -const char *wxFrameNameStr = "frame"; -const char *wxGaugeNameStr = "gauge"; -const char *wxStaticBoxNameStr = "groupBox"; -const char *wxListBoxNameStr = "listBox"; -const char *wxStaticTextNameStr = "message"; -const char *wxStaticBitmapNameStr = "message"; -const char *wxMultiTextNameStr = "multitext"; -const char *wxPanelNameStr = "panel"; -const char *wxRadioBoxNameStr = "radioBox"; -const char *wxRadioButtonNameStr = "radioButton"; -const char *wxBitmapRadioButtonNameStr = "radioButton"; -const char *wxScrollBarNameStr = "scrollBar"; -const char *wxSliderNameStr = "slider"; -const char *wxStaticNameStr = "static"; -const char *wxTextCtrlWindowNameStr = "textWindow"; -const char *wxTextCtrlNameStr = "text"; -const char *wxVirtListBoxNameStr = "virtListBox"; -const char *wxButtonBarNameStr = "buttonbar"; -const char *wxEnhDialogNameStr = "Shell"; -const char *wxToolBarNameStr = "toolbar"; -const char *wxStatusLineNameStr = "status_line"; -const char *wxEmptyString = ""; -const char *wxGetTextFromUserPromptStr = "Input Text"; -const char *wxMessageBoxCaptionStr = "Message"; -const char *wxFileSelectorPromptStr = "Select a file"; -const char *wxFileSelectorDefaultWildcardStr = "*.*"; -const char *wxInternalErrorStr = "wxWindows Internal Error"; -const char *wxFatalErrorStr = "wxWindows Fatal Error"; +const wxChar *wxButtonNameStr = _T("button"); +const wxChar *wxCanvasNameStr = _T("canvas"); +const wxChar *wxCheckBoxNameStr = _T("check"); +const wxChar *wxChoiceNameStr = _T("choice"); +const wxChar *wxComboBoxNameStr = _T("comboBox"); +const wxChar *wxDialogNameStr = _T("dialog"); +const wxChar *wxFrameNameStr = _T("frame"); +const wxChar *wxGaugeNameStr = _T("gauge"); +const wxChar *wxStaticBoxNameStr = _T("groupBox"); +const wxChar *wxListBoxNameStr = _T("listBox"); +const wxChar *wxStaticTextNameStr = _T("message"); +const wxChar *wxStaticBitmapNameStr = _T("message"); +const wxChar *wxMultiTextNameStr = _T("multitext"); +const wxChar *wxPanelNameStr = _T("panel"); +const wxChar *wxRadioBoxNameStr = _T("radioBox"); +const wxChar *wxRadioButtonNameStr = _T("radioButton"); +const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton"); +const wxChar *wxScrollBarNameStr = _T("scrollBar"); +const wxChar *wxSliderNameStr = _T("slider"); +const wxChar *wxStaticNameStr = _T("static"); +const wxChar *wxTextCtrlWindowNameStr = _T("textWindow"); +const wxChar *wxTextCtrlNameStr = _T("text"); +const wxChar *wxVirtListBoxNameStr = _T("virtListBox"); +const wxChar *wxButtonBarNameStr = _T("buttonbar"); +const wxChar *wxEnhDialogNameStr = _T("Shell"); +const wxChar *wxToolBarNameStr = _T("toolbar"); +const wxChar *wxStatusLineNameStr = _T("status_line"); +const wxChar *wxEmptyString = _T(""); +const wxChar *wxGetTextFromUserPromptStr = _T("Input Text"); +const wxChar *wxMessageBoxCaptionStr = _T("Message"); +const wxChar *wxFileSelectorPromptStr = _T("Select a file"); +const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*"); +const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error"); +const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error"); /* See wx/utils.h */ -const char *wxFloatToStringStr = "%.2f"; -const char *wxDoubleToStringStr = "%.2f"; +const wxChar *wxFloatToStringStr = _T("%.2f"); +const wxChar *wxDoubleToStringStr = _T("%.2f"); /* Dafaults for wxWindow etc. */ const wxSize wxDefaultSize(-1, -1); diff --git a/src/gtk/dataobj.cpp b/src/gtk/dataobj.cpp index e495bfd98a..161a6b5e3e 100644 --- a/src/gtk/dataobj.cpp +++ b/src/gtk/dataobj.cpp @@ -78,7 +78,7 @@ wxDataFormat::wxDataFormat( const GdkAtom atom ) m_type = wxDF_PRIVATE; m_id = gdk_atom_name( m_atom ); - if (m_id == "file:ALL") + if (m_id == _T("file:ALL")) { m_type = wxDF_FILENAME; } @@ -91,21 +91,21 @@ void wxDataFormat::SetType( wxDataType type ) if (m_type == wxDF_TEXT) { - m_id = "STRING"; + m_id = _T("STRING"); } else if (m_type == wxDF_BITMAP) { - m_id = "BITMAP"; + m_id = _T("BITMAP"); } else if (m_type == wxDF_FILENAME) { - m_id = "file:ALL"; + m_id = _T("file:ALL"); } else { - wxFAIL_MSG( "invalid dataformat" ); + wxFAIL_MSG( _T("invalid dataformat") ); } m_hasAtom = FALSE; @@ -146,7 +146,7 @@ GdkAtom wxDataFormat::GetAtom() else if (m_type == wxDF_PRIVATE) { - m_atom = gdk_atom_intern( WXSTRINGCAST( m_id ), FALSE ); + m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE ); } else if (m_type == wxDF_FILENAME) @@ -352,7 +352,7 @@ wxFileDataObject::wxFileDataObject() void wxFileDataObject::AddFile( const wxString &file ) { m_files += file; - m_files += (char)0; + m_files += (wxChar)0; } wxString wxFileDataObject::GetFiles() const diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index b6044d4b6c..4c19c24458 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -140,18 +140,18 @@ wxWindowDC::~wxWindowDC() void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style) ) { - wxFAIL_MSG( "wxWindowDC::FloodFill not implemented" ); + wxFAIL_MSG( _T("wxWindowDC::FloodFill not implemented") ); } bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const { - wxFAIL_MSG( "wxWindowDC::GetPixel not implemented" ); + wxFAIL_MSG( _T("wxWindowDC::GetPixel not implemented") ); return FALSE; } void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -165,7 +165,7 @@ void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 ) void wxWindowDC::CrossHair( long x, long y ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -181,7 +181,7 @@ void wxWindowDC::CrossHair( long x, long y ) void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx1 = XLOG2DEV(x1); long yy1 = YLOG2DEV(y1); @@ -231,7 +231,7 @@ void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -256,7 +256,7 @@ void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, doubl void wxWindowDC::DrawPoint( long x, long y ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) ); @@ -266,7 +266,7 @@ void wxWindowDC::DrawPoint( long x, long y ) void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; if (n <= 0) return; @@ -287,7 +287,7 @@ void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; @@ -314,7 +314,7 @@ void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset ) void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (n <= 0) return; @@ -348,7 +348,7 @@ void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffse void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle)) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); int n = lines->Number(); if (n <= 0) return; @@ -389,7 +389,7 @@ void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXU void wxWindowDC::DrawRectangle( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -415,7 +415,7 @@ void wxWindowDC::DrawRectangle( long x, long y, long width, long height ) void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (radius < 0.0) radius = - radius * ((width < height) ? width : height); @@ -484,7 +484,7 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, void wxWindowDC::DrawEllipse( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -517,7 +517,7 @@ void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y ) void wxWindowDC::DrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (!bitmap.Ok()) return; @@ -595,9 +595,9 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height, of the source dc, but scales correctly on the target dc and knows about possible mask information in a memory dc. */ - wxCHECK_MSG( Ok(), FALSE, "invalid window dc" ); + wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") ); - wxCHECK_MSG( source, FALSE, "invalid source dc" ); + wxCHECK_MSG( source, FALSE, _T("invalid source dc") ); wxClientDC *srcDC = (wxClientDC*)source; wxMemoryDC *memDC = (wxMemoryDC*)source; @@ -783,7 +783,7 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height, void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); GdkFont *font = m_font.GetInternalFont( m_scaleY ); @@ -793,20 +793,20 @@ void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(u /* CMB 21/5/98: draw text background if mode is wxSOLID */ if (m_backgroundMode == wxSOLID) { - long width = gdk_string_width( font, text ); + long width = gdk_string_width( font, text.mbc_str() ); long height = font->ascent + font->descent; gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() ); gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height ); gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); } - gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text ); + gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text.mbc_str() ); /* CMB 17/7/98: simple underline: ignores scaling and underlying X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS properties (see wxXt implementation) */ if (m_font.GetUnderlined()) { - long width = gdk_string_width( font, text ); + long width = gdk_string_width( font, text.mbc_str() ); long ul_y = y + font->ascent; if (font->descent > 0) ul_y++; gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y); @@ -827,13 +827,13 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh long *descent, long *externalLeading, wxFont *theFont, bool WXUNUSED(use16) ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxFont fontToUse = m_font; if (theFont) fontToUse = *theFont; GdkFont *font = fontToUse.GetInternalFont( m_scaleY ); - if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX); + if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX); if (height) (*height) = long((font->ascent + font->descent) / m_scaleY); if (descent) (*descent) = long(font->descent / m_scaleY); if (externalLeading) (*externalLeading) = 0; // ?? @@ -841,7 +841,7 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh long wxWindowDC::GetCharWidth() { - wxCHECK_MSG( Ok(), 0, "invalid window dc" ); + wxCHECK_MSG( Ok(), 0, _T("invalid window dc") ); GdkFont *font = m_font.GetInternalFont( m_scaleY ); return long(gdk_string_width( font, "H" ) / m_scaleX); @@ -849,7 +849,7 @@ long wxWindowDC::GetCharWidth() long wxWindowDC::GetCharHeight() { - wxCHECK_MSG( Ok(), 0, "invalid window dc" ); + wxCHECK_MSG( Ok(), 0, _T("invalid window dc") ); GdkFont *font = m_font.GetInternalFont( m_scaleY ); return long((font->ascent + font->descent) / m_scaleY); @@ -857,7 +857,7 @@ long wxWindowDC::GetCharHeight() void wxWindowDC::Clear() { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); /* - we either are a memory dc or have a window as the owner. anything else shouldn't happen. @@ -885,14 +885,14 @@ void wxWindowDC::Clear() void wxWindowDC::SetFont( const wxFont &font ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); m_font = font; } void wxWindowDC::SetPen( const wxPen &pen ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen == pen) return; @@ -948,7 +948,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) void wxWindowDC::SetBrush( const wxBrush &brush ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_brush == brush) return; @@ -991,7 +991,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) /* CMB 21/7/98: Added SetBackground. Sets background brush * for Clear() and bg colour for shapes filled with cross-hatch brush */ - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_backgroundBrush == brush) return; @@ -1031,7 +1031,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetLogicalFunction( int function ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_logicalFunction == function) return; @@ -1051,7 +1051,7 @@ void wxWindowDC::SetLogicalFunction( int function ) void wxWindowDC::SetTextForeground( const wxColour &col ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_textForegroundColour == col) return; @@ -1064,7 +1064,7 @@ void wxWindowDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextBackground( const wxColour &col ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_textBackgroundColour == col) return; @@ -1077,7 +1077,7 @@ void wxWindowDC::SetTextBackground( const wxColour &col ) void wxWindowDC::SetBackgroundMode( int mode ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); m_backgroundMode = mode; @@ -1093,12 +1093,12 @@ void wxWindowDC::SetBackgroundMode( int mode ) void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) { - wxFAIL_MSG( "wxWindowDC::SetPalette not implemented" ); + wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") ); } void wxWindowDC::SetClippingRegion( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxDC::SetClippingRegion( x, y, width, height ); @@ -1115,7 +1115,7 @@ void wxWindowDC::SetClippingRegion( long x, long y, long width, long height ) void wxWindowDC::SetClippingRegion( const wxRegion ®ion ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (region.Empty()) { @@ -1131,7 +1131,7 @@ void wxWindowDC::SetClippingRegion( const wxRegion ®ion ) void wxWindowDC::DestroyClippingRegion() { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxDC::DestroyClippingRegion(); @@ -1320,7 +1320,7 @@ static void wx_spline_draw_point_array(wxDC *dc) void wxWindowDC::DrawSpline( wxList *points ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxPoint *p; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; diff --git a/src/gtk/dnd.cpp b/src/gtk/dnd.cpp index 7ffdb34a11..a86abfa51c 100644 --- a/src/gtk/dnd.cpp +++ b/src/gtk/dnd.cpp @@ -399,7 +399,7 @@ bool wxDropTarget::GetData( wxDataObject *data_object ) void wxDropTarget::UnregisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, "unregister widget is NULL" ); + wxCHECK_RET( widget != NULL, _T("unregister widget is NULL") ); gtk_drag_dest_unset( widget ); @@ -418,7 +418,7 @@ void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::RegisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, "register widget is NULL" ); + wxCHECK_RET( widget != NULL, _T("register widget is NULL") ); /* gtk_drag_dest_set() determines what default behaviour we'd like GTK to supply. we don't want to specify out targets (=formats) @@ -474,7 +474,7 @@ bool wxTextDropTarget::OnData( int x, int y ) wxTextDataObject data; if (!GetData( &data )) return FALSE; - OnDropText( x, y, data.GetText() ); + OnDropText( x, y, data.GetText().mbc_str() ); return TRUE; } @@ -550,19 +550,19 @@ bool wxFileDropTarget::OnData( int x, int y ) size_t number = 0; size_t i; size_t size = data.GetFiles().Length(); - char *text = WXSTRINGCAST data.GetFiles(); + wxChar *text = WXSTRINGCAST data.GetFiles(); for ( i = 0; i < size; i++) if (text[i] == 0) number++; if (number == 0) return FALSE; - char **files = new char*[number]; + wxChar **files = new wxChar*[number]; text = WXSTRINGCAST data.GetFiles(); for (i = 0; i < number; i++) { files[i] = text; - int len = strlen( text ); + int len = wxStrlen( text ); text += len+1; } @@ -755,7 +755,7 @@ wxDropSource::~wxDropSource(void) wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) { - wxASSERT_MSG( m_data, "wxDragSource: no data" ); + wxASSERT_MSG( m_data, _T("wxDragSource: no data") ); if (!m_data) return (wxDragResult) wxDragNone; @@ -1547,4 +1547,4 @@ shape_create_icon (const wxIcon &shape, #endif - // wxUSE_DRAG_AND_DROP \ No newline at end of file + // wxUSE_DRAG_AND_DROP diff --git a/src/gtk1/checklst.cpp b/src/gtk1/checklst.cpp index e47e7bd805..fc439b68de 100644 --- a/src/gtk1/checklst.cpp +++ b/src/gtk1/checklst.cpp @@ -43,7 +43,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id, bool wxCheckListBox::IsChecked( int index ) const { - wxCHECK_MSG( m_list != NULL, FALSE, "invalid checklistbox" ); + wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -56,13 +56,13 @@ bool wxCheckListBox::IsChecked( int index ) const return (str[1] == 'X'); } - wxFAIL_MSG("wrong checklistbox index"); + wxFAIL_MSG(_T("wrong checklistbox index")); return FALSE; } void wxCheckListBox::Check( int index, bool check ) { - wxCHECK_RET( m_list != NULL, "invalid checklistbox" ); + wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") ); GList *child = g_list_nth( m_list->children, index ); if (child) @@ -72,19 +72,19 @@ void wxCheckListBox::Check( int index, bool check ) wxString str = label->label; - if (check == (str[1] == 'X')) return; + if (check == (str[1] == _T('X'))) return; if (check) - str.SetChar( 1, 'X' ); + str.SetChar( 1, _T('X') ); else - str.SetChar( 1, '-' ); + str.SetChar( 1, _T('-') ); - gtk_label_set( label, str ); + gtk_label_set( label, str.mbc_str() ); return; } - wxFAIL_MSG("wrong checklistbox index"); + wxFAIL_MSG(_T("wrong checklistbox index")); } int wxCheckListBox::GetItemHeight() const diff --git a/src/gtk1/choice.cpp b/src/gtk1/choice.cpp index 248123389a..2c1d4c702c 100644 --- a/src/gtk1/choice.cpp +++ b/src/gtk1/choice.cpp @@ -82,7 +82,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id, m_clientDataList.Append( (wxObject*) NULL ); m_clientObjectList.Append( (wxObject*) NULL ); - GtkWidget *item = gtk_menu_item_new_with_label( choices[i] ); + GtkWidget *item = gtk_menu_item_new_with_label( choices[i].mbc_str() ); gtk_menu_append( GTK_MENU(menu), item ); gtk_widget_realize( item ); @@ -117,10 +117,10 @@ wxChoice::~wxChoice() void wxChoice::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ); - GtkWidget *menu_item = gtk_menu_item_new_with_label( item ); + GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() ); gtk_menu_append( GTK_MENU(menu), menu_item ); @@ -161,7 +161,7 @@ void wxChoice::Append( const wxString &item, wxClientData *clientData ) void wxChoice::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -171,7 +171,7 @@ void wxChoice::SetClientData( int n, void* clientData ) void* wxChoice::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -181,7 +181,7 @@ void* wxChoice::GetClientData( int n ) void wxChoice::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -194,7 +194,7 @@ void wxChoice::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxChoice::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -204,7 +204,7 @@ wxClientData* wxChoice::GetClientObject( int n ) void wxChoice::Clear() { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) ); GtkWidget *menu = gtk_menu_new(); @@ -224,12 +224,12 @@ void wxChoice::Clear() void wxChoice::Delete( int WXUNUSED(n) ) { - wxFAIL_MSG( "wxChoice:Delete not implemented" ); + wxFAIL_MSG( _T("wxChoice:Delete not implemented") ); } int wxChoice::FindString( const wxString &string ) const { - wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); // If you read this code once and you think you understand // it, then you are very wrong. Robert Roebling. @@ -244,7 +244,7 @@ int wxChoice::FindString( const wxString &string ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , "wxChoice: invalid label" ); + wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); if (string == label->label) return count; @@ -263,7 +263,7 @@ int wxChoice::GetColumns() const int wxChoice::GetSelection() { - wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -276,14 +276,14 @@ int wxChoice::GetSelection() count++; } - wxFAIL_MSG( "wxChoice: no selection" ); + wxFAIL_MSG( _T("wxChoice: no selection") ); return -1; } wxString wxChoice::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, "", "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -297,7 +297,7 @@ wxString wxChoice::GetString( int n ) const if (bin->child) label = GTK_LABEL(bin->child); if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , "wxChoice: invalid label" ); + wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); return label->label; } @@ -305,25 +305,25 @@ wxString wxChoice::GetString( int n ) const count++; } - wxFAIL_MSG( "wxChoice: invalid index in GetString()" ); + wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") ); return ""; } wxString wxChoice::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, "", "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") ); GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child ); - wxASSERT_MSG( label != NULL , "wxChoice: invalid label" ); + wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") ); return label->label; } int wxChoice::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid choice" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) ); int count = 0; @@ -342,7 +342,7 @@ void wxChoice::SetColumns( int WXUNUSED(n) ) void wxChoice::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); int tmp = n; gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp ); @@ -352,7 +352,7 @@ void wxChoice::SetSelection( int n ) void wxChoice::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, "invalid choice" ); + wxCHECK_RET( m_widget != NULL, _T("invalid choice") ); int n = FindString( string ); if (n != -1) SetSelection( n ); diff --git a/src/gtk1/clipbrd.cpp b/src/gtk1/clipbrd.cpp index 91048b86cb..2d056fc1ed 100644 --- a/src/gtk1/clipbrd.cpp +++ b/src/gtk1/clipbrd.cpp @@ -273,14 +273,19 @@ selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data wxString text = text_object->GetText(); - char *s = WXSTRINGCAST text; +#if wxUSE_UNICODE + const wxWX2MBbuf s = text.mbc_str(); + int len = strlen(s); +#else // more efficient in non-Unicode + const char *s = text.c_str(); int len = (int) text.Length(); +#endif gtk_selection_data_set( selection_data, GDK_SELECTION_TYPE_STRING, 8*sizeof(gchar), - (unsigned char*) s, + (unsigned char*) (const char*) s, len ); break; @@ -405,7 +410,7 @@ void wxClipboard::Clear() bool wxClipboard::Open() { - wxCHECK_MSG( !m_open, FALSE, "clipboard already open" ); + wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") ); m_open = TRUE; @@ -414,9 +419,9 @@ bool wxClipboard::Open() bool wxClipboard::SetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, "data is invalid" ); + wxCHECK_MSG( data, FALSE, _T("data is invalid") ); Clear(); @@ -425,9 +430,9 @@ bool wxClipboard::SetData( wxDataObject *data ) bool wxClipboard::AddData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); - wxCHECK_MSG( data, FALSE, "data is invalid" ); + wxCHECK_MSG( data, FALSE, _T("data is invalid") ); /* if clipboard has been cleared before, create new data broker */ @@ -441,7 +446,7 @@ bool wxClipboard::AddData( wxDataObject *data ) GdkAtom format = data->GetFormat().GetAtom(); - wxCHECK_MSG( format, FALSE, "data has invalid format" ); + wxCHECK_MSG( format, FALSE, _T("data has invalid format") ); /* This should happen automatically, but to be on the safe side */ @@ -506,20 +511,20 @@ bool wxClipboard::AddData( wxDataObject *data ) void wxClipboard::Close() { - wxCHECK_RET( m_open, "clipboard not open" ); + wxCHECK_RET( m_open, _T("clipboard not open") ); m_open = FALSE; } bool wxClipboard::IsSupported( wxDataFormat format ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); /* store requested format to be asked for by callbacks */ m_targetRequested = format.GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); + wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); m_formatSupported = FALSE; @@ -547,7 +552,7 @@ bool wxClipboard::IsSupported( wxDataFormat format ) bool wxClipboard::GetData( wxDataObject *data ) { - wxCHECK_MSG( m_open, FALSE, "clipboard not open" ); + wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") ); /* is data supported by clipboard ? */ @@ -561,7 +566,7 @@ bool wxClipboard::GetData( wxDataObject *data ) m_targetRequested = data->GetFormat().GetAtom(); - wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); + wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") ); /* start query */ @@ -587,7 +592,7 @@ bool wxClipboard::GetData( wxDataObject *data ) /* this is a true error as we checked for the presence of such data before */ - wxCHECK_MSG( m_formatSupported, FALSE, "error retrieving data from clipboard" ); + wxCHECK_MSG( m_formatSupported, FALSE, _T("error retrieving data from clipboard") ); return TRUE; } diff --git a/src/gtk1/colour.cpp b/src/gtk1/colour.cpp index 72104a8843..9c9eef687d 100644 --- a/src/gtk1/colour.cpp +++ b/src/gtk1/colour.cpp @@ -89,10 +89,10 @@ void wxColour::InitFromName( const wxString &colourName ) else { m_refData = new wxColourRefData(); - if (!gdk_color_parse( colourName, &M_COLDATA->m_color )) + if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color )) { - wxFAIL_MSG( "wxColour: couldn't find colour" ); - printf( "Colourname %s.\n", WXSTRINGCAST colourName ); + wxFAIL_MSG( _T("wxColour: couldn't find colour") ); + wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName ); delete m_refData; m_refData = (wxObjectRefData *) NULL; @@ -138,21 +138,21 @@ void wxColour::Set( unsigned char red, unsigned char green, unsigned char blue ) unsigned char wxColour::Red() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT); } unsigned char wxColour::Green() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT); } unsigned char wxColour::Blue() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT); } @@ -200,14 +200,14 @@ void wxColour::CalcPixel( GdkColormap *cmap ) int wxColour::GetPixel() const { - wxCHECK_MSG( Ok(), 0, "invalid colour" ); + wxCHECK_MSG( Ok(), 0, _T("invalid colour") ); return M_COLDATA->m_color.pixel; } GdkColor *wxColour::GetColor() const { - wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" ); + wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") ); return &M_COLDATA->m_color; } diff --git a/src/gtk1/combobox.cpp b/src/gtk1/combobox.cpp index efbb27e187..54aea8e647 100644 --- a/src/gtk1/combobox.cpp +++ b/src/gtk1/combobox.cpp @@ -106,7 +106,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value, for (int i = 0; i < n; i++) { - GtkWidget *list_item = gtk_list_item_new_with_label( choices[i] ); + GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() ); m_clientDataList.Append( (wxObject*)NULL ); m_clientObjectList.Append( (wxObject*)NULL ); @@ -165,11 +165,11 @@ wxComboBox::~wxComboBox() void wxComboBox::AppendCommon( const wxString &item ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; - GtkWidget *list_item = gtk_list_item_new_with_label( item ); + GtkWidget *list_item = gtk_list_item_new_with_label( item.mbc_str() ); gtk_signal_connect( GTK_OBJECT(list_item), "select", GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this ); @@ -207,7 +207,7 @@ void wxComboBox::Append( const wxString &item, wxClientData *clientData ) void wxComboBox::SetClientData( int n, void* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return; @@ -217,7 +217,7 @@ void wxComboBox::SetClientData( int n, void* clientData ) void* wxComboBox::GetClientData( int n ) { - wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return NULL; @@ -227,7 +227,7 @@ void* wxComboBox::GetClientData( int n ) void wxComboBox::SetClientObject( int n, wxClientData* clientData ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); wxNode *node = m_clientObjectList.Nth( n ); if (!node) return; @@ -240,7 +240,7 @@ void wxComboBox::SetClientObject( int n, wxClientData* clientData ) wxClientData* wxComboBox::GetClientObject( int n ) { - wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") ); wxNode *node = m_clientDataList.Nth( n ); if (!node) return (wxClientData*) NULL; @@ -250,7 +250,7 @@ wxClientData* wxComboBox::GetClientObject( int n ) void wxComboBox::Clear() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; gtk_list_clear_items( GTK_LIST(list), 0, Number() ); @@ -269,7 +269,7 @@ void wxComboBox::Clear() void wxComboBox::Delete( int n ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list ); @@ -277,7 +277,7 @@ void wxComboBox::Delete( int n ) if (!child) { - wxFAIL_MSG("wrong index"); + wxFAIL_MSG(_T("wrong index")); return; } @@ -302,7 +302,7 @@ void wxComboBox::Delete( int n ) int wxComboBox::FindString( const wxString &item ) { - wxCHECK_MSG( m_widget != NULL, -1, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -323,7 +323,7 @@ int wxComboBox::FindString( const wxString &item ) int wxComboBox::GetSelection() const { - wxCHECK_MSG( m_widget != NULL, -1, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, -1, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -340,14 +340,14 @@ int wxComboBox::GetSelection() const } } - wxFAIL_MSG( "wxComboBox: no selection" ); + wxFAIL_MSG( _T("wxComboBox: no selection") ); return -1; } wxString wxComboBox::GetString( int n ) const { - wxCHECK_MSG( m_widget != NULL, "", "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -361,7 +361,7 @@ wxString wxComboBox::GetString( int n ) const } else { - wxFAIL_MSG( "wxComboBox: wrong index" ); + wxFAIL_MSG( _T("wxComboBox: wrong index") ); } return str; @@ -369,7 +369,7 @@ wxString wxComboBox::GetString( int n ) const wxString wxComboBox::GetStringSelection() const { - wxCHECK_MSG( m_widget != NULL, "", "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -381,14 +381,14 @@ wxString wxComboBox::GetStringSelection() const return tmp; } - wxFAIL_MSG( "wxComboBox: no selection" ); + wxFAIL_MSG( _T("wxComboBox: no selection") ); - return ""; + return _T(""); } int wxComboBox::Number() const { - wxCHECK_MSG( m_widget != NULL, 0, "invalid combobox" ); + wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; @@ -400,7 +400,7 @@ int wxComboBox::Number() const void wxComboBox::SetSelection( int n ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *list = GTK_COMBO(m_widget)->list; gtk_list_select_item( GTK_LIST(list), n ); @@ -408,7 +408,7 @@ void wxComboBox::SetSelection( int n ) void wxComboBox::SetStringSelection( const wxString &string ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); int res = FindString( string ); if (res == -1) return; @@ -424,17 +424,17 @@ wxString wxComboBox::GetValue() const void wxComboBox::SetValue( const wxString& value ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; - wxString tmp = ""; + wxString tmp = _T(""); if (!value.IsNull()) tmp = value; - gtk_entry_set_text( GTK_ENTRY(entry), tmp ); + gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() ); } void wxComboBox::Copy() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -446,7 +446,7 @@ void wxComboBox::Copy() void wxComboBox::Cut() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -458,7 +458,7 @@ void wxComboBox::Cut() void wxComboBox::Paste() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; #if (GTK_MINOR_VERSION > 0) @@ -470,7 +470,7 @@ void wxComboBox::Paste() void wxComboBox::SetInsertionPoint( long pos ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_entry_set_position( GTK_ENTRY(entry), (int)pos ); @@ -478,7 +478,7 @@ void wxComboBox::SetInsertionPoint( long pos ) void wxComboBox::SetInsertionPointEnd() { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); SetInsertionPoint( -1 ); } @@ -498,18 +498,19 @@ long wxComboBox::GetLastPosition() const void wxComboBox::Replace( long from, long to, const wxString& value ) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); + // FIXME: not quite sure how to do this method right in multibyte mode GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); if (value.IsNull()) return; gint pos = (gint)to; - gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos ); + gtk_editable_insert_text( GTK_EDITABLE(entry), value.mbc_str(), value.Length(), &pos ); } void wxComboBox::Remove(long from, long to) { - wxCHECK_RET( m_widget != NULL, "invalid combobox" ); + wxCHECK_RET( m_widget != NULL, _T("invalid combobox") ); GtkWidget *entry = GTK_COMBO(m_widget)->entry; gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); diff --git a/src/gtk1/cursor.cpp b/src/gtk1/cursor.cpp index 7c497e454c..3c22177973 100644 --- a/src/gtk1/cursor.cpp +++ b/src/gtk1/cursor.cpp @@ -84,7 +84,7 @@ wxCursor::wxCursor( int cursorId ) case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; */ default: - wxFAIL_MSG("unsupported cursor type"); + wxFAIL_MSG(_T("unsupported cursor type")); // will use the standard one case wxCURSOR_ARROW: @@ -148,7 +148,7 @@ void wxEndBusyCursor() return; wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(), - "calling wxEndBusyCursor() without wxBeginBusyCursor()?" ); + _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") ); wxSetCursor(*gs_savedCursor); delete gs_savedCursor; @@ -161,7 +161,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) ) return; wxASSERT_MSG( !gs_savedCursor, - "forgot to call wxEndBusyCursor, will leak memory" ); + _T("forgot to call wxEndBusyCursor, will leak memory") ); gs_savedCursor = new wxCursor; if ( g_globalCursor && g_globalCursor->Ok() ) @@ -180,5 +180,3 @@ void wxSetCursor( const wxCursor& cursor ) { if (g_globalCursor) (*g_globalCursor) = cursor; } - - diff --git a/src/gtk1/data.cpp b/src/gtk1/data.cpp index ad7aff2b3a..37f4f0006c 100644 --- a/src/gtk1/data.cpp +++ b/src/gtk1/data.cpp @@ -134,44 +134,44 @@ wxColour wxNullColour; wxPalette wxNullPalette; /* Default window names */ -const char *wxButtonNameStr = "button"; -const char *wxCanvasNameStr = "canvas"; -const char *wxCheckBoxNameStr = "check"; -const char *wxChoiceNameStr = "choice"; -const char *wxComboBoxNameStr = "comboBox"; -const char *wxDialogNameStr = "dialog"; -const char *wxFrameNameStr = "frame"; -const char *wxGaugeNameStr = "gauge"; -const char *wxStaticBoxNameStr = "groupBox"; -const char *wxListBoxNameStr = "listBox"; -const char *wxStaticTextNameStr = "message"; -const char *wxStaticBitmapNameStr = "message"; -const char *wxMultiTextNameStr = "multitext"; -const char *wxPanelNameStr = "panel"; -const char *wxRadioBoxNameStr = "radioBox"; -const char *wxRadioButtonNameStr = "radioButton"; -const char *wxBitmapRadioButtonNameStr = "radioButton"; -const char *wxScrollBarNameStr = "scrollBar"; -const char *wxSliderNameStr = "slider"; -const char *wxStaticNameStr = "static"; -const char *wxTextCtrlWindowNameStr = "textWindow"; -const char *wxTextCtrlNameStr = "text"; -const char *wxVirtListBoxNameStr = "virtListBox"; -const char *wxButtonBarNameStr = "buttonbar"; -const char *wxEnhDialogNameStr = "Shell"; -const char *wxToolBarNameStr = "toolbar"; -const char *wxStatusLineNameStr = "status_line"; -const char *wxEmptyString = ""; -const char *wxGetTextFromUserPromptStr = "Input Text"; -const char *wxMessageBoxCaptionStr = "Message"; -const char *wxFileSelectorPromptStr = "Select a file"; -const char *wxFileSelectorDefaultWildcardStr = "*.*"; -const char *wxInternalErrorStr = "wxWindows Internal Error"; -const char *wxFatalErrorStr = "wxWindows Fatal Error"; +const wxChar *wxButtonNameStr = _T("button"); +const wxChar *wxCanvasNameStr = _T("canvas"); +const wxChar *wxCheckBoxNameStr = _T("check"); +const wxChar *wxChoiceNameStr = _T("choice"); +const wxChar *wxComboBoxNameStr = _T("comboBox"); +const wxChar *wxDialogNameStr = _T("dialog"); +const wxChar *wxFrameNameStr = _T("frame"); +const wxChar *wxGaugeNameStr = _T("gauge"); +const wxChar *wxStaticBoxNameStr = _T("groupBox"); +const wxChar *wxListBoxNameStr = _T("listBox"); +const wxChar *wxStaticTextNameStr = _T("message"); +const wxChar *wxStaticBitmapNameStr = _T("message"); +const wxChar *wxMultiTextNameStr = _T("multitext"); +const wxChar *wxPanelNameStr = _T("panel"); +const wxChar *wxRadioBoxNameStr = _T("radioBox"); +const wxChar *wxRadioButtonNameStr = _T("radioButton"); +const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton"); +const wxChar *wxScrollBarNameStr = _T("scrollBar"); +const wxChar *wxSliderNameStr = _T("slider"); +const wxChar *wxStaticNameStr = _T("static"); +const wxChar *wxTextCtrlWindowNameStr = _T("textWindow"); +const wxChar *wxTextCtrlNameStr = _T("text"); +const wxChar *wxVirtListBoxNameStr = _T("virtListBox"); +const wxChar *wxButtonBarNameStr = _T("buttonbar"); +const wxChar *wxEnhDialogNameStr = _T("Shell"); +const wxChar *wxToolBarNameStr = _T("toolbar"); +const wxChar *wxStatusLineNameStr = _T("status_line"); +const wxChar *wxEmptyString = _T(""); +const wxChar *wxGetTextFromUserPromptStr = _T("Input Text"); +const wxChar *wxMessageBoxCaptionStr = _T("Message"); +const wxChar *wxFileSelectorPromptStr = _T("Select a file"); +const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*"); +const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error"); +const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error"); /* See wx/utils.h */ -const char *wxFloatToStringStr = "%.2f"; -const char *wxDoubleToStringStr = "%.2f"; +const wxChar *wxFloatToStringStr = _T("%.2f"); +const wxChar *wxDoubleToStringStr = _T("%.2f"); /* Dafaults for wxWindow etc. */ const wxSize wxDefaultSize(-1, -1); diff --git a/src/gtk1/dataobj.cpp b/src/gtk1/dataobj.cpp index e495bfd98a..161a6b5e3e 100644 --- a/src/gtk1/dataobj.cpp +++ b/src/gtk1/dataobj.cpp @@ -78,7 +78,7 @@ wxDataFormat::wxDataFormat( const GdkAtom atom ) m_type = wxDF_PRIVATE; m_id = gdk_atom_name( m_atom ); - if (m_id == "file:ALL") + if (m_id == _T("file:ALL")) { m_type = wxDF_FILENAME; } @@ -91,21 +91,21 @@ void wxDataFormat::SetType( wxDataType type ) if (m_type == wxDF_TEXT) { - m_id = "STRING"; + m_id = _T("STRING"); } else if (m_type == wxDF_BITMAP) { - m_id = "BITMAP"; + m_id = _T("BITMAP"); } else if (m_type == wxDF_FILENAME) { - m_id = "file:ALL"; + m_id = _T("file:ALL"); } else { - wxFAIL_MSG( "invalid dataformat" ); + wxFAIL_MSG( _T("invalid dataformat") ); } m_hasAtom = FALSE; @@ -146,7 +146,7 @@ GdkAtom wxDataFormat::GetAtom() else if (m_type == wxDF_PRIVATE) { - m_atom = gdk_atom_intern( WXSTRINGCAST( m_id ), FALSE ); + m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE ); } else if (m_type == wxDF_FILENAME) @@ -352,7 +352,7 @@ wxFileDataObject::wxFileDataObject() void wxFileDataObject::AddFile( const wxString &file ) { m_files += file; - m_files += (char)0; + m_files += (wxChar)0; } wxString wxFileDataObject::GetFiles() const diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index b6044d4b6c..4c19c24458 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -140,18 +140,18 @@ wxWindowDC::~wxWindowDC() void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style) ) { - wxFAIL_MSG( "wxWindowDC::FloodFill not implemented" ); + wxFAIL_MSG( _T("wxWindowDC::FloodFill not implemented") ); } bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const { - wxFAIL_MSG( "wxWindowDC::GetPixel not implemented" ); + wxFAIL_MSG( _T("wxWindowDC::GetPixel not implemented") ); return FALSE; } void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -165,7 +165,7 @@ void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 ) void wxWindowDC::CrossHair( long x, long y ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) { @@ -181,7 +181,7 @@ void wxWindowDC::CrossHair( long x, long y ) void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx1 = XLOG2DEV(x1); long yy1 = YLOG2DEV(y1); @@ -231,7 +231,7 @@ void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -256,7 +256,7 @@ void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, doubl void wxWindowDC::DrawPoint( long x, long y ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() != wxTRANSPARENT) gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) ); @@ -266,7 +266,7 @@ void wxWindowDC::DrawPoint( long x, long y ) void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; if (n <= 0) return; @@ -287,7 +287,7 @@ void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen.GetStyle() == wxTRANSPARENT) return; @@ -314,7 +314,7 @@ void wxWindowDC::DrawLines( wxList *points, long xoffset, long yoffset ) void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle) ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (n <= 0) return; @@ -348,7 +348,7 @@ void wxWindowDC::DrawPolygon( int n, wxPoint points[], long xoffset, long yoffse void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle)) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); int n = lines->Number(); if (n <= 0) return; @@ -389,7 +389,7 @@ void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXU void wxWindowDC::DrawRectangle( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -415,7 +415,7 @@ void wxWindowDC::DrawRectangle( long x, long y, long width, long height ) void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, double radius ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (radius < 0.0) radius = - radius * ((width < height) ? width : height); @@ -484,7 +484,7 @@ void wxWindowDC::DrawRoundedRectangle( long x, long y, long width, long height, void wxWindowDC::DrawEllipse( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); long xx = XLOG2DEV(x); long yy = YLOG2DEV(y); @@ -517,7 +517,7 @@ void wxWindowDC::DrawIcon( const wxIcon &icon, long x, long y ) void wxWindowDC::DrawBitmap( const wxBitmap &bitmap, long x, long y, bool useMask ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (!bitmap.Ok()) return; @@ -595,9 +595,9 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height, of the source dc, but scales correctly on the target dc and knows about possible mask information in a memory dc. */ - wxCHECK_MSG( Ok(), FALSE, "invalid window dc" ); + wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") ); - wxCHECK_MSG( source, FALSE, "invalid source dc" ); + wxCHECK_MSG( source, FALSE, _T("invalid source dc") ); wxClientDC *srcDC = (wxClientDC*)source; wxMemoryDC *memDC = (wxMemoryDC*)source; @@ -783,7 +783,7 @@ bool wxWindowDC::Blit( long xdest, long ydest, long width, long height, void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(use16) ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); GdkFont *font = m_font.GetInternalFont( m_scaleY ); @@ -793,20 +793,20 @@ void wxWindowDC::DrawText( const wxString &text, long x, long y, bool WXUNUSED(u /* CMB 21/5/98: draw text background if mode is wxSOLID */ if (m_backgroundMode == wxSOLID) { - long width = gdk_string_width( font, text ); + long width = gdk_string_width( font, text.mbc_str() ); long height = font->ascent + font->descent; gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() ); gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height ); gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); } - gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text ); + gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text.mbc_str() ); /* CMB 17/7/98: simple underline: ignores scaling and underlying X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS properties (see wxXt implementation) */ if (m_font.GetUnderlined()) { - long width = gdk_string_width( font, text ); + long width = gdk_string_width( font, text.mbc_str() ); long ul_y = y + font->ascent; if (font->descent > 0) ul_y++; gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y); @@ -827,13 +827,13 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh long *descent, long *externalLeading, wxFont *theFont, bool WXUNUSED(use16) ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxFont fontToUse = m_font; if (theFont) fontToUse = *theFont; GdkFont *font = fontToUse.GetInternalFont( m_scaleY ); - if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX); + if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX); if (height) (*height) = long((font->ascent + font->descent) / m_scaleY); if (descent) (*descent) = long(font->descent / m_scaleY); if (externalLeading) (*externalLeading) = 0; // ?? @@ -841,7 +841,7 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh long wxWindowDC::GetCharWidth() { - wxCHECK_MSG( Ok(), 0, "invalid window dc" ); + wxCHECK_MSG( Ok(), 0, _T("invalid window dc") ); GdkFont *font = m_font.GetInternalFont( m_scaleY ); return long(gdk_string_width( font, "H" ) / m_scaleX); @@ -849,7 +849,7 @@ long wxWindowDC::GetCharWidth() long wxWindowDC::GetCharHeight() { - wxCHECK_MSG( Ok(), 0, "invalid window dc" ); + wxCHECK_MSG( Ok(), 0, _T("invalid window dc") ); GdkFont *font = m_font.GetInternalFont( m_scaleY ); return long((font->ascent + font->descent) / m_scaleY); @@ -857,7 +857,7 @@ long wxWindowDC::GetCharHeight() void wxWindowDC::Clear() { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); /* - we either are a memory dc or have a window as the owner. anything else shouldn't happen. @@ -885,14 +885,14 @@ void wxWindowDC::Clear() void wxWindowDC::SetFont( const wxFont &font ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); m_font = font; } void wxWindowDC::SetPen( const wxPen &pen ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_pen == pen) return; @@ -948,7 +948,7 @@ void wxWindowDC::SetPen( const wxPen &pen ) void wxWindowDC::SetBrush( const wxBrush &brush ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_brush == brush) return; @@ -991,7 +991,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) /* CMB 21/7/98: Added SetBackground. Sets background brush * for Clear() and bg colour for shapes filled with cross-hatch brush */ - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_backgroundBrush == brush) return; @@ -1031,7 +1031,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush ) void wxWindowDC::SetLogicalFunction( int function ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_logicalFunction == function) return; @@ -1051,7 +1051,7 @@ void wxWindowDC::SetLogicalFunction( int function ) void wxWindowDC::SetTextForeground( const wxColour &col ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_textForegroundColour == col) return; @@ -1064,7 +1064,7 @@ void wxWindowDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextBackground( const wxColour &col ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (m_textBackgroundColour == col) return; @@ -1077,7 +1077,7 @@ void wxWindowDC::SetTextBackground( const wxColour &col ) void wxWindowDC::SetBackgroundMode( int mode ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); m_backgroundMode = mode; @@ -1093,12 +1093,12 @@ void wxWindowDC::SetBackgroundMode( int mode ) void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) { - wxFAIL_MSG( "wxWindowDC::SetPalette not implemented" ); + wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") ); } void wxWindowDC::SetClippingRegion( long x, long y, long width, long height ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxDC::SetClippingRegion( x, y, width, height ); @@ -1115,7 +1115,7 @@ void wxWindowDC::SetClippingRegion( long x, long y, long width, long height ) void wxWindowDC::SetClippingRegion( const wxRegion ®ion ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); if (region.Empty()) { @@ -1131,7 +1131,7 @@ void wxWindowDC::SetClippingRegion( const wxRegion ®ion ) void wxWindowDC::DestroyClippingRegion() { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxDC::DestroyClippingRegion(); @@ -1320,7 +1320,7 @@ static void wx_spline_draw_point_array(wxDC *dc) void wxWindowDC::DrawSpline( wxList *points ) { - wxCHECK_RET( Ok(), "invalid window dc" ); + wxCHECK_RET( Ok(), _T("invalid window dc") ); wxPoint *p; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index 7ffdb34a11..a86abfa51c 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -399,7 +399,7 @@ bool wxDropTarget::GetData( wxDataObject *data_object ) void wxDropTarget::UnregisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, "unregister widget is NULL" ); + wxCHECK_RET( widget != NULL, _T("unregister widget is NULL") ); gtk_drag_dest_unset( widget ); @@ -418,7 +418,7 @@ void wxDropTarget::UnregisterWidget( GtkWidget *widget ) void wxDropTarget::RegisterWidget( GtkWidget *widget ) { - wxCHECK_RET( widget != NULL, "register widget is NULL" ); + wxCHECK_RET( widget != NULL, _T("register widget is NULL") ); /* gtk_drag_dest_set() determines what default behaviour we'd like GTK to supply. we don't want to specify out targets (=formats) @@ -474,7 +474,7 @@ bool wxTextDropTarget::OnData( int x, int y ) wxTextDataObject data; if (!GetData( &data )) return FALSE; - OnDropText( x, y, data.GetText() ); + OnDropText( x, y, data.GetText().mbc_str() ); return TRUE; } @@ -550,19 +550,19 @@ bool wxFileDropTarget::OnData( int x, int y ) size_t number = 0; size_t i; size_t size = data.GetFiles().Length(); - char *text = WXSTRINGCAST data.GetFiles(); + wxChar *text = WXSTRINGCAST data.GetFiles(); for ( i = 0; i < size; i++) if (text[i] == 0) number++; if (number == 0) return FALSE; - char **files = new char*[number]; + wxChar **files = new wxChar*[number]; text = WXSTRINGCAST data.GetFiles(); for (i = 0; i < number; i++) { files[i] = text; - int len = strlen( text ); + int len = wxStrlen( text ); text += len+1; } @@ -755,7 +755,7 @@ wxDropSource::~wxDropSource(void) wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) { - wxASSERT_MSG( m_data, "wxDragSource: no data" ); + wxASSERT_MSG( m_data, _T("wxDragSource: no data") ); if (!m_data) return (wxDragResult) wxDragNone; @@ -1547,4 +1547,4 @@ shape_create_icon (const wxIcon &shape, #endif - // wxUSE_DRAG_AND_DROP \ No newline at end of file + // wxUSE_DRAG_AND_DROP -- 2.45.2