These at least compiles in Unicode mode...

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2167 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ove Kaaven
1999-04-14 21:53:47 +00:00
parent 578c208107
commit 93c5dd39af
20 changed files with 364 additions and 356 deletions

View File

@@ -43,7 +43,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
bool wxCheckListBox::IsChecked( int index ) const 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 ); GList *child = g_list_nth( m_list->children, index );
if (child) if (child)
@@ -56,13 +56,13 @@ bool wxCheckListBox::IsChecked( int index ) const
return (str[1] == 'X'); return (str[1] == 'X');
} }
wxFAIL_MSG("wrong checklistbox index"); wxFAIL_MSG(_T("wrong checklistbox index"));
return FALSE; return FALSE;
} }
void wxCheckListBox::Check( int index, bool check ) 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 ); GList *child = g_list_nth( m_list->children, index );
if (child) if (child)
@@ -72,19 +72,19 @@ void wxCheckListBox::Check( int index, bool check )
wxString str = label->label; wxString str = label->label;
if (check == (str[1] == 'X')) return; if (check == (str[1] == _T('X'))) return;
if (check) if (check)
str.SetChar( 1, 'X' ); str.SetChar( 1, _T('X') );
else else
str.SetChar( 1, '-' ); str.SetChar( 1, _T('-') );
gtk_label_set( label, str ); gtk_label_set( label, str.mbc_str() );
return; return;
} }
wxFAIL_MSG("wrong checklistbox index"); wxFAIL_MSG(_T("wrong checklistbox index"));
} }
int wxCheckListBox::GetItemHeight() const int wxCheckListBox::GetItemHeight() const

View File

@@ -82,7 +82,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
m_clientDataList.Append( (wxObject*) NULL ); m_clientDataList.Append( (wxObject*) NULL );
m_clientObjectList.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_menu_append( GTK_MENU(menu), item );
gtk_widget_realize( item ); gtk_widget_realize( item );
@@ -117,10 +117,10 @@ wxChoice::~wxChoice()
void wxChoice::AppendCommon( const wxString &item ) 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 = 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 ); 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 ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return; if (!node) return;
@@ -171,7 +171,7 @@ void wxChoice::SetClientData( int n, void* clientData )
void* wxChoice::GetClientData( int n ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL; if (!node) return NULL;
@@ -181,7 +181,7 @@ void* wxChoice::GetClientData( int n )
void wxChoice::SetClientObject( int n, wxClientData* clientData ) 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 ); wxNode *node = m_clientObjectList.Nth( n );
if (!node) return; if (!node) return;
@@ -194,7 +194,7 @@ void wxChoice::SetClientObject( int n, wxClientData* clientData )
wxClientData* wxChoice::GetClientObject( int n ) 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 ); wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL; if (!node) return (wxClientData*) NULL;
@@ -204,7 +204,7 @@ wxClientData* wxChoice::GetClientObject( int n )
void wxChoice::Clear() 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) ); gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new(); GtkWidget *menu = gtk_menu_new();
@@ -224,12 +224,12 @@ void wxChoice::Clear()
void wxChoice::Delete( int WXUNUSED(n) ) 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 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 // If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling. // 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 (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->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) if (string == label->label)
return count; return count;
@@ -263,7 +263,7 @@ int wxChoice::GetColumns() const
int wxChoice::GetSelection() 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) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -276,14 +276,14 @@ int wxChoice::GetSelection()
count++; count++;
} }
wxFAIL_MSG( "wxChoice: no selection" ); wxFAIL_MSG( _T("wxChoice: no selection") );
return -1; return -1;
} }
wxString wxChoice::GetString( int n ) const 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) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -297,7 +297,7 @@ wxString wxChoice::GetString( int n ) const
if (bin->child) label = GTK_LABEL(bin->child); if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->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; return label->label;
} }
@@ -305,25 +305,25 @@ wxString wxChoice::GetString( int n ) const
count++; count++;
} }
wxFAIL_MSG( "wxChoice: invalid index in GetString()" ); wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
return ""; return "";
} }
wxString wxChoice::GetStringSelection() const 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 ); 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; return label->label;
} }
int wxChoice::Number() const 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) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -342,7 +342,7 @@ void wxChoice::SetColumns( int WXUNUSED(n) )
void wxChoice::SetSelection( int n ) void wxChoice::SetSelection( int n )
{ {
wxCHECK_RET( m_widget != NULL, "invalid choice" ); wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
int tmp = n; int tmp = n;
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp ); 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 ) 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 ); int n = FindString( string );
if (n != -1) SetSelection( n ); if (n != -1) SetSelection( n );

View File

