From 62bd5cf059a04bf27edc80ae7437289d26faeffa Mon Sep 17 00:00:00 2001 From: Ove Kaaven Date: Tue, 13 Apr 1999 17:55:13 +0000 Subject: [PATCH] This is the way to go (well, close enough). Unicodified lots of asserts. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/bitmap.cpp | 32 +++++++++++++++----------------- src/gtk/bmpbuttn.cpp | 14 +++++++------- src/gtk/brush.cpp | 6 +++--- src/gtk1/bitmap.cpp | 32 +++++++++++++++----------------- src/gtk1/bmpbuttn.cpp | 14 +++++++------- src/gtk1/brush.cpp | 6 +++--- 6 files changed, 50 insertions(+), 54 deletions(-) diff --git a/src/gtk/bitmap.cpp b/src/gtk/bitmap.cpp index 0b6b995c25..0a2da3f4e9 100644 --- a/src/gtk/bitmap.cpp +++ b/src/gtk/bitmap.cpp @@ -104,8 +104,8 @@ wxBitmap::wxBitmap() wxBitmap::wxBitmap( int width, int height, int depth ) { - wxCHECK_RET( (width > 0) && (height > 0), "invalid bitmap size" ) - wxCHECK_RET( (depth > 0) || (depth == -1), "invalid bitmap depth" ) + wxCHECK_RET( (width > 0) && (height > 0), _T("invalid bitmap size") ) + wxCHECK_RET( (depth > 0) || (depth == -1), _T("invalid bitmap depth") ) m_refData = new wxBitmapRefData(); @@ -122,7 +122,7 @@ wxBitmap::wxBitmap( int width, int height, int depth ) wxBitmap::wxBitmap( const char **bits ) { - wxCHECK_RET( bits != NULL, "invalid bitmap data" ) + wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -145,7 +145,7 @@ wxBitmap::wxBitmap( const char **bits ) wxBitmap::wxBitmap( char **bits ) { - wxCHECK_RET( bits != NULL, "invalid bitmap data" ) + wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -154,7 +154,7 @@ wxBitmap::wxBitmap( char **bits ) M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits ); - wxCHECK_RET( M_BMPDATA->m_pixmap, "couldn't create pixmap" ); + wxCHECK_RET( M_BMPDATA->m_pixmap, _T("couldn't create pixmap") ); if (mask) { @@ -193,7 +193,7 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth M_BMPDATA->m_height = height; M_BMPDATA->m_bpp = 1; - wxCHECK_RET( M_BMPDATA->m_bitmap, "couldn't create bitmap" ); + wxCHECK_RET( M_BMPDATA->m_bitmap, _T("couldn't create bitmap") ); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } @@ -227,35 +227,35 @@ bool wxBitmap::Ok(void) const int wxBitmap::GetHeight(void) const { - wxCHECK_MSG( Ok(), -1, "invalid bitmap" ); + wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth(void) const { - wxCHECK_MSG( Ok(), -1, "invalid bitmap" ); + wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth(void) const { - wxCHECK_MSG( Ok(), -1, "invalid bitmap" ); + wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask(void) const { - wxCHECK_MSG( Ok(), (wxMask *) NULL, "invalid bitmap" ); + wxCHECK_MSG( Ok(), (wxMask *) NULL, _T("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask( wxMask *mask ) { - wxCHECK_RET( Ok(), "invalid bitmap" ); + wxCHECK_RET( Ok(), _T("invalid bitmap") ); if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; @@ -264,7 +264,7 @@ void wxBitmap::SetMask( wxMask *mask ) bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) ) { - wxCHECK_MSG( Ok(), FALSE, "invalid bitmap" ); + wxCHECK_MSG( Ok(), FALSE, _T("invalid bitmap") ); if (type == wxBITMAP_TYPE_PNG) { @@ -288,7 +288,7 @@ bool wxBitmap::LoadFile( const wxString &name, int type ) GdkBitmap *mask = (GdkBitmap*) NULL; GdkWindow *parent = (GdkWindow*) &gdk_root_parent; - M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm( parent, &mask, NULL, name ); + M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm( parent, &mask, NULL, name.fn_str() ); if (mask) { @@ -354,16 +354,14 @@ void wxBitmap::SetPixmap( GdkPixmap *pixmap ) GdkPixmap *wxBitmap::GetPixmap(void) const { - wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, "invalid bitmap" ); + wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, _T("invalid bitmap") ); return M_BMPDATA->m_pixmap; } GdkBitmap *wxBitmap::GetBitmap(void) const { - wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, "invalid bitmap" ); + wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, _T("invalid bitmap") ); return M_BMPDATA->m_bitmap; } - - diff --git a/src/gtk/bmpbuttn.cpp b/src/gtk/bmpbuttn.cpp index 0984b03302..c6d4499cef 100644 --- a/src/gtk/bmpbuttn.cpp +++ b/src/gtk/bmpbuttn.cpp @@ -171,14 +171,14 @@ void wxBitmapButton::SetDefault() void wxBitmapButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); wxControl::SetLabel( label ); } wxString wxBitmapButton::GetLabel() const { - wxCHECK_MSG( m_widget != NULL, "", "invalid button" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") ); return wxControl::GetLabel(); } @@ -189,7 +189,7 @@ void wxBitmapButton::ApplyWidgetStyle() void wxBitmapButton::SetBitmap() { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); wxBitmap the_one; @@ -224,7 +224,7 @@ void wxBitmapButton::SetBitmap() void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if ( ! m_disabled.Ok() ) return; m_disabled = bitmap; @@ -234,7 +234,7 @@ void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if ( ! m_focus.Ok() ) return; m_focus = bitmap; @@ -244,7 +244,7 @@ void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if (!m_bitmap.Ok()) return; m_bitmap = bitmap; @@ -254,7 +254,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if ( ! m_selected.Ok() ) return; m_selected = bitmap; diff --git a/src/gtk/brush.cpp b/src/gtk/brush.cpp index be6d5e2e91..ae8e34635c 100644 --- a/src/gtk/brush.cpp +++ b/src/gtk/brush.cpp @@ -111,7 +111,7 @@ int wxBrush::GetStyle() const { if (m_refData == NULL) { - wxFAIL_MSG( "invalid brush" ); + wxFAIL_MSG( _T("invalid brush") ); return 0; } @@ -122,7 +122,7 @@ wxColour &wxBrush::GetColour() const { if (m_refData == NULL) { - wxFAIL_MSG( "invalid brush" ); + wxFAIL_MSG( _T("invalid brush") ); return wxNullColour; } @@ -133,7 +133,7 @@ wxBitmap *wxBrush::GetStipple() const { if (m_refData == NULL) { - wxFAIL_MSG( "invalid brush" ); + wxFAIL_MSG( _T("invalid brush") ); return &wxNullBitmap; } diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 0b6b995c25..0a2da3f4e9 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -104,8 +104,8 @@ wxBitmap::wxBitmap() wxBitmap::wxBitmap( int width, int height, int depth ) { - wxCHECK_RET( (width > 0) && (height > 0), "invalid bitmap size" ) - wxCHECK_RET( (depth > 0) || (depth == -1), "invalid bitmap depth" ) + wxCHECK_RET( (width > 0) && (height > 0), _T("invalid bitmap size") ) + wxCHECK_RET( (depth > 0) || (depth == -1), _T("invalid bitmap depth") ) m_refData = new wxBitmapRefData(); @@ -122,7 +122,7 @@ wxBitmap::wxBitmap( int width, int height, int depth ) wxBitmap::wxBitmap( const char **bits ) { - wxCHECK_RET( bits != NULL, "invalid bitmap data" ) + wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -145,7 +145,7 @@ wxBitmap::wxBitmap( const char **bits ) wxBitmap::wxBitmap( char **bits ) { - wxCHECK_RET( bits != NULL, "invalid bitmap data" ) + wxCHECK_RET( bits != NULL, _T("invalid bitmap data") ) m_refData = new wxBitmapRefData(); @@ -154,7 +154,7 @@ wxBitmap::wxBitmap( char **bits ) M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm_d( parent, &mask, NULL, (gchar **) bits ); - wxCHECK_RET( M_BMPDATA->m_pixmap, "couldn't create pixmap" ); + wxCHECK_RET( M_BMPDATA->m_pixmap, _T("couldn't create pixmap") ); if (mask) { @@ -193,7 +193,7 @@ wxBitmap::wxBitmap( const char bits[], int width, int height, int WXUNUSED(depth M_BMPDATA->m_height = height; M_BMPDATA->m_bpp = 1; - wxCHECK_RET( M_BMPDATA->m_bitmap, "couldn't create bitmap" ); + wxCHECK_RET( M_BMPDATA->m_bitmap, _T("couldn't create bitmap") ); if (wxTheBitmapList) wxTheBitmapList->AddBitmap(this); } @@ -227,35 +227,35 @@ bool wxBitmap::Ok(void) const int wxBitmap::GetHeight(void) const { - wxCHECK_MSG( Ok(), -1, "invalid bitmap" ); + wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); return M_BMPDATA->m_height; } int wxBitmap::GetWidth(void) const { - wxCHECK_MSG( Ok(), -1, "invalid bitmap" ); + wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); return M_BMPDATA->m_width; } int wxBitmap::GetDepth(void) const { - wxCHECK_MSG( Ok(), -1, "invalid bitmap" ); + wxCHECK_MSG( Ok(), -1, _T("invalid bitmap") ); return M_BMPDATA->m_bpp; } wxMask *wxBitmap::GetMask(void) const { - wxCHECK_MSG( Ok(), (wxMask *) NULL, "invalid bitmap" ); + wxCHECK_MSG( Ok(), (wxMask *) NULL, _T("invalid bitmap") ); return M_BMPDATA->m_mask; } void wxBitmap::SetMask( wxMask *mask ) { - wxCHECK_RET( Ok(), "invalid bitmap" ); + wxCHECK_RET( Ok(), _T("invalid bitmap") ); if (M_BMPDATA->m_mask) delete M_BMPDATA->m_mask; @@ -264,7 +264,7 @@ void wxBitmap::SetMask( wxMask *mask ) bool wxBitmap::SaveFile( const wxString &name, int type, wxPalette *WXUNUSED(palette) ) { - wxCHECK_MSG( Ok(), FALSE, "invalid bitmap" ); + wxCHECK_MSG( Ok(), FALSE, _T("invalid bitmap") ); if (type == wxBITMAP_TYPE_PNG) { @@ -288,7 +288,7 @@ bool wxBitmap::LoadFile( const wxString &name, int type ) GdkBitmap *mask = (GdkBitmap*) NULL; GdkWindow *parent = (GdkWindow*) &gdk_root_parent; - M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm( parent, &mask, NULL, name ); + M_BMPDATA->m_pixmap = gdk_pixmap_create_from_xpm( parent, &mask, NULL, name.fn_str() ); if (mask) { @@ -354,16 +354,14 @@ void wxBitmap::SetPixmap( GdkPixmap *pixmap ) GdkPixmap *wxBitmap::GetPixmap(void) const { - wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, "invalid bitmap" ); + wxCHECK_MSG( Ok(), (GdkPixmap *) NULL, _T("invalid bitmap") ); return M_BMPDATA->m_pixmap; } GdkBitmap *wxBitmap::GetBitmap(void) const { - wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, "invalid bitmap" ); + wxCHECK_MSG( Ok(), (GdkBitmap *) NULL, _T("invalid bitmap") ); return M_BMPDATA->m_bitmap; } - - diff --git a/src/gtk1/bmpbuttn.cpp b/src/gtk1/bmpbuttn.cpp index 0984b03302..c6d4499cef 100644 --- a/src/gtk1/bmpbuttn.cpp +++ b/src/gtk1/bmpbuttn.cpp @@ -171,14 +171,14 @@ void wxBitmapButton::SetDefault() void wxBitmapButton::SetLabel( const wxString &label ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); wxControl::SetLabel( label ); } wxString wxBitmapButton::GetLabel() const { - wxCHECK_MSG( m_widget != NULL, "", "invalid button" ); + wxCHECK_MSG( m_widget != NULL, _T(""), _T("invalid button") ); return wxControl::GetLabel(); } @@ -189,7 +189,7 @@ void wxBitmapButton::ApplyWidgetStyle() void wxBitmapButton::SetBitmap() { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); wxBitmap the_one; @@ -224,7 +224,7 @@ void wxBitmapButton::SetBitmap() void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if ( ! m_disabled.Ok() ) return; m_disabled = bitmap; @@ -234,7 +234,7 @@ void wxBitmapButton::SetBitmapDisabled( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if ( ! m_focus.Ok() ) return; m_focus = bitmap; @@ -244,7 +244,7 @@ void wxBitmapButton::SetBitmapFocus( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if (!m_bitmap.Ok()) return; m_bitmap = bitmap; @@ -254,7 +254,7 @@ void wxBitmapButton::SetBitmapLabel( const wxBitmap& bitmap ) void wxBitmapButton::SetBitmapSelected( const wxBitmap& bitmap ) { - wxCHECK_RET( m_widget != NULL, "invalid button" ); + wxCHECK_RET( m_widget != NULL, _T("invalid button") ); if ( ! m_selected.Ok() ) return; m_selected = bitmap; diff --git a/src/gtk1/brush.cpp b/src/gtk1/brush.cpp index be6d5e2e91..ae8e34635c 100644 --- a/src/gtk1/brush.cpp +++ b/src/gtk1/brush.cpp @@ -111,7 +111,7 @@ int wxBrush::GetStyle() const { if (m_refData == NULL) { - wxFAIL_MSG( "invalid brush" ); + wxFAIL_MSG( _T("invalid brush") ); return 0; } @@ -122,7 +122,7 @@ wxColour &wxBrush::GetColour() const { if (m_refData == NULL) { - wxFAIL_MSG( "invalid brush" ); + wxFAIL_MSG( _T("invalid brush") ); return wxNullColour; } @@ -133,7 +133,7 @@ wxBitmap *wxBrush::GetStipple() const { if (m_refData == NULL) { - wxFAIL_MSG( "invalid brush" ); + wxFAIL_MSG( _T("invalid brush") ); return &wxNullBitmap; } -- 2.45.2