void wxDialog::SetTitle( const wxString& title )
{
m_title = title;
- if (m_title.IsNull()) m_title = "";
- gtk_window_set_title( GTK_WINDOW(m_widget), m_title );
+ if (m_title.IsNull()) m_title = _T("");
+ gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() );
}
wxString wxDialog::GetTitle() const
void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
if (GetAutoLayout())
{
void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid dialog" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
void wxDialog::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
int x = 0;
int y = 0;
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
- wxFAIL_MSG( "wxDialog:SetModal obsolete now" );
+ wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") );
}
int wxDialog::ShowModal()
{
if (IsModal())
{
- wxFAIL_MSG( "wxDialog:ShowModal called twice" );
+ wxFAIL_MSG( _T("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
if (!IsModal())
{
- wxFAIL_MSG( "wxDialog:EndModal called twice" );
+ wxFAIL_MSG( _T("wxDialog:EndModal called twice") );
return;
}
PreCreation( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, "filedialog" );
m_message = message;
- m_path = "";
+ m_path = _T("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
m_dialogStyle = style;
m_filterIndex = 1;
- m_widget = gtk_file_selection_new( m_message );
+ m_widget = gtk_file_selection_new( m_message.mbc_str() );
int x = (gdk_screen_width () - 400) / 2;
int y = (gdk_screen_height () - 400) / 2;
gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
m_path.Append(m_dir);
- if( ! m_path.IsEmpty() && m_path.Last()!='/' )
+ if( ! m_path.IsEmpty() && m_path.Last()!=_T('/') )
m_path.Append('/');
m_path.Append(m_fileName);
- if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path);
+ if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path.mbc_str());
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), _("OK") );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), wxConv_current->cWX2MB(_("OK")) );
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), _("Cancel") );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), wxConv_current->cWX2MB(_("Cancel")) );
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
// global functions
// ----------------------------------------------------------------------------
-wxString wxFileSelector( const char *title,
- const char *defaultDir, const char *defaultFileName,
- const char *defaultExtension, const char *filter, int flags,
+wxString wxFileSelector( const wxChar *title,
+ const wxChar *defaultDir, const wxChar *defaultFileName,
+ const wxChar *defaultExtension, const wxChar *filter, int flags,
wxWindow *parent, int x, int y )
{
wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString("*.") + wxString(defaultExtension) ;
+ filter2 = wxString(_T("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
}
}
-wxString wxLoadFileSelector( const char *what, const char *extension, const char *default_name, wxWindow *parent )
+wxString wxLoadFileSelector( const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent )
{
- char *ext = (char *)extension;
+ wxChar *ext = (wxChar *)extension;
- char prompt[50];
+ wxChar prompt[50];
wxString str = _("Load %s file");
- sprintf(prompt, str, what);
+ wxSprintf(prompt, str, what);
- if (*ext == '.') ext++;
- char wild[60];
- sprintf(wild, "*.%s", ext);
+ if (*ext == _T('.')) ext++;
+ wxChar wild[60];
+ wxSprintf(wild, _T("*.%s"), ext);
- return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
+ return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
-wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
+wxString wxSaveFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name,
wxWindow *parent )
{
- char *ext = (char *)extension;
+ wxChar *ext = (wxChar *)extension;
- char prompt[50];
+ wxChar prompt[50];
wxString str = _("Save %s file");
- sprintf(prompt, str, what);
+ wxSprintf(prompt, str, what);
- if (*ext == '.') ext++;
- char wild[60];
- sprintf(wild, "*.%s", ext);
+ if (*ext == _T('.')) ext++;
+ wxChar wild[60];
+ wxSprintf(wild, _T("*.%s"), ext);
- return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
+ return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), "", "invalid font" );
+ wxCHECK_MSG( Ok(), _T(""), _T("invalid font") );
return M_FONTDATA->m_faceName;
}
int wxFont::GetFamily() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_family;
}
wxString wxFont::GetFamilyString() const
{
- wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
+ wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
switch (M_FONTDATA->m_family)
{
- case wxDECORATIVE: return wxString("wxDECORATIVE");
- case wxROMAN: return wxString("wxROMAN");
- case wxSCRIPT: return wxString("wxSCRIPT");
- case wxSWISS: return wxString("wxSWISS");
- case wxMODERN: return wxString("wxMODERN");
- case wxTELETYPE: return wxString("wxTELETYPE");
- default: return "wxDEFAULT";
+ case wxDECORATIVE: return wxString(_T("wxDECORATIVE"));
+ case wxROMAN: return wxString(_T("wxROMAN"));
+ case wxSCRIPT: return wxString(_T("wxSCRIPT"));
+ case wxSWISS: return wxString(_T("wxSWISS"));
+ case wxMODERN: return wxString(_T("wxMODERN"));
+ case wxTELETYPE: return wxString(_T("wxTELETYPE"));
+ default: return _T("wxDEFAULT");
}
return "wxDEFAULT";
int wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_style;
}
wxString wxFont::GetStyleString() const
{
- wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
+ wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
switch (M_FONTDATA->m_style)
{
- case wxNORMAL: return wxString("wxNORMAL");
- case wxSLANT: return wxString("wxSLANT");
- case wxITALIC: return wxString("wxITALIC");
- default: return wxString("wxDEFAULT");
+ case wxNORMAL: return wxString(_T("wxNORMAL"));
+ case wxSLANT: return wxString(_T("wxSLANT"));
+ case wxITALIC: return wxString(_T("wxITALIC"));
+ default: return wxString(_T("wxDEFAULT"));
}
- return wxString("wxDEFAULT");
+ return wxString(_T("wxDEFAULT"));
}
int wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_weight;
}
wxString wxFont::GetWeightString() const
{
- wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
+ wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
switch (M_FONTDATA->m_weight)
{
- case wxNORMAL: return wxString("wxNORMAL");
- case wxBOLD: return wxString("wxBOLD");
- case wxLIGHT: return wxString("wxLIGHT");
- default: return wxString("wxDEFAULT");
+ case wxNORMAL: return wxString(_T("wxNORMAL"));
+ case wxBOLD: return wxString(_T("wxBOLD"));
+ case wxLIGHT: return wxString(_T("wxLIGHT"));
+ default: return wxString(_T("wxDEFAULT"));
}
- return wxString("wxDEFAULT");
+ return wxString(_T("wxDEFAULT"));
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), FALSE, "invalid font" );
+ wxCHECK_MSG( Ok(), FALSE, _T("invalid font") );
return M_FONTDATA->m_underlined;
}
{
if (!Ok())
{
- wxFAIL_MSG( "invalid font" );
+ wxFAIL_MSG( _T("invalid font") );
return (GdkFont*) NULL;
}
if (!font)
{
- wxLogError("could not load any font");
+ wxLogError(_T("could not load any font"));
}
return font;
static GdkFont*wxLoadQueryFont( int pointSize, int family, int style, int weight,
bool underlined, const wxString &facename )
{
- char *xfamily = (char*) NULL;
- char *xstyle = (char*) NULL;
- char *xweight = (char*) NULL;
+ wxChar *xfamily = (wxChar*) NULL;
+ wxChar *xstyle = (wxChar*) NULL;
+ wxChar *xweight = (wxChar*) NULL;
switch (family)
{
- case wxDECORATIVE: xfamily = "lucida"; break;
- case wxROMAN: xfamily = "times"; break;
- case wxMODERN: xfamily = "courier"; break;
- case wxSWISS: xfamily = "helvetica"; break;
- case wxTELETYPE: xfamily = "lucidatypewriter"; break;
- case wxSCRIPT: xfamily = "utopia"; break;
- default: xfamily = "*";
+ case wxDECORATIVE: xfamily = _T("lucida"); break;
+ case wxROMAN: xfamily = _T("times"); break;
+ case wxMODERN: xfamily = _T("courier"); break;
+ case wxSWISS: xfamily = _T("helvetica"); break;
+ case wxTELETYPE: xfamily = _T("lucidatypewriter"); break;
+ case wxSCRIPT: xfamily = _T("utopia"); break;
+ default: xfamily = _T("*");
}
if (!facename.IsEmpty())
{
- sprintf( wxBuffer, "-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*", facename.c_str() );
- GdkFont *test = gdk_font_load( wxBuffer );
+ wxSprintf( wxBuffer, _T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), facename.c_str() );
+ GdkFont *test = gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
if (test)
{
gdk_font_unref( test );
switch (style)
{
- case wxITALIC: xstyle = "i"; break;
- case wxSLANT: xstyle = "o"; break;
- case wxNORMAL: xstyle = "r"; break;
- default: xstyle = "*"; break;
+ case wxITALIC: xstyle = _T("i"); break;
+ case wxSLANT: xstyle = _T("o"); break;
+ case wxNORMAL: xstyle = _T("r"); break;
+ default: xstyle = _T("*"); break;
}
switch (weight)
{
- case wxBOLD: xweight = "bold"; break;
+ case wxBOLD: xweight = _T("bold"); break;
case wxLIGHT:
- case wxNORMAL: xweight = "medium"; break;
- default: xweight = "*"; break;
+ case wxNORMAL: xweight = _T("medium"); break;
+ default: xweight = _T("*"); break;
}
- sprintf( wxBuffer, "-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-*-*",
+ wxSprintf( wxBuffer, _T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-*-*"),
xfamily, xweight, xstyle, pointSize);
- return gdk_font_load( wxBuffer );
+ return gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
}
static GdkFont *wxLoadQueryNearestFont( int point_size, int family, int style, int weight,
m_widget = gtk_window_new( win_type );
- gtk_window_set_title( GTK_WINDOW(m_widget), title );
+ gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
/* needed ? */
bool wxFrame::Show( bool show )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
if (show && !m_sizeSet)
{
bool wxFrame::Destroy()
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
/* avoid recursions */
if (m_resizing) return;
void wxFrame::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
int x = 0;
int y = 0;
void wxFrame::GetClientSize( int *width, int *height ) const
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
wxWindow::GetClientSize( width, height );
if (height)
void wxFrame::DoSetClientSize( int width, int height )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
int h = height;
if (m_frameMenuBar && !m_menuBarDetached) h += wxMENU_HEIGHT;
m_resizing = TRUE;
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
m_width = width;
m_height = height;
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
if (GetAutoLayout())
{
void wxFrame::SetMenuBar( wxMenuBar *menuBar )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
m_frameMenuBar = menuBar;
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_MSG( m_frameToolBar == NULL, FALSE, "recreating toolbar in wxFrame" );
+ wxCHECK_MSG( m_frameToolBar == NULL, FALSE, _T("recreating toolbar in wxFrame") );
m_frameToolBar = OnCreateToolBar( style, id, name );
wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, "recreating status bar in wxFrame" );
+ wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, _T("recreating status bar in wxFrame") );
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
void wxFrame::SetStatusText(const wxString& text, int number)
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" );
+ wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") );
m_frameStatusBar->SetStatusText(text, number);
}
void wxFrame::SetStatusWidths(int n, const int widths_field[] )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" );
+ wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") );
m_frameStatusBar->SetStatusWidths(n, widths_field);
}
void wxFrame::SetTitle( const wxString &title )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
m_title = title;
- if (m_title.IsNull()) m_title = "";
- gtk_window_set_title( GTK_WINDOW(m_widget), title );
+ if (m_title.IsNull()) m_title = _T("");
+ gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
}
void wxFrame::SetIcon( const wxIcon &icon )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
m_icon = icon;
if (!icon.Ok()) return;
str.Prepend(CHECKBOX_STRING);
}
- list_item = gtk_list_item_new_with_label( str );
+ list_item = gtk_list_item_new_with_label( str.mbc_str() );
gtk_container_add( GTK_CONTAINER(m_list), list_item );
void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GList *children = m_list->children;
int length = g_list_length(children);
- wxCHECK_RET( pos <= length, "invalid index in wxListBox::InsertItems" );
+ wxCHECK_RET( pos <= length, _T("invalid index in wxListBox::InsertItems") );
// VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item
// into a listbox at the given position, this is why we first delete
void wxListBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GtkWidget *list_item;
label.Prepend(CHECKBOX_STRING);
}
- list_item = gtk_list_item_new_with_label( label );
+ list_item = gtk_list_item_new_with_label( label.mbc_str() );
gtk_container_add( GTK_CONTAINER(m_list), list_item );
void wxListBox::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* wxListBox::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 wxListBox::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* wxListBox::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 wxListBox::Clear()
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
gtk_list_clear_items( m_list, 0, Number() );
void wxListBox::Delete( int n )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
- wxCHECK_RET( child, "wrong listbox index" );
+ wxCHECK_RET( child, _T("wrong listbox index") );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
void wxListBox::Deselect( int n )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
gtk_list_unselect_item( m_list, n );
}
int wxListBox::FindString( const wxString &item ) const
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelection() const
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelections( wxArrayInt& aSelections ) const
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
// get the number of selected items first
GList *child = m_list->children;
wxString wxListBox::GetString( int n ) const
{
- wxCHECK_MSG( m_list != NULL, "", "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
return str;
}
- wxFAIL_MSG("wrong listbox index");
+ wxFAIL_MSG(_T("wrong listbox index"));
- return "";
+ return _T("");
}
wxString wxListBox::GetStringSelection() const
{
- wxCHECK_MSG( m_list != NULL, "", "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
GList *selection = m_list->selection;
if (selection)
return str;
}
- wxFAIL_MSG("no listbox selection available");
- return "";
+ wxFAIL_MSG(_T("no listbox selection available"));
+ return _T("");
}
int wxListBox::Number()
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
bool wxListBox::Selected( int n )
{
- wxCHECK_MSG( m_list != NULL, FALSE, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid listbox") );
GList *target = g_list_nth( m_list->children, n );
if (target)
child = child->next;
}
}
- wxFAIL_MSG("wrong listbox index");
+ wxFAIL_MSG(_T("wrong listbox index"));
return FALSE;
}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
- wxFAIL_MSG("wxListBox::Set not implemented");
+ wxFAIL_MSG(_T("wxListBox::Set not implemented"));
}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
- wxFAIL_MSG("wxListBox::SetFirstItem not implemented");
+ wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
- wxFAIL_MSG("wxListBox::SetFirstItem not implemented");
+ wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetSelection( int n, bool select )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
if (select)
gtk_list_select_item( m_list, n );
void wxListBox::SetString( int n, const wxString &string )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
str += CHECKBOX_STRING;
str += string;
- gtk_label_set( label, str );
+ gtk_label_set( label, str.mbc_str() );
}
else
{
- wxFAIL_MSG("wrong listbox index");
+ wxFAIL_MSG(_T("wrong listbox index"));
}
}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
SetSelection( FindString(string), select );
}
#if wxUSE_DRAG_AND_DROP
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
#ifndef NEW_GTK_DND_CODE
if (m_dropTarget)
child = child->next;
}
}
-
wxString s = child->m_title;
if (s.IsNull()) s = _("MDI child");
- GtkWidget *label_widget = gtk_label_new( s );
+ GtkWidget *label_widget = gtk_label_new( s.mbc_str() );
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
void wxDialog::SetTitle( const wxString& title )
{
m_title = title;
- if (m_title.IsNull()) m_title = "";
- gtk_window_set_title( GTK_WINDOW(m_widget), m_title );
+ if (m_title.IsNull()) m_title = _T("");
+ gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() );
}
wxString wxDialog::GetTitle() const
void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
if (GetAutoLayout())
{
void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid dialog" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") );
if (m_resizing) return; /* I don't like recursions */
m_resizing = TRUE;
void wxDialog::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid dialog" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") );
int x = 0;
int y = 0;
else
if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL;
*/
- wxFAIL_MSG( "wxDialog:SetModal obsolete now" );
+ wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") );
}
int wxDialog::ShowModal()
{
if (IsModal())
{
- wxFAIL_MSG( "wxDialog:ShowModal called twice" );
+ wxFAIL_MSG( _T("wxDialog:ShowModal called twice") );
return GetReturnCode();
}
if (!IsModal())
{
- wxFAIL_MSG( "wxDialog:EndModal called twice" );
+ wxFAIL_MSG( _T("wxDialog:EndModal called twice") );
return;
}
PreCreation( parent, -1, pos, wxDefaultSize, style | wxDIALOG_MODAL, "filedialog" );
m_message = message;
- m_path = "";
+ m_path = _T("");
m_fileName = defaultFileName;
m_dir = defaultDir;
m_wildCard = wildCard;
m_dialogStyle = style;
m_filterIndex = 1;
- m_widget = gtk_file_selection_new( m_message );
+ m_widget = gtk_file_selection_new( m_message.mbc_str() );
int x = (gdk_screen_width () - 400) / 2;
int y = (gdk_screen_height () - 400) / 2;
gtk_file_selection_hide_fileop_buttons( sel ); // they don't work anyway
m_path.Append(m_dir);
- if( ! m_path.IsEmpty() && m_path.Last()!='/' )
+ if( ! m_path.IsEmpty() && m_path.Last()!=_T('/') )
m_path.Append('/');
m_path.Append(m_fileName);
- if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path);
+ if(m_path.Length()>1) gtk_file_selection_set_filename(sel,m_path.mbc_str());
gtk_signal_connect( GTK_OBJECT(sel->ok_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_ok_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), _("OK") );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->ok_button)->child ), wxConv_current->cWX2MB(_("OK")) );
gtk_signal_connect( GTK_OBJECT(sel->cancel_button), "clicked",
GTK_SIGNAL_FUNC(gtk_filedialog_cancel_callback), (gpointer*)this );
// strange way to internationalize
- gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), _("Cancel") );
+ gtk_label_set( GTK_LABEL( GTK_BUTTON(sel->cancel_button)->child ), wxConv_current->cWX2MB(_("Cancel")) );
gtk_signal_connect( GTK_OBJECT(m_widget), "delete_event",
GTK_SIGNAL_FUNC(gtk_filedialog_delete_callback), (gpointer)this );
// global functions
// ----------------------------------------------------------------------------
-wxString wxFileSelector( const char *title,
- const char *defaultDir, const char *defaultFileName,
- const char *defaultExtension, const char *filter, int flags,
+wxString wxFileSelector( const wxChar *title,
+ const wxChar *defaultDir, const wxChar *defaultFileName,
+ const wxChar *defaultExtension, const wxChar *filter, int flags,
wxWindow *parent, int x, int y )
{
wxString filter2;
if ( defaultExtension && !filter )
- filter2 = wxString("*.") + wxString(defaultExtension) ;
+ filter2 = wxString(_T("*.")) + wxString(defaultExtension) ;
else if ( filter )
filter2 = filter;
}
}
-wxString wxLoadFileSelector( const char *what, const char *extension, const char *default_name, wxWindow *parent )
+wxString wxLoadFileSelector( const wxChar *what, const wxChar *extension, const wxChar *default_name, wxWindow *parent )
{
- char *ext = (char *)extension;
+ wxChar *ext = (wxChar *)extension;
- char prompt[50];
+ wxChar prompt[50];
wxString str = _("Load %s file");
- sprintf(prompt, str, what);
+ wxSprintf(prompt, str, what);
- if (*ext == '.') ext++;
- char wild[60];
- sprintf(wild, "*.%s", ext);
+ if (*ext == _T('.')) ext++;
+ wxChar wild[60];
+ wxSprintf(wild, _T("*.%s"), ext);
- return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
+ return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
-wxString wxSaveFileSelector(const char *what, const char *extension, const char *default_name,
+wxString wxSaveFileSelector(const wxChar *what, const wxChar *extension, const wxChar *default_name,
wxWindow *parent )
{
- char *ext = (char *)extension;
+ wxChar *ext = (wxChar *)extension;
- char prompt[50];
+ wxChar prompt[50];
wxString str = _("Save %s file");
- sprintf(prompt, str, what);
+ wxSprintf(prompt, str, what);
- if (*ext == '.') ext++;
- char wild[60];
- sprintf(wild, "*.%s", ext);
+ if (*ext == _T('.')) ext++;
+ wxChar wild[60];
+ wxSprintf(wild, _T("*.%s"), ext);
- return wxFileSelector (prompt, (const char *) NULL, default_name, ext, wild, 0, parent);
+ return wxFileSelector (prompt, (const wxChar *) NULL, default_name, ext, wild, 0, parent);
}
int wxFont::GetPointSize() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_pointSize;
}
wxString wxFont::GetFaceName() const
{
- wxCHECK_MSG( Ok(), "", "invalid font" );
+ wxCHECK_MSG( Ok(), _T(""), _T("invalid font") );
return M_FONTDATA->m_faceName;
}
int wxFont::GetFamily() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_family;
}
wxString wxFont::GetFamilyString() const
{
- wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
+ wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
switch (M_FONTDATA->m_family)
{
- case wxDECORATIVE: return wxString("wxDECORATIVE");
- case wxROMAN: return wxString("wxROMAN");
- case wxSCRIPT: return wxString("wxSCRIPT");
- case wxSWISS: return wxString("wxSWISS");
- case wxMODERN: return wxString("wxMODERN");
- case wxTELETYPE: return wxString("wxTELETYPE");
- default: return "wxDEFAULT";
+ case wxDECORATIVE: return wxString(_T("wxDECORATIVE"));
+ case wxROMAN: return wxString(_T("wxROMAN"));
+ case wxSCRIPT: return wxString(_T("wxSCRIPT"));
+ case wxSWISS: return wxString(_T("wxSWISS"));
+ case wxMODERN: return wxString(_T("wxMODERN"));
+ case wxTELETYPE: return wxString(_T("wxTELETYPE"));
+ default: return _T("wxDEFAULT");
}
return "wxDEFAULT";
int wxFont::GetStyle() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_style;
}
wxString wxFont::GetStyleString() const
{
- wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
+ wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
switch (M_FONTDATA->m_style)
{
- case wxNORMAL: return wxString("wxNORMAL");
- case wxSLANT: return wxString("wxSLANT");
- case wxITALIC: return wxString("wxITALIC");
- default: return wxString("wxDEFAULT");
+ case wxNORMAL: return wxString(_T("wxNORMAL"));
+ case wxSLANT: return wxString(_T("wxSLANT"));
+ case wxITALIC: return wxString(_T("wxITALIC"));
+ default: return wxString(_T("wxDEFAULT"));
}
- return wxString("wxDEFAULT");
+ return wxString(_T("wxDEFAULT"));
}
int wxFont::GetWeight() const
{
- wxCHECK_MSG( Ok(), 0, "invalid font" );
+ wxCHECK_MSG( Ok(), 0, _T("invalid font") );
return M_FONTDATA->m_weight;
}
wxString wxFont::GetWeightString() const
{
- wxCHECK_MSG( Ok(), "wxDEFAULT", "invalid font" );
+ wxCHECK_MSG( Ok(), _T("wxDEFAULT"), _T("invalid font") );
switch (M_FONTDATA->m_weight)
{
- case wxNORMAL: return wxString("wxNORMAL");
- case wxBOLD: return wxString("wxBOLD");
- case wxLIGHT: return wxString("wxLIGHT");
- default: return wxString("wxDEFAULT");
+ case wxNORMAL: return wxString(_T("wxNORMAL"));
+ case wxBOLD: return wxString(_T("wxBOLD"));
+ case wxLIGHT: return wxString(_T("wxLIGHT"));
+ default: return wxString(_T("wxDEFAULT"));
}
- return wxString("wxDEFAULT");
+ return wxString(_T("wxDEFAULT"));
}
bool wxFont::GetUnderlined() const
{
- wxCHECK_MSG( Ok(), FALSE, "invalid font" );
+ wxCHECK_MSG( Ok(), FALSE, _T("invalid font") );
return M_FONTDATA->m_underlined;
}
{
if (!Ok())
{
- wxFAIL_MSG( "invalid font" );
+ wxFAIL_MSG( _T("invalid font") );
return (GdkFont*) NULL;
}
if (!font)
{
- wxLogError("could not load any font");
+ wxLogError(_T("could not load any font"));
}
return font;
static GdkFont*wxLoadQueryFont( int pointSize, int family, int style, int weight,
bool underlined, const wxString &facename )
{
- char *xfamily = (char*) NULL;
- char *xstyle = (char*) NULL;
- char *xweight = (char*) NULL;
+ wxChar *xfamily = (wxChar*) NULL;
+ wxChar *xstyle = (wxChar*) NULL;
+ wxChar *xweight = (wxChar*) NULL;
switch (family)
{
- case wxDECORATIVE: xfamily = "lucida"; break;
- case wxROMAN: xfamily = "times"; break;
- case wxMODERN: xfamily = "courier"; break;
- case wxSWISS: xfamily = "helvetica"; break;
- case wxTELETYPE: xfamily = "lucidatypewriter"; break;
- case wxSCRIPT: xfamily = "utopia"; break;
- default: xfamily = "*";
+ case wxDECORATIVE: xfamily = _T("lucida"); break;
+ case wxROMAN: xfamily = _T("times"); break;
+ case wxMODERN: xfamily = _T("courier"); break;
+ case wxSWISS: xfamily = _T("helvetica"); break;
+ case wxTELETYPE: xfamily = _T("lucidatypewriter"); break;
+ case wxSCRIPT: xfamily = _T("utopia"); break;
+ default: xfamily = _T("*");
}
if (!facename.IsEmpty())
{
- sprintf( wxBuffer, "-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*", facename.c_str() );
- GdkFont *test = gdk_font_load( wxBuffer );
+ wxSprintf( wxBuffer, _T("-*-%s-*-*-normal-*-*-*-*-*-*-*-*-*"), facename.c_str() );
+ GdkFont *test = gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
if (test)
{
gdk_font_unref( test );
switch (style)
{
- case wxITALIC: xstyle = "i"; break;
- case wxSLANT: xstyle = "o"; break;
- case wxNORMAL: xstyle = "r"; break;
- default: xstyle = "*"; break;
+ case wxITALIC: xstyle = _T("i"); break;
+ case wxSLANT: xstyle = _T("o"); break;
+ case wxNORMAL: xstyle = _T("r"); break;
+ default: xstyle = _T("*"); break;
}
switch (weight)
{
- case wxBOLD: xweight = "bold"; break;
+ case wxBOLD: xweight = _T("bold"); break;
case wxLIGHT:
- case wxNORMAL: xweight = "medium"; break;
- default: xweight = "*"; break;
+ case wxNORMAL: xweight = _T("medium"); break;
+ default: xweight = _T("*"); break;
}
- sprintf( wxBuffer, "-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-*-*",
+ wxSprintf( wxBuffer, _T("-*-%s-%s-%s-normal-*-*-%d-*-*-*-*-*-*"),
xfamily, xweight, xstyle, pointSize);
- return gdk_font_load( wxBuffer );
+ return gdk_font_load( wxConv_libc.cWX2MB(wxBuffer) );
}
static GdkFont *wxLoadQueryNearestFont( int point_size, int family, int style, int weight,
m_widget = gtk_window_new( win_type );
- gtk_window_set_title( GTK_WINDOW(m_widget), title );
+ gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS );
/* needed ? */
bool wxFrame::Show( bool show )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
if (show && !m_sizeSet)
{
bool wxFrame::Destroy()
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
if (!wxPendingDelete.Member(this)) wxPendingDelete.Append(this);
void wxFrame::DoSetSize( int x, int y, int width, int height, int sizeFlags )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
/* avoid recursions */
if (m_resizing) return;
void wxFrame::Centre( int direction )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
int x = 0;
int y = 0;
void wxFrame::GetClientSize( int *width, int *height ) const
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
wxWindow::GetClientSize( width, height );
if (height)
void wxFrame::DoSetClientSize( int width, int height )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
int h = height;
if (m_frameMenuBar && !m_menuBarDetached) h += wxMENU_HEIGHT;
m_resizing = TRUE;
/* this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow */
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
m_width = width;
m_height = height;
void wxFrame::OnSize( wxSizeEvent &WXUNUSED(event) )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
if (GetAutoLayout())
{
void wxFrame::SetMenuBar( wxMenuBar *menuBar )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
- wxASSERT_MSG( (m_wxwindow != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
+ wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid frame") );
m_frameMenuBar = menuBar;
wxToolBar* wxFrame::CreateToolBar(long style, wxWindowID id, const wxString& name)
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_MSG( m_frameToolBar == NULL, FALSE, "recreating toolbar in wxFrame" );
+ wxCHECK_MSG( m_frameToolBar == NULL, FALSE, _T("recreating toolbar in wxFrame") );
m_frameToolBar = OnCreateToolBar( style, id, name );
wxStatusBar* wxFrame::CreateStatusBar( int number, long style, wxWindowID id, const wxString& name )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, "recreating status bar in wxFrame" );
+ wxCHECK_MSG( m_frameStatusBar == NULL, FALSE, _T("recreating status bar in wxFrame") );
m_frameStatusBar = OnCreateStatusBar( number, style, id, name );
void wxFrame::SetStatusText(const wxString& text, int number)
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set text for" );
+ wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set text for") );
m_frameStatusBar->SetStatusText(text, number);
}
void wxFrame::SetStatusWidths(int n, const int widths_field[] )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
- wxCHECK_RET( m_frameStatusBar != NULL, "no statusbar to set widths for" );
+ wxCHECK_RET( m_frameStatusBar != NULL, _T("no statusbar to set widths for") );
m_frameStatusBar->SetStatusWidths(n, widths_field);
}
void wxFrame::SetTitle( const wxString &title )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
m_title = title;
- if (m_title.IsNull()) m_title = "";
- gtk_window_set_title( GTK_WINDOW(m_widget), title );
+ if (m_title.IsNull()) m_title = _T("");
+ gtk_window_set_title( GTK_WINDOW(m_widget), title.mbc_str() );
}
void wxFrame::SetIcon( const wxIcon &icon )
{
- wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
+ wxASSERT_MSG( (m_widget != NULL), _T("invalid frame") );
m_icon = icon;
if (!icon.Ok()) return;
str.Prepend(CHECKBOX_STRING);
}
- list_item = gtk_list_item_new_with_label( str );
+ list_item = gtk_list_item_new_with_label( str.mbc_str() );
gtk_container_add( GTK_CONTAINER(m_list), list_item );
void wxListBox::InsertItems(int nItems, const wxString items[], int pos)
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GList *children = m_list->children;
int length = g_list_length(children);
- wxCHECK_RET( pos <= length, "invalid index in wxListBox::InsertItems" );
+ wxCHECK_RET( pos <= length, _T("invalid index in wxListBox::InsertItems") );
// VZ: it seems that GTK 1.0.6 doesn't has a function to insert an item
// into a listbox at the given position, this is why we first delete
void wxListBox::AppendCommon( const wxString &item )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GtkWidget *list_item;
label.Prepend(CHECKBOX_STRING);
}
- list_item = gtk_list_item_new_with_label( label );
+ list_item = gtk_list_item_new_with_label( label.mbc_str() );
gtk_container_add( GTK_CONTAINER(m_list), list_item );
void wxListBox::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* wxListBox::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 wxListBox::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* wxListBox::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 wxListBox::Clear()
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
gtk_list_clear_items( m_list, 0, Number() );
void wxListBox::Delete( int n )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
- wxCHECK_RET( child, "wrong listbox index" );
+ wxCHECK_RET( child, _T("wrong listbox index") );
GList *list = g_list_append( (GList*) NULL, child->data );
gtk_list_remove_items( m_list, list );
void wxListBox::Deselect( int n )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
gtk_list_unselect_item( m_list, n );
}
int wxListBox::FindString( const wxString &item ) const
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelection() const
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
int wxListBox::GetSelections( wxArrayInt& aSelections ) const
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
// get the number of selected items first
GList *child = m_list->children;
wxString wxListBox::GetString( int n ) const
{
- wxCHECK_MSG( m_list != NULL, "", "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
return str;
}
- wxFAIL_MSG("wrong listbox index");
+ wxFAIL_MSG(_T("wrong listbox index"));
- return "";
+ return _T("");
}
wxString wxListBox::GetStringSelection() const
{
- wxCHECK_MSG( m_list != NULL, "", "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, _T(""), _T("invalid listbox") );
GList *selection = m_list->selection;
if (selection)
return str;
}
- wxFAIL_MSG("no listbox selection available");
- return "";
+ wxFAIL_MSG(_T("no listbox selection available"));
+ return _T("");
}
int wxListBox::Number()
{
- wxCHECK_MSG( m_list != NULL, -1, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, -1, _T("invalid listbox") );
GList *child = m_list->children;
int count = 0;
bool wxListBox::Selected( int n )
{
- wxCHECK_MSG( m_list != NULL, FALSE, "invalid listbox" );
+ wxCHECK_MSG( m_list != NULL, FALSE, _T("invalid listbox") );
GList *target = g_list_nth( m_list->children, n );
if (target)
child = child->next;
}
}
- wxFAIL_MSG("wrong listbox index");
+ wxFAIL_MSG(_T("wrong listbox index"));
return FALSE;
}
void wxListBox::Set( int WXUNUSED(n), const wxString *WXUNUSED(choices) )
{
- wxFAIL_MSG("wxListBox::Set not implemented");
+ wxFAIL_MSG(_T("wxListBox::Set not implemented"));
}
void wxListBox::SetFirstItem( int WXUNUSED(n) )
{
- wxFAIL_MSG("wxListBox::SetFirstItem not implemented");
+ wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetFirstItem( const wxString &WXUNUSED(item) )
{
- wxFAIL_MSG("wxListBox::SetFirstItem not implemented");
+ wxFAIL_MSG(_T("wxListBox::SetFirstItem not implemented"));
}
void wxListBox::SetSelection( int n, bool select )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
if (select)
gtk_list_select_item( m_list, n );
void wxListBox::SetString( int n, const wxString &string )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
GList *child = g_list_nth( m_list->children, n );
if (child)
str += CHECKBOX_STRING;
str += string;
- gtk_label_set( label, str );
+ gtk_label_set( label, str.mbc_str() );
}
else
{
- wxFAIL_MSG("wrong listbox index");
+ wxFAIL_MSG(_T("wrong listbox index"));
}
}
void wxListBox::SetStringSelection( const wxString &string, bool select )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
SetSelection( FindString(string), select );
}
#if wxUSE_DRAG_AND_DROP
void wxListBox::SetDropTarget( wxDropTarget *dropTarget )
{
- wxCHECK_RET( m_list != NULL, "invalid listbox" );
+ wxCHECK_RET( m_list != NULL, _T("invalid listbox") );
#ifndef NEW_GTK_DND_CODE
if (m_dropTarget)
child = child->next;
}
}
-
wxString s = child->m_title;
if (s.IsNull()) s = _("MDI child");
- GtkWidget *label_widget = gtk_label_new( s );
+ GtkWidget *label_widget = gtk_label_new( s.mbc_str() );
gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",