@@ -273,14 +273,19 @@ selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data
wxString text = text_object->GetText(); 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(); int len = (int) text.Length();
#endif
gtk_selection_data_set( gtk_selection_data_set(
selection_data, selection_data,
GDK_SELECTION_TYPE_STRING, GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar), 8*sizeof(gchar),
(unsigned char*) s, (unsigned char*) (const char*) s,
len ); len );
break; break;
@@ -405,7 +410,7 @@ void wxClipboard::Clear()
bool wxClipboard::Open() bool wxClipboard::Open()
{ {
wxCHECK_MSG( !m_open, FALSE, "clipboard already open" ); wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
m_open = TRUE; m_open = TRUE;
@@ -414,9 +419,9 @@ bool wxClipboard::Open()
bool wxClipboard::SetData( wxDataObject *data ) 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(); Clear();
@@ -425,9 +430,9 @@ bool wxClipboard::SetData( wxDataObject *data )
bool wxClipboard::AddData( 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 */ /* if clipboard has been cleared before, create new data broker */
@@ -441,7 +446,7 @@ bool wxClipboard::AddData( wxDataObject *data )
GdkAtom format = data->GetFormat().GetAtom(); 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 */ /* This should happen automatically, but to be on the safe side */
@@ -506,20 +511,20 @@ bool wxClipboard::AddData( wxDataObject *data )
void wxClipboard::Close() void wxClipboard::Close()
{ {
wxCHECK_RET( m_open, "clipboard not open" ); wxCHECK_RET( m_open, _T("clipboard not open") );
m_open = FALSE; m_open = FALSE;
} }
bool wxClipboard::IsSupported( wxDataFormat format ) 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 */ /* store requested format to be asked for by callbacks */
m_targetRequested = format.GetAtom(); m_targetRequested = format.GetAtom();
wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
m_formatSupported = FALSE; m_formatSupported = FALSE;
@@ -547,7 +552,7 @@ bool wxClipboard::IsSupported( wxDataFormat format )
bool wxClipboard::GetData( wxDataObject *data ) 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 ? */ /* is data supported by clipboard ? */
@@ -561,7 +566,7 @@ bool wxClipboard::GetData( wxDataObject *data )
m_targetRequested = data->GetFormat().GetAtom(); m_targetRequested = data->GetFormat().GetAtom();
wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
/* start query */ /* 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 */ /* 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; return TRUE;
} }

View File

@@ -89,10 +89,10 @@ void wxColour::InitFromName( const wxString &colourName )
else else
{ {
m_refData = new wxColourRefData(); 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" ); wxFAIL_MSG( _T("wxColour: couldn't find colour") );
printf( "Colourname %s.\n", WXSTRINGCAST colourName ); wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData; delete m_refData;
m_refData = (wxObjectRefData *) NULL; 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 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); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
} }
unsigned char wxColour::Green() const 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); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
} }
unsigned char wxColour::Blue() const 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); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
} }
@@ -200,14 +200,14 @@ void wxColour::CalcPixel( GdkColormap *cmap )
int wxColour::GetPixel() const int wxColour::GetPixel() const
{ {
wxCHECK_MSG( Ok(), 0, "invalid colour" ); wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return M_COLDATA->m_color.pixel; return M_COLDATA->m_color.pixel;
} }
GdkColor *wxColour::GetColor() const GdkColor *wxColour::GetColor() const
{ {
wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" ); wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") );
return &M_COLDATA->m_color; return &M_COLDATA->m_color;
} }

View File

@@ -106,7 +106,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
for (int i = 0; i < n; i++) 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_clientDataList.Append( (wxObject*)NULL );
m_clientObjectList.Append( (wxObject*)NULL ); m_clientObjectList.Append( (wxObject*)NULL );
@@ -165,11 +165,11 @@ wxComboBox::~wxComboBox()
void wxComboBox::AppendCommon( const wxString &item ) 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 = 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_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this ); 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 ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return; if (!node) return;
@@ -217,7 +217,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
void* wxComboBox::GetClientData( int n ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL; if (!node) return NULL;
@@ -227,7 +227,7 @@ void* wxComboBox::GetClientData( int n )
void wxComboBox::SetClientObject( int n, wxClientData* clientData ) 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 ); wxNode *node = m_clientObjectList.Nth( n );
if (!node) return; if (!node) return;
@@ -240,7 +240,7 @@ void wxComboBox::SetClientObject( int n, wxClientData* clientData )
wxClientData* wxComboBox::GetClientObject( int n ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return (wxClientData*) NULL; if (!node) return (wxClientData*) NULL;
@@ -250,7 +250,7 @@ wxClientData* wxComboBox::GetClientObject( int n )
void wxComboBox::Clear() 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() ); gtk_list_clear_items( GTK_LIST(list), 0, Number() );
@@ -269,7 +269,7 @@ void wxComboBox::Clear()
void wxComboBox::Delete( int n ) 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 ); GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list );
@@ -277,7 +277,7 @@ void wxComboBox::Delete( int n )
if (!child) if (!child)
{ {
wxFAIL_MSG("wrong index"); wxFAIL_MSG(_T("wrong index"));
return; return;
} }
@@ -302,7 +302,7 @@ void wxComboBox::Delete( int n )
int wxComboBox::FindString( const wxString &item ) 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -323,7 +323,7 @@ int wxComboBox::FindString( const wxString &item )
int wxComboBox::GetSelection() const 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; 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; return -1;
} }
wxString wxComboBox::GetString( int n ) const 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -361,7 +361,7 @@ wxString wxComboBox::GetString( int n ) const
} }
else else
{ {
wxFAIL_MSG( "wxComboBox: wrong index" ); wxFAIL_MSG( _T("wxComboBox: wrong index") );
} }
return str; return str;
@@ -369,7 +369,7 @@ wxString wxComboBox::GetString( int n ) const
wxString wxComboBox::GetStringSelection() 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -381,14 +381,14 @@ wxString wxComboBox::GetStringSelection() const
return tmp; return tmp;
} }
wxFAIL_MSG( "wxComboBox: no selection" ); wxFAIL_MSG( _T("wxComboBox: no selection") );
return ""; return _T("");
} }
int wxComboBox::Number() const 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -400,7 +400,7 @@ int wxComboBox::Number() const
void wxComboBox::SetSelection( int n ) 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n ); gtk_list_select_item( GTK_LIST(list), n );
@@ -408,7 +408,7 @@ void wxComboBox::SetSelection( int n )
void wxComboBox::SetStringSelection( const wxString &string ) 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 ); int res = FindString( string );
if (res == -1) return; if (res == -1) return;
@@ -424,17 +424,17 @@ wxString wxComboBox::GetValue() const
void wxComboBox::SetValue( const wxString& value ) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp = ""; wxString tmp = _T("");
if (!value.IsNull()) tmp = value; 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() 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
@@ -446,7 +446,7 @@ void wxComboBox::Copy()
void wxComboBox::Cut() 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
@@ -458,7 +458,7 @@ void wxComboBox::Cut()
void wxComboBox::Paste() 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
@@ -470,7 +470,7 @@ void wxComboBox::Paste()
void wxComboBox::SetInsertionPoint( long pos ) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_entry_set_position( GTK_ENTRY(entry), (int)pos ); gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );
@@ -478,7 +478,7 @@ void wxComboBox::SetInsertionPoint( long pos )
void wxComboBox::SetInsertionPointEnd() void wxComboBox::SetInsertionPointEnd()
{ {
wxCHECK_RET( m_widget != NULL, "invalid combobox" ); wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
SetInsertionPoint( -1 ); SetInsertionPoint( -1 );
} }
@@ -498,18 +498,19 @@ long wxComboBox::GetLastPosition() const
void wxComboBox::Replace( long from, long to, const wxString& value ) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
if (value.IsNull()) return; if (value.IsNull()) return;
gint pos = (gint)to; 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) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );

View File

@@ -84,7 +84,7 @@ wxCursor::wxCursor( int cursorId )
case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break;
*/ */
default: default:
wxFAIL_MSG("unsupported cursor type"); wxFAIL_MSG(_T("unsupported cursor type"));
// will use the standard one // will use the standard one
case wxCURSOR_ARROW: case wxCURSOR_ARROW:
@@ -148,7 +148,7 @@ void wxEndBusyCursor()
return; return;
wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(), wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(),
"calling wxEndBusyCursor() without wxBeginBusyCursor()?" ); _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") );
wxSetCursor(*gs_savedCursor); wxSetCursor(*gs_savedCursor);
delete gs_savedCursor; delete gs_savedCursor;
@@ -161,7 +161,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
return; return;
wxASSERT_MSG( !gs_savedCursor, wxASSERT_MSG( !gs_savedCursor,
"forgot to call wxEndBusyCursor, will leak memory" ); _T("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = new wxCursor; gs_savedCursor = new wxCursor;
if ( g_globalCursor && g_globalCursor->Ok() ) if ( g_globalCursor && g_globalCursor->Ok() )
@@ -180,5 +180,3 @@ void wxSetCursor( const wxCursor& cursor )
{ {
if (g_globalCursor) (*g_globalCursor) = cursor; if (g_globalCursor) (*g_globalCursor) = cursor;
} }

View File

@@ -134,44 +134,44 @@ wxColour wxNullColour;
wxPalette wxNullPalette; wxPalette wxNullPalette;
/* Default window names */ /* Default window names */
const char *wxButtonNameStr = "button"; const wxChar *wxButtonNameStr = _T("button");
const char *wxCanvasNameStr = "canvas"; const wxChar *wxCanvasNameStr = _T("canvas");
const char *wxCheckBoxNameStr = "check"; const wxChar *wxCheckBoxNameStr = _T("check");
const char *wxChoiceNameStr = "choice"; const wxChar *wxChoiceNameStr = _T("choice");
const char *wxComboBoxNameStr = "comboBox"; const wxChar *wxComboBoxNameStr = _T("comboBox");
const char *wxDialogNameStr = "dialog"; const wxChar *wxDialogNameStr = _T("dialog");
const char *wxFrameNameStr = "frame"; const wxChar *wxFrameNameStr = _T("frame");
const char *wxGaugeNameStr = "gauge"; const wxChar *wxGaugeNameStr = _T("gauge");
const char *wxStaticBoxNameStr = "groupBox"; const wxChar *wxStaticBoxNameStr = _T("groupBox");
const char *wxListBoxNameStr = "listBox"; const wxChar *wxListBoxNameStr = _T("listBox");
const char *wxStaticTextNameStr = "message"; const wxChar *wxStaticTextNameStr = _T("message");
const char *wxStaticBitmapNameStr = "message"; const wxChar *wxStaticBitmapNameStr = _T("message");
const char *wxMultiTextNameStr = "multitext"; const wxChar *wxMultiTextNameStr = _T("multitext");
const char *wxPanelNameStr = "panel"; const wxChar *wxPanelNameStr = _T("panel");
const char *wxRadioBoxNameStr = "radioBox"; const wxChar *wxRadioBoxNameStr = _T("radioBox");
const char *wxRadioButtonNameStr = "radioButton"; const wxChar *wxRadioButtonNameStr = _T("radioButton");
const char *wxBitmapRadioButtonNameStr = "radioButton"; const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
const char *wxScrollBarNameStr = "scrollBar"; const wxChar *wxScrollBarNameStr = _T("scrollBar");
const char *wxSliderNameStr = "slider"; const wxChar *wxSliderNameStr = _T("slider");
const char *wxStaticNameStr = "static"; const wxChar *wxStaticNameStr = _T("static");
const char *wxTextCtrlWindowNameStr = "textWindow"; const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
const char *wxTextCtrlNameStr = "text"; const wxChar *wxTextCtrlNameStr = _T("text");
const char *wxVirtListBoxNameStr = "virtListBox"; const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
const char *wxButtonBarNameStr = "buttonbar"; const wxChar *wxButtonBarNameStr = _T("buttonbar");
const char *wxEnhDialogNameStr = "Shell"; const wxChar *wxEnhDialogNameStr = _T("Shell");
const char *wxToolBarNameStr = "toolbar"; const wxChar *wxToolBarNameStr = _T("toolbar");
const char *wxStatusLineNameStr = "status_line"; const wxChar *wxStatusLineNameStr = _T("status_line");
const char *wxEmptyString = ""; const wxChar *wxEmptyString = _T("");
const char *wxGetTextFromUserPromptStr = "Input Text"; const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
const char *wxMessageBoxCaptionStr = "Message"; const wxChar *wxMessageBoxCaptionStr = _T("Message");
const char *wxFileSelectorPromptStr = "Select a file"; const wxChar *wxFileSelectorPromptStr = _T("Select a file");
const char *wxFileSelectorDefaultWildcardStr = "*.*"; const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*");
const char *wxInternalErrorStr = "wxWindows Internal Error"; const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
const char *wxFatalErrorStr = "wxWindows Fatal Error"; const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
/* See wx/utils.h */ /* See wx/utils.h */
const char *wxFloatToStringStr = "%.2f"; const wxChar *wxFloatToStringStr = _T("%.2f");
const char *wxDoubleToStringStr = "%.2f"; const wxChar *wxDoubleToStringStr = _T("%.2f");
/* Dafaults for wxWindow etc. */ /* Dafaults for wxWindow etc. */
const wxSize wxDefaultSize(-1, -1); const wxSize wxDefaultSize(-1, -1);

View File

@@ -78,7 +78,7 @@ wxDataFormat::wxDataFormat( const GdkAtom atom )
m_type = wxDF_PRIVATE; m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom ); m_id = gdk_atom_name( m_atom );
if (m_id == "file:ALL") if (m_id == _T("file:ALL"))
{ {
m_type = wxDF_FILENAME; m_type = wxDF_FILENAME;
} }
@@ -91,21 +91,21 @@ void wxDataFormat::SetType( wxDataType type )
if (m_type == wxDF_TEXT) if (m_type == wxDF_TEXT)
{ {
m_id = "STRING"; m_id = _T("STRING");
} }
else else
if (m_type == wxDF_BITMAP) if (m_type == wxDF_BITMAP)
{ {
m_id = "BITMAP"; m_id = _T("BITMAP");
} }
else else
if (m_type == wxDF_FILENAME) if (m_type == wxDF_FILENAME)
{ {
m_id = "file:ALL"; m_id = _T("file:ALL");
} }
else else
{ {
wxFAIL_MSG( "invalid dataformat" ); wxFAIL_MSG( _T("invalid dataformat") );
} }
m_hasAtom = FALSE; m_hasAtom = FALSE;
@@ -146,7 +146,7 @@ GdkAtom wxDataFormat::GetAtom()
else else
if (m_type == wxDF_PRIVATE) 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 else
if (m_type == wxDF_FILENAME) if (m_type == wxDF_FILENAME)
@@ -352,7 +352,7 @@ wxFileDataObject::wxFileDataObject()
void wxFileDataObject::AddFile( const wxString &file ) void wxFileDataObject::AddFile( const wxString &file )
{ {
m_files += file; m_files += file;
m_files += (char)0; m_files += (wxChar)0;
} }
wxString wxFileDataObject::GetFiles() const wxString wxFileDataObject::GetFiles() const

View File

@@ -140,18 +140,18 @@ wxWindowDC::~wxWindowDC()
void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y), void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) ) 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 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; return FALSE;
} }
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 ) 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) 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 ) 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) 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 ) 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 xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1); 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 ) 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 xx = XLOG2DEV(x);
long yy = YLOG2DEV(y); 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 ) 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) if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) ); 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 ) 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 (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) 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 ) 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; 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) ) 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; 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)) 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(); int n = lines->Number();
if (n <= 0) return; 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 ) 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 xx = XLOG2DEV(x);
long yy = YLOG2DEV(y); 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 ) 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); 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 ) 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 xx = XLOG2DEV(x);
long yy = YLOG2DEV(y); 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 ) 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; 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 of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */ 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; wxClientDC *srcDC = (wxClientDC*)source;
wxMemoryDC *memDC = (wxMemoryDC*)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) ) 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 ); 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 */ /* CMB 21/5/98: draw text background if mode is wxSOLID */
if (m_backgroundMode == 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; long height = font->ascent + font->descent;
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() ); gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height ); gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); 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 /* CMB 17/7/98: simple underline: ignores scaling and underlying
X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS
properties (see wxXt implementation) */ properties (see wxXt implementation) */
if (m_font.GetUnderlined()) 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; long ul_y = y + font->ascent;
if (font->descent > 0) ul_y++; if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, 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, long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) ) wxFont *theFont, bool WXUNUSED(use16) )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
wxFont fontToUse = m_font; wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont; if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( m_scaleY ); 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 (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = long(font->descent / m_scaleY); if (descent) (*descent) = long(font->descent / m_scaleY);
if (externalLeading) (*externalLeading) = 0; // ?? if (externalLeading) (*externalLeading) = 0; // ??
@@ -841,7 +841,7 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh
long wxWindowDC::GetCharWidth() 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 ); GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX); return long(gdk_string_width( font, "H" ) / m_scaleX);
@@ -849,7 +849,7 @@ long wxWindowDC::GetCharWidth()
long wxWindowDC::GetCharHeight() 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 ); GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY); return long((font->ascent + font->descent) / m_scaleY);
@@ -857,7 +857,7 @@ long wxWindowDC::GetCharHeight()
void wxWindowDC::Clear() 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 /* - we either are a memory dc or have a window as the
owner. anything else shouldn't happen. owner. anything else shouldn't happen.
@@ -885,14 +885,14 @@ void wxWindowDC::Clear()
void wxWindowDC::SetFont( const wxFont &font ) void wxWindowDC::SetFont( const wxFont &font )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
m_font = font; m_font = font;
} }
void wxWindowDC::SetPen( const wxPen &pen ) void wxWindowDC::SetPen( const wxPen &pen )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen == pen) return; if (m_pen == pen) return;
@@ -948,7 +948,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
void wxWindowDC::SetBrush( const wxBrush &brush ) void wxWindowDC::SetBrush( const wxBrush &brush )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_brush == brush) return; if (m_brush == brush) return;
@@ -991,7 +991,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
/* CMB 21/7/98: Added SetBackground. Sets background brush /* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch 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; if (m_backgroundBrush == brush) return;
@@ -1031,7 +1031,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
void wxWindowDC::SetLogicalFunction( int function ) void wxWindowDC::SetLogicalFunction( int function )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_logicalFunction == function) return; if (m_logicalFunction == function) return;
@@ -1051,7 +1051,7 @@ void wxWindowDC::SetLogicalFunction( int function )
void wxWindowDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextForeground( const wxColour &col )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_textForegroundColour == col) return; if (m_textForegroundColour == col) return;
@@ -1064,7 +1064,7 @@ void wxWindowDC::SetTextForeground( const wxColour &col )
void wxWindowDC::SetTextBackground( 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; if (m_textBackgroundColour == col) return;
@@ -1077,7 +1077,7 @@ void wxWindowDC::SetTextBackground( const wxColour &col )
void wxWindowDC::SetBackgroundMode( int mode ) void wxWindowDC::SetBackgroundMode( int mode )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
m_backgroundMode = mode; m_backgroundMode = mode;
@@ -1093,12 +1093,12 @@ void wxWindowDC::SetBackgroundMode( int mode )
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) 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 ) 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 ); 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 &region ) void wxWindowDC::SetClippingRegion( const wxRegion &region )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (region.Empty()) if (region.Empty())
{ {
@@ -1131,7 +1131,7 @@ void wxWindowDC::SetClippingRegion( const wxRegion &region )
void wxWindowDC::DestroyClippingRegion() void wxWindowDC::DestroyClippingRegion()
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
wxDC::DestroyClippingRegion(); wxDC::DestroyClippingRegion();
@@ -1320,7 +1320,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
void wxWindowDC::DrawSpline( wxList *points ) void wxWindowDC::DrawSpline( wxList *points )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
wxPoint *p; wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;

View File

@@ -399,7 +399,7 @@ bool wxDropTarget::GetData( wxDataObject *data_object )
void wxDropTarget::UnregisterWidget( GtkWidget *widget ) 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 ); gtk_drag_dest_unset( widget );
@@ -418,7 +418,7 @@ void wxDropTarget::UnregisterWidget( GtkWidget *widget )
void wxDropTarget::RegisterWidget( 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_drag_dest_set() determines what default behaviour we'd like
GTK to supply. we don't want to specify out targets (=formats) 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; wxTextDataObject data;
if (!GetData( &data )) return FALSE; if (!GetData( &data )) return FALSE;
OnDropText( x, y, data.GetText() ); OnDropText( x, y, data.GetText().mbc_str() );
return TRUE; return TRUE;
} }
@@ -550,19 +550,19 @@ bool wxFileDropTarget::OnData( int x, int y )
size_t number = 0; size_t number = 0;
size_t i; size_t i;
size_t size = data.GetFiles().Length(); size_t size = data.GetFiles().Length();
char *text = WXSTRINGCAST data.GetFiles(); wxChar *text = WXSTRINGCAST data.GetFiles();
for ( i = 0; i < size; i++) for ( i = 0; i < size; i++)
if (text[i] == 0) number++; if (text[i] == 0) number++;
if (number == 0) return FALSE; if (number == 0) return FALSE;
char **files = new char*[number]; wxChar **files = new wxChar*[number];
text = WXSTRINGCAST data.GetFiles(); text = WXSTRINGCAST data.GetFiles();
for (i = 0; i < number; i++) for (i = 0; i < number; i++)
{ {
files[i] = text; files[i] = text;
int len = strlen( text ); int len = wxStrlen( text );
text += len+1; text += len+1;
} }
@@ -755,7 +755,7 @@ wxDropSource::~wxDropSource(void)
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) 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; if (!m_data) return (wxDragResult) wxDragNone;
@@ -1547,4 +1547,4 @@ shape_create_icon (const wxIcon &shape,
#endif #endif
// wxUSE_DRAG_AND_DROP // wxUSE_DRAG_AND_DROP

View File

@@ -43,7 +43,7 @@ wxCheckListBox::wxCheckListBox(wxWindow *parent, wxWindowID id,
bool wxCheckListBox::IsChecked( int index ) const 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 ); GList *child = g_list_nth( m_list->children, index );
if (child) if (child)
@@ -56,13 +56,13 @@ bool wxCheckListBox::IsChecked( int index ) const
return (str[1] == 'X'); return (str[1] == 'X');
} }
wxFAIL_MSG("wrong checklistbox index"); wxFAIL_MSG(_T("wrong checklistbox index"));
return FALSE; return FALSE;
} }
void wxCheckListBox::Check( int index, bool check ) 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 ); GList *child = g_list_nth( m_list->children, index );
if (child) if (child)
@@ -72,19 +72,19 @@ void wxCheckListBox::Check( int index, bool check )
wxString str = label->label; wxString str = label->label;
if (check == (str[1] == 'X')) return; if (check == (str[1] == _T('X'))) return;
if (check) if (check)
str.SetChar( 1, 'X' ); str.SetChar( 1, _T('X') );
else else
str.SetChar( 1, '-' ); str.SetChar( 1, _T('-') );
gtk_label_set( label, str ); gtk_label_set( label, str.mbc_str() );
return; return;
} }
wxFAIL_MSG("wrong checklistbox index"); wxFAIL_MSG(_T("wrong checklistbox index"));
} }
int wxCheckListBox::GetItemHeight() const int wxCheckListBox::GetItemHeight() const

View File

@@ -82,7 +82,7 @@ bool wxChoice::Create( wxWindow *parent, wxWindowID id,
m_clientDataList.Append( (wxObject*) NULL ); m_clientDataList.Append( (wxObject*) NULL );
m_clientObjectList.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_menu_append( GTK_MENU(menu), item );
gtk_widget_realize( item ); gtk_widget_realize( item );
@@ -117,10 +117,10 @@ wxChoice::~wxChoice()
void wxChoice::AppendCommon( const wxString &item ) 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 = 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 ); 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 ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return; if (!node) return;
@@ -171,7 +171,7 @@ void wxChoice::SetClientData( int n, void* clientData )
void* wxChoice::GetClientData( int n ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL; if (!node) return NULL;
@@ -181,7 +181,7 @@ void* wxChoice::GetClientData( int n )
void wxChoice::SetClientObject( int n, wxClientData* clientData ) 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 ); wxNode *node = m_clientObjectList.Nth( n );
if (!node) return; if (!node) return;
@@ -194,7 +194,7 @@ void wxChoice::SetClientObject( int n, wxClientData* clientData )
wxClientData* wxChoice::GetClientObject( int n ) 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 ); wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL; if (!node) return (wxClientData*) NULL;
@@ -204,7 +204,7 @@ wxClientData* wxChoice::GetClientObject( int n )
void wxChoice::Clear() 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) ); gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new(); GtkWidget *menu = gtk_menu_new();
@@ -224,12 +224,12 @@ void wxChoice::Clear()
void wxChoice::Delete( int WXUNUSED(n) ) 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 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 // If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling. // 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 (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->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) if (string == label->label)
return count; return count;
@@ -263,7 +263,7 @@ int wxChoice::GetColumns() const
int wxChoice::GetSelection() 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) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -276,14 +276,14 @@ int wxChoice::GetSelection()
count++; count++;
} }
wxFAIL_MSG( "wxChoice: no selection" ); wxFAIL_MSG( _T("wxChoice: no selection") );
return -1; return -1;
} }
wxString wxChoice::GetString( int n ) const 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) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -297,7 +297,7 @@ wxString wxChoice::GetString( int n ) const
if (bin->child) label = GTK_LABEL(bin->child); if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->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; return label->label;
} }
@@ -305,25 +305,25 @@ wxString wxChoice::GetString( int n ) const
count++; count++;
} }
wxFAIL_MSG( "wxChoice: invalid index in GetString()" ); wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
return ""; return "";
} }
wxString wxChoice::GetStringSelection() const 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 ); 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; return label->label;
} }
int wxChoice::Number() const 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) ) ); GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0; int count = 0;
@@ -342,7 +342,7 @@ void wxChoice::SetColumns( int WXUNUSED(n) )
void wxChoice::SetSelection( int n ) void wxChoice::SetSelection( int n )
{ {
wxCHECK_RET( m_widget != NULL, "invalid choice" ); wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
int tmp = n; int tmp = n;
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp ); 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 ) 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 ); int n = FindString( string );
if (n != -1) SetSelection( n ); if (n != -1) SetSelection( n );

View File

@@ -273,14 +273,19 @@ selection_handler( GtkWidget *WXUNUSED(widget), GtkSelectionData *selection_data
wxString text = text_object->GetText(); 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(); int len = (int) text.Length();
#endif
gtk_selection_data_set( gtk_selection_data_set(
selection_data, selection_data,
GDK_SELECTION_TYPE_STRING, GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar), 8*sizeof(gchar),
(unsigned char*) s, (unsigned char*) (const char*) s,
len ); len );
break; break;
@@ -405,7 +410,7 @@ void wxClipboard::Clear()
bool wxClipboard::Open() bool wxClipboard::Open()
{ {
wxCHECK_MSG( !m_open, FALSE, "clipboard already open" ); wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
m_open = TRUE; m_open = TRUE;
@@ -414,9 +419,9 @@ bool wxClipboard::Open()
bool wxClipboard::SetData( wxDataObject *data ) 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(); Clear();
@@ -425,9 +430,9 @@ bool wxClipboard::SetData( wxDataObject *data )
bool wxClipboard::AddData( 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 */ /* if clipboard has been cleared before, create new data broker */
@@ -441,7 +446,7 @@ bool wxClipboard::AddData( wxDataObject *data )
GdkAtom format = data->GetFormat().GetAtom(); 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 */ /* This should happen automatically, but to be on the safe side */
@@ -506,20 +511,20 @@ bool wxClipboard::AddData( wxDataObject *data )
void wxClipboard::Close() void wxClipboard::Close()
{ {
wxCHECK_RET( m_open, "clipboard not open" ); wxCHECK_RET( m_open, _T("clipboard not open") );
m_open = FALSE; m_open = FALSE;
} }
bool wxClipboard::IsSupported( wxDataFormat format ) 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 */ /* store requested format to be asked for by callbacks */
m_targetRequested = format.GetAtom(); m_targetRequested = format.GetAtom();
wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
m_formatSupported = FALSE; m_formatSupported = FALSE;
@@ -547,7 +552,7 @@ bool wxClipboard::IsSupported( wxDataFormat format )
bool wxClipboard::GetData( wxDataObject *data ) 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 ? */ /* is data supported by clipboard ? */
@@ -561,7 +566,7 @@ bool wxClipboard::GetData( wxDataObject *data )
m_targetRequested = data->GetFormat().GetAtom(); m_targetRequested = data->GetFormat().GetAtom();
wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" ); wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
/* start query */ /* 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 */ /* 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; return TRUE;
} }

View File

@@ -89,10 +89,10 @@ void wxColour::InitFromName( const wxString &colourName )
else else
{ {
m_refData = new wxColourRefData(); 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" ); wxFAIL_MSG( _T("wxColour: couldn't find colour") );
printf( "Colourname %s.\n", WXSTRINGCAST colourName ); wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData; delete m_refData;
m_refData = (wxObjectRefData *) NULL; 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 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); return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
} }
unsigned char wxColour::Green() const 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); return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
} }
unsigned char wxColour::Blue() const 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); return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
} }
@@ -200,14 +200,14 @@ void wxColour::CalcPixel( GdkColormap *cmap )
int wxColour::GetPixel() const int wxColour::GetPixel() const
{ {
wxCHECK_MSG( Ok(), 0, "invalid colour" ); wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return M_COLDATA->m_color.pixel; return M_COLDATA->m_color.pixel;
} }
GdkColor *wxColour::GetColor() const GdkColor *wxColour::GetColor() const
{ {
wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" ); wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") );
return &M_COLDATA->m_color; return &M_COLDATA->m_color;
} }

View File

@@ -106,7 +106,7 @@ bool wxComboBox::Create( wxWindow *parent, wxWindowID id, const wxString& value,
for (int i = 0; i < n; i++) 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_clientDataList.Append( (wxObject*)NULL );
m_clientObjectList.Append( (wxObject*)NULL ); m_clientObjectList.Append( (wxObject*)NULL );
@@ -165,11 +165,11 @@ wxComboBox::~wxComboBox()
void wxComboBox::AppendCommon( const wxString &item ) 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 = 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_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this ); 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 ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return; if (!node) return;
@@ -217,7 +217,7 @@ void wxComboBox::SetClientData( int n, void* clientData )
void* wxComboBox::GetClientData( int n ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL; if (!node) return NULL;
@@ -227,7 +227,7 @@ void* wxComboBox::GetClientData( int n )
void wxComboBox::SetClientObject( int n, wxClientData* clientData ) 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 ); wxNode *node = m_clientObjectList.Nth( n );
if (!node) return; if (!node) return;
@@ -240,7 +240,7 @@ void wxComboBox::SetClientObject( int n, wxClientData* clientData )
wxClientData* wxComboBox::GetClientObject( int n ) 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 ); wxNode *node = m_clientDataList.Nth( n );
if (!node) return (wxClientData*) NULL; if (!node) return (wxClientData*) NULL;
@@ -250,7 +250,7 @@ wxClientData* wxComboBox::GetClientObject( int n )
void wxComboBox::Clear() 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() ); gtk_list_clear_items( GTK_LIST(list), 0, Number() );
@@ -269,7 +269,7 @@ void wxComboBox::Clear()
void wxComboBox::Delete( int n ) 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 ); GtkList *listbox = GTK_LIST( GTK_COMBO(m_widget)->list );
@@ -277,7 +277,7 @@ void wxComboBox::Delete( int n )
if (!child) if (!child)
{ {
wxFAIL_MSG("wrong index"); wxFAIL_MSG(_T("wrong index"));
return; return;
} }
@@ -302,7 +302,7 @@ void wxComboBox::Delete( int n )
int wxComboBox::FindString( const wxString &item ) 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -323,7 +323,7 @@ int wxComboBox::FindString( const wxString &item )
int wxComboBox::GetSelection() const 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; 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; return -1;
} }
wxString wxComboBox::GetString( int n ) const 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -361,7 +361,7 @@ wxString wxComboBox::GetString( int n ) const
} }
else else
{ {
wxFAIL_MSG( "wxComboBox: wrong index" ); wxFAIL_MSG( _T("wxComboBox: wrong index") );
} }
return str; return str;
@@ -369,7 +369,7 @@ wxString wxComboBox::GetString( int n ) const
wxString wxComboBox::GetStringSelection() 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -381,14 +381,14 @@ wxString wxComboBox::GetStringSelection() const
return tmp; return tmp;
} }
wxFAIL_MSG( "wxComboBox: no selection" ); wxFAIL_MSG( _T("wxComboBox: no selection") );
return ""; return _T("");
} }
int wxComboBox::Number() const 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
@@ -400,7 +400,7 @@ int wxComboBox::Number() const
void wxComboBox::SetSelection( int n ) 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; GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n ); gtk_list_select_item( GTK_LIST(list), n );
@@ -408,7 +408,7 @@ void wxComboBox::SetSelection( int n )
void wxComboBox::SetStringSelection( const wxString &string ) 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 ); int res = FindString( string );
if (res == -1) return; if (res == -1) return;
@@ -424,17 +424,17 @@ wxString wxComboBox::GetValue() const
void wxComboBox::SetValue( const wxString& value ) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
wxString tmp = ""; wxString tmp = _T("");
if (!value.IsNull()) tmp = value; 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() 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
@@ -446,7 +446,7 @@ void wxComboBox::Copy()
void wxComboBox::Cut() 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
@@ -458,7 +458,7 @@ void wxComboBox::Cut()
void wxComboBox::Paste() 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0) #if (GTK_MINOR_VERSION > 0)
@@ -470,7 +470,7 @@ void wxComboBox::Paste()
void wxComboBox::SetInsertionPoint( long pos ) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_entry_set_position( GTK_ENTRY(entry), (int)pos ); gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );
@@ -478,7 +478,7 @@ void wxComboBox::SetInsertionPoint( long pos )
void wxComboBox::SetInsertionPointEnd() void wxComboBox::SetInsertionPointEnd()
{ {
wxCHECK_RET( m_widget != NULL, "invalid combobox" ); wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
SetInsertionPoint( -1 ); SetInsertionPoint( -1 );
} }
@@ -498,18 +498,19 @@ long wxComboBox::GetLastPosition() const
void wxComboBox::Replace( long from, long to, const wxString& value ) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
if (value.IsNull()) return; if (value.IsNull()) return;
gint pos = (gint)to; 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) 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; GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to ); gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );

View File

@@ -84,7 +84,7 @@ wxCursor::wxCursor( int cursorId )
case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break; case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break;
*/ */
default: default:
wxFAIL_MSG("unsupported cursor type"); wxFAIL_MSG(_T("unsupported cursor type"));
// will use the standard one // will use the standard one
case wxCURSOR_ARROW: case wxCURSOR_ARROW:
@@ -148,7 +148,7 @@ void wxEndBusyCursor()
return; return;
wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(), wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(),
"calling wxEndBusyCursor() without wxBeginBusyCursor()?" ); _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") );
wxSetCursor(*gs_savedCursor); wxSetCursor(*gs_savedCursor);
delete gs_savedCursor; delete gs_savedCursor;
@@ -161,7 +161,7 @@ void wxBeginBusyCursor( wxCursor *WXUNUSED(cursor) )
return; return;
wxASSERT_MSG( !gs_savedCursor, wxASSERT_MSG( !gs_savedCursor,
"forgot to call wxEndBusyCursor, will leak memory" ); _T("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = new wxCursor; gs_savedCursor = new wxCursor;
if ( g_globalCursor && g_globalCursor->Ok() ) if ( g_globalCursor && g_globalCursor->Ok() )
@@ -180,5 +180,3 @@ void wxSetCursor( const wxCursor& cursor )
{ {
if (g_globalCursor) (*g_globalCursor) = cursor; if (g_globalCursor) (*g_globalCursor) = cursor;
} }

View File

@@ -134,44 +134,44 @@ wxColour wxNullColour;
wxPalette wxNullPalette; wxPalette wxNullPalette;
/* Default window names */ /* Default window names */
const char *wxButtonNameStr = "button"; const wxChar *wxButtonNameStr = _T("button");
const char *wxCanvasNameStr = "canvas"; const wxChar *wxCanvasNameStr = _T("canvas");
const char *wxCheckBoxNameStr = "check"; const wxChar *wxCheckBoxNameStr = _T("check");
const char *wxChoiceNameStr = "choice"; const wxChar *wxChoiceNameStr = _T("choice");
const char *wxComboBoxNameStr = "comboBox"; const wxChar *wxComboBoxNameStr = _T("comboBox");
const char *wxDialogNameStr = "dialog"; const wxChar *wxDialogNameStr = _T("dialog");
const char *wxFrameNameStr = "frame"; const wxChar *wxFrameNameStr = _T("frame");
const char *wxGaugeNameStr = "gauge"; const wxChar *wxGaugeNameStr = _T("gauge");
const char *wxStaticBoxNameStr = "groupBox"; const wxChar *wxStaticBoxNameStr = _T("groupBox");
const char *wxListBoxNameStr = "listBox"; const wxChar *wxListBoxNameStr = _T("listBox");
const char *wxStaticTextNameStr = "message"; const wxChar *wxStaticTextNameStr = _T("message");
const char *wxStaticBitmapNameStr = "message"; const wxChar *wxStaticBitmapNameStr = _T("message");
const char *wxMultiTextNameStr = "multitext"; const wxChar *wxMultiTextNameStr = _T("multitext");
const char *wxPanelNameStr = "panel"; const wxChar *wxPanelNameStr = _T("panel");
const char *wxRadioBoxNameStr = "radioBox"; const wxChar *wxRadioBoxNameStr = _T("radioBox");
const char *wxRadioButtonNameStr = "radioButton"; const wxChar *wxRadioButtonNameStr = _T("radioButton");
const char *wxBitmapRadioButtonNameStr = "radioButton"; const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
const char *wxScrollBarNameStr = "scrollBar"; const wxChar *wxScrollBarNameStr = _T("scrollBar");
const char *wxSliderNameStr = "slider"; const wxChar *wxSliderNameStr = _T("slider");
const char *wxStaticNameStr = "static"; const wxChar *wxStaticNameStr = _T("static");
const char *wxTextCtrlWindowNameStr = "textWindow"; const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
const char *wxTextCtrlNameStr = "text"; const wxChar *wxTextCtrlNameStr = _T("text");
const char *wxVirtListBoxNameStr = "virtListBox"; const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
const char *wxButtonBarNameStr = "buttonbar"; const wxChar *wxButtonBarNameStr = _T("buttonbar");
const char *wxEnhDialogNameStr = "Shell"; const wxChar *wxEnhDialogNameStr = _T("Shell");
const char *wxToolBarNameStr = "toolbar"; const wxChar *wxToolBarNameStr = _T("toolbar");
const char *wxStatusLineNameStr = "status_line"; const wxChar *wxStatusLineNameStr = _T("status_line");
const char *wxEmptyString = ""; const wxChar *wxEmptyString = _T("");
const char *wxGetTextFromUserPromptStr = "Input Text"; const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
const char *wxMessageBoxCaptionStr = "Message"; const wxChar *wxMessageBoxCaptionStr = _T("Message");
const char *wxFileSelectorPromptStr = "Select a file"; const wxChar *wxFileSelectorPromptStr = _T("Select a file");
const char *wxFileSelectorDefaultWildcardStr = "*.*"; const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*");
const char *wxInternalErrorStr = "wxWindows Internal Error"; const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
const char *wxFatalErrorStr = "wxWindows Fatal Error"; const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
/* See wx/utils.h */ /* See wx/utils.h */
const char *wxFloatToStringStr = "%.2f"; const wxChar *wxFloatToStringStr = _T("%.2f");
const char *wxDoubleToStringStr = "%.2f"; const wxChar *wxDoubleToStringStr = _T("%.2f");
/* Dafaults for wxWindow etc. */ /* Dafaults for wxWindow etc. */
const wxSize wxDefaultSize(-1, -1); const wxSize wxDefaultSize(-1, -1);

View File

@@ -78,7 +78,7 @@ wxDataFormat::wxDataFormat( const GdkAtom atom )
m_type = wxDF_PRIVATE; m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom ); m_id = gdk_atom_name( m_atom );
if (m_id == "file:ALL") if (m_id == _T("file:ALL"))
{ {
m_type = wxDF_FILENAME; m_type = wxDF_FILENAME;
} }
@@ -91,21 +91,21 @@ void wxDataFormat::SetType( wxDataType type )
if (m_type == wxDF_TEXT) if (m_type == wxDF_TEXT)
{ {
m_id = "STRING"; m_id = _T("STRING");
} }
else else
if (m_type == wxDF_BITMAP) if (m_type == wxDF_BITMAP)
{ {
m_id = "BITMAP"; m_id = _T("BITMAP");
} }
else else
if (m_type == wxDF_FILENAME) if (m_type == wxDF_FILENAME)
{ {
m_id = "file:ALL"; m_id = _T("file:ALL");
} }
else else
{ {
wxFAIL_MSG( "invalid dataformat" ); wxFAIL_MSG( _T("invalid dataformat") );
} }
m_hasAtom = FALSE; m_hasAtom = FALSE;
@@ -146,7 +146,7 @@ GdkAtom wxDataFormat::GetAtom()
else else
if (m_type == wxDF_PRIVATE) 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 else
if (m_type == wxDF_FILENAME) if (m_type == wxDF_FILENAME)
@@ -352,7 +352,7 @@ wxFileDataObject::wxFileDataObject()
void wxFileDataObject::AddFile( const wxString &file ) void wxFileDataObject::AddFile( const wxString &file )
{ {
m_files += file; m_files += file;
m_files += (char)0; m_files += (wxChar)0;
} }
wxString wxFileDataObject::GetFiles() const wxString wxFileDataObject::GetFiles() const

View File

@@ -140,18 +140,18 @@ wxWindowDC::~wxWindowDC()
void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y), void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) ) 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 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; return FALSE;
} }
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 ) 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) 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 ) 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) 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 ) 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 xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1); 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 ) 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 xx = XLOG2DEV(x);
long yy = YLOG2DEV(y); 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 ) 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) if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) ); 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 ) 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 (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) 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 ) 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; 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) ) 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; 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)) 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(); int n = lines->Number();
if (n <= 0) return; 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 ) 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 xx = XLOG2DEV(x);
long yy = YLOG2DEV(y); 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 ) 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); 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 ) 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 xx = XLOG2DEV(x);
long yy = YLOG2DEV(y); 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 ) 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; 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 of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */ 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; wxClientDC *srcDC = (wxClientDC*)source;
wxMemoryDC *memDC = (wxMemoryDC*)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) ) 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 ); 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 */ /* CMB 21/5/98: draw text background if mode is wxSOLID */
if (m_backgroundMode == 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; long height = font->ascent + font->descent;
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() ); gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height ); gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() ); 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 /* CMB 17/7/98: simple underline: ignores scaling and underlying
X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS
properties (see wxXt implementation) */ properties (see wxXt implementation) */
if (m_font.GetUnderlined()) 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; long ul_y = y + font->ascent;
if (font->descent > 0) ul_y++; if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, 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, long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) ) wxFont *theFont, bool WXUNUSED(use16) )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
wxFont fontToUse = m_font; wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont; if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( m_scaleY ); 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 (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = long(font->descent / m_scaleY); if (descent) (*descent) = long(font->descent / m_scaleY);
if (externalLeading) (*externalLeading) = 0; // ?? if (externalLeading) (*externalLeading) = 0; // ??
@@ -841,7 +841,7 @@ void wxWindowDC::GetTextExtent( const wxString &string, long *width, long *heigh
long wxWindowDC::GetCharWidth() 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 ); GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX); return long(gdk_string_width( font, "H" ) / m_scaleX);
@@ -849,7 +849,7 @@ long wxWindowDC::GetCharWidth()
long wxWindowDC::GetCharHeight() 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 ); GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY); return long((font->ascent + font->descent) / m_scaleY);
@@ -857,7 +857,7 @@ long wxWindowDC::GetCharHeight()
void wxWindowDC::Clear() 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 /* - we either are a memory dc or have a window as the
owner. anything else shouldn't happen. owner. anything else shouldn't happen.
@@ -885,14 +885,14 @@ void wxWindowDC::Clear()
void wxWindowDC::SetFont( const wxFont &font ) void wxWindowDC::SetFont( const wxFont &font )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
m_font = font; m_font = font;
} }
void wxWindowDC::SetPen( const wxPen &pen ) void wxWindowDC::SetPen( const wxPen &pen )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen == pen) return; if (m_pen == pen) return;
@@ -948,7 +948,7 @@ void wxWindowDC::SetPen( const wxPen &pen )
void wxWindowDC::SetBrush( const wxBrush &brush ) void wxWindowDC::SetBrush( const wxBrush &brush )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_brush == brush) return; if (m_brush == brush) return;
@@ -991,7 +991,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
/* CMB 21/7/98: Added SetBackground. Sets background brush /* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch 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; if (m_backgroundBrush == brush) return;
@@ -1031,7 +1031,7 @@ void wxWindowDC::SetBackground( const wxBrush &brush )
void wxWindowDC::SetLogicalFunction( int function ) void wxWindowDC::SetLogicalFunction( int function )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_logicalFunction == function) return; if (m_logicalFunction == function) return;
@@ -1051,7 +1051,7 @@ void wxWindowDC::SetLogicalFunction( int function )
void wxWindowDC::SetTextForeground( const wxColour &col ) void wxWindowDC::SetTextForeground( const wxColour &col )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_textForegroundColour == col) return; if (m_textForegroundColour == col) return;
@@ -1064,7 +1064,7 @@ void wxWindowDC::SetTextForeground( const wxColour &col )
void wxWindowDC::SetTextBackground( 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; if (m_textBackgroundColour == col) return;
@@ -1077,7 +1077,7 @@ void wxWindowDC::SetTextBackground( const wxColour &col )
void wxWindowDC::SetBackgroundMode( int mode ) void wxWindowDC::SetBackgroundMode( int mode )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
m_backgroundMode = mode; m_backgroundMode = mode;
@@ -1093,12 +1093,12 @@ void wxWindowDC::SetBackgroundMode( int mode )
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) 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 ) 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 ); 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 &region ) void wxWindowDC::SetClippingRegion( const wxRegion &region )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
if (region.Empty()) if (region.Empty())
{ {
@@ -1131,7 +1131,7 @@ void wxWindowDC::SetClippingRegion( const wxRegion &region )
void wxWindowDC::DestroyClippingRegion() void wxWindowDC::DestroyClippingRegion()
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
wxDC::DestroyClippingRegion(); wxDC::DestroyClippingRegion();
@@ -1320,7 +1320,7 @@ static void wx_spline_draw_point_array(wxDC *dc)
void wxWindowDC::DrawSpline( wxList *points ) void wxWindowDC::DrawSpline( wxList *points )
{ {
wxCHECK_RET( Ok(), "invalid window dc" ); wxCHECK_RET( Ok(), _T("invalid window dc") );
wxPoint *p; wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4; double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;

View File

@@ -399,7 +399,7 @@ bool wxDropTarget::GetData( wxDataObject *data_object )
void wxDropTarget::UnregisterWidget( GtkWidget *widget ) 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 ); gtk_drag_dest_unset( widget );
@@ -418,7 +418,7 @@ void wxDropTarget::UnregisterWidget( GtkWidget *widget )
void wxDropTarget::RegisterWidget( 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_drag_dest_set() determines what default behaviour we'd like
GTK to supply. we don't want to specify out targets (=formats) 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; wxTextDataObject data;
if (!GetData( &data )) return FALSE; if (!GetData( &data )) return FALSE;
OnDropText( x, y, data.GetText() ); OnDropText( x, y, data.GetText().mbc_str() );
return TRUE; return TRUE;
} }
@@ -550,19 +550,19 @@ bool wxFileDropTarget::OnData( int x, int y )
size_t number = 0; size_t number = 0;
size_t i; size_t i;
size_t size = data.GetFiles().Length(); size_t size = data.GetFiles().Length();
char *text = WXSTRINGCAST data.GetFiles(); wxChar *text = WXSTRINGCAST data.GetFiles();
for ( i = 0; i < size; i++) for ( i = 0; i < size; i++)
if (text[i] == 0) number++; if (text[i] == 0) number++;
if (number == 0) return FALSE; if (number == 0) return FALSE;
char **files = new char*[number]; wxChar **files = new wxChar*[number];
text = WXSTRINGCAST data.GetFiles(); text = WXSTRINGCAST data.GetFiles();
for (i = 0; i < number; i++) for (i = 0; i < number; i++)
{ {
files[i] = text; files[i] = text;
int len = strlen( text ); int len = wxStrlen( text );
text += len+1; text += len+1;
} }
@@ -755,7 +755,7 @@ wxDropSource::~wxDropSource(void)
wxDragResult wxDropSource::DoDragDrop( bool WXUNUSED(bAllowMove) ) 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; if (!m_data) return (wxDragResult) wxDragNone;
@@ -1547,4 +1547,4 @@ shape_create_icon (const wxIcon &shape,
#endif #endif
// wxUSE_DRAG_AND_DROP // wxUSE_DRAG_AND_DROP