bool wxCheckListBox::IsChecked( int index ) const
{
- wxCHECK_MSG( m_list != NULL, FALSE, "invalid checklistbox" );
+ wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
return (str[1] == 'X');
}
- wxFAIL_MSG("wrong checklistbox index");
+ wxFAIL_MSG(_T("wrong checklistbox index"));
return FALSE;
}
void wxCheckListBox::Check( int index, bool check )
{
- wxCHECK_RET( m_list != NULL, "invalid checklistbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
wxString str = label->label;
- if (check == (str[1] == 'X')) return;
+ if (check == (str[1] == _T('X'))) return;
if (check)
- str.SetChar( 1, 'X' );
+ str.SetChar( 1, _T('X') );
else
- str.SetChar( 1, '-' );
+ str.SetChar( 1, _T('-') );
- gtk_label_set( label, str );
+ gtk_label_set( label, str.mbc_str() );
return;
}
- wxFAIL_MSG("wrong checklistbox index");
+ wxFAIL_MSG(_T("wrong checklistbox index"));
}
int wxCheckListBox::GetItemHeight() const
m_clientDataList.Append( (wxObject*) NULL );
m_clientObjectList.Append( (wxObject*) NULL );
- GtkWidget *item = gtk_menu_item_new_with_label( choices[i] );
+ GtkWidget *item = gtk_menu_item_new_with_label( choices[i].mbc_str() );
gtk_menu_append( GTK_MENU(menu), item );
gtk_widget_realize( item );
void wxChoice::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
- GtkWidget *menu_item = gtk_menu_item_new_with_label( item );
+ GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() );
gtk_menu_append( GTK_MENU(menu), menu_item );
void wxChoice::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxChoice::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxChoice::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxChoice::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxChoice::Clear()
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
void wxChoice::Delete( int WXUNUSED(n) )
{
- wxFAIL_MSG( "wxChoice:Delete not implemented" );
+ wxFAIL_MSG( _T("wxChoice:Delete not implemented") );
}
int wxChoice::FindString( const wxString &string ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
// If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling.
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+ wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
if (string == label->label)
return count;
int wxChoice::GetSelection()
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
count++;
}
- wxFAIL_MSG( "wxChoice: no selection" );
+ wxFAIL_MSG( _T("wxChoice: no selection") );
return -1;
}
wxString wxChoice::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+ wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label;
}
count++;
}
- wxFAIL_MSG( "wxChoice: invalid index in GetString()" );
+ wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
return "";
}
wxString wxChoice::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+ wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label;
}
int wxChoice::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
void wxChoice::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
int tmp = n;
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
void wxChoice::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
int n = FindString( string );
if (n != -1) SetSelection( n );
wxString text = text_object->GetText();
- char *s = WXSTRINGCAST text;
+#if wxUSE_UNICODE
+ const wxWX2MBbuf s = text.mbc_str();
+ int len = strlen(s);
+#else // more efficient in non-Unicode
+ const char *s = text.c_str();
int len = (int) text.Length();
+#endif
gtk_selection_data_set(
selection_data,
GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar),
- (unsigned char*) s,
+ (unsigned char*) (const char*) s,
len );
break;
bool wxClipboard::Open()
{
- wxCHECK_MSG( !m_open, FALSE, "clipboard already open" );
+ wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
m_open = TRUE;
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();
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 */
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 */
void wxClipboard::Close()
{
- wxCHECK_RET( m_open, "clipboard not open" );
+ wxCHECK_RET( m_open, _T("clipboard not open") );
m_open = FALSE;
}
bool wxClipboard::IsSupported( wxDataFormat format )
{
- wxCHECK_MSG( m_open, FALSE, "clipboard not open" );
+ wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
/* store requested format to be asked for by callbacks */
m_targetRequested = format.GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
+ wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
m_formatSupported = FALSE;
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 ? */
m_targetRequested = data->GetFormat().GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
+ wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
/* start query */
/* 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;
}
else
{
m_refData = new wxColourRefData();
- if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
+ if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color ))
{
- wxFAIL_MSG( "wxColour: couldn't find colour" );
- printf( "Colourname %s.\n", WXSTRINGCAST colourName );
+ wxFAIL_MSG( _T("wxColour: couldn't find colour") );
+ wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData;
m_refData = (wxObjectRefData *) NULL;
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return M_COLDATA->m_color.pixel;
}
GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" );
+ wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") );
return &M_COLDATA->m_color;
}
for (int i = 0; i < n; i++)
{
- GtkWidget *list_item = gtk_list_item_new_with_label( choices[i] );
+ GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() );
m_clientDataList.Append( (wxObject*)NULL );
m_clientObjectList.Append( (wxObject*)NULL );
void wxComboBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
- GtkWidget *list_item = gtk_list_item_new_with_label( item );
+ GtkWidget *list_item = gtk_list_item_new_with_label( item.mbc_str() );
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
void wxComboBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxComboBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxComboBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxComboBox::Clear()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
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 );
if (!child)
{
- wxFAIL_MSG("wrong index");
+ wxFAIL_MSG(_T("wrong index"));
return;
}
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;
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;
}
}
- wxFAIL_MSG( "wxComboBox: no selection" );
+ wxFAIL_MSG( _T("wxComboBox: no selection") );
return -1;
}
wxString wxComboBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
}
else
{
- wxFAIL_MSG( "wxComboBox: wrong index" );
+ wxFAIL_MSG( _T("wxComboBox: wrong index") );
}
return str;
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;
return tmp;
}
- wxFAIL_MSG( "wxComboBox: no selection" );
+ wxFAIL_MSG( _T("wxComboBox: no selection") );
- return "";
+ return _T("");
}
int wxComboBox::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
void wxComboBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n );
void wxComboBox::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
int res = FindString( string );
if (res == -1) return;
void wxComboBox::SetValue( const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
- wxString tmp = "";
+ wxString tmp = _T("");
if (!value.IsNull()) tmp = value;
- gtk_entry_set_text( GTK_ENTRY(entry), tmp );
+ gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() );
}
void wxComboBox::Copy()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Cut()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Paste()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::SetInsertionPoint( long pos )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );
void wxComboBox::SetInsertionPointEnd()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
SetInsertionPoint( -1 );
}
void wxComboBox::Replace( long from, long to, const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ // FIXME: not quite sure how to do this method right in multibyte mode
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
if (value.IsNull()) return;
gint pos = (gint)to;
- gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos );
+ gtk_editable_insert_text( GTK_EDITABLE(entry), value.mbc_str(), value.Length(), &pos );
}
void wxComboBox::Remove(long from, long to)
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break;
*/
default:
- wxFAIL_MSG("unsupported cursor type");
+ wxFAIL_MSG(_T("unsupported cursor type"));
// will use the standard one
case wxCURSOR_ARROW:
return;
wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(),
- "calling wxEndBusyCursor() without wxBeginBusyCursor()?" );
+ _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") );
wxSetCursor(*gs_savedCursor);
delete gs_savedCursor;
return;
wxASSERT_MSG( !gs_savedCursor,
- "forgot to call wxEndBusyCursor, will leak memory" );
+ _T("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = new wxCursor;
if ( g_globalCursor && g_globalCursor->Ok() )
{
if (g_globalCursor) (*g_globalCursor) = cursor;
}
-
-
wxPalette wxNullPalette;
/* Default window names */
-const char *wxButtonNameStr = "button";
-const char *wxCanvasNameStr = "canvas";
-const char *wxCheckBoxNameStr = "check";
-const char *wxChoiceNameStr = "choice";
-const char *wxComboBoxNameStr = "comboBox";
-const char *wxDialogNameStr = "dialog";
-const char *wxFrameNameStr = "frame";
-const char *wxGaugeNameStr = "gauge";
-const char *wxStaticBoxNameStr = "groupBox";
-const char *wxListBoxNameStr = "listBox";
-const char *wxStaticTextNameStr = "message";
-const char *wxStaticBitmapNameStr = "message";
-const char *wxMultiTextNameStr = "multitext";
-const char *wxPanelNameStr = "panel";
-const char *wxRadioBoxNameStr = "radioBox";
-const char *wxRadioButtonNameStr = "radioButton";
-const char *wxBitmapRadioButtonNameStr = "radioButton";
-const char *wxScrollBarNameStr = "scrollBar";
-const char *wxSliderNameStr = "slider";
-const char *wxStaticNameStr = "static";
-const char *wxTextCtrlWindowNameStr = "textWindow";
-const char *wxTextCtrlNameStr = "text";
-const char *wxVirtListBoxNameStr = "virtListBox";
-const char *wxButtonBarNameStr = "buttonbar";
-const char *wxEnhDialogNameStr = "Shell";
-const char *wxToolBarNameStr = "toolbar";
-const char *wxStatusLineNameStr = "status_line";
-const char *wxEmptyString = "";
-const char *wxGetTextFromUserPromptStr = "Input Text";
-const char *wxMessageBoxCaptionStr = "Message";
-const char *wxFileSelectorPromptStr = "Select a file";
-const char *wxFileSelectorDefaultWildcardStr = "*.*";
-const char *wxInternalErrorStr = "wxWindows Internal Error";
-const char *wxFatalErrorStr = "wxWindows Fatal Error";
+const wxChar *wxButtonNameStr = _T("button");
+const wxChar *wxCanvasNameStr = _T("canvas");
+const wxChar *wxCheckBoxNameStr = _T("check");
+const wxChar *wxChoiceNameStr = _T("choice");
+const wxChar *wxComboBoxNameStr = _T("comboBox");
+const wxChar *wxDialogNameStr = _T("dialog");
+const wxChar *wxFrameNameStr = _T("frame");
+const wxChar *wxGaugeNameStr = _T("gauge");
+const wxChar *wxStaticBoxNameStr = _T("groupBox");
+const wxChar *wxListBoxNameStr = _T("listBox");
+const wxChar *wxStaticTextNameStr = _T("message");
+const wxChar *wxStaticBitmapNameStr = _T("message");
+const wxChar *wxMultiTextNameStr = _T("multitext");
+const wxChar *wxPanelNameStr = _T("panel");
+const wxChar *wxRadioBoxNameStr = _T("radioBox");
+const wxChar *wxRadioButtonNameStr = _T("radioButton");
+const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
+const wxChar *wxScrollBarNameStr = _T("scrollBar");
+const wxChar *wxSliderNameStr = _T("slider");
+const wxChar *wxStaticNameStr = _T("static");
+const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
+const wxChar *wxTextCtrlNameStr = _T("text");
+const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
+const wxChar *wxButtonBarNameStr = _T("buttonbar");
+const wxChar *wxEnhDialogNameStr = _T("Shell");
+const wxChar *wxToolBarNameStr = _T("toolbar");
+const wxChar *wxStatusLineNameStr = _T("status_line");
+const wxChar *wxEmptyString = _T("");
+const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
+const wxChar *wxMessageBoxCaptionStr = _T("Message");
+const wxChar *wxFileSelectorPromptStr = _T("Select a file");
+const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*");
+const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
+const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
/* See wx/utils.h */
-const char *wxFloatToStringStr = "%.2f";
-const char *wxDoubleToStringStr = "%.2f";
+const wxChar *wxFloatToStringStr = _T("%.2f");
+const wxChar *wxDoubleToStringStr = _T("%.2f");
/* Dafaults for wxWindow etc. */
const wxSize wxDefaultSize(-1, -1);
m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom );
- if (m_id == "file:ALL")
+ if (m_id == _T("file:ALL"))
{
m_type = wxDF_FILENAME;
}
if (m_type == wxDF_TEXT)
{
- m_id = "STRING";
+ m_id = _T("STRING");
}
else
if (m_type == wxDF_BITMAP)
{
- m_id = "BITMAP";
+ m_id = _T("BITMAP");
}
else
if (m_type == wxDF_FILENAME)
{
- m_id = "file:ALL";
+ m_id = _T("file:ALL");
}
else
{
- wxFAIL_MSG( "invalid dataformat" );
+ wxFAIL_MSG( _T("invalid dataformat") );
}
m_hasAtom = FALSE;
else
if (m_type == wxDF_PRIVATE)
{
- m_atom = gdk_atom_intern( WXSTRINGCAST( m_id ), FALSE );
+ m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE );
}
else
if (m_type == wxDF_FILENAME)
void wxFileDataObject::AddFile( const wxString &file )
{
m_files += file;
- m_files += (char)0;
+ m_files += (wxChar)0;
}
wxString wxFileDataObject::GetFiles() const
void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
- wxFAIL_MSG( "wxWindowDC::FloodFill not implemented" );
+ wxFAIL_MSG( _T("wxWindowDC::FloodFill not implemented") );
}
bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
- wxFAIL_MSG( "wxWindowDC::GetPixel not implemented" );
+ wxFAIL_MSG( _T("wxWindowDC::GetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
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)
{
void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DrawPoint( long x, long y )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
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;
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;
void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
int n = lines->Number();
if (n <= 0) return;
void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
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);
void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
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;
of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */
- wxCHECK_MSG( Ok(), FALSE, "invalid window dc" );
+ wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") );
- wxCHECK_MSG( source, FALSE, "invalid source dc" );
+ wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
wxClientDC *srcDC = (wxClientDC*)source;
wxMemoryDC *memDC = (wxMemoryDC*)source;
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 );
/* CMB 21/5/98: draw text background if mode is wxSOLID */
if (m_backgroundMode == wxSOLID)
{
- long width = gdk_string_width( font, text );
+ long width = gdk_string_width( font, text.mbc_str() );
long height = font->ascent + font->descent;
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
}
- gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text );
+ gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text.mbc_str() );
/* CMB 17/7/98: simple underline: ignores scaling and underlying
X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS
properties (see wxXt implementation) */
if (m_font.GetUnderlined())
{
- long width = gdk_string_width( font, text );
+ long width = gdk_string_width( font, text.mbc_str() );
long ul_y = y + font->ascent;
if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
- if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
+ if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = long(font->descent / m_scaleY);
if (externalLeading) (*externalLeading) = 0; // ??
long wxWindowDC::GetCharWidth()
{
- wxCHECK_MSG( Ok(), 0, "invalid window dc" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid window dc") );
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
long wxWindowDC::GetCharHeight()
{
- wxCHECK_MSG( Ok(), 0, "invalid window dc" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid window dc") );
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
void wxWindowDC::Clear()
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
/* - we either are a memory dc or have a window as the
owner. anything else shouldn't happen.
void wxWindowDC::SetFont( const wxFont &font )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
m_font = font;
}
void wxWindowDC::SetPen( const wxPen &pen )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen == pen) return;
void wxWindowDC::SetBrush( const wxBrush &brush )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_brush == brush) return;
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_backgroundBrush == brush) return;
void wxWindowDC::SetLogicalFunction( int function )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_logicalFunction == function) return;
void wxWindowDC::SetTextForeground( const wxColour &col )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_textForegroundColour == col) return;
void wxWindowDC::SetTextBackground( const wxColour &col )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_textBackgroundColour == col) return;
void wxWindowDC::SetBackgroundMode( int mode )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
m_backgroundMode = mode;
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{
- wxFAIL_MSG( "wxWindowDC::SetPalette not implemented" );
+ wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxDC::SetClippingRegion( x, y, width, height );
void wxWindowDC::SetClippingRegion( const wxRegion ®ion )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (region.Empty())
{
void wxWindowDC::DestroyClippingRegion()
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxDC::DestroyClippingRegion();
void wxWindowDC::DrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
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 );
void wxDropTarget::RegisterWidget( GtkWidget *widget )
{
- wxCHECK_RET( widget != NULL, "register widget is NULL" );
+ wxCHECK_RET( widget != NULL, _T("register widget is NULL") );
/* gtk_drag_dest_set() determines what default behaviour we'd like
GTK to supply. we don't want to specify out targets (=formats)
wxTextDataObject data;
if (!GetData( &data )) return FALSE;
- OnDropText( x, y, data.GetText() );
+ OnDropText( x, y, data.GetText().mbc_str() );
return TRUE;
}
size_t number = 0;
size_t i;
size_t size = data.GetFiles().Length();
- char *text = WXSTRINGCAST data.GetFiles();
+ wxChar *text = WXSTRINGCAST data.GetFiles();
for ( i = 0; i < size; i++)
if (text[i] == 0) number++;
if (number == 0) return FALSE;
- char **files = new char*[number];
+ wxChar **files = new wxChar*[number];
text = WXSTRINGCAST data.GetFiles();
for (i = 0; i < number; i++)
{
files[i] = text;
- int len = strlen( text );
+ int len = wxStrlen( text );
text += len+1;
}
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;
#endif
- // wxUSE_DRAG_AND_DROP
\ No newline at end of file
+ // wxUSE_DRAG_AND_DROP
bool wxCheckListBox::IsChecked( int index ) const
{
- wxCHECK_MSG( m_list != NULL, FALSE, "invalid checklistbox" );
+ wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
return (str[1] == 'X');
}
- wxFAIL_MSG("wrong checklistbox index");
+ wxFAIL_MSG(_T("wrong checklistbox index"));
return FALSE;
}
void wxCheckListBox::Check( int index, bool check )
{
- wxCHECK_RET( m_list != NULL, "invalid checklistbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid checklistbox") );
GList *child = g_list_nth( m_list->children, index );
if (child)
wxString str = label->label;
- if (check == (str[1] == 'X')) return;
+ if (check == (str[1] == _T('X'))) return;
if (check)
- str.SetChar( 1, 'X' );
+ str.SetChar( 1, _T('X') );
else
- str.SetChar( 1, '-' );
+ str.SetChar( 1, _T('-') );
- gtk_label_set( label, str );
+ gtk_label_set( label, str.mbc_str() );
return;
}
- wxFAIL_MSG("wrong checklistbox index");
+ wxFAIL_MSG(_T("wrong checklistbox index"));
}
int wxCheckListBox::GetItemHeight() const
m_clientDataList.Append( (wxObject*) NULL );
m_clientObjectList.Append( (wxObject*) NULL );
- GtkWidget *item = gtk_menu_item_new_with_label( choices[i] );
+ GtkWidget *item = gtk_menu_item_new_with_label( choices[i].mbc_str() );
gtk_menu_append( GTK_MENU(menu), item );
gtk_widget_realize( item );
void wxChoice::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
GtkWidget *menu = gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) );
- GtkWidget *menu_item = gtk_menu_item_new_with_label( item );
+ GtkWidget *menu_item = gtk_menu_item_new_with_label( item.mbc_str() );
gtk_menu_append( GTK_MENU(menu), menu_item );
void wxChoice::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxChoice::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxChoice::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxChoice::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*) NULL, _T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxChoice::Clear()
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
gtk_option_menu_remove_menu( GTK_OPTION_MENU(m_widget) );
GtkWidget *menu = gtk_menu_new();
void wxChoice::Delete( int WXUNUSED(n) )
{
- wxFAIL_MSG( "wxChoice:Delete not implemented" );
+ wxFAIL_MSG( _T("wxChoice:Delete not implemented") );
}
int wxChoice::FindString( const wxString &string ) const
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
// If you read this code once and you think you understand
// it, then you are very wrong. Robert Roebling.
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+ wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
if (string == label->label)
return count;
int wxChoice::GetSelection()
{
- wxCHECK_MSG( m_widget != NULL, -1, "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, -1, _T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
count++;
}
- wxFAIL_MSG( "wxChoice: no selection" );
+ wxFAIL_MSG( _T("wxChoice: no selection") );
return -1;
}
wxString wxChoice::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
if (bin->child) label = GTK_LABEL(bin->child);
if (!label) label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+ wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label;
}
count++;
}
- wxFAIL_MSG( "wxChoice: invalid index in GetString()" );
+ wxFAIL_MSG( _T("wxChoice: invalid index in GetString()") );
return "";
}
wxString wxChoice::GetStringSelection() const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid choice") );
GtkLabel *label = GTK_LABEL( GTK_BUTTON(m_widget)->child );
- wxASSERT_MSG( label != NULL , "wxChoice: invalid label" );
+ wxASSERT_MSG( label != NULL , _T("wxChoice: invalid label") );
return label->label;
}
int wxChoice::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, "invalid choice" );
+ wxCHECK_MSG( m_widget != NULL, 0, _T("invalid choice") );
GtkMenuShell *menu_shell = GTK_MENU_SHELL( gtk_option_menu_get_menu( GTK_OPTION_MENU(m_widget) ) );
int count = 0;
void wxChoice::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
int tmp = n;
gtk_option_menu_set_history( GTK_OPTION_MENU(m_widget), (gint)tmp );
void wxChoice::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, "invalid choice" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid choice") );
int n = FindString( string );
if (n != -1) SetSelection( n );
wxString text = text_object->GetText();
- char *s = WXSTRINGCAST text;
+#if wxUSE_UNICODE
+ const wxWX2MBbuf s = text.mbc_str();
+ int len = strlen(s);
+#else // more efficient in non-Unicode
+ const char *s = text.c_str();
int len = (int) text.Length();
+#endif
gtk_selection_data_set(
selection_data,
GDK_SELECTION_TYPE_STRING,
8*sizeof(gchar),
- (unsigned char*) s,
+ (unsigned char*) (const char*) s,
len );
break;
bool wxClipboard::Open()
{
- wxCHECK_MSG( !m_open, FALSE, "clipboard already open" );
+ wxCHECK_MSG( !m_open, FALSE, _T("clipboard already open") );
m_open = TRUE;
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();
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 */
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 */
void wxClipboard::Close()
{
- wxCHECK_RET( m_open, "clipboard not open" );
+ wxCHECK_RET( m_open, _T("clipboard not open") );
m_open = FALSE;
}
bool wxClipboard::IsSupported( wxDataFormat format )
{
- wxCHECK_MSG( m_open, FALSE, "clipboard not open" );
+ wxCHECK_MSG( m_open, FALSE, _T("clipboard not open") );
/* store requested format to be asked for by callbacks */
m_targetRequested = format.GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
+ wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
m_formatSupported = FALSE;
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 ? */
m_targetRequested = data->GetFormat().GetAtom();
- wxCHECK_MSG( m_targetRequested, FALSE, "invalid clipboard format" );
+ wxCHECK_MSG( m_targetRequested, FALSE, _T("invalid clipboard format") );
/* start query */
/* 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;
}
else
{
m_refData = new wxColourRefData();
- if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
+ if (!gdk_color_parse( colourName.mb_str(), &M_COLDATA->m_color ))
{
- wxFAIL_MSG( "wxColour: couldn't find colour" );
- printf( "Colourname %s.\n", WXSTRINGCAST colourName );
+ wxFAIL_MSG( _T("wxColour: couldn't find colour") );
+ wxPrintf( _T("Colourname %s.\n"), WXSTRINGCAST colourName );
delete m_refData;
m_refData = (wxObjectRefData *) NULL;
unsigned char wxColour::Red() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.red >> SHIFT);
}
unsigned char wxColour::Green() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.green >> SHIFT);
}
unsigned char wxColour::Blue() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return (unsigned char)(M_COLDATA->m_color.blue >> SHIFT);
}
int wxColour::GetPixel() const
{
- wxCHECK_MSG( Ok(), 0, "invalid colour" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid colour") );
return M_COLDATA->m_color.pixel;
}
GdkColor *wxColour::GetColor() const
{
- wxCHECK_MSG( Ok(), (GdkColor *) NULL, "invalid colour" );
+ wxCHECK_MSG( Ok(), (GdkColor *) NULL, _T("invalid colour") );
return &M_COLDATA->m_color;
}
for (int i = 0; i < n; i++)
{
- GtkWidget *list_item = gtk_list_item_new_with_label( choices[i] );
+ GtkWidget *list_item = gtk_list_item_new_with_label( choices[i].mbc_str() );
m_clientDataList.Append( (wxObject*)NULL );
m_clientObjectList.Append( (wxObject*)NULL );
void wxComboBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
- GtkWidget *list_item = gtk_list_item_new_with_label( item );
+ GtkWidget *list_item = gtk_list_item_new_with_label( item.mbc_str() );
gtk_signal_connect( GTK_OBJECT(list_item), "select",
GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
void wxComboBox::SetClientData( int n, void* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return;
void* wxComboBox::GetClientData( int n )
{
- wxCHECK_MSG( m_widget != NULL, NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return NULL;
void wxComboBox::SetClientObject( int n, wxClientData* clientData )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
wxNode *node = m_clientObjectList.Nth( n );
if (!node) return;
wxClientData* wxComboBox::GetClientObject( int n )
{
- wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, (wxClientData*)NULL, _T("invalid combobox") );
wxNode *node = m_clientDataList.Nth( n );
if (!node) return (wxClientData*) NULL;
void wxComboBox::Clear()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_clear_items( GTK_LIST(list), 0, Number() );
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 );
if (!child)
{
- wxFAIL_MSG("wrong index");
+ wxFAIL_MSG(_T("wrong index"));
return;
}
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;
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;
}
}
- wxFAIL_MSG( "wxComboBox: no selection" );
+ wxFAIL_MSG( _T("wxComboBox: no selection") );
return -1;
}
wxString wxComboBox::GetString( int n ) const
{
- wxCHECK_MSG( m_widget != NULL, "", "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
}
else
{
- wxFAIL_MSG( "wxComboBox: wrong index" );
+ wxFAIL_MSG( _T("wxComboBox: wrong index") );
}
return str;
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;
return tmp;
}
- wxFAIL_MSG( "wxComboBox: no selection" );
+ wxFAIL_MSG( _T("wxComboBox: no selection") );
- return "";
+ return _T("");
}
int wxComboBox::Number() const
{
- wxCHECK_MSG( m_widget != NULL, 0, "invalid combobox" );
+ wxCHECK_MSG( m_widget != NULL, 0, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
void wxComboBox::SetSelection( int n )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n );
void wxComboBox::SetStringSelection( const wxString &string )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
int res = FindString( string );
if (res == -1) return;
void wxComboBox::SetValue( const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
- wxString tmp = "";
+ wxString tmp = _T("");
if (!value.IsNull()) tmp = value;
- gtk_entry_set_text( GTK_ENTRY(entry), tmp );
+ gtk_entry_set_text( GTK_ENTRY(entry), tmp.mbc_str() );
}
void wxComboBox::Copy()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Cut()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::Paste()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
#if (GTK_MINOR_VERSION > 0)
void wxComboBox::SetInsertionPoint( long pos )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_entry_set_position( GTK_ENTRY(entry), (int)pos );
void wxComboBox::SetInsertionPointEnd()
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
SetInsertionPoint( -1 );
}
void wxComboBox::Replace( long from, long to, const wxString& value )
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ // FIXME: not quite sure how to do this method right in multibyte mode
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
if (value.IsNull()) return;
gint pos = (gint)to;
- gtk_editable_insert_text( GTK_EDITABLE(entry), value, value.Length(), &pos );
+ gtk_editable_insert_text( GTK_EDITABLE(entry), value.mbc_str(), value.Length(), &pos );
}
void wxComboBox::Remove(long from, long to)
{
- wxCHECK_RET( m_widget != NULL, "invalid combobox" );
+ wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
GtkWidget *entry = GTK_COMBO(m_widget)->entry;
gtk_editable_delete_text( GTK_EDITABLE(entry), (gint)from, (gint)to );
case wxCURSOR_BASED_ARROW_DOWN: gdk_cur = GDK_BASED_ARROW_DOWN; break;
*/
default:
- wxFAIL_MSG("unsupported cursor type");
+ wxFAIL_MSG(_T("unsupported cursor type"));
// will use the standard one
case wxCURSOR_ARROW:
return;
wxCHECK_RET( gs_savedCursor && gs_savedCursor->Ok(),
- "calling wxEndBusyCursor() without wxBeginBusyCursor()?" );
+ _T("calling wxEndBusyCursor() without wxBeginBusyCursor()?") );
wxSetCursor(*gs_savedCursor);
delete gs_savedCursor;
return;
wxASSERT_MSG( !gs_savedCursor,
- "forgot to call wxEndBusyCursor, will leak memory" );
+ _T("forgot to call wxEndBusyCursor, will leak memory") );
gs_savedCursor = new wxCursor;
if ( g_globalCursor && g_globalCursor->Ok() )
{
if (g_globalCursor) (*g_globalCursor) = cursor;
}
-
-
wxPalette wxNullPalette;
/* Default window names */
-const char *wxButtonNameStr = "button";
-const char *wxCanvasNameStr = "canvas";
-const char *wxCheckBoxNameStr = "check";
-const char *wxChoiceNameStr = "choice";
-const char *wxComboBoxNameStr = "comboBox";
-const char *wxDialogNameStr = "dialog";
-const char *wxFrameNameStr = "frame";
-const char *wxGaugeNameStr = "gauge";
-const char *wxStaticBoxNameStr = "groupBox";
-const char *wxListBoxNameStr = "listBox";
-const char *wxStaticTextNameStr = "message";
-const char *wxStaticBitmapNameStr = "message";
-const char *wxMultiTextNameStr = "multitext";
-const char *wxPanelNameStr = "panel";
-const char *wxRadioBoxNameStr = "radioBox";
-const char *wxRadioButtonNameStr = "radioButton";
-const char *wxBitmapRadioButtonNameStr = "radioButton";
-const char *wxScrollBarNameStr = "scrollBar";
-const char *wxSliderNameStr = "slider";
-const char *wxStaticNameStr = "static";
-const char *wxTextCtrlWindowNameStr = "textWindow";
-const char *wxTextCtrlNameStr = "text";
-const char *wxVirtListBoxNameStr = "virtListBox";
-const char *wxButtonBarNameStr = "buttonbar";
-const char *wxEnhDialogNameStr = "Shell";
-const char *wxToolBarNameStr = "toolbar";
-const char *wxStatusLineNameStr = "status_line";
-const char *wxEmptyString = "";
-const char *wxGetTextFromUserPromptStr = "Input Text";
-const char *wxMessageBoxCaptionStr = "Message";
-const char *wxFileSelectorPromptStr = "Select a file";
-const char *wxFileSelectorDefaultWildcardStr = "*.*";
-const char *wxInternalErrorStr = "wxWindows Internal Error";
-const char *wxFatalErrorStr = "wxWindows Fatal Error";
+const wxChar *wxButtonNameStr = _T("button");
+const wxChar *wxCanvasNameStr = _T("canvas");
+const wxChar *wxCheckBoxNameStr = _T("check");
+const wxChar *wxChoiceNameStr = _T("choice");
+const wxChar *wxComboBoxNameStr = _T("comboBox");
+const wxChar *wxDialogNameStr = _T("dialog");
+const wxChar *wxFrameNameStr = _T("frame");
+const wxChar *wxGaugeNameStr = _T("gauge");
+const wxChar *wxStaticBoxNameStr = _T("groupBox");
+const wxChar *wxListBoxNameStr = _T("listBox");
+const wxChar *wxStaticTextNameStr = _T("message");
+const wxChar *wxStaticBitmapNameStr = _T("message");
+const wxChar *wxMultiTextNameStr = _T("multitext");
+const wxChar *wxPanelNameStr = _T("panel");
+const wxChar *wxRadioBoxNameStr = _T("radioBox");
+const wxChar *wxRadioButtonNameStr = _T("radioButton");
+const wxChar *wxBitmapRadioButtonNameStr = _T("radioButton");
+const wxChar *wxScrollBarNameStr = _T("scrollBar");
+const wxChar *wxSliderNameStr = _T("slider");
+const wxChar *wxStaticNameStr = _T("static");
+const wxChar *wxTextCtrlWindowNameStr = _T("textWindow");
+const wxChar *wxTextCtrlNameStr = _T("text");
+const wxChar *wxVirtListBoxNameStr = _T("virtListBox");
+const wxChar *wxButtonBarNameStr = _T("buttonbar");
+const wxChar *wxEnhDialogNameStr = _T("Shell");
+const wxChar *wxToolBarNameStr = _T("toolbar");
+const wxChar *wxStatusLineNameStr = _T("status_line");
+const wxChar *wxEmptyString = _T("");
+const wxChar *wxGetTextFromUserPromptStr = _T("Input Text");
+const wxChar *wxMessageBoxCaptionStr = _T("Message");
+const wxChar *wxFileSelectorPromptStr = _T("Select a file");
+const wxChar *wxFileSelectorDefaultWildcardStr = _T("*.*");
+const wxChar *wxInternalErrorStr = _T("wxWindows Internal Error");
+const wxChar *wxFatalErrorStr = _T("wxWindows Fatal Error");
/* See wx/utils.h */
-const char *wxFloatToStringStr = "%.2f";
-const char *wxDoubleToStringStr = "%.2f";
+const wxChar *wxFloatToStringStr = _T("%.2f");
+const wxChar *wxDoubleToStringStr = _T("%.2f");
/* Dafaults for wxWindow etc. */
const wxSize wxDefaultSize(-1, -1);
m_type = wxDF_PRIVATE;
m_id = gdk_atom_name( m_atom );
- if (m_id == "file:ALL")
+ if (m_id == _T("file:ALL"))
{
m_type = wxDF_FILENAME;
}
if (m_type == wxDF_TEXT)
{
- m_id = "STRING";
+ m_id = _T("STRING");
}
else
if (m_type == wxDF_BITMAP)
{
- m_id = "BITMAP";
+ m_id = _T("BITMAP");
}
else
if (m_type == wxDF_FILENAME)
{
- m_id = "file:ALL";
+ m_id = _T("file:ALL");
}
else
{
- wxFAIL_MSG( "invalid dataformat" );
+ wxFAIL_MSG( _T("invalid dataformat") );
}
m_hasAtom = FALSE;
else
if (m_type == wxDF_PRIVATE)
{
- m_atom = gdk_atom_intern( WXSTRINGCAST( m_id ), FALSE );
+ m_atom = gdk_atom_intern( MBSTRINGCAST m_id.mbc_str(), FALSE );
}
else
if (m_type == wxDF_FILENAME)
void wxFileDataObject::AddFile( const wxString &file )
{
m_files += file;
- m_files += (char)0;
+ m_files += (wxChar)0;
}
wxString wxFileDataObject::GetFiles() const
void wxWindowDC::FloodFill( long WXUNUSED(x), long WXUNUSED(y),
const wxColour &WXUNUSED(col), int WXUNUSED(style) )
{
- wxFAIL_MSG( "wxWindowDC::FloodFill not implemented" );
+ wxFAIL_MSG( _T("wxWindowDC::FloodFill not implemented") );
}
bool wxWindowDC::GetPixel( long WXUNUSED(x1), long WXUNUSED(y1), wxColour *WXUNUSED(col) ) const
{
- wxFAIL_MSG( "wxWindowDC::GetPixel not implemented" );
+ wxFAIL_MSG( _T("wxWindowDC::GetPixel not implemented") );
return FALSE;
}
void wxWindowDC::DrawLine( long x1, long y1, long x2, long y2 )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
{
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)
{
void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx1 = XLOG2DEV(x1);
long yy1 = YLOG2DEV(y1);
void wxWindowDC::DrawEllipticArc( long x, long y, long width, long height, double sa, double ea )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
void wxWindowDC::DrawPoint( long x, long y )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen.GetStyle() != wxTRANSPARENT)
gdk_draw_point( m_window, m_penGC, XLOG2DEV(x), YLOG2DEV(y) );
void wxWindowDC::DrawLines( int n, wxPoint points[], long xoffset, long yoffset )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return;
if (n <= 0) return;
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;
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;
void wxWindowDC::DrawPolygon( wxList *lines, long xoffset, long yoffset, int WXUNUSED(fillStyle))
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
int n = lines->Number();
if (n <= 0) return;
void wxWindowDC::DrawRectangle( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
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);
void wxWindowDC::DrawEllipse( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
long xx = XLOG2DEV(x);
long yy = YLOG2DEV(y);
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;
of the source dc, but scales correctly on the target dc and
knows about possible mask information in a memory dc. */
- wxCHECK_MSG( Ok(), FALSE, "invalid window dc" );
+ wxCHECK_MSG( Ok(), FALSE, _T("invalid window dc") );
- wxCHECK_MSG( source, FALSE, "invalid source dc" );
+ wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
wxClientDC *srcDC = (wxClientDC*)source;
wxMemoryDC *memDC = (wxMemoryDC*)source;
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 );
/* CMB 21/5/98: draw text background if mode is wxSOLID */
if (m_backgroundMode == wxSOLID)
{
- long width = gdk_string_width( font, text );
+ long width = gdk_string_width( font, text.mbc_str() );
long height = font->ascent + font->descent;
gdk_gc_set_foreground( m_textGC, m_textBackgroundColour.GetColor() );
gdk_draw_rectangle( m_window, m_textGC, TRUE, x, y, width, height );
gdk_gc_set_foreground( m_textGC, m_textForegroundColour.GetColor() );
}
- gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text );
+ gdk_draw_string( m_window, font, m_textGC, x, y + font->ascent, text.mbc_str() );
/* CMB 17/7/98: simple underline: ignores scaling and underlying
X font's XA_UNDERLINE_POSITION and XA_UNDERLINE_THICKNESS
properties (see wxXt implementation) */
if (m_font.GetUnderlined())
{
- long width = gdk_string_width( font, text );
+ long width = gdk_string_width( font, text.mbc_str() );
long ul_y = y + font->ascent;
if (font->descent > 0) ul_y++;
gdk_draw_line( m_window, m_textGC, x, ul_y, x + width, ul_y);
long *descent, long *externalLeading,
wxFont *theFont, bool WXUNUSED(use16) )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxFont fontToUse = m_font;
if (theFont) fontToUse = *theFont;
GdkFont *font = fontToUse.GetInternalFont( m_scaleY );
- if (width) (*width) = long(gdk_string_width( font, string ) / m_scaleX);
+ if (width) (*width) = long(gdk_string_width( font, string.mbc_str() ) / m_scaleX);
if (height) (*height) = long((font->ascent + font->descent) / m_scaleY);
if (descent) (*descent) = long(font->descent / m_scaleY);
if (externalLeading) (*externalLeading) = 0; // ??
long wxWindowDC::GetCharWidth()
{
- wxCHECK_MSG( Ok(), 0, "invalid window dc" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid window dc") );
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long(gdk_string_width( font, "H" ) / m_scaleX);
long wxWindowDC::GetCharHeight()
{
- wxCHECK_MSG( Ok(), 0, "invalid window dc" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid window dc") );
GdkFont *font = m_font.GetInternalFont( m_scaleY );
return long((font->ascent + font->descent) / m_scaleY);
void wxWindowDC::Clear()
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
/* - we either are a memory dc or have a window as the
owner. anything else shouldn't happen.
void wxWindowDC::SetFont( const wxFont &font )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
m_font = font;
}
void wxWindowDC::SetPen( const wxPen &pen )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_pen == pen) return;
void wxWindowDC::SetBrush( const wxBrush &brush )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_brush == brush) return;
/* CMB 21/7/98: Added SetBackground. Sets background brush
* for Clear() and bg colour for shapes filled with cross-hatch brush */
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_backgroundBrush == brush) return;
void wxWindowDC::SetLogicalFunction( int function )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_logicalFunction == function) return;
void wxWindowDC::SetTextForeground( const wxColour &col )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_textForegroundColour == col) return;
void wxWindowDC::SetTextBackground( const wxColour &col )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (m_textBackgroundColour == col) return;
void wxWindowDC::SetBackgroundMode( int mode )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
m_backgroundMode = mode;
void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) )
{
- wxFAIL_MSG( "wxWindowDC::SetPalette not implemented" );
+ wxFAIL_MSG( _T("wxWindowDC::SetPalette not implemented") );
}
void wxWindowDC::SetClippingRegion( long x, long y, long width, long height )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxDC::SetClippingRegion( x, y, width, height );
void wxWindowDC::SetClippingRegion( const wxRegion ®ion )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
if (region.Empty())
{
void wxWindowDC::DestroyClippingRegion()
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxDC::DestroyClippingRegion();
void wxWindowDC::DrawSpline( wxList *points )
{
- wxCHECK_RET( Ok(), "invalid window dc" );
+ wxCHECK_RET( Ok(), _T("invalid window dc") );
wxPoint *p;
double cx1, cy1, cx2, cy2, cx3, cy3, cx4, cy4;
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 );
void wxDropTarget::RegisterWidget( GtkWidget *widget )
{
- wxCHECK_RET( widget != NULL, "register widget is NULL" );
+ wxCHECK_RET( widget != NULL, _T("register widget is NULL") );
/* gtk_drag_dest_set() determines what default behaviour we'd like
GTK to supply. we don't want to specify out targets (=formats)
wxTextDataObject data;
if (!GetData( &data )) return FALSE;
- OnDropText( x, y, data.GetText() );
+ OnDropText( x, y, data.GetText().mbc_str() );
return TRUE;
}
size_t number = 0;
size_t i;
size_t size = data.GetFiles().Length();
- char *text = WXSTRINGCAST data.GetFiles();
+ wxChar *text = WXSTRINGCAST data.GetFiles();
for ( i = 0; i < size; i++)
if (text[i] == 0) number++;
if (number == 0) return FALSE;
- char **files = new char*[number];
+ wxChar **files = new wxChar*[number];
text = WXSTRINGCAST data.GetFiles();
for (i = 0; i < number; i++)
{
files[i] = text;
- int len = strlen( text );
+ int len = wxStrlen( text );
text += len+1;
}
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;
#endif
- // wxUSE_DRAG_AND_DROP
\ No newline at end of file
+ // wxUSE_DRAG_AND_DROP