Globally replace _T() with wxT().

Standardize on using a single macro across all wxWidgets sources and solve the name clash with Sun CC standard headers (see #10660).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61508 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-07-23 20:30:22 +00:00
parent 32cdc45397
commit 9a83f86094
798 changed files with 10370 additions and 10349 deletions

View File

@@ -81,19 +81,19 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
wxImage image = bitmap.ConvertToImage();
#if wxUSE_LIBPNG
if ( !image.SaveFile( dir + _T("test.png"), wxBITMAP_TYPE_PNG ))
if ( !image.SaveFile( dir + wxT("test.png"), wxBITMAP_TYPE_PNG ))
{
wxLogError(wxT("Can't save file"));
}
image.Destroy();
if ( image.LoadFile( dir + _T("test.png") ) )
if ( image.LoadFile( dir + wxT("test.png") ) )
my_square = wxBitmap( image );
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.png")) )
if ( !image.LoadFile( dir + wxT("horse.png")) )
{
wxLogError(wxT("Can't load PNG image"));
}
@@ -102,7 +102,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
my_horse_png = wxBitmap( image );
}
if ( !image.LoadFile( dir + _T("toucan.png")) )
if ( !image.LoadFile( dir + wxT("toucan.png")) )
{
wxLogError(wxT("Can't load PNG image"));
}
@@ -125,7 +125,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_LIBJPEG
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.jpg")) )
if ( !image.LoadFile( dir + wxT("horse.jpg")) )
{
wxLogError(wxT("Can't load JPG image"));
}
@@ -140,9 +140,9 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
colorized_horse_jpeg = wxBitmap( image );
}
if ( !image.LoadFile( dir + _T("cmyk.jpg")) )
if ( !image.LoadFile( dir + wxT("cmyk.jpg")) )
{
wxLogError(_T("Can't load CMYK JPG image"));
wxLogError(wxT("Can't load CMYK JPG image"));
}
else
{
@@ -153,7 +153,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_GIF
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.gif" )) )
if ( !image.LoadFile( dir + wxT("horse.gif" )) )
{
wxLogError(wxT("Can't load GIF image"));
}
@@ -166,7 +166,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_PCX
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.pcx"), wxBITMAP_TYPE_PCX ) )
if ( !image.LoadFile( dir + wxT("horse.pcx"), wxBITMAP_TYPE_PCX ) )
{
wxLogError(wxT("Can't load PCX image"));
}
@@ -178,7 +178,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.bmp"), wxBITMAP_TYPE_BMP ) )
if ( !image.LoadFile( dir + wxT("horse.bmp"), wxBITMAP_TYPE_BMP ) )
{
wxLogError(wxT("Can't load BMP image"));
}
@@ -190,7 +190,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_XPM
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.xpm"), wxBITMAP_TYPE_XPM ) )
if ( !image.LoadFile( dir + wxT("horse.xpm"), wxBITMAP_TYPE_XPM ) )
{
wxLogError(wxT("Can't load XPM image"));
}
@@ -199,7 +199,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
my_horse_xpm = wxBitmap( image );
}
if ( !image.SaveFile( dir + _T("test.xpm"), wxBITMAP_TYPE_XPM ))
if ( !image.SaveFile( dir + wxT("test.xpm"), wxBITMAP_TYPE_XPM ))
{
wxLogError(wxT("Can't save file"));
}
@@ -208,7 +208,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_PNM
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.pnm"), wxBITMAP_TYPE_PNM ) )
if ( !image.LoadFile( dir + wxT("horse.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
@@ -219,7 +219,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) )
if ( !image.LoadFile( dir + wxT("horse_ag.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
@@ -230,7 +230,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) )
if ( !image.LoadFile( dir + wxT("horse_rg.pnm"), wxBITMAP_TYPE_PNM ) )
{
wxLogError(wxT("Can't load PNM image"));
}
@@ -243,7 +243,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_LIBTIFF
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.tif"), wxBITMAP_TYPE_TIF ) )
if ( !image.LoadFile( dir + wxT("horse.tif"), wxBITMAP_TYPE_TIF ) )
{
wxLogError(wxT("Can't load TIFF image"));
}
@@ -256,7 +256,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
#if wxUSE_LIBTIFF
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.tga"), wxBITMAP_TYPE_TGA ) )
if ( !image.LoadFile( dir + wxT("horse.tga"), wxBITMAP_TYPE_TGA ) )
{
wxLogError(wxT("Can't load TGA image"));
}
@@ -273,12 +273,12 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
// demonstrates XPM automatically using the mask when saving
if ( m_bmpSmileXpm.Ok() )
m_bmpSmileXpm.SaveFile(_T("saved.xpm"), wxBITMAP_TYPE_XPM);
m_bmpSmileXpm.SaveFile(wxT("saved.xpm"), wxBITMAP_TYPE_XPM);
#if wxUSE_ICO_CUR
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) )
if ( !image.LoadFile( dir + wxT("horse.ico"), wxBITMAP_TYPE_ICO, 0 ) )
{
wxLogError(wxT("Can't load first ICO image"));
}
@@ -289,7 +289,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) )
if ( !image.LoadFile( dir + wxT("horse.ico"), wxBITMAP_TYPE_ICO, 1 ) )
{
wxLogError(wxT("Can't load second ICO image"));
}
@@ -300,7 +300,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.ico") ) )
if ( !image.LoadFile( dir + wxT("horse.ico") ) )
{
wxLogError(wxT("Can't load best ICO image"));
}
@@ -311,7 +311,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
if ( !image.LoadFile( dir + _T("horse.cur"), wxBITMAP_TYPE_CUR ) )
if ( !image.LoadFile( dir + wxT("horse.cur"), wxBITMAP_TYPE_CUR ) )
{
wxLogError(wxT("Can't load best ICO image"));
}
@@ -322,7 +322,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
yH = 2420 + image.GetOptionInt(wxIMAGE_OPTION_CUR_HOTSPOT_Y) ;
}
m_ani_images = wxImage::GetImageCount ( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI );
m_ani_images = wxImage::GetImageCount ( dir + wxT("horse3.ani"), wxBITMAP_TYPE_ANI );
if (m_ani_images==0)
{
wxLogError(wxT("No ANI-format images found"));
@@ -336,7 +336,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
for (i=0; i < m_ani_images; i++)
{
image.Destroy();
if (!image.LoadFile( dir + _T("horse3.ani"), wxBITMAP_TYPE_ANI, i ))
if (!image.LoadFile( dir + wxT("horse3.ani"), wxBITMAP_TYPE_ANI, i ))
{
wxString tmp = wxT("Can't load image number ");
tmp << i ;
@@ -351,7 +351,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
image.Destroy();
// test image loading from stream
wxFile file(dir + _T("horse.bmp"));
wxFile file(dir + wxT("horse.bmp"));
if ( file.IsOpened() )
{
wxFileOffset len = file.Length();
@@ -359,7 +359,7 @@ MyCanvas::MyCanvas( wxWindow *parent, wxWindowID id,
void *data = malloc(dataSize);
if ( file.Read(data, dataSize) != len )
{
wxLogError(_T("Reading bitmap file failed"));
wxLogError(wxT("Reading bitmap file failed"));
}
else
{
@@ -388,11 +388,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
wxPaintDC dc( this );
PrepareDC( dc );
dc.DrawText( _T("Loaded image"), 30, 10 );
dc.DrawText( wxT("Loaded image"), 30, 10 );
if (my_square.Ok())
dc.DrawBitmap( my_square, 30, 30 );
dc.DrawText( _T("Drawn directly"), 150, 10 );
dc.DrawText( wxT("Drawn directly"), 150, 10 );
dc.SetBrush( wxBrush( wxT("orange"), wxSOLID ) );
dc.SetPen( *wxBLACK_PEN );
dc.DrawRectangle( 150, 30, 100, 100 );
@@ -402,65 +402,65 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
if (my_anti.Ok())
dc.DrawBitmap( my_anti, 280, 30 );
dc.DrawText( _T("PNG handler"), 30, 135 );
dc.DrawText( wxT("PNG handler"), 30, 135 );
if (my_horse_png.Ok())
{
dc.DrawBitmap( my_horse_png, 30, 150 );
wxRect rect(0,0,100,100);
wxBitmap sub( my_horse_png.GetSubBitmap(rect) );
dc.DrawText( _T("GetSubBitmap()"), 280, 175 );
dc.DrawText( wxT("GetSubBitmap()"), 280, 175 );
dc.DrawBitmap( sub, 280, 195 );
}
dc.DrawText( _T("JPEG handler"), 30, 365 );
dc.DrawText( wxT("JPEG handler"), 30, 365 );
if (my_horse_jpeg.Ok())
dc.DrawBitmap( my_horse_jpeg, 30, 380 );
dc.DrawText( _T("Green rotated to red"), 280, 365 );
dc.DrawText( wxT("Green rotated to red"), 280, 365 );
if (colorized_horse_jpeg.Ok())
dc.DrawBitmap( colorized_horse_jpeg, 280, 380 );
dc.DrawText( _T("CMYK JPEG image"), 530, 365 );
dc.DrawText( wxT("CMYK JPEG image"), 530, 365 );
if (my_cmyk_jpeg.Ok())
dc.DrawBitmap( my_cmyk_jpeg, 530, 380 );
dc.DrawText( _T("GIF handler"), 30, 595 );
dc.DrawText( wxT("GIF handler"), 30, 595 );
if (my_horse_gif.Ok())
dc.DrawBitmap( my_horse_gif, 30, 610 );
dc.DrawText( _T("PCX handler"), 30, 825 );
dc.DrawText( wxT("PCX handler"), 30, 825 );
if (my_horse_pcx.Ok())
dc.DrawBitmap( my_horse_pcx, 30, 840 );
dc.DrawText( _T("BMP handler"), 30, 1055 );
dc.DrawText( wxT("BMP handler"), 30, 1055 );
if (my_horse_bmp.Ok())
dc.DrawBitmap( my_horse_bmp, 30, 1070 );
dc.DrawText( _T("BMP read from memory"), 280, 1055 );
dc.DrawText( wxT("BMP read from memory"), 280, 1055 );
if (my_horse_bmp2.Ok())
dc.DrawBitmap( my_horse_bmp2, 280, 1070 );
dc.DrawText( _T("PNM handler"), 30, 1285 );
dc.DrawText( wxT("PNM handler"), 30, 1285 );
if (my_horse_pnm.Ok())
dc.DrawBitmap( my_horse_pnm, 30, 1300 );
dc.DrawText( _T("PNM handler (ascii grey)"), 280, 1285 );
dc.DrawText( wxT("PNM handler (ascii grey)"), 280, 1285 );
if (my_horse_asciigrey_pnm.Ok())
dc.DrawBitmap( my_horse_asciigrey_pnm, 280, 1300 );
dc.DrawText( _T("PNM handler (raw grey)"), 530, 1285 );
dc.DrawText( wxT("PNM handler (raw grey)"), 530, 1285 );
if (my_horse_rawgrey_pnm.Ok())
dc.DrawBitmap( my_horse_rawgrey_pnm, 530, 1300 );
dc.DrawText( _T("TIFF handler"), 30, 1515 );
dc.DrawText( wxT("TIFF handler"), 30, 1515 );
if (my_horse_tiff.Ok())
dc.DrawBitmap( my_horse_tiff, 30, 1530 );
dc.DrawText( _T("TGA handler"), 30, 1745 );
dc.DrawText( wxT("TGA handler"), 30, 1745 );
if (my_horse_tga.Ok())
dc.DrawBitmap( my_horse_tga, 30, 1760 );
dc.DrawText( _T("XPM handler"), 30, 1975 );
dc.DrawText( wxT("XPM handler"), 30, 1975 );
if (my_horse_xpm.Ok())
dc.DrawBitmap( my_horse_xpm, 30, 2000 );
@@ -505,15 +505,15 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{
int x = 300, y = 1800;
dc.DrawText( _T("XBM bitmap"), x, y );
dc.DrawText( _T("(green on red)"), x, y + 15 );
dc.SetTextForeground( _T("GREEN") );
dc.SetTextBackground( _T("RED") );
dc.DrawText( wxT("XBM bitmap"), x, y );
dc.DrawText( wxT("(green on red)"), x, y + 15 );
dc.SetTextForeground( wxT("GREEN") );
dc.SetTextBackground( wxT("RED") );
dc.DrawBitmap( my_smile_xbm, x, y + 30 );
dc.SetTextForeground( *wxBLACK );
dc.DrawText( _T("After wxImage conversion"), x + 120, y );
dc.DrawText( _T("(red on white)"), x + 120, y + 15 );
dc.DrawText( wxT("After wxImage conversion"), x + 120, y );
dc.DrawText( wxT("(red on white)"), x + 120, y + 15 );
dc.SetTextForeground( wxT("RED") );
wxImage i = my_smile_xbm.ConvertToImage();
i.SetMaskColour( 255, 255, 255 );
@@ -535,7 +535,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
memdc.SetTextForeground( *wxBLACK );
#ifndef __WXGTK20__
// I cannot convince GTK2 to draw into mono bitmaps
memdc.DrawText( _T("Hi!"), 5, 5 );
memdc.DrawText( wxT("Hi!"), 5, 5 );
#endif
memdc.SetBrush( *wxBLACK_BRUSH );
memdc.DrawRectangle( 33,5,20,20 );
@@ -547,15 +547,15 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
{
int x = 300, y = 1900;
dc.DrawText( _T("Mono bitmap"), x, y );
dc.DrawText( _T("(red on green)"), x, y + 15 );
dc.DrawText( wxT("Mono bitmap"), x, y );
dc.DrawText( wxT("(red on green)"), x, y + 15 );
dc.SetTextForeground( wxT("RED") );
dc.SetTextBackground( wxT("GREEN") );
dc.DrawBitmap( mono, x, y + 30 );
dc.SetTextForeground( *wxBLACK );
dc.DrawText( _T("After wxImage conversion"), x + 120, y );
dc.DrawText( _T("(red on white)"), x + 120, y + 15 );
dc.DrawText( wxT("After wxImage conversion"), x + 120, y );
dc.DrawText( wxT("(red on white)"), x + 120, y + 15 );
dc.SetTextForeground( wxT("RED") );
wxImage i = mono.ConvertToImage();
i.SetMaskColour( 255,255,255 );
@@ -571,11 +571,11 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetBrush( *wxRED_BRUSH );
dc.DrawRectangle( 20, 2220, 560, 68 );
dc.DrawText(_T("XPM bitmap"), 30, 2230 );
dc.DrawText(wxT("XPM bitmap"), 30, 2230 );
if ( m_bmpSmileXpm.Ok() )
dc.DrawBitmap(m_bmpSmileXpm, 30, 2250, true);
dc.DrawText(_T("XPM icon"), 110, 2230 );
dc.DrawText(wxT("XPM icon"), 110, 2230 );
if ( m_iconSmileXpm.Ok() )
dc.DrawIcon(m_iconSmileXpm, 110, 2250);
@@ -583,19 +583,19 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
wxBitmap to_blit( m_iconSmileXpm );
if (to_blit.Ok())
{
dc.DrawText( _T("SubBitmap"), 170, 2230 );
dc.DrawText( wxT("SubBitmap"), 170, 2230 );
wxBitmap sub = to_blit.GetSubBitmap( wxRect(0,0,15,15) );
if (sub.Ok())
dc.DrawBitmap( sub, 170, 2250, true );
dc.DrawText( _T("Enlarged"), 250, 2230 );
dc.DrawText( wxT("Enlarged"), 250, 2230 );
dc.SetUserScale( 1.5, 1.5 );
dc.DrawBitmap( to_blit, (int)(250/1.5), (int)(2250/1.5), true );
dc.SetUserScale( 2, 2 );
dc.DrawBitmap( to_blit, (int)(300/2), (int)(2250/2), true );
dc.SetUserScale( 1.0, 1.0 );
dc.DrawText( _T("Blit"), 400, 2230);
dc.DrawText( wxT("Blit"), 400, 2230);
wxMemoryDC blit_dc;
blit_dc.SelectObject( to_blit );
dc.Blit( 400, 2250, to_blit.GetWidth(), to_blit.GetHeight(), &blit_dc, 0, 0, wxCOPY, true );
@@ -606,19 +606,19 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.SetUserScale( 1.0, 1.0 );
}
dc.DrawText( _T("ICO handler (1st image)"), 30, 2290 );
dc.DrawText( wxT("ICO handler (1st image)"), 30, 2290 );
if (my_horse_ico32.Ok())
dc.DrawBitmap( my_horse_ico32, 30, 2330, true );
dc.DrawText( _T("ICO handler (2nd image)"), 230, 2290 );
dc.DrawText( wxT("ICO handler (2nd image)"), 230, 2290 );
if (my_horse_ico16.Ok())
dc.DrawBitmap( my_horse_ico16, 230, 2330, true );
dc.DrawText( _T("ICO handler (best image)"), 430, 2290 );
dc.DrawText( wxT("ICO handler (best image)"), 430, 2290 );
if (my_horse_ico.Ok())
dc.DrawBitmap( my_horse_ico, 430, 2330, true );
dc.DrawText( _T("CUR handler"), 30, 2390 );
dc.DrawText( wxT("CUR handler"), 30, 2390 );
if (my_horse_cur.Ok())
{
dc.DrawBitmap( my_horse_cur, 30, 2420, true );
@@ -627,7 +627,7 @@ void MyCanvas::OnPaint( wxPaintEvent &WXUNUSED(event) )
dc.DrawLine (xH,yH-10,xH,yH+10);
}
dc.DrawText( _T("ANI handler"), 230, 2390 );
dc.DrawText( wxT("ANI handler"), 230, 2390 );
for ( int i=0; i < m_ani_images; i++ )
{
if (my_horse_ani[i].Ok())
@@ -649,8 +649,8 @@ void MyCanvas::CreateAntiAliasedBitmap()
dc.SetFont( wxFont( 24, wxDECORATIVE, wxNORMAL, wxNORMAL) );
dc.SetTextForeground( wxT("RED") );
dc.DrawText( _T("This is anti-aliased Text."), 20, 5 );
dc.DrawText( _T("And a Rectangle."), 20, 45 );
dc.DrawText( wxT("This is anti-aliased Text."), 20, 5 );
dc.DrawText( wxT("And a Rectangle."), 20, 45 );
dc.SetBrush( *wxRED_BRUSH );
dc.SetPen( *wxTRANSPARENT_PEN );

View File

@@ -135,7 +135,7 @@ private:
int numImages = 1)
{
if ( !wxFrame::Create(parent, wxID_ANY,
wxString::Format(_T("Image from %s"), desc),
wxString::Format(wxT("Image from %s"), desc),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_FRAME_STYLE | wxFULL_REPAINT_ON_RESIZE) )
return false;
@@ -146,19 +146,19 @@ private:
wxMenu *menu = new wxMenu;
menu->Append(wxID_SAVE);
menu->AppendSeparator();
menu->AppendCheckItem(ID_PAINT_BG, _T("&Paint background"),
menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"),
"Uncheck this for transparent images");
menu->AppendSeparator();
menu->Append(ID_RESIZE, _T("&Fit to window\tCtrl-F"));
menu->Append(ID_RESIZE, wxT("&Fit to window\tCtrl-F"));
menu->Append(wxID_ZOOM_IN, "Zoom &in\tCtrl-+");
menu->Append(wxID_ZOOM_OUT, "Zoom &out\tCtrl--");
menu->Append(wxID_ZOOM_100, "Reset zoom to &100%\tCtrl-1");
menu->AppendSeparator();
menu->Append(ID_ROTATE_LEFT, _T("Rotate &left\tCtrl-L"));
menu->Append(ID_ROTATE_RIGHT, _T("Rotate &right\tCtrl-R"));
menu->Append(ID_ROTATE_LEFT, wxT("Rotate &left\tCtrl-L"));
menu->Append(ID_ROTATE_RIGHT, wxT("Rotate &right\tCtrl-R"));
wxMenuBar *mbar = new wxMenuBar;
mbar->Append(menu, _T("&Image"));
mbar->Append(menu, wxT("&Image"));
SetMenuBar(mbar);
mbar->Check(ID_PAINT_BG, true);
@@ -227,7 +227,7 @@ private:
wxFileName::SplitPath(savefilename, NULL, NULL, &extension);
bool saved = false;
if ( extension == _T("bmp") )
if ( extension == wxT("bmp") )
{
static const int bppvalues[] =
{
@@ -243,18 +243,18 @@ private:
const wxString bppchoices[] =
{
_T("1 bpp color"),
_T("1 bpp B&W"),
_T("4 bpp color"),
_T("8 bpp color"),
_T("8 bpp greyscale"),
_T("8 bpp red"),
_T("8 bpp own palette"),
_T("24 bpp")
wxT("1 bpp color"),
wxT("1 bpp B&W"),
wxT("4 bpp color"),
wxT("8 bpp color"),
wxT("8 bpp greyscale"),
wxT("8 bpp red"),
wxT("8 bpp own palette"),
wxT("24 bpp")
};
int bppselection = wxGetSingleChoiceIndex(_T("Set BMP BPP"),
_T("Image sample: save file"),
int bppselection = wxGetSingleChoiceIndex(wxT("Set BMP BPP"),
wxT("Image sample: save file"),
WXSIZEOF(bppchoices),
bppchoices,
this);
@@ -274,7 +274,7 @@ private:
}
}
}
else if ( extension == _T("png") )
else if ( extension == wxT("png") )
{
static const int pngvalues[] =
{
@@ -288,16 +288,16 @@ private:
const wxString pngchoices[] =
{
_T("Colour 8bpp"),
_T("Colour 16bpp"),
_T("Grey 8bpp"),
_T("Grey 16bpp"),
_T("Grey red 8bpp"),
_T("Grey red 16bpp"),
wxT("Colour 8bpp"),
wxT("Colour 16bpp"),
wxT("Grey 8bpp"),
wxT("Grey 16bpp"),
wxT("Grey red 8bpp"),
wxT("Grey red 16bpp"),
};
int sel = wxGetSingleChoiceIndex(_T("Set PNG format"),
_T("Image sample: save file"),
int sel = wxGetSingleChoiceIndex(wxT("Set PNG format"),
wxT("Image sample: save file"),
WXSIZEOF(pngchoices),
pngchoices,
this);
@@ -309,22 +309,22 @@ private:
// these values are taken from OptiPNG with -o3 switch
const wxString compressionChoices[] =
{
_T("compression = 9, memory = 8, strategy = 0, filter = 0"),
_T("compression = 9, memory = 9, strategy = 0, filter = 0"),
_T("compression = 9, memory = 8, strategy = 1, filter = 0"),
_T("compression = 9, memory = 9, strategy = 1, filter = 0"),
_T("compression = 1, memory = 8, strategy = 2, filter = 0"),
_T("compression = 1, memory = 9, strategy = 2, filter = 0"),
_T("compression = 9, memory = 8, strategy = 0, filter = 5"),
_T("compression = 9, memory = 9, strategy = 0, filter = 5"),
_T("compression = 9, memory = 8, strategy = 1, filter = 5"),
_T("compression = 9, memory = 9, strategy = 1, filter = 5"),
_T("compression = 1, memory = 8, strategy = 2, filter = 5"),
_T("compression = 1, memory = 9, strategy = 2, filter = 5"),
wxT("compression = 9, memory = 8, strategy = 0, filter = 0"),
wxT("compression = 9, memory = 9, strategy = 0, filter = 0"),
wxT("compression = 9, memory = 8, strategy = 1, filter = 0"),
wxT("compression = 9, memory = 9, strategy = 1, filter = 0"),
wxT("compression = 1, memory = 8, strategy = 2, filter = 0"),
wxT("compression = 1, memory = 9, strategy = 2, filter = 0"),
wxT("compression = 9, memory = 8, strategy = 0, filter = 5"),
wxT("compression = 9, memory = 9, strategy = 0, filter = 5"),
wxT("compression = 9, memory = 8, strategy = 1, filter = 5"),
wxT("compression = 9, memory = 9, strategy = 1, filter = 5"),
wxT("compression = 1, memory = 8, strategy = 2, filter = 5"),
wxT("compression = 1, memory = 9, strategy = 2, filter = 5"),
};
int sel = wxGetSingleChoiceIndex(_T("Select compression option (Cancel to use default)\n"),
_T("PNG Compression Options"),
int sel = wxGetSingleChoiceIndex(wxT("Select compression option (Cancel to use default)\n"),
wxT("PNG Compression Options"),
WXSIZEOF(compressionChoices),
compressionChoices,
this);
@@ -344,7 +344,7 @@ private:
}
}
}
else if ( extension == _T("cur") )
else if ( extension == wxT("cur") )
{
image.Rescale(32,32);
image.SetOption(wxIMAGE_OPTION_CUR_HOTSPOT_X, 0);
@@ -396,7 +396,7 @@ private:
img = img.Rotate(angle, wxPoint(img.GetWidth() / 2, img.GetHeight() / 2));
if ( !img.Ok() )
{
wxLogWarning(_T("Rotation failed"));
wxLogWarning(wxT("Rotation failed"));
return;
}
@@ -407,7 +407,7 @@ private:
void UpdateStatusBar()
{
wxLogStatus(this, _T("Image size: (%d, %d), zoom %.2f"),
wxLogStatus(this, wxT("Image size: (%d, %d), zoom %.2f"),
m_bitmap.GetWidth(),
m_bitmap.GetHeight(),
m_zoom);
@@ -435,7 +435,7 @@ public:
};
MyRawBitmapFrame(wxFrame *parent)
: wxFrame(parent, wxID_ANY, _T("Raw bitmaps (how exciting)")),
: wxFrame(parent, wxID_ANY, wxT("Raw bitmaps (how exciting)")),
m_bitmap(SIZE, SIZE, 24),
m_alphaBitmap(SIZE, SIZE, 32)
{
@@ -453,7 +453,7 @@ public:
wxAlphaPixelData data( m_alphaBitmap, wxPoint(0,0), wxSize(SIZE, SIZE) );
if ( !data )
{
wxLogError(_T("Failed to gain raw access to bitmap data"));
wxLogError(wxT("Failed to gain raw access to bitmap data"));
return;
}
wxAlphaPixelData::Iterator p(data);
@@ -475,7 +475,7 @@ public:
wxSize(REAL_SIZE, REAL_SIZE));
if ( !data )
{
wxLogError(_T("Failed to gain raw access to bitmap data"));
wxLogError(wxT("Failed to gain raw access to bitmap data"));
return;
}
@@ -512,7 +512,7 @@ public:
wxNativePixelData data(m_bitmap);
if ( !data )
{
wxLogError(_T("Failed to gain raw access to bitmap data"));
wxLogError(wxT("Failed to gain raw access to bitmap data"));
return;
}
@@ -541,12 +541,12 @@ public:
void OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc( this );
dc.DrawText(_T("This is alpha and raw bitmap test"), 0, BORDER);
dc.DrawText(_T("This is alpha and raw bitmap test"), 0, SIZE/2 - BORDER);
dc.DrawText(_T("This is alpha and raw bitmap test"), 0, SIZE - 2*BORDER);
dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, BORDER);
dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, SIZE/2 - BORDER);
dc.DrawText(wxT("This is alpha and raw bitmap test"), 0, SIZE - 2*BORDER);
dc.DrawBitmap( m_alphaBitmap, 0, 0, true /* use mask */ );
dc.DrawText(_T("Raw bitmap access without alpha"), 0, SIZE+5);
dc.DrawText(wxT("Raw bitmap access without alpha"), 0, SIZE+5);
dc.DrawBitmap( m_bitmap, 0, SIZE+5+dc.GetCharHeight());
}
@@ -624,7 +624,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
END_EVENT_TABLE()
MyFrame::MyFrame()
: wxFrame( (wxFrame *)NULL, wxID_ANY, _T("wxImage sample"),
: wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxImage sample"),
wxPoint(20, 20), wxSize(950, 700) )
{
SetIcon(wxICON(sample));
@@ -632,26 +632,26 @@ MyFrame::MyFrame()
wxMenuBar *menu_bar = new wxMenuBar();
wxMenu *menuImage = new wxMenu;
menuImage->Append( ID_NEW, _T("&Show any image...\tCtrl-O"));
menuImage->Append( ID_INFO, _T("Show image &information...\tCtrl-I"));
menuImage->Append( ID_NEW, wxT("&Show any image...\tCtrl-O"));
menuImage->Append( ID_INFO, wxT("Show image &information...\tCtrl-I"));
#ifdef wxHAVE_RAW_BITMAP
menuImage->AppendSeparator();
menuImage->Append( ID_SHOWRAW, _T("Test &raw bitmap...\tCtrl-R"));
menuImage->Append( ID_SHOWRAW, wxT("Test &raw bitmap...\tCtrl-R"));
#endif
menuImage->AppendSeparator();
menuImage->Append( ID_SHOWTHUMBNAIL, _T("Test &thumbnail...\tCtrl-T"),
menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"),
"Test scaling the image during load (try with JPEG)");
menuImage->AppendSeparator();
menuImage->Append( ID_ABOUT, _T("&About..."));
menuImage->Append( ID_ABOUT, wxT("&About..."));
menuImage->AppendSeparator();
menuImage->Append( ID_QUIT, _T("E&xit\tCtrl-Q"));
menu_bar->Append(menuImage, _T("&Image"));
menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q"));
menu_bar->Append(menuImage, wxT("&Image"));
#if wxUSE_CLIPBOARD
wxMenu *menuClipboard = new wxMenu;
menuClipboard->Append(wxID_COPY, _T("&Copy test image\tCtrl-C"));
menuClipboard->Append(wxID_PASTE, _T("&Paste image\tCtrl-V"));
menu_bar->Append(menuClipboard, _T("&Clipboard"));
menuClipboard->Append(wxID_COPY, wxT("&Copy test image\tCtrl-C"));
menuClipboard->Append(wxID_PASTE, wxT("&Paste image\tCtrl-V"));
menu_bar->Append(menuClipboard, wxT("&Clipboard"));
#endif // wxUSE_CLIPBOARD
SetMenuBar( menu_bar );
@@ -687,12 +687,12 @@ wxString MyFrame::LoadUserImage(wxImage& image)
wxString filename;
#if wxUSE_FILEDLG
filename = wxLoadFileSelector(_T("image"), wxEmptyString);
filename = wxLoadFileSelector(wxT("image"), wxEmptyString);
if ( !filename.empty() )
{
if ( !image.LoadFile(filename) )
{
wxLogError(_T("Couldn't load image from '%s'."), filename.c_str());
wxLogError(wxT("Couldn't load image from '%s'."), filename.c_str());
return wxEmptyString;
}
@@ -769,7 +769,7 @@ void MyFrame::OnCopy(wxCommandEvent& WXUNUSED(event))
if ( !wxTheClipboard->SetData(dobjBmp) )
{
wxLogError(_T("Failed to copy bitmap to clipboard"));
wxLogError(wxT("Failed to copy bitmap to clipboard"));
}
wxTheClipboard->Close();
@@ -782,11 +782,11 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event))
wxTheClipboard->Open();
if ( !wxTheClipboard->GetData(dobjBmp) )
{
wxLogMessage(_T("No bitmap data in the clipboard"));
wxLogMessage(wxT("No bitmap data in the clipboard"));
}
else
{
new MyImageFrame(this, _T("Clipboard"), dobjBmp.GetBitmap());
new MyImageFrame(this, wxT("Clipboard"), dobjBmp.GetBitmap());
}
wxTheClipboard->Close();
}
@@ -796,7 +796,7 @@ void MyFrame::OnPaste(wxCommandEvent& WXUNUSED(event))
void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
{
#if wxUSE_FILEDLG
wxString filename = wxLoadFileSelector(_T("image"), wxEmptyString, wxEmptyString, this);
wxString filename = wxLoadFileSelector(wxT("image"), wxEmptyString, wxEmptyString, this);
if ( filename.empty() )
return;
@@ -810,7 +810,7 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
wxStopWatch sw;
if ( !image.LoadFile(filename) )
{
wxLogError(_T("Couldn't load image from '%s'."), filename.c_str());
wxLogError(wxT("Couldn't load image from '%s'."), filename.c_str());
return;
}
@@ -819,7 +819,7 @@ void MyFrame::OnThumbnail( wxCommandEvent &WXUNUSED(event) )
MyImageFrame * const frame = new MyImageFrame(this, filename, image);
wxLogStatus(frame, "Loaded \"%s\" in %ldms", filename, loadTime);
#else
wxLogError( _T("Couldn't create file selector dialog") );
wxLogError( wxT("Couldn't create file selector dialog") );
return;
#endif // wxUSE_FILEDLG
}