}
case SHAPE_DRAG_TEXT:
{
- m_dragImage = new wxDragImage(wxString("Dragging some test text"), wxCursor(wxCURSOR_HAND));
+ m_dragImage = new wxDragImage(wxString(_T("Dragging some test text")), wxCursor(wxCURSOR_HAND));
break;
}
case SHAPE_DRAG_ICON:
END_EVENT_TABLE()
MyFrame::MyFrame()
- : wxFrame( (wxFrame *)NULL, -1, "wxDragImage sample",
+ : wxFrame( (wxFrame *)NULL, -1, _T("wxDragImage sample"),
wxPoint(20,20), wxSize(470,360) )
{
wxMenu *file_menu = new wxMenu();
- file_menu->Append( wxID_ABOUT, "&About...");
- file_menu->Append( TEST_USE_SCREEN, "&Use whole screen for dragging", "Use whole screen", TRUE);
- file_menu->Append( wxID_EXIT, "E&xit");
+ file_menu->Append( wxID_ABOUT, _T("&About..."));
+ file_menu->Append( TEST_USE_SCREEN, _T("&Use whole screen for dragging"), _T("Use whole screen"), TRUE);
+ file_menu->Append( wxID_EXIT, _T("E&xit"));
wxMenuBar *menu_bar = new wxMenuBar();
- menu_bar->Append(file_menu, "&File");
+ menu_bar->Append(file_menu, _T("&File"));
SetMenuBar( menu_bar );
void MyFrame::OnAbout( wxCommandEvent &WXUNUSED(event) )
{
- (void)wxMessageBox( "wxDragImage demo\n"
- "Julian Smart (c) 2000",
- "About wxDragImage Demo", wxICON_INFORMATION | wxOK );
+ (void)wxMessageBox( _T("wxDragImage demo\n")
+ _T("Julian Smart (c) 2000"),
+ _T("About wxDragImage Demo"),
+ wxICON_INFORMATION | wxOK );
}
//-----------------------------------------------------------------------------
#endif
wxImage image;
- if (image.LoadFile("backgrnd.png", wxBITMAP_TYPE_PNG))
+ if (image.LoadFile(_T("backgrnd.png"), wxBITMAP_TYPE_PNG))
{
m_background = wxBitmap(image);
}
MyFrame *frame = new MyFrame();
- wxString rootName("shape0");
+ wxString rootName(_T("shape0"));
int i;
for (i = 1; i < 4; i++)
gs_bmp36 = new wxBitmap;
wxPathList pathList;
- pathList.Add(".");
- pathList.Add("..");
+ pathList.Add(_T("."));
+ pathList.Add(_T(".."));
- wxString path = pathList.FindValidPath("pat4.bmp");
+ wxString path = pathList.FindValidPath(_T("pat4.bmp"));
if ( !path )
return FALSE;
wxMask* mask4 = new wxMask(*gs_bmp4_mono, *wxBLACK);
gs_bmp4_mono->SetMask(mask4);
- path = pathList.FindValidPath("pat36.bmp");
+ path = pathList.FindValidPath(_T("pat36.bmp"));
if ( !path )
return FALSE;
gs_bmp36->LoadFile(path, wxBITMAP_TYPE_BMP);
wxMask* mask36 = new wxMask(*gs_bmp36, *wxBLACK);
gs_bmp36->SetMask(mask36);
- path = pathList.FindValidPath("image.bmp");
+ path = pathList.FindValidPath(_T("image.bmp"));
if ( !path )
return FALSE;
gs_bmpNoMask->LoadFile(path, wxBITMAP_TYPE_BMP);
gs_bmpWithMask->LoadFile(path, wxBITMAP_TYPE_BMP);
gs_bmpWithColMask->LoadFile(path, wxBITMAP_TYPE_BMP);
- path = pathList.FindValidPath("mask.bmp");
+ path = pathList.FindValidPath(_T("mask.bmp"));
if ( !path )
return FALSE;
gs_bmpMask->LoadFile(path, wxBITMAP_TYPE_BMP);
bool MyApp::OnInit()
{
// Create the main application window
- MyFrame *frame = new MyFrame("Drawing sample",
+ MyFrame *frame = new MyFrame(_T("Drawing sample"),
wxPoint(50, 50), wxSize(550, 340));
// Show it and tell the application that it's our main window
dc.SetBrush(wxBrush(*wxGREEN, wxSOLID));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText("Solid green", x + 10, y + 10);
+ dc.DrawText(_T("Solid green"), x + 10, y + 10);
y += HEIGHT;
dc.SetBrush(wxBrush(*wxRED, wxCROSSDIAG_HATCH));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText("Hatched red", x + 10, y + 10);
+ dc.DrawText(_T("Hatched red"), x + 10, y + 10);
y += HEIGHT;
dc.SetBrush(wxBrush(*gs_bmpMask));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText("Stipple mono", x + 10, y + 10);
+ dc.DrawText(_T("Stipple mono"), x + 10, y + 10);
y += HEIGHT;
dc.SetBrush(wxBrush(*gs_bmpNoMask));
dc.DrawRectangle(x, y, WIDTH, HEIGHT);
- dc.DrawText("Stipple colour", x + 10, y + 10);
+ dc.DrawText(_T("Stipple colour"), x + 10, y + 10);
}
void MyCanvas::DrawTestPoly(wxDC& dc)
star[3] = wxPoint(40, 100);
star[4] = wxPoint(140, 150);
- dc.DrawText("You should see two (irregular) stars below, the left one "
- "hatched", 10, 10);
- dc.DrawText("except for the central region and the right "
- "one entirely hatched", 10, 30);
+ dc.DrawText(_T("You should see two (irregular) stars below, the left one ")
+ _T("hatched"), 10, 10);
+ dc.DrawText(_T("except for the central region and the right ")
+ _T("one entirely hatched"), 10, 30);
dc.DrawPolygon(WXSIZEOF(star), star);
dc.DrawPolygon(WXSIZEOF(star), star, 160, 0, wxWINDING_RULE);
dc.DrawText(wxString::Format(wxT("Testing lines of width %d"), width), x + 10, y - 10);
dc.DrawRectangle( x+10, y+10, 100, 190 );
- dc.DrawText("Solid/dot/short dash/long dash/dot dash", x + 150, y + 10);
+ dc.DrawText(_T("Solid/dot/short dash/long dash/dot dash"), x + 150, y + 10);
dc.SetPen( wxPen( wxT("black"), width, wxSOLID) );
dc.DrawLine( x+20, y+20, 100, y+20 );
dc.SetPen( wxPen( wxT("black"), width, wxDOT) );
dc.SetPen( wxPen( wxT("black"), width, wxDOT_DASH) );
dc.DrawLine( x+20, y+60, 100, y+60 );
- dc.DrawText("Misc hatches", x + 150, y + 70);
+ dc.DrawText(_T("Misc hatches"), x + 150, y + 70);
dc.SetPen( wxPen( wxT("black"), width, wxBDIAGONAL_HATCH) );
dc.DrawLine( x+20, y+70, 100, y+70 );
dc.SetPen( wxPen( wxT("black"), width, wxCROSSDIAG_HATCH) );
dc.SetPen( wxPen( wxT("black"), width, wxVERTICAL_HATCH) );
dc.DrawLine( x+20, y+120, 100, y+120 );
- dc.DrawText("User dash", x + 150, y + 140);
+ dc.DrawText(_T("User dash"), x + 150, y + 140);
wxPen ud( wxT("black"), width, wxUSER_DASH );
wxDash dash1[1];
dash1[0] = 0;
{
// set underlined font for testing
dc.SetFont( wxFont(12, wxMODERN, wxNORMAL, wxNORMAL, TRUE) );
- dc.DrawText( "This is text", 110, 10 );
- dc.DrawRotatedText( "That is text", 20, 10, -45 );
+ dc.DrawText( _T("This is text"), 110, 10 );
+ dc.DrawRotatedText( _T("That is text"), 20, 10, -45 );
// use wxSWISS_FONT and not wxNORMAL_FONT as the latter can't be rotated
// under Win9x (it is not TrueType)
dc.SetFont( wxFont( 18, wxSWISS, wxNORMAL, wxNORMAL ) );
- dc.DrawText( "This is Swiss 18pt text.", 110, 40 );
+ dc.DrawText( _T("This is Swiss 18pt text."), 110, 40 );
long length;
long height;
long descent;
- dc.GetTextExtent( "This is Swiss 18pt text.", &length, &height, &descent );
+ dc.GetTextExtent( _T("This is Swiss 18pt text."), &length, &height, &descent );
text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent );
dc.DrawText( text, 110, 80 );
// test the logical function effect
wxCoord y = 150;
dc.SetLogicalFunction(wxINVERT);
- dc.DrawText( "There should be no text below", 110, 150 );
+ dc.DrawText( _T("There should be no text below"), 110, 150 );
dc.DrawRectangle( 110, y, 100, height );
// twice drawn inverted should result in invisible
y += height;
- dc.DrawText( "Invisible text", 110, y );
+ dc.DrawText( _T("Invisible text"), 110, y );
dc.DrawRectangle( 110, y, 100, height );
- dc.DrawText( "Invisible text", 110, y );
+ dc.DrawText( _T("Invisible text"), 110, y );
dc.DrawRectangle( 110, y, 100, height );
dc.SetLogicalFunction(wxCOPY);
y += height;
dc.DrawRectangle( 110, y, 100, height );
- dc.DrawText( "Visible text", 110, y );
+ dc.DrawText( _T("Visible text"), 110, y );
}
static const struct
void MyCanvas::DrawImages(wxDC& dc)
{
- dc.DrawText("original image", 0, 0);
+ dc.DrawText(_T("original image"), 0, 0);
dc.DrawBitmap(*gs_bmpNoMask, 0, 20, 0);
- dc.DrawText("with colour mask", 0, 100);
+ dc.DrawText(_T("with colour mask"), 0, 100);
dc.DrawBitmap(*gs_bmpWithColMask, 0, 120, TRUE);
- dc.DrawText("the mask image", 0, 200);
+ dc.DrawText(_T("the mask image"), 0, 200);
dc.DrawBitmap(*gs_bmpMask, 0, 220, 0);
- dc.DrawText("masked image", 0, 300);
+ dc.DrawText(_T("masked image"), 0, 300);
dc.DrawBitmap(*gs_bmpWithMask, 0, 320, TRUE);
int cx = gs_bmpWithColMask->GetWidth(),
y = 100,
r = 20;
- dc.DrawText("Some circles", 0, y);
+ dc.DrawText(_T("Some circles"), 0, y);
dc.DrawCircle(x, y, r);
dc.DrawCircle(x + 2*r, y, r);
dc.DrawCircle(x + 4*r, y, r);
y += 2*r;
- dc.DrawText("And ellipses", 0, y);
+ dc.DrawText(_T("And ellipses"), 0, y);
dc.DrawEllipse(x - r, y, 2*r, r);
dc.DrawEllipse(x + r, y, 2*r, r);
dc.DrawEllipse(x + 3*r, y, 2*r, r);
y += 2*r;
- dc.DrawText("And arcs", 0, y);
+ dc.DrawText(_T("And arcs"), 0, y);
dc.DrawArc(x - r, y, x + r, y, x, y);
dc.DrawArc(x + 4*r, y, x + 2*r, y, x + 3*r, y);
dc.DrawArc(x + 5*r, y, x + 5*r, y, x + 6*r, y);
void MyCanvas::DrawRegions(wxDC& dc)
{
- dc.DrawText("You should see a red rect partly covered by a cyan one "
- "on the left", 10, 5);
- dc.DrawText("and 5 smileys from which 4 are partially clipped on the right",
+ dc.DrawText(_T("You should see a red rect partly covered by a cyan one ")
+ _T("on the left"), 10, 5);
+ dc.DrawText(_T("and 5 smileys from which 4 are partially clipped on the right"),
10, 5 + dc.GetCharHeight());
- dc.DrawText("The second copy should be identical but right part of it "
- "should be offset by 10 pixels.",
+ dc.DrawText(_T("The second copy should be identical but right part of it ")
+ _T("should be offset by 10 pixels."),
10, 5 + 2*dc.GetCharHeight());
DrawRegionsHelper(dc, 10, TRUE);
SetIcon(wxICON(mondrian));
wxMenu *menuFile = new wxMenu;
- menuFile->Append(File_ShowDefault, "&Default screen\tF1");
- menuFile->Append(File_ShowText, "&Text screen\tF2");
- menuFile->Append(File_ShowLines, "&Lines screen\tF3");
- menuFile->Append(File_ShowBrushes, "&Brushes screen\tF4");
- menuFile->Append(File_ShowPolygons, "&Polygons screen\tF5");
- menuFile->Append(File_ShowMask, "&Mask screen\tF6");
- menuFile->Append(File_ShowOps, "&ROP screen\tF7");
- menuFile->Append(File_ShowRegions, "Re&gions screen\tF8");
- menuFile->Append(File_ShowCircles, "&Circles screen\tF9");
+ menuFile->Append(File_ShowDefault, _T("&Default screen\tF1"));
+ menuFile->Append(File_ShowText, _T("&Text screen\tF2"));
+ menuFile->Append(File_ShowLines, _T("&Lines screen\tF3"));
+ menuFile->Append(File_ShowBrushes, _T("&Brushes screen\tF4"));
+ menuFile->Append(File_ShowPolygons, _T("&Polygons screen\tF5"));
+ menuFile->Append(File_ShowMask, _T("&Mask screen\tF6"));
+ menuFile->Append(File_ShowOps, _T("&ROP screen\tF7"));
+ menuFile->Append(File_ShowRegions, _T("Re&gions screen\tF8"));
+ menuFile->Append(File_ShowCircles, _T("&Circles screen\tF9"));
menuFile->AppendSeparator();
- menuFile->AppendCheckItem(File_Clip, "&Clip\tCtrl-C", "Clip/unclip drawing");
+ menuFile->AppendCheckItem(File_Clip, _T("&Clip\tCtrl-C"), _T("Clip/unclip drawing"));
menuFile->AppendSeparator();
- menuFile->Append(File_About, "&About...\tCtrl-A", "Show about dialog");
+ menuFile->Append(File_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
menuFile->AppendSeparator();
- menuFile->Append(File_Quit, "E&xit\tAlt-X", "Quit this program");
+ menuFile->Append(File_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
wxMenu *menuMapMode = new wxMenu;
- menuMapMode->Append( MapMode_Text, "&TEXT map mode" );
- menuMapMode->Append( MapMode_Lometric, "&LOMETRIC map mode" );
- menuMapMode->Append( MapMode_Twips, "T&WIPS map mode" );
- menuMapMode->Append( MapMode_Points, "&POINTS map mode" );
- menuMapMode->Append( MapMode_Metric, "&METRIC map mode" );
+ menuMapMode->Append( MapMode_Text, _T("&TEXT map mode") );
+ menuMapMode->Append( MapMode_Lometric, _T("&LOMETRIC map mode") );
+ menuMapMode->Append( MapMode_Twips, _T("T&WIPS map mode") );
+ menuMapMode->Append( MapMode_Points, _T("&POINTS map mode") );
+ menuMapMode->Append( MapMode_Metric, _T("&METRIC map mode") );
wxMenu *menuUserScale = new wxMenu;
- menuUserScale->Append( UserScale_StretchHoriz, "Stretch &horizontally\tCtrl-H" );
- menuUserScale->Append( UserScale_ShrinkHoriz, "Shrin&k horizontally\tCtrl-G" );
- menuUserScale->Append( UserScale_StretchVertic, "Stretch &vertically\tCtrl-V" );
- menuUserScale->Append( UserScale_ShrinkVertic, "&Shrink vertically\tCtrl-W" );
+ menuUserScale->Append( UserScale_StretchHoriz, _T("Stretch &horizontally\tCtrl-H") );
+ menuUserScale->Append( UserScale_ShrinkHoriz, _T("Shrin&k horizontally\tCtrl-G") );
+ menuUserScale->Append( UserScale_StretchVertic, _T("Stretch &vertically\tCtrl-V") );
+ menuUserScale->Append( UserScale_ShrinkVertic, _T("&Shrink vertically\tCtrl-W") );
menuUserScale->AppendSeparator();
- menuUserScale->Append( UserScale_Restore, "&Restore to normal\tCtrl-0" );
+ menuUserScale->Append( UserScale_Restore, _T("&Restore to normal\tCtrl-0") );
wxMenu *menuAxis = new wxMenu;
- menuAxis->Append( AxisMirror_Horiz, "Mirror horizontally\tCtrl-M", "", TRUE );
- menuAxis->Append( AxisMirror_Vertic, "Mirror vertically\tCtrl-N", "", TRUE );
+ menuAxis->Append( AxisMirror_Horiz, _T("Mirror horizontally\tCtrl-M"), _T(""), TRUE );
+ menuAxis->Append( AxisMirror_Vertic, _T("Mirror vertically\tCtrl-N"), _T(""), TRUE );
wxMenu *menuLogical = new wxMenu;
- menuLogical->Append( LogicalOrigin_MoveDown, "Move &down\tCtrl-D" );
- menuLogical->Append( LogicalOrigin_MoveUp, "Move &up\tCtrl-U" );
- menuLogical->Append( LogicalOrigin_MoveLeft, "Move &right\tCtrl-L" );
- menuLogical->Append( LogicalOrigin_MoveRight, "Move &left\tCtrl-R" );
+ menuLogical->Append( LogicalOrigin_MoveDown, _T("Move &down\tCtrl-D") );
+ menuLogical->Append( LogicalOrigin_MoveUp, _T("Move &up\tCtrl-U") );
+ menuLogical->Append( LogicalOrigin_MoveLeft, _T("Move &right\tCtrl-L") );
+ menuLogical->Append( LogicalOrigin_MoveRight, _T("Move &left\tCtrl-R") );
menuLogical->AppendSeparator();
- menuLogical->Append( LogicalOrigin_Set, "Set to (&100, 100)\tShift-Ctrl-1" );
- menuLogical->Append( LogicalOrigin_Restore, "&Restore to normal\tShift-Ctrl-0" );
+ menuLogical->Append( LogicalOrigin_Set, _T("Set to (&100, 100)\tShift-Ctrl-1") );
+ menuLogical->Append( LogicalOrigin_Restore, _T("&Restore to normal\tShift-Ctrl-0") );
wxMenu *menuColour = new wxMenu;
- menuColour->Append( Colour_TextForeground, "Text &foreground..." );
- menuColour->Append( Colour_TextBackground, "Text &background..." );
- menuColour->Append( Colour_Background, "Background &colour..." );
- menuColour->Append( Colour_BackgroundMode, "&Opaque/transparent\tCtrl-B", "", TRUE );
- menuColour->Append( Colour_TextureBackgound, "Draw textured back&ground\tCtrl-T", "", TRUE);
+ menuColour->Append( Colour_TextForeground, _T("Text &foreground...") );
+ menuColour->Append( Colour_TextBackground, _T("Text &background...") );
+ menuColour->Append( Colour_Background, _T("Background &colour...") );
+ menuColour->Append( Colour_BackgroundMode, _T("&Opaque/transparent\tCtrl-B"), _T(""), TRUE );
+ menuColour->Append( Colour_TextureBackgound, _T("Draw textured back&ground\tCtrl-T"), _T(""), TRUE);
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar;
- menuBar->Append(menuFile, "&File");
- menuBar->Append(menuMapMode, "&Mode");
- menuBar->Append(menuUserScale, "&Scale");
- menuBar->Append(menuAxis, "&Axis");
- menuBar->Append(menuLogical, "&Origin");
- menuBar->Append(menuColour, "&Colours");
+ menuBar->Append(menuFile, _T("&File"));
+ menuBar->Append(menuMapMode, _T("&Mode"));
+ menuBar->Append(menuUserScale, _T("&Scale"));
+ menuBar->Append(menuAxis, _T("&Axis"));
+ menuBar->Append(menuLogical, _T("&Origin"));
+ menuBar->Append(menuColour, _T("&Colours"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create a status bar just for fun (by default with 1 pane only)
CreateStatusBar(2);
- SetStatusText("Welcome to wxWindows!");
+ SetStatusText(_T("Welcome to wxWindows!"));
m_mapMode = wxMM_TEXT;
m_xUserScale = 1.0;
wxT("Copyright (c) Robert Roebling 1999")
);
- wxMessageBox(msg, "About Drawing", wxOK | wxICON_INFORMATION, this);
+ wxMessageBox(msg, _T("About Drawing"), wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnClip(wxCommandEvent& event)
// Define a new frame type
class MyFrame: public wxFrame
{ public:
- MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h);
+ MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h);
public:
void OnQuit(wxCommandEvent& event);
bool MyApp::OnInit(void)
{
// Create the main frame window
- MyFrame *frame = new MyFrame(NULL, "Dynamic wxWindows App", 50, 50, 450, 340);
+ MyFrame *frame = new MyFrame(NULL, _T("Dynamic wxWindows App"), 50, 50, 450, 340);
frame->Connect( DYNAMIC_QUIT, -1, wxEVT_COMMAND_MENU_SELECTED,
(wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction)
// Give it an icon
#ifdef __WXMSW__
- frame->SetIcon(wxIcon("mondrian"));
+ frame->SetIcon(wxIcon(_T("mondrian")));
#else
frame->SetIcon(wxIcon(mondrian_xpm));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(DYNAMIC_ABOUT, "&About");
- file_menu->Append(DYNAMIC_QUIT, "E&xit");
+ file_menu->Append(DYNAMIC_ABOUT, _T("&About"));
+ file_menu->Append(DYNAMIC_QUIT, _T("E&xit"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, "&File");
+ menu_bar->Append(file_menu, _T("&File"));
frame->SetMenuBar(menu_bar);
// Make a panel with a message
wxPanel *panel = new wxPanel(frame, -1, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL);
- (void)new wxStaticText(panel, 311, "Hello!", wxPoint(10, 10), wxSize(-1, -1), 0);
+ (void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxSize(-1, -1), 0);
// Show the frame
frame->Show(TRUE);
}
// My frame constructor
-MyFrame::MyFrame(wxFrame *frame, char *title, int x, int y, int w, int h):
+MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h):
wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h))
{}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- wxMessageDialog dialog(this, "This demonstrates dynamic event handling",
- "About Dynamic", wxYES_NO|wxCANCEL);
+ wxMessageDialog dialog(this, _T("This demonstrates dynamic event handling"),
+ _T("About Dynamic"), wxYES_NO|wxCANCEL);
dialog.ShowModal();
}
{
SetIcon(wxICON(mondrian));
- wxMenu *menuFile = new wxMenu("", wxMENU_TEAROFF);
+ wxMenu *menuFile = new wxMenu(_T(""), wxMENU_TEAROFF);
wxMenu *helpMenu = new wxMenu;
helpMenu->Append(wxID_ABOUT, _T("&About...\tCtrl-A"), _T("Show about dialog"));
wxRegionIterator upd( GetUpdateRegion() );
while (upd)
{
- wxLogDebug( "Paint: %d %d %d %d", upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
+ wxLogDebug( _T("Paint: %d %d %d %d"), upd.GetX(), upd.GetY(), upd.GetWidth(), upd.GetHeight() );
upd ++;
}
#endif
#if 0
wxSize size = GetSize();
wxSize client_size = GetClientSize();
- wxLogDebug( "size %d %d client_size %d %d", size.x, size.y, client_size.x, client_size.y );
+ wxLogDebug( _T("size %d %d client_size %d %d"), size.x, size.y, client_size.x, client_size.y );
#endif
#if 0
return;
wxDDEClient client;
- wxConnectionBase *conn = client.MakeConnection("", m_server, m_topic);
+ wxConnectionBase *conn = client.MakeConnection(_T(""), m_server, m_topic);
if ( !conn )
{
wxLogError(_T("Failed to connect to the DDE server '%s'."),
return;
wxDDEClient client;
- wxConnectionBase *conn = client.MakeConnection("", m_server, m_topic);
+ wxConnectionBase *conn = client.MakeConnection(_T(""), m_server, m_topic);
if ( !conn )
{
wxLogError(_T("Failed to connect to the DDE server '%s'."),
}
// draw the lines between them
- dc.SetPen(wxPen(wxColour("blue"), 1, wxSOLID));
+ dc.SetPen(wxPen(wxColour(_T("blue")), 1, wxSOLID));
int l;
// horizontal
bool MyApp::OnInit(void)
{
#ifdef __WXMSW__
- cellBitmap1 = new wxBitmap("bitmap1");
- cellBitmap2 = new wxBitmap("bitmap2");
+ cellBitmap1 = new wxBitmap(_T("bitmap1"));
+ cellBitmap2 = new wxBitmap(_T("bitmap2"));
#endif
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, (char *) "wxGrid Sample", wxPoint(50, 50), wxSize(450, 300));
+ MyFrame *frame = new MyFrame(NULL, _T("wxGrid Sample"), wxPoint(50, 50), wxSize(450, 300));
// Give it an icon
#ifdef __WXMSW__
- frame->SetIcon(wxIcon("mondrian"));
+ frame->SetIcon(wxIcon(_T("mondrian")));
#endif
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(GRID_QUIT, "E&xit");
+ file_menu->Append(GRID_QUIT, _T("E&xit"));
wxMenu *settings_menu = new wxMenu;
- settings_menu->Append(GRID_TOGGLE_EDITABLE, "&Toggle editable");
- settings_menu->Append(GRID_TOGGLE_EDITINPLACE, "&Toggle edit in place");
- settings_menu->Append(GRID_TOGGLE_ROW_LABEL, "Toggle ro&w label");
- settings_menu->Append(GRID_TOGGLE_COL_LABEL, "Toggle co&l label");
- settings_menu->Append(GRID_TOGGLE_DIVIDERS, "Toggle ÷rs");
+ settings_menu->Append(GRID_TOGGLE_EDITABLE, _T("&Toggle editable"));
+ settings_menu->Append(GRID_TOGGLE_EDITINPLACE, _T("&Toggle edit in place"));
+ settings_menu->Append(GRID_TOGGLE_ROW_LABEL, _T("Toggle ro&w label"));
+ settings_menu->Append(GRID_TOGGLE_COL_LABEL, _T("Toggle co&l label"));
+ settings_menu->Append(GRID_TOGGLE_DIVIDERS, _T("Toggle ÷rs"));
settings_menu->AppendSeparator();
- settings_menu->Append(GRID_LEFT_CELL, "&Left cell alignment ");
- settings_menu->Append(GRID_CENTRE_CELL, "&Centre cell alignment ");
- settings_menu->Append(GRID_RIGHT_CELL, "&Right cell alignment ");
+ settings_menu->Append(GRID_LEFT_CELL, _T("&Left cell alignment "));
+ settings_menu->Append(GRID_CENTRE_CELL, _T("&Centre cell alignment "));
+ settings_menu->Append(GRID_RIGHT_CELL, _T("&Right cell alignment "));
settings_menu->AppendSeparator();
- settings_menu->Append(GRID_COLOUR_LABEL_BACKGROUND, "Choose a label &background colour");
- settings_menu->Append(GRID_COLOUR_LABEL_TEXT, "Choose a label fore&ground colour");
- settings_menu->Append(GRID_NORMAL_LABEL_COLOURING, "&Normal label colouring");
+ settings_menu->Append(GRID_COLOUR_LABEL_BACKGROUND, _T("Choose a label &background colour"));
+ settings_menu->Append(GRID_COLOUR_LABEL_TEXT, _T("Choose a label fore&ground colour"));
+ settings_menu->Append(GRID_NORMAL_LABEL_COLOURING, _T("&Normal label colouring"));
settings_menu->AppendSeparator();
- settings_menu->Append(GRID_COLOUR_CELL_BACKGROUND, "Choo&se a cell &background colour");
- settings_menu->Append(GRID_COLOUR_CELL_TEXT, "Choose &a cell foreground colour");
- settings_menu->Append(GRID_NORMAL_CELL_COLOURING, "N&ormal cell colouring");
+ settings_menu->Append(GRID_COLOUR_CELL_BACKGROUND, _T("Choo&se a cell &background colour"));
+ settings_menu->Append(GRID_COLOUR_CELL_TEXT, _T("Choose &a cell foreground colour"));
+ settings_menu->Append(GRID_NORMAL_CELL_COLOURING, _T("N&ormal cell colouring"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, "&File");
- menu_bar->Append(settings_menu, "&Settings");
+ menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(settings_menu, _T("&Settings"));
frame->SetMenuBar(menu_bar);
// Make a grid
frame->grid->CreateGrid(10, 8);
frame->grid->SetColumnWidth(3, 200);
frame->grid->SetRowHeight(4, 45);
- frame->grid->SetCellValue("First cell", 0, 0);
- frame->grid->SetCellValue("Another cell", 1, 1);
- frame->grid->SetCellValue("Yet another cell", 2, 2);
+ frame->grid->SetCellValue(_T("First cell"), 0, 0);
+ frame->grid->SetCellValue(_T("Another cell"), 1, 1);
+ frame->grid->SetCellValue(_T("Yet another cell"), 2, 2);
frame->grid->SetCellTextFont(wxFont(10, wxROMAN, wxITALIC, wxNORMAL), 0, 0);
frame->grid->SetCellTextColour(*wxRED, 1, 1);
frame->grid->SetCellBackgroundColour(*wxCYAN, 2, 2);
bool MyApp::OnInit()
{
// create the main application window
- MyFrame *frame = new MyFrame("wxStatusBar sample",
+ MyFrame *frame = new MyFrame(_T("wxStatusBar sample"),
wxPoint(50, 50), wxSize(450, 340));
// and show it (the frames, unlike simple controls, are not shown when
// create a menu bar
wxMenu *menuFile = new wxMenu;
- menuFile->Append(StatusBar_Quit, "E&xit\tAlt-X", "Quit this program");
+ menuFile->Append(StatusBar_Quit, _T("E&xit\tAlt-X"), _T("Quit this program"));
wxMenu *statbarMenu = new wxMenu;
- statbarMenu->Append(StatusBar_SetFields, "&Set field count\tCtrl-C",
- "Set the number of status bar fields");
- statbarMenu->Append(StatusBar_Toggle, "&Toggle Status Bar",
- "Toggle the status bar display", true);
- statbarMenu->Append(StatusBar_Recreate, "&Recreate\tCtrl-R",
- "Toggle status bar format");
+ statbarMenu->Append(StatusBar_SetFields, _T("&Set field count\tCtrl-C"),
+ _T("Set the number of status bar fields"));
+ statbarMenu->Append(StatusBar_Toggle, _T("&Toggle Status Bar"),
+ _T("Toggle the status bar display"), true);
+ statbarMenu->Append(StatusBar_Recreate, _T("&Recreate\tCtrl-R"),
+ _T("Toggle status bar format"));
wxMenu *helpMenu = new wxMenu;
- helpMenu->Append(StatusBar_About, "&About...\tCtrl-A", "Show about dialog");
+ helpMenu->Append(StatusBar_About, _T("&About...\tCtrl-A"), _T("Show about dialog"));
// now append the freshly created menu to the menu bar...
wxMenuBar *menuBar = new wxMenuBar();
- menuBar->Append(menuFile, "&File");
- menuBar->Append(statbarMenu, "&Status bar");
- menuBar->Append(helpMenu, "&Help");
+ menuBar->Append(menuFile, _T("&File"));
+ menuBar->Append(statbarMenu, _T("&Status bar"));
+ menuBar->Append(helpMenu, _T("&Help"));
// ... and attach this menu bar to the frame
SetMenuBar(menuBar);
// create default status bar to start with
CreateStatusBar(2);
m_statbarKind = StatBar_Default;
- SetStatusText("Welcome to wxWindows!");
+ SetStatusText(_T("Welcome to wxWindows!"));
m_statbarDefault = GetStatusBar();
}
// ----------------------------------------------------------------------------
MyAboutDialog::MyAboutDialog(wxWindow *parent)
- : wxDialog(parent, -1, wxString("About statbar"),
+ : wxDialog(parent, -1, wxString(_T("About statbar")),
wxDefaultPosition, wxDefaultSize,
wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
{
wxStaticText *text = new wxStaticText(this, -1,
- "wxStatusBar sample\n"
- "(c) 2000 Vadim Zeitlin");
+ _T("wxStatusBar sample\n")
+ _T("(c) 2000 Vadim Zeitlin"));
- wxButton *btn = new wxButton(this, wxID_OK, "&Close");
+ wxButton *btn = new wxButton(this, wxID_OK, _T("&Close"));
// create the top status bar without the size grip (default style),
// otherwise it looks weird
wxStatusBar *statbarTop = new wxStatusBar(this, -1, 0);
statbarTop->SetFieldsCount(3);
- statbarTop->SetStatusText("This is a top status bar", 0);
- statbarTop->SetStatusText("in a dialog", 1);
- statbarTop->SetStatusText("Great, isn't it?", 2);
+ statbarTop->SetStatusText(_T("This is a top status bar"), 0);
+ statbarTop->SetStatusText(_T("in a dialog"), 1);
+ statbarTop->SetStatusText(_T("Great, isn't it?"), 2);
wxStatusBar *statbarBottom = new wxStatusBar(this, -1);
statbarBottom->SetFieldsCount(2);
- statbarBottom->SetStatusText("This is a bottom status bar", 0);
- statbarBottom->SetStatusText("in a dialog", 1);
+ statbarBottom->SetStatusText(_T("This is a bottom status bar"), 0);
+ statbarBottom->SetStatusText(_T("in a dialog"), 1);
wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL);
sizerTop->Add(statbarTop, 0, wxGROW);
m_statbmp->Refresh();
#endif
- SetStatusText("", Field_Clock);
+ SetStatusText(_T(""), Field_Clock);
}
}
void MyDialog::Init(void)
{
- (void)new wxStaticText(this, -1, "Press OK to hide me, Exit to quit.",
+ (void)new wxStaticText(this, -1, _T("Press OK to hide me, Exit to quit."),
wxPoint(10, 20));
- (void)new wxStaticText(this, -1, "Double-click on the taskbar icon to show me again.",
+ (void)new wxStaticText(this, -1, _T("Double-click on the taskbar icon to show me again."),
wxPoint(10, 40));
- (void)new wxButton(this, wxID_EXIT, "Exit", wxPoint(185, 230), wxSize(80, 25));
- (new wxButton(this, wxID_OK, "OK", wxPoint(100, 230), wxSize(80, 25)))->SetDefault();
+ (void)new wxButton(this, wxID_EXIT, _T("Exit"), wxPoint(185, 230), wxSize(80, 25));
+ (new wxButton(this, wxID_OK, _T("OK"), wxPoint(100, 230), wxSize(80, 25)))->SetDefault();
Centre(wxBOTH);
}
{
wxMenu menu;
- menu.Append(PU_RESTORE, "&Restore TBTest");
+ menu.Append(PU_RESTORE, _T("&Restore TBTest"));
#ifdef __WXMSW__
- menu.Append(PU_NEW_ICON,"&Set New Icon");
+ menu.Append(PU_NEW_ICON,_T("&Set New Icon"));
#endif
- menu.Append(PU_EXIT, "E&xit");
+ menu.Append(PU_EXIT, _T("E&xit"));
PopupMenu(&menu);
}
class MyFrame: public wxFrame
{
public:
- MyFrame(wxFrame *frame, const char *title, int x, int y, int w, int h);
+ MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h);
void OnQuit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
{
// Create the main frame window
MyFrame *frame = new MyFrame((wxFrame *) NULL,
- "Text wxWindows sample", 50, 50, 700, 420);
+ _T("Text wxWindows sample"), 50, 50, 700, 420);
frame->SetSizeHints( 500, 400 );
wxMenu *file_menu = new wxMenu;
- file_menu->Append(TEXT_SAVE, "&Save file\tCtrl-S",
- "Save the text control contents to file");
- file_menu->Append(TEXT_LOAD, "&Load file\tCtrl-O",
- "Load the sample file into text control");
+ file_menu->Append(TEXT_SAVE, _T("&Save file\tCtrl-S"),
+ _T("Save the text control contents to file"));
+ file_menu->Append(TEXT_LOAD, _T("&Load file\tCtrl-O"),
+ _T("Load the sample file into text control"));
file_menu->AppendSeparator();
- file_menu->Append(TEXT_ABOUT, "&About\tAlt-A");
+ file_menu->Append(TEXT_ABOUT, _T("&About\tAlt-A"));
file_menu->AppendSeparator();
- file_menu->Append(TEXT_QUIT, "E&xit\tAlt-X", "Quit this sample");
+ file_menu->Append(TEXT_QUIT, _T("E&xit\tAlt-X"), _T("Quit this sample"));
wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE );
- menu_bar->Append(file_menu, "&File");
+ menu_bar->Append(file_menu, _T("&File"));
#if wxUSE_TOOLTIPS
wxMenu *tooltip_menu = new wxMenu;
- tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, "Set &delay\tCtrl-D");
+ tooltip_menu->Append(TEXT_TOOLTIPS_SETDELAY, _T("Set &delay\tCtrl-D"));
tooltip_menu->AppendSeparator();
- tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, "&Toggle tooltips\tCtrl-T",
- "enable/disable tooltips", TRUE);
+ tooltip_menu->Append(TEXT_TOOLTIPS_ENABLE, _T("&Toggle tooltips\tCtrl-T"),
+ _T("enable/disable tooltips"), TRUE);
tooltip_menu->Check(TEXT_TOOLTIPS_ENABLE, TRUE);
- menu_bar->Append(tooltip_menu, "&Tooltips");
+ menu_bar->Append(tooltip_menu, _T("&Tooltips"));
#endif // wxUSE_TOOLTIPS
#if wxUSE_CLIPBOARD
wxMenu *menuClipboard = new wxMenu;
- menuClipboard->Append(TEXT_CLIPBOARD_COPY, "&Copy\tCtrl-C",
- "Copy the first line to the clipboard");
- menuClipboard->Append(TEXT_CLIPBOARD_PASTE, "&Paste\tCtrl-V",
- "Paste from clipboard to the text control");
- menu_bar->Append(menuClipboard, "&Clipboard");
+ menuClipboard->Append(TEXT_CLIPBOARD_COPY, _T("&Copy\tCtrl-C"),
+ _T("Copy the first line to the clipboard"));
+ menuClipboard->Append(TEXT_CLIPBOARD_PASTE, _T("&Paste\tCtrl-V"),
+ _T("Paste from clipboard to the text control"));
+ menu_bar->Append(menuClipboard, _T("&Clipboard"));
#endif // wxUSE_CLIPBOARD
wxMenu *menuText = new wxMenu;
- menuText->Append(TEXT_ADD_SOME, "&Append some text\tCtrl-A");
- menuText->Append(TEXT_ADD_FREEZE, "&Append text with freeze/thaw\tShift-Ctrl-A");
- menuText->Append(TEXT_REMOVE, "&Remove first 10 characters\tCtrl-X");
- menuText->Append(TEXT_SET, "&Set the first text zone value\tCtrl-E");
+ menuText->Append(TEXT_ADD_SOME, _T("&Append some text\tCtrl-A"));
+ menuText->Append(TEXT_ADD_FREEZE, _T("&Append text with freeze/thaw\tShift-Ctrl-A"));
+ menuText->Append(TEXT_REMOVE, _T("&Remove first 10 characters\tCtrl-X"));
+ menuText->Append(TEXT_SET, _T("&Set the first text zone value\tCtrl-E"));
menuText->AppendSeparator();
- menuText->Append(TEXT_MOVE_ENDTEXT, "Move cursor to the end of &text");
- menuText->Append(TEXT_MOVE_ENDENTRY, "Move cursor to the end of &entry");
- menuText->Append(TEXT_SET_EDITABLE, "Toggle &editable state", "", TRUE);
- menuText->Append(TEXT_SET_ENABLED, "Toggle e&nabled state", "", TRUE);
+ menuText->Append(TEXT_MOVE_ENDTEXT, _T("Move cursor to the end of &text"));
+ menuText->Append(TEXT_MOVE_ENDENTRY, _T("Move cursor to the end of &entry"));
+ menuText->Append(TEXT_SET_EDITABLE, _T("Toggle &editable state"), _T(""), TRUE);
+ menuText->Append(TEXT_SET_ENABLED, _T("Toggle e&nabled state"), _T(""), TRUE);
menuText->Check(TEXT_SET_EDITABLE, TRUE);
menuText->Check(TEXT_SET_ENABLED, TRUE);
menuText->AppendSeparator();
- menuText->Append(TEXT_LINE_DOWN, "Scroll text one line down");
- menuText->Append(TEXT_LINE_UP, "Scroll text one line up");
- menuText->Append(TEXT_PAGE_DOWN, "Scroll text one page down");
- menuText->Append(TEXT_PAGE_DOWN, "Scroll text one page up");
- menu_bar->Append(menuText, "Te&xt");
+ menuText->Append(TEXT_LINE_DOWN, _T("Scroll text one line down"));
+ menuText->Append(TEXT_LINE_UP, _T("Scroll text one line up"));
+ menuText->Append(TEXT_PAGE_DOWN, _T("Scroll text one page down"));
+ menuText->Append(TEXT_PAGE_DOWN, _T("Scroll text one page up"));
+ menu_bar->Append(menuText, _T("Te&xt"));
wxMenu *menuLog = new wxMenu;
- menuLog->Append(TEXT_LOG_KEY, "Log &key events", "", TRUE);
- menuLog->Append(TEXT_LOG_CHAR, "Log &char events", "", TRUE);
- menuLog->Append(TEXT_LOG_MOUSE, "Log &mouse events", "", TRUE);
- menuLog->Append(TEXT_LOG_TEXT, "Log &text events", "", TRUE);
- menuLog->Append(TEXT_LOG_FOCUS, "Log &focus events", "", TRUE);
+ menuLog->Append(TEXT_LOG_KEY, _T("Log &key events"), _T(""), TRUE);
+ menuLog->Append(TEXT_LOG_CHAR, _T("Log &char events"), _T(""), TRUE);
+ menuLog->Append(TEXT_LOG_MOUSE, _T("Log &mouse events"), _T(""), TRUE);
+ menuLog->Append(TEXT_LOG_TEXT, _T("Log &text events"), _T(""), TRUE);
+ menuLog->Append(TEXT_LOG_FOCUS, _T("Log &focus events"), _T(""), TRUE);
menuLog->AppendSeparator();
- menuLog->Append(TEXT_CLEAR, "&Clear the log\tCtrl-C",
- "Clear the log window contents");
+ menuLog->Append(TEXT_CLEAR, _T("&Clear the log\tCtrl-C"),
+ _T("Clear the log window contents"));
// select only the interesting events by default
menuLog->Check(TEXT_LOG_KEY, TRUE);
MyTextCtrl::ms_logKey =
MyTextCtrl::ms_logChar =
MyTextCtrl::ms_logText = TRUE;
- menu_bar->Append(menuLog, "&Log");
+ menu_bar->Append(menuLog, _T("&Log"));
frame->SetMenuBar(menu_bar);
{
switch ( keycode )
{
- case WXK_BACK: key = "BACK"; break;
- case WXK_TAB: key = "TAB"; break;
- case WXK_RETURN: key = "RETURN"; break;
- case WXK_ESCAPE: key = "ESCAPE"; break;
- case WXK_SPACE: key = "SPACE"; break;
- case WXK_DELETE: key = "DELETE"; break;
- case WXK_START: key = "START"; break;
- case WXK_LBUTTON: key = "LBUTTON"; break;
- case WXK_RBUTTON: key = "RBUTTON"; break;
- case WXK_CANCEL: key = "CANCEL"; break;
- case WXK_MBUTTON: key = "MBUTTON"; break;
- case WXK_CLEAR: key = "CLEAR"; break;
- case WXK_SHIFT: key = "SHIFT"; break;
- case WXK_ALT: key = "ALT"; break;
- case WXK_CONTROL: key = "CONTROL"; break;
- case WXK_MENU: key = "MENU"; break;
- case WXK_PAUSE: key = "PAUSE"; break;
- case WXK_CAPITAL: key = "CAPITAL"; break;
- case WXK_PRIOR: key = "PRIOR"; break;
- case WXK_NEXT: key = "NEXT"; break;
- case WXK_END: key = "END"; break;
- case WXK_HOME: key = "HOME"; break;
- case WXK_LEFT: key = "LEFT"; break;
- case WXK_UP: key = "UP"; break;
- case WXK_RIGHT: key = "RIGHT"; break;
- case WXK_DOWN: key = "DOWN"; break;
- case WXK_SELECT: key = "SELECT"; break;
- case WXK_PRINT: key = "PRINT"; break;
- case WXK_EXECUTE: key = "EXECUTE"; break;
- case WXK_SNAPSHOT: key = "SNAPSHOT"; break;
- case WXK_INSERT: key = "INSERT"; break;
- case WXK_HELP: key = "HELP"; break;
- case WXK_NUMPAD0: key = "NUMPAD0"; break;
- case WXK_NUMPAD1: key = "NUMPAD1"; break;
- case WXK_NUMPAD2: key = "NUMPAD2"; break;
- case WXK_NUMPAD3: key = "NUMPAD3"; break;
- case WXK_NUMPAD4: key = "NUMPAD4"; break;
- case WXK_NUMPAD5: key = "NUMPAD5"; break;
- case WXK_NUMPAD6: key = "NUMPAD6"; break;
- case WXK_NUMPAD7: key = "NUMPAD7"; break;
- case WXK_NUMPAD8: key = "NUMPAD8"; break;
- case WXK_NUMPAD9: key = "NUMPAD9"; break;
- case WXK_MULTIPLY: key = "MULTIPLY"; break;
- case WXK_ADD: key = "ADD"; break;
- case WXK_SEPARATOR: key = "SEPARATOR"; break;
- case WXK_SUBTRACT: key = "SUBTRACT"; break;
- case WXK_DECIMAL: key = "DECIMAL"; break;
- case WXK_DIVIDE: key = "DIVIDE"; break;
- case WXK_F1: key = "F1"; break;
- case WXK_F2: key = "F2"; break;
- case WXK_F3: key = "F3"; break;
- case WXK_F4: key = "F4"; break;
- case WXK_F5: key = "F5"; break;
- case WXK_F6: key = "F6"; break;
- case WXK_F7: key = "F7"; break;
- case WXK_F8: key = "F8"; break;
- case WXK_F9: key = "F9"; break;
- case WXK_F10: key = "F10"; break;
- case WXK_F11: key = "F11"; break;
- case WXK_F12: key = "F12"; break;
- case WXK_F13: key = "F13"; break;
- case WXK_F14: key = "F14"; break;
- case WXK_F15: key = "F15"; break;
- case WXK_F16: key = "F16"; break;
- case WXK_F17: key = "F17"; break;
- case WXK_F18: key = "F18"; break;
- case WXK_F19: key = "F19"; break;
- case WXK_F20: key = "F20"; break;
- case WXK_F21: key = "F21"; break;
- case WXK_F22: key = "F22"; break;
- case WXK_F23: key = "F23"; break;
- case WXK_F24: key = "F24"; break;
- case WXK_NUMLOCK: key = "NUMLOCK"; break;
- case WXK_SCROLL: key = "SCROLL"; break;
- case WXK_PAGEUP: key = "PAGEUP"; break;
- case WXK_PAGEDOWN: key = "PAGEDOWN"; break;
- case WXK_NUMPAD_SPACE: key = "NUMPAD_SPACE"; break;
- case WXK_NUMPAD_TAB: key = "NUMPAD_TAB"; break;
- case WXK_NUMPAD_ENTER: key = "NUMPAD_ENTER"; break;
- case WXK_NUMPAD_F1: key = "NUMPAD_F1"; break;
- case WXK_NUMPAD_F2: key = "NUMPAD_F2"; break;
- case WXK_NUMPAD_F3: key = "NUMPAD_F3"; break;
- case WXK_NUMPAD_F4: key = "NUMPAD_F4"; break;
- case WXK_NUMPAD_HOME: key = "NUMPAD_HOME"; break;
- case WXK_NUMPAD_LEFT: key = "NUMPAD_LEFT"; break;
- case WXK_NUMPAD_UP: key = "NUMPAD_UP"; break;
- case WXK_NUMPAD_RIGHT: key = "NUMPAD_RIGHT"; break;
- case WXK_NUMPAD_DOWN: key = "NUMPAD_DOWN"; break;
- case WXK_NUMPAD_PRIOR: key = "NUMPAD_PRIOR"; break;
- case WXK_NUMPAD_PAGEUP: key = "NUMPAD_PAGEUP"; break;
- case WXK_NUMPAD_PAGEDOWN: key = "NUMPAD_PAGEDOWN"; break;
- case WXK_NUMPAD_END: key = "NUMPAD_END"; break;
- case WXK_NUMPAD_BEGIN: key = "NUMPAD_BEGIN"; break;
- case WXK_NUMPAD_INSERT: key = "NUMPAD_INSERT"; break;
- case WXK_NUMPAD_DELETE: key = "NUMPAD_DELETE"; break;
- case WXK_NUMPAD_EQUAL: key = "NUMPAD_EQUAL"; break;
- case WXK_NUMPAD_MULTIPLY: key = "NUMPAD_MULTIPLY"; break;
- case WXK_NUMPAD_ADD: key = "NUMPAD_ADD"; break;
- case WXK_NUMPAD_SEPARATOR: key = "NUMPAD_SEPARATOR"; break;
- case WXK_NUMPAD_SUBTRACT: key = "NUMPAD_SUBTRACT"; break;
- case WXK_NUMPAD_DECIMAL: key = "NUMPAD_DECIMAL"; break;
+ case WXK_BACK: key = _T("BACK"); break;
+ case WXK_TAB: key = _T("TAB"); break;
+ case WXK_RETURN: key = _T("RETURN"); break;
+ case WXK_ESCAPE: key = _T("ESCAPE"); break;
+ case WXK_SPACE: key = _T("SPACE"); break;
+ case WXK_DELETE: key = _T("DELETE"); break;
+ case WXK_START: key = _T("START"); break;
+ case WXK_LBUTTON: key = _T("LBUTTON"); break;
+ case WXK_RBUTTON: key = _T("RBUTTON"); break;
+ case WXK_CANCEL: key = _T("CANCEL"); break;
+ case WXK_MBUTTON: key = _T("MBUTTON"); break;
+ case WXK_CLEAR: key = _T("CLEAR"); break;
+ case WXK_SHIFT: key = _T("SHIFT"); break;
+ case WXK_ALT: key = _T("ALT"); break;
+ case WXK_CONTROL: key = _T("CONTROL"); break;
+ case WXK_MENU: key = _T("MENU"); break;
+ case WXK_PAUSE: key = _T("PAUSE"); break;
+ case WXK_CAPITAL: key = _T("CAPITAL"); break;
+ case WXK_PRIOR: key = _T("PRIOR"); break;
+ case WXK_NEXT: key = _T("NEXT"); break;
+ case WXK_END: key = _T("END"); break;
+ case WXK_HOME: key = _T("HOME"); break;
+ case WXK_LEFT: key = _T("LEFT"); break;
+ case WXK_UP: key = _T("UP"); break;
+ case WXK_RIGHT: key = _T("RIGHT"); break;
+ case WXK_DOWN: key = _T("DOWN"); break;
+ case WXK_SELECT: key = _T("SELECT"); break;
+ case WXK_PRINT: key = _T("PRINT"); break;
+ case WXK_EXECUTE: key = _T("EXECUTE"); break;
+ case WXK_SNAPSHOT: key = _T("SNAPSHOT"); break;
+ case WXK_INSERT: key = _T("INSERT"); break;
+ case WXK_HELP: key = _T("HELP"); break;
+ case WXK_NUMPAD0: key = _T("NUMPAD0"); break;
+ case WXK_NUMPAD1: key = _T("NUMPAD1"); break;
+ case WXK_NUMPAD2: key = _T("NUMPAD2"); break;
+ case WXK_NUMPAD3: key = _T("NUMPAD3"); break;
+ case WXK_NUMPAD4: key = _T("NUMPAD4"); break;
+ case WXK_NUMPAD5: key = _T("NUMPAD5"); break;
+ case WXK_NUMPAD6: key = _T("NUMPAD6"); break;
+ case WXK_NUMPAD7: key = _T("NUMPAD7"); break;
+ case WXK_NUMPAD8: key = _T("NUMPAD8"); break;
+ case WXK_NUMPAD9: key = _T("NUMPAD9"); break;
+ case WXK_MULTIPLY: key = _T("MULTIPLY"); break;
+ case WXK_ADD: key = _T("ADD"); break;
+ case WXK_SEPARATOR: key = _T("SEPARATOR"); break;
+ case WXK_SUBTRACT: key = _T("SUBTRACT"); break;
+ case WXK_DECIMAL: key = _T("DECIMAL"); break;
+ case WXK_DIVIDE: key = _T("DIVIDE"); break;
+ case WXK_F1: key = _T("F1"); break;
+ case WXK_F2: key = _T("F2"); break;
+ case WXK_F3: key = _T("F3"); break;
+ case WXK_F4: key = _T("F4"); break;
+ case WXK_F5: key = _T("F5"); break;
+ case WXK_F6: key = _T("F6"); break;
+ case WXK_F7: key = _T("F7"); break;
+ case WXK_F8: key = _T("F8"); break;
+ case WXK_F9: key = _T("F9"); break;
+ case WXK_F10: key = _T("F10"); break;
+ case WXK_F11: key = _T("F11"); break;
+ case WXK_F12: key = _T("F12"); break;
+ case WXK_F13: key = _T("F13"); break;
+ case WXK_F14: key = _T("F14"); break;
+ case WXK_F15: key = _T("F15"); break;
+ case WXK_F16: key = _T("F16"); break;
+ case WXK_F17: key = _T("F17"); break;
+ case WXK_F18: key = _T("F18"); break;
+ case WXK_F19: key = _T("F19"); break;
+ case WXK_F20: key = _T("F20"); break;
+ case WXK_F21: key = _T("F21"); break;
+ case WXK_F22: key = _T("F22"); break;
+ case WXK_F23: key = _T("F23"); break;
+ case WXK_F24: key = _T("F24"); break;
+ case WXK_NUMLOCK: key = _T("NUMLOCK"); break;
+ case WXK_SCROLL: key = _T("SCROLL"); break;
+ case WXK_PAGEUP: key = _T("PAGEUP"); break;
+ case WXK_PAGEDOWN: key = _T("PAGEDOWN"); break;
+ case WXK_NUMPAD_SPACE: key = _T("NUMPAD_SPACE"); break;
+ case WXK_NUMPAD_TAB: key = _T("NUMPAD_TAB"); break;
+ case WXK_NUMPAD_ENTER: key = _T("NUMPAD_ENTER"); break;
+ case WXK_NUMPAD_F1: key = _T("NUMPAD_F1"); break;
+ case WXK_NUMPAD_F2: key = _T("NUMPAD_F2"); break;
+ case WXK_NUMPAD_F3: key = _T("NUMPAD_F3"); break;
+ case WXK_NUMPAD_F4: key = _T("NUMPAD_F4"); break;
+ case WXK_NUMPAD_HOME: key = _T("NUMPAD_HOME"); break;
+ case WXK_NUMPAD_LEFT: key = _T("NUMPAD_LEFT"); break;
+ case WXK_NUMPAD_UP: key = _T("NUMPAD_UP"); break;
+ case WXK_NUMPAD_RIGHT: key = _T("NUMPAD_RIGHT"); break;
+ case WXK_NUMPAD_DOWN: key = _T("NUMPAD_DOWN"); break;
+ case WXK_NUMPAD_PRIOR: key = _T("NUMPAD_PRIOR"); break;
+ case WXK_NUMPAD_PAGEUP: key = _T("NUMPAD_PAGEUP"); break;
+ case WXK_NUMPAD_PAGEDOWN: key = _T("NUMPAD_PAGEDOWN"); break;
+ case WXK_NUMPAD_END: key = _T("NUMPAD_END"); break;
+ case WXK_NUMPAD_BEGIN: key = _T("NUMPAD_BEGIN"); break;
+ case WXK_NUMPAD_INSERT: key = _T("NUMPAD_INSERT"); break;
+ case WXK_NUMPAD_DELETE: key = _T("NUMPAD_DELETE"); break;
+ case WXK_NUMPAD_EQUAL: key = _T("NUMPAD_EQUAL"); break;
+ case WXK_NUMPAD_MULTIPLY: key = _T("NUMPAD_MULTIPLY"); break;
+ case WXK_NUMPAD_ADD: key = _T("NUMPAD_ADD"); break;
+ case WXK_NUMPAD_SEPARATOR: key = _T("NUMPAD_SEPARATOR"); break;
+ case WXK_NUMPAD_SUBTRACT: key = _T("NUMPAD_SUBTRACT"); break;
+ case WXK_NUMPAD_DECIMAL: key = _T("NUMPAD_DECIMAL"); break;
default:
{
case WXK_F5:
// insert a blank line
- WriteText("\n");
+ WriteText(_T("\n"));
break;
case WXK_F6:
break;
case WXK_F9:
- WriteText("WriteText() has been called");
+ WriteText(_T("WriteText() has been called"));
break;
case WXK_F10:
- AppendText("AppendText() has been called");
+ AppendText(_T("AppendText() has been called"));
break;
}
MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h )
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
{
- m_log = new wxTextCtrl( this, -1, "This is the log window.\n",
+ m_log = new wxTextCtrl( this, -1, _T("This is the log window.\n"),
wxPoint(5,260), wxSize(630,100),
wxTE_MULTILINE | wxTE_READONLY /* | wxTE_RICH */);
// single line text controls
- m_text = new MyTextCtrl( this, -1, "Single line.",
+ m_text = new MyTextCtrl( this, -1, _T("Single line."),
wxPoint(10,10), wxSize(140,-1),
wxTE_PROCESS_ENTER);
m_text->SetForegroundColour(*wxBLUE);
m_text->SetBackgroundColour(*wxLIGHT_GREY);
- (*m_text) << " Appended.";
+ (*m_text) << _T(" Appended.");
m_text->SetInsertionPoint(0);
- m_text->WriteText( "Prepended. " );
+ m_text->WriteText( _T("Prepended. ") );
- m_password = new MyTextCtrl( this, -1, "",
+ m_password = new MyTextCtrl( this, -1, _T(""),
wxPoint(10,50), wxSize(140,-1), wxTE_PASSWORD );
- m_readonly = new MyTextCtrl( this, -1, "Read only",
+ m_readonly = new MyTextCtrl( this, -1, _T("Read only"),
wxPoint(10,90), wxSize(140,-1), wxTE_READONLY );
- m_limited = new MyTextCtrl(this, -1, "Max 8 ch",
+ m_limited = new MyTextCtrl(this, -1, _T("Max 8 ch"),
wxPoint(10, 130), wxSize(140, -1));
m_limited->SetMaxLength(8);
// multi line text controls
- m_horizontal = new MyTextCtrl( this, -1, "Multiline text control with a horizontal scrollbar.",
+ m_horizontal = new MyTextCtrl( this, -1, _T("Multiline text control with a horizontal scrollbar."),
wxPoint(10,170), wxSize(140,70), wxTE_MULTILINE | wxHSCROLL );
// a little hack to use the command line argument for encoding testing
{
case '2':
m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL,
- FALSE, "",
+ FALSE, _T(""),
wxFONTENCODING_ISO8859_2));
- m_horizontal->SetValue("®lu»ouèký kùò zbìsile èe¹tina «»");
+ m_horizontal->SetValue(_T("®lu»ouèký kùò zbìsile èe¹tina «»"));
break;
case '1':
m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL,
- FALSE, "",
+ FALSE, _T(""),
wxFONTENCODING_CP1251));
- m_horizontal->SetValue("Ïðèâåò!");
+ m_horizontal->SetValue(_T("Ïðèâåò!"));
break;
case '8':
m_horizontal->SetFont(wxFont(18, wxSWISS, wxNORMAL, wxNORMAL,
- FALSE, "",
+ FALSE, _T(""),
wxFONTENCODING_CP1251));
#if wxUSE_UNICODE
m_horizontal->SetValue(L"\x0412\x0430\x0434\x0438\x043c \x0426");
}
else
{
- m_horizontal->SetValue("Text in default encoding");
+ m_horizontal->SetValue(_T("Text in default encoding"));
}
- m_multitext = new MyTextCtrl( this, -1, "Multi line.",
+ m_multitext = new MyTextCtrl( this, -1, _T("Multi line."),
wxPoint(180,10), wxSize(240,70), wxTE_MULTILINE );
m_multitext->SetFont(*wxITALIC_FONT);
- (*m_multitext) << " Appended.";
+ (*m_multitext) << _T(" Appended.");
m_multitext->SetInsertionPoint(0);
- m_multitext->WriteText( "Prepended. " );
+ m_multitext->WriteText( _T("Prepended. ") );
m_multitext->SetForegroundColour(*wxRED);
m_multitext->SetBackgroundColour(*wxLIGHT_GREY);
#if wxUSE_TOOLTIPS
- m_multitext->SetToolTip("Press Fn function keys here");
+ m_multitext->SetToolTip(_T("Press Fn function keys here"));
#endif
- m_tab = new MyTextCtrl( this, 100, "Multiline, allow <TAB> processing.",
+ m_tab = new MyTextCtrl( this, 100, _T("Multiline, allow <TAB> processing."),
wxPoint(180,90), wxSize(240,70), wxTE_MULTILINE | wxTE_PROCESS_TAB );
m_tab->SetClientData((void *)_T("tab"));
- m_enter = new MyTextCtrl( this, 100, "Multiline, allow <ENTER> processing.",
+ m_enter = new MyTextCtrl( this, 100, _T("Multiline, allow <ENTER> processing."),
wxPoint(180,170), wxSize(240,70), wxTE_MULTILINE);
m_enter->SetClientData((void *)_T("enter"));
- m_textrich = new MyTextCtrl(this, -1, "Allows more than 30Kb of text\n"
- "(even under broken Win9x)\n"
- "and a very very very very very "
- "very very very long line to test "
- "wxHSCROLL style",
+ m_textrich = new MyTextCtrl(this, -1, _T("Allows more than 30Kb of text\n")
+ _T("(even under broken Win9x)\n")
+ _T("and a very very very very very ")
+ _T("very very very long line to test ")
+ _T("wxHSCROLL style"),
wxPoint(450, 10), wxSize(230, 230),
wxTE_RICH |
wxTE_MULTILINE |
if (!wxTheClipboard->Open())
{
- *m_log << "Error opening the clipboard.\n";
+ *m_log << _T("Error opening the clipboard.\n");
return;
}
else
{
- *m_log << "Successfully opened the clipboard.\n";
+ *m_log << _T("Successfully opened the clipboard.\n");
}
wxTextDataObject data;
if (wxTheClipboard->IsSupported( data.GetFormat() ))
{
- *m_log << "Clipboard supports requested format.\n";
+ *m_log << _T("Clipboard supports requested format.\n");
if (wxTheClipboard->GetData( data ))
{
- *m_log << "Successfully retrieved data from the clipboard.\n";
- *m_multitext << data.GetText() << "\n";
+ *m_log << _T("Successfully retrieved data from the clipboard.\n");
+ *m_multitext << data.GetText() << _T("\n");
}
else
{
- *m_log << "Error getting data from the clipboard.\n";
+ *m_log << _T("Error getting data from the clipboard.\n");
}
}
else
{
- *m_log << "Clipboard doesn't support requested format.\n";
+ *m_log << _T("Clipboard doesn't support requested format.\n");
}
wxTheClipboard->Close();
- *m_log << "Closed the clipboard.\n";
+ *m_log << _T("Closed the clipboard.\n");
}
void MyPanel::DoCopyToClipboard()
if (text.IsEmpty())
{
- *m_log << "No text to copy.\n";
+ *m_log << _T("No text to copy.\n");
return;
}
if (!wxTheClipboard->Open())
{
- *m_log << "Error opening the clipboard.\n";
+ *m_log << _T("Error opening the clipboard.\n");
return;
}
else
{
- *m_log << "Successfully opened the clipboard.\n";
+ *m_log << _T("Successfully opened the clipboard.\n");
}
wxTextDataObject *data = new wxTextDataObject( text );
if (!wxTheClipboard->SetData( data ))
{
- *m_log << "Error while copying to the clipboard.\n";
+ *m_log << _T("Error while copying to the clipboard.\n");
}
else
{
- *m_log << "Successfully copied data to the clipboard.\n";
+ *m_log << _T("Successfully copied data to the clipboard.\n");
}
wxTheClipboard->Close();
- *m_log << "Closed the clipboard.\n";
+ *m_log << _T("Closed the clipboard.\n");
}
#endif // wxUSE_CLIPBOARD
EVT_IDLE(MyFrame::OnIdle)
END_EVENT_TABLE()
-MyFrame::MyFrame(wxFrame *frame, const char *title, int x, int y, int w, int h)
+MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h)
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h) )
{
CreateStatusBar(2);
wxBeginBusyCursor();
wxMessageDialog dialog(this,
- "This is a text control sample. It demonstrates the many different\n"
- "text control styles, the use of the clipboard, setting and handling\n"
- "tooltips and intercepting key and char events.\n"
- "\n"
- "Copyright (c) 1999, Robert Roebling, Julian Smart, Vadim Zeitlin",
- "About wxTextCtrl Sample",
+ _T("This is a text control sample. It demonstrates the many different\n")
+ _T("text control styles, the use of the clipboard, setting and handling\n")
+ _T("tooltips and intercepting key and char events.\n")
+ _T("\n")
+ _T("Copyright (c) 1999, Robert Roebling, Julian Smart, Vadim Zeitlin"),
+ _T("About wxTextCtrl Sample"),
wxOK | wxICON_INFORMATION);
dialog.ShowModal();
wxString delay;
delay.Printf( _T("%ld"), s_delay);
- delay = wxGetTextFromUser("Enter delay (in milliseconds)",
- "Set tooltip delay",
+ delay = wxGetTextFromUser(_T("Enter delay (in milliseconds)"),
+ _T("Set tooltip delay"),
delay,
this);
if ( !delay )
void MyFrame::OnFileSave(wxCommandEvent& event)
{
- if ( m_panel->m_textrich->SaveFile("dummy.txt") )
+ if ( m_panel->m_textrich->SaveFile(_T("dummy.txt")) )
{
#if wxUSE_FILE
// verify that the fil length is correct (it wasn't under Win95)
void MyFrame::OnFileLoad(wxCommandEvent& event)
{
- if ( m_panel->m_textrich->LoadFile("dummy.txt") )
+ if ( m_panel->m_textrich->LoadFile(_T("dummy.txt")) )
wxLogStatus(this, _T("Successfully loaded file"));
else
wxLogStatus(this, _T("Couldn't load the file"));
//wxLog::AddTraceMask("thread");
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *)NULL, "wxWindows threads sample",
+ MyFrame *frame = new MyFrame((wxFrame *)NULL, _T("wxWindows threads sample"),
50, 50, 450, 340);
// Make a menubar
wxMenuBar *menuBar = new wxMenuBar;
wxMenu *menuFile = new wxMenu;
- menuFile->Append(THREAD_CLEAR, "&Clear log\tCtrl-L");
+ menuFile->Append(THREAD_CLEAR, _T("&Clear log\tCtrl-L"));
menuFile->AppendSeparator();
- menuFile->Append(THREAD_QUIT, "E&xit\tAlt-X");
- menuBar->Append(menuFile, "&File");
+ menuFile->Append(THREAD_QUIT, _T("E&xit\tAlt-X"));
+ menuBar->Append(menuFile, _T("&File"));
wxMenu *menuThread = new wxMenu;
- menuThread->Append(THREAD_START_THREAD, "&Start a new thread\tCtrl-N");
- menuThread->Append(THREAD_START_THREADS, "Start &many threads at once");
- menuThread->Append(THREAD_STOP_THREAD, "S&top a running thread\tCtrl-S");
+ menuThread->Append(THREAD_START_THREAD, _T("&Start a new thread\tCtrl-N"));
+ menuThread->Append(THREAD_START_THREADS, _T("Start &many threads at once"));
+ menuThread->Append(THREAD_STOP_THREAD, _T("S&top a running thread\tCtrl-S"));
menuThread->AppendSeparator();
- menuThread->Append(THREAD_PAUSE_THREAD, "&Pause a running thread\tCtrl-P");
- menuThread->Append(THREAD_RESUME_THREAD, "&Resume suspended thread\tCtrl-R");
+ menuThread->Append(THREAD_PAUSE_THREAD, _T("&Pause a running thread\tCtrl-P"));
+ menuThread->Append(THREAD_RESUME_THREAD, _T("&Resume suspended thread\tCtrl-R"));
menuThread->AppendSeparator();
- menuThread->Append(THREAD_START_WORKER, "Start &worker thread\tCtrl-W");
- menuBar->Append(menuThread, "&Thread");
+ menuThread->Append(THREAD_START_WORKER, _T("Start &worker thread\tCtrl-W"));
+ menuBar->Append(menuThread, _T("&Thread"));
wxMenu *menuExec = new wxMenu;
- menuExec->Append(THREAD_EXEC_MAIN, "&Launch a program from main thread\tF5");
- menuExec->Append(THREAD_EXEC_THREAD, "L&aunch a program from a thread\tCtrl-F5");
- menuBar->Append(menuExec, "&Execute");
+ menuExec->Append(THREAD_EXEC_MAIN, _T("&Launch a program from main thread\tF5"));
+ menuExec->Append(THREAD_EXEC_THREAD, _T("L&aunch a program from a thread\tCtrl-F5"));
+ menuBar->Append(menuExec, _T("&Execute"));
wxMenu *menuHelp = new wxMenu;
- menuHelp->Append(THREAD_SHOWCPUS, "&Show CPU count");
+ menuHelp->Append(THREAD_SHOWCPUS, _T("&Show CPU count"));
menuHelp->AppendSeparator();
- menuHelp->Append(THREAD_ABOUT, "&About...");
- menuBar->Append(menuHelp, "&Help");
+ menuHelp->Append(THREAD_ABOUT, _T("&About..."));
+ menuBar->Append(menuHelp, _T("&Help"));
frame->SetMenuBar(menuBar);
CreateStatusBar(2);
- m_txtctrl = new wxTextCtrl(this, -1, "", wxPoint(0, 0), wxSize(0, 0),
+ m_txtctrl = new wxTextCtrl(this, -1, _T(""), wxPoint(0, 0), wxSize(0, 0),
wxTE_MULTILINE | wxTE_READONLY);
}
{
static long s_num = 10;
- s_num = wxGetNumberFromUser("How many threads to start: ", "",
- "wxThread sample", s_num, 1, 10000, this);
+ s_num = wxGetNumberFromUser(_T("How many threads to start: "), _T(""),
+ _T("wxThread sample"), s_num, 1, 10000, this);
if ( s_num == -1 )
{
s_num = 10;
wxLogError(wxT("Can't start thread!"));
}
- SetStatusText("New thread started.", 1);
+ SetStatusText(_T("New thread started."), 1);
}
void MyFrame::OnStopThread(wxCommandEvent& WXUNUSED(event) )
thread->Delete();
- SetStatusText("Thread stopped.", 1);
+ SetStatusText(_T("Thread stopped."), 1);
}
}
{
wxGetApp().m_threads[n]->Resume();
- SetStatusText("Thread resumed.", 1);
+ SetStatusText(_T("Thread resumed."), 1);
}
}
{
wxGetApp().m_threads[n]->Pause();
- SetStatusText("Thread paused.", 1);
+ SetStatusText(_T("Thread paused."), 1);
}
}
void MyFrame::OnExecMain(wxCommandEvent& WXUNUSED(event))
{
wxLogMessage(wxT("The exit code from the main program is %ld"),
- EXEC("/bin/echo \"main program\""));
+ EXEC(_T("/bin/echo \"main program\"")));
}
void MyFrame::OnExecThread(wxCommandEvent& WXUNUSED(event))
switch ( nCPUs )
{
case -1:
- msg = "Unknown number of CPUs";
+ msg = _T("Unknown number of CPUs");
break;
case 0:
- msg = "WARNING: you're running without any CPUs!";
+ msg = _T("WARNING: you're running without any CPUs!");
break;
case 1:
- msg = "This system only has one CPU.";
+ msg = _T("This system only has one CPU.");
break;
default:
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- wxMessageDialog dialog(this, "wxWindows multithreaded application sample\n"
- "(c) 1998 Julian Smart, Guilhem Lavaux\n"
- "(c) 1999 Vadim Zeitlin\n"
- "(c) 2000 Robert Roebling",
- "About wxThread sample",
+ wxMessageDialog dialog(this,
+ _T("wxWindows multithreaded application sample\n")
+ _T("(c) 1998 Julian Smart, Guilhem Lavaux\n")
+ _T("(c) 1999 Vadim Zeitlin\n")
+ _T("(c) 2000 Robert Roebling"),
+ _T("About wxThread sample"),
wxOK | wxICON_INFORMATION);
dialog.ShowModal();
m_dlgProgress = new wxProgressDialog
(
- "Progress dialog",
- "Wait until the thread terminates or press [Cancel]",
+ _T("Progress dialog"),
+ _T("Wait until the thread terminates or press [Cancel]"),
100,
this,
wxPD_CAN_ABORT |
void MyFrame::OnWorkerEvent(wxCommandEvent& event)
{
#if 0
- WriteText( "Got message from worker thread: " );
+ WriteText( _T("Got message from worker thread: ") );
WriteText( event.GetString() );
- WriteText( "\n" );
+ WriteText( _T("\n") );
#else
int n = event.GetInt();
if ( n == -1 )
public:
MyFrame(wxFrame *parent,
wxWindowID id = -1,
- const wxString& title = "wxToolBar Sample",
+ const wxString& title = _T("wxToolBar Sample"),
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE);
{
// Create the main frame window
MyFrame* frame = new MyFrame((wxFrame *) NULL, -1,
- "wxToolBar Sample",
+ _T("wxToolBar Sample"),
wxPoint(100, 100), wxSize(550, 300));
frame->Show(TRUE);
- frame->SetStatusText("Hello, wxWindows");
+ frame->SetStatusText(_T("Hello, wxWindows"));
SetTopWindow(frame);
// adding a combo to a vertical toolbar is not very smart
if ( m_horzToolbar )
{
- wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, "", wxDefaultPosition, wxSize(200,-1) );
+ wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, _T(""), wxDefaultPosition, wxSize(200,-1) );
combo->Append(_T("This"));
combo->Append(_T("is a"));
combo->Append(_T("combobox"));
bool MyApp::OnInit()
{
// Create the main frame window
- MyFrame *frame = new MyFrame((wxFrame *) NULL, "wxWindows Types Demo",
+ MyFrame *frame = new MyFrame((wxFrame *) NULL, _T("wxWindows Types Demo"),
wxPoint(50, 50), wxSize(450, 340));
// Give it an icon
// Make a menubar
wxMenu *file_menu = new wxMenu;
- file_menu->Append(TYPES_ABOUT, "&About");
+ file_menu->Append(TYPES_ABOUT, _T("&About"));
file_menu->AppendSeparator();
- file_menu->Append(TYPES_QUIT, "E&xit\tAlt-X");
+ file_menu->Append(TYPES_QUIT, _T("E&xit\tAlt-X"));
wxMenu *test_menu = new wxMenu;
#if wxUSE_TIMEDATE
- test_menu->Append(TYPES_DATE, "&Date test");
- test_menu->Append(TYPES_TIME, "&Time test");
+ test_menu->Append(TYPES_DATE, _T("&Date test"));
+ test_menu->Append(TYPES_TIME, _T("&Time test"));
#endif // wxUSE_TIMEDATE
- test_menu->Append(TYPES_VARIANT, "&Variant test");
- test_menu->Append(TYPES_BYTEORDER, "&Byteorder test");
+ test_menu->Append(TYPES_VARIANT, _T("&Variant test"));
+ test_menu->Append(TYPES_BYTEORDER, _T("&Byteorder test"));
#if wxUSE_UNICODE
- test_menu->Append(TYPES_UNICODE, "&Unicode test");
+ test_menu->Append(TYPES_UNICODE, _T("&Unicode test"));
#endif // wxUSE_UNICODE
- test_menu->Append(TYPES_STREAM, "&Stream test");
- test_menu->Append(TYPES_STREAM2, "&Stream seek test");
- test_menu->Append(TYPES_STREAM3, "&Stream error test");
- test_menu->Append(TYPES_STREAM4, "&Stream buffer test");
- test_menu->Append(TYPES_STREAM5, "&Stream peek test");
- test_menu->Append(TYPES_STREAM6, "&Stream ungetch test");
- test_menu->Append(TYPES_STREAM7, "&Stream ungetch test for a buffered stream");
+ test_menu->Append(TYPES_STREAM, _T("&Stream test"));
+ test_menu->Append(TYPES_STREAM2, _T("&Stream seek test"));
+ test_menu->Append(TYPES_STREAM3, _T("&Stream error test"));
+ test_menu->Append(TYPES_STREAM4, _T("&Stream buffer test"));
+ test_menu->Append(TYPES_STREAM5, _T("&Stream peek test"));
+ test_menu->Append(TYPES_STREAM6, _T("&Stream ungetch test"));
+ test_menu->Append(TYPES_STREAM7, _T("&Stream ungetch test for a buffered stream"));
test_menu->AppendSeparator();
- test_menu->Append(TYPES_MIME, "&MIME database test");
+ test_menu->Append(TYPES_MIME, _T("&MIME database test"));
wxMenuBar *menu_bar = new wxMenuBar;
- menu_bar->Append(file_menu, "&File");
- menu_bar->Append(test_menu, "&Tests");
+ menu_bar->Append(file_menu, _T("&File"));
+ menu_bar->Append(test_menu, _T("&Tests"));
frame->SetMenuBar(menu_bar);
- m_textCtrl = new wxTextCtrl(frame, -1, "", wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
+ m_textCtrl = new wxTextCtrl(frame, -1, _T(""), wxPoint(0, 0), wxDefaultSize, wxTE_MULTILINE);
// Show the frame
frame->Show(TRUE);
textCtrl.Clear();
textCtrl << _T("\nTest fstream vs. wxFileStream:\n\n");
- textCtrl.WriteText( "Writing to ofstream and wxFileOutputStream:\n" );
+ textCtrl.WriteText( _T("Writing to ofstream and wxFileOutputStream:\n") );
wxSTD ofstream std_file_output( "test_std.dat" );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
wxBufferedOutputStream buf_output( file_output );
wxTextOutputStream text_output( buf_output );
signed int si = 0xFFFFFFFF;
tmp.Printf( _T("Signed int: %d\n"), si );
textCtrl.WriteText( tmp );
- text_output << si << "\n";
- std_file_output << si << "\n";
+ text_output << si << _T("\n");
+ std_file_output << si << _T("\n");
unsigned int ui = 0xFFFFFFFF;
tmp.Printf( _T("Unsigned int: %u\n"), ui );
textCtrl.WriteText( tmp );
- text_output << ui << "\n";
- std_file_output << ui << "\n";
+ text_output << ui << _T("\n");
+ std_file_output << ui << _T("\n");
double d = 2.01234567890123456789;
tmp.Printf( _T("Double: %f\n"), d );
textCtrl.WriteText( tmp );
- text_output << d << "\n";
- std_file_output << d << "\n";
+ text_output << d << _T("\n");
+ std_file_output << d << _T("\n");
float f = (float)0.00001;
tmp.Printf( _T("Float: %f\n"), f );
textCtrl.WriteText( tmp );
- text_output << f << "\n";
- std_file_output << f << "\n";
+ text_output << f << _T("\n");
+ std_file_output << f << _T("\n");
wxString str( _T("Hello!") );
tmp.Printf( _T("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
- text_output << str << "\n";
- std_file_output << str.c_str() << "\n";
+ text_output << str << _T("\n");
+ std_file_output << str.c_str() << _T("\n");
- textCtrl.WriteText( "\nReading from ifstream:\n" );
+ textCtrl.WriteText( _T("\nReading from ifstream:\n") );
wxSTD ifstream std_file_input( "test_std.dat" );
textCtrl.WriteText( tmp );
#endif
- textCtrl.WriteText( "\nReading from wxFileInputStream:\n" );
+ textCtrl.WriteText( _T("\nReading from wxFileInputStream:\n") );
buf_output.Sync();
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
wxBufferedInputStream buf_input( file_input );
wxTextInputStream text_input( file_input );
- textCtrl << "\nTest for wxDataStream:\n\n";
+ textCtrl << _T("\nTest for wxDataStream:\n\n");
- textCtrl.WriteText( "Writing to wxDataOutputStream:\n" );
+ textCtrl.WriteText( _T("Writing to wxDataOutputStream:\n") );
file_output.SeekO( 0 );
wxDataOutputStream data_output( buf_output );
textCtrl.WriteText( tmp );
data_output.WriteDouble( d );
- str = "Hello!";
+ str = _T("Hello!");
tmp.Printf( _T("String: %s\n"), str.c_str() );
textCtrl.WriteText( tmp );
data_output.WriteString( str );
buf_output.Sync();
- textCtrl.WriteText( "\nReading from wxDataInputStream:\n" );
+ textCtrl.WriteText( _T("\nReading from wxDataInputStream:\n") );
file_input.SeekI( 0 );
wxDataInputStream data_input( buf_input );
char ch,ch2;
- textCtrl.WriteText( "Writing number 0 to 9 to buffered wxFileOutputStream:\n\n" );
+ textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream:\n\n") );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
wxBufferedOutputStream buf_output( file_output );
for (ch = 0; ch < 10; ch++)
buf_output.Write( &ch, 1 );
buf_output.Sync();
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + _T('0')) );
}
- textCtrl.WriteText( "\n\n\n" );
+ textCtrl.WriteText( _T("\n\n\n") );
- textCtrl.WriteText( "Writing number 0 to 9 to buffered wxFileOutputStream, then\n" );
- textCtrl.WriteText( "seeking back to #3 and writing 0:\n\n" );
+ textCtrl.WriteText( _T("Writing number 0 to 9 to buffered wxFileOutputStream, then\n") );
+ textCtrl.WriteText( _T("seeking back to #3 and writing 0:\n\n") );
- wxFileOutputStream file_output2( wxString("test_wx2.dat") );
+ wxFileOutputStream file_output2( wxString(_T("test_wx2.dat")) );
wxBufferedOutputStream buf_output2( file_output2 );
for (ch = 0; ch < 10; ch++)
buf_output2.Write( &ch, 1 );
buf_output2.Write( &ch, 1 );
buf_output2.Sync();
- wxFileInputStream file_input2( wxString("test_wx2.dat") );
+ wxFileInputStream file_input2( wxString(_T("test_wx2.dat")) );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input2.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + _T('0')) );
}
- textCtrl.WriteText( "\n\n\n" );
+ textCtrl.WriteText( _T("\n\n\n") );
// now append 2000 bytes to file (bigger than buffer)
buf_output2.SeekO( 0, wxFromEnd );
buf_output2.Write( &ch, 1 );
buf_output2.Sync();
- textCtrl.WriteText( "Reading number 0 to 9 from buffered wxFileInputStream, then\n" );
- textCtrl.WriteText( "seeking back to #3 and reading the 0:\n\n" );
+ textCtrl.WriteText( _T("Reading number 0 to 9 from buffered wxFileInputStream, then\n") );
+ textCtrl.WriteText( _T("seeking back to #3 and reading the 0:\n\n") );
- wxFileInputStream file_input3( wxString("test_wx2.dat") );
+ wxFileInputStream file_input3( wxString(_T("test_wx2.dat")) );
wxBufferedInputStream buf_input3( file_input3 );
for (ch2 = 0; ch2 < 10; ch2++)
{
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + _T('0')) );
}
for (int j = 0; j < 2000; j++)
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
buf_input3.SeekI( 3 );
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "\n\n\n" );
+ textCtrl.WriteText( (wxChar)(ch + _T('0')) );
+ textCtrl.WriteText( _T("\n\n\n") );
}
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << "\nTesting wxFileInputStream's and wxFFileInputStream's error handling:\n\n";
+ textCtrl << _T("\nTesting wxFileInputStream's and wxFFileInputStream's error handling:\n\n");
char ch,ch2;
- textCtrl.WriteText( "Writing number 0 to 9 to wxFileOutputStream:\n\n" );
+ textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
// Testing wxFileInputStream
- textCtrl.WriteText( "Reading 0 to 10 to wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading 0 to 10 to wxFileInputStream:\n\n") );
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
for (ch2 = 0; ch2 < 11; ch2++)
{
file_input.Read( &ch, 1 );
- textCtrl.WriteText( "Value read: " );
+ textCtrl.WriteText( _T("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
switch (file_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
}
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
- textCtrl.WriteText( "Seeking to 0; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") );
file_input.SeekI( 0 );
switch (file_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
file_input.Read( &ch, 1 );
- textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("Value read: ") );
+ textCtrl.WriteText( (wxChar)(ch + _T('0')) );
+ textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
switch (file_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
// Testing wxFFileInputStream
- textCtrl.WriteText( "Reading 0 to 10 to wxFFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading 0 to 10 to wxFFileInputStream:\n\n") );
- wxFFileInputStream ffile_input( wxString("test_wx.dat") );
+ wxFFileInputStream ffile_input( wxString(_T("test_wx.dat")) );
for (ch2 = 0; ch2 < 11; ch2++)
{
ffile_input.Read( &ch, 1 );
- textCtrl.WriteText( "Value read: " );
+ textCtrl.WriteText( _T("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
switch (ffile_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
}
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
- textCtrl.WriteText( "Seeking to 0; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") );
ffile_input.SeekI( 0 );
switch (ffile_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
ffile_input.Read( &ch, 1 );
- textCtrl.WriteText( "Value read: " );
+ textCtrl.WriteText( _T("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
switch (ffile_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
// Testing wxFFileInputStream
- textCtrl.WriteText( "Reading 0 to 10 to buffered wxFFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading 0 to 10 to buffered wxFFileInputStream:\n\n") );
- wxFFileInputStream ffile_input2( wxString("test_wx.dat") );
+ wxFFileInputStream ffile_input2( wxString(_T("test_wx.dat")) );
wxBufferedInputStream buf_input( ffile_input2 );
for (ch2 = 0; ch2 < 11; ch2++)
{
buf_input.Read( &ch, 1 );
- textCtrl.WriteText( "Value read: " );
+ textCtrl.WriteText( _T("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
}
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
- textCtrl.WriteText( "Seeking to 0; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("Seeking to 0; stream.GetLastError() returns: ") );
buf_input.SeekI( 0 );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
- textCtrl.WriteText( "\n" );
+ textCtrl.WriteText( _T("\n") );
buf_input.Read( &ch, 1 );
- textCtrl.WriteText( "Value read: " );
+ textCtrl.WriteText( _T("Value read: ") );
textCtrl.WriteText( (wxChar)(ch + '0') );
- textCtrl.WriteText( "; stream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("; stream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
}
wxString msg;
textCtrl.Clear();
- textCtrl << "\nTesting wxStreamBuffer:\n\n";
+ textCtrl << _T("\nTesting wxStreamBuffer:\n\n");
// bigger than buffer
- textCtrl.WriteText( "Writing 2000x 1 to wxFileOutputStream.\n\n" );
+ textCtrl.WriteText( _T("Writing 2000x 1 to wxFileOutputStream.\n\n") );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
for (int i = 0; i < 2000; i++)
{
char ch = 1;
file_output.Write( &ch, 1 );
}
- textCtrl.WriteText( "Opening with a buffered wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Opening with a buffered wxFileInputStream:\n\n") );
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
wxBufferedInputStream buf_input( file_input );
- textCtrl.WriteText( "wxBufferedInputStream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
- textCtrl.WriteText( "Seeking to position 300:\n\n" );
+ textCtrl.WriteText( _T("Seeking to position 300:\n\n") );
buf_input.SeekI( 300 );
- textCtrl.WriteText( "wxBufferedInputStream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
char buf[2000];
- textCtrl.WriteText( "Reading 500 bytes:\n\n" );
+ textCtrl.WriteText( _T("Reading 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( "wxBufferedInputStream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
- textCtrl.WriteText( "Reading another 500 bytes:\n\n" );
+ textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( "wxBufferedInputStream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
- textCtrl.WriteText( "Reading another 500 bytes:\n\n" );
+ textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( "wxBufferedInputStream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
- textCtrl.WriteText( "Reading another 500 bytes:\n\n" );
+ textCtrl.WriteText( _T("Reading another 500 bytes:\n\n") );
buf_input.Read( buf, 500 );
- textCtrl.WriteText( "wxBufferedInputStream.GetLastError() returns: " );
+ textCtrl.WriteText( _T("wxBufferedInputStream.GetLastError() returns: ") );
switch (buf_input.GetLastError())
{
- case wxSTREAM_NO_ERROR: textCtrl.WriteText( "wxSTREAM_NO_ERROR\n" ); break;
- case wxSTREAM_EOF: textCtrl.WriteText( "wxSTREAM_EOF\n" ); break;
- case wxSTREAM_READ_ERROR: textCtrl.WriteText( "wxSTREAM_READ_ERROR\n" ); break;
- case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
- default: textCtrl.WriteText( "Huh?\n" ); break;
+ case wxSTREAM_NO_ERROR: textCtrl.WriteText( _T("wxSTREAM_NO_ERROR\n") ); break;
+ case wxSTREAM_EOF: textCtrl.WriteText( _T("wxSTREAM_EOF\n") ); break;
+ case wxSTREAM_READ_ERROR: textCtrl.WriteText( _T("wxSTREAM_READ_ERROR\n") ); break;
+ case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( _T("wxSTREAM_WRITE_ERROR\n") ); break;
+ default: textCtrl.WriteText( _T("Huh?\n") ); break;
}
msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
- textCtrl.WriteText( "\n\n" );
+ textCtrl.WriteText( _T("\n\n") );
}
void MyApp::DoStreamDemo5(wxCommandEvent& WXUNUSED(event))
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << "\nTesting wxFileInputStream's Peek():\n\n";
+ textCtrl << _T("\nTesting wxFileInputStream's Peek():\n\n");
char ch;
wxString str;
- textCtrl.WriteText( "Writing number 0 to 9 to wxFileOutputStream:\n\n" );
+ textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream:\n\n") );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
file_output.Sync();
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
ch = file_input.Peek();
str.Printf( wxT("First char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
- textCtrl << "\n\n\nTesting wxMemoryInputStream's Peek():\n\n";
+ textCtrl << _T("\n\n\nTesting wxMemoryInputStream's Peek():\n\n");
char buf[] = { 0,1,2,3,4,5,6,7,8,9,10 };
wxMemoryInputStream input( buf, 10 );
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl.WriteText( "\nTesting Ungetch():\n\n" );
+ textCtrl.WriteText( _T("\nTesting Ungetch():\n\n") );
char ch = 0;
size_t pos = 0;
wxString str;
- textCtrl.WriteText( "Writing number 0 to 9 to wxFileOutputStream...\n\n" );
+ textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
file_output.Sync();
- textCtrl.WriteText( "Reading char from wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
ch = file_input.GetC();
pos = file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading another char from wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading yet another char from wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading yet another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Now calling Ungetch( 5 ) from wxFileInputStream...\n\n" );
+ textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream...\n\n") );
file_input.Ungetch( 5 );
pos = file_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading char from wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading another char from wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading another char from wxFileInputStream:\n\n") );
ch = file_input.GetC();
pos = file_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n" );
+ textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxFileInputStream again...\n\n") );
file_input.Ungetch( 5 );
pos = file_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Seeking to pos 3 in wxFileInputStream. This invalidates the writeback buffer.\n\n" );
+ textCtrl.WriteText( _T("Seeking to pos 3 in wxFileInputStream. This invalidates the writeback buffer.\n\n") );
file_input.SeekI( 3 );
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl.WriteText( "\nTesting Ungetch() in buffered input stream:\n\n" );
+ textCtrl.WriteText( _T("\nTesting Ungetch() in buffered input stream:\n\n") );
char ch = 0;
size_t pos = 0;
wxString str;
- textCtrl.WriteText( "Writing number 0 to 9 to wxFileOutputStream...\n\n" );
+ textCtrl.WriteText( _T("Writing number 0 to 9 to wxFileOutputStream...\n\n") );
- wxFileOutputStream file_output( wxString("test_wx.dat") );
+ wxFileOutputStream file_output( wxString(_T("test_wx.dat")) );
for (ch = 0; ch < 10; ch++)
file_output.Write( &ch, 1 );
file_output.Sync();
- textCtrl.WriteText( "Reading char from wxBufferedInputStream via wxFileInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading char from wxBufferedInputStream via wxFileInputStream:\n\n") );
- wxFileInputStream file_input( wxString("test_wx.dat") );
+ wxFileInputStream file_input( wxString(_T("test_wx.dat")) );
wxBufferedInputStream buf_input( file_input );
ch = buf_input.GetC();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading another char from wxBufferedInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading yet another char from wxBufferedInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading yet another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n" );
+ textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream...\n\n") );
buf_input.Ungetch( 5 );
pos = buf_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading char from wxBufferedInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Reading another char from wxBufferedInputStream:\n\n" );
+ textCtrl.WriteText( _T("Reading another char from wxBufferedInputStream:\n\n") );
ch = buf_input.GetC();
pos = buf_input.TellI();
str.Printf( wxT("Read char: %d. Now at position %d\n\n"), (int) ch, (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n" );
+ textCtrl.WriteText( _T("Now calling Ungetch( 5 ) from wxBufferedInputStream again...\n\n") );
buf_input.Ungetch( 5 );
pos = buf_input.TellI();
str.Printf( wxT("Now at position %d\n\n"), (int) pos );
textCtrl.WriteText( str );
- textCtrl.WriteText( "Seeking to pos 3 in wxBufferedInputStream. This invalidates the writeback buffer.\n\n" );
+ textCtrl.WriteText( _T("Seeking to pos 3 in wxBufferedInputStream. This invalidates the writeback buffer.\n\n") );
buf_input.SeekI( 3 );
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << "\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:";
+ textCtrl << _T("\nTest wchar_t to char (Unicode to ANSI/Multibyte) converions:");
wxString str;
str = _T("Robert Röbling\n");
void MyApp::DoMIMEDemo(wxCommandEvent& WXUNUSED(event))
{
- static wxString s_defaultExt = "xyz";
+ static wxString s_defaultExt = _T("xyz");
- wxString ext = wxGetTextFromUser("Enter a file extension: ",
- "MIME database test",
+ wxString ext = wxGetTextFromUser(_T("Enter a file extension: "),
+ _T("MIME database test"),
s_defaultExt);
if ( !!ext )
{
static const wxFileTypeInfo fallbacks[] =
{
- wxFileTypeInfo("application/xyz",
- "XyZ %s",
- "XyZ -p %s",
- "The one and only XYZ format file",
- "xyz", "123", NULL),
- wxFileTypeInfo("text/html",
- "lynx %s",
- "lynx -dump %s | lpr",
- "HTML document (from fallback)",
- "htm", "html", NULL),
+ wxFileTypeInfo(_T("application/xyz"),
+ _T("XyZ %s"),
+ _T("XyZ -p %s"),
+ _T("The one and only XYZ format file"),
+ _T("xyz"), _T("123"), NULL),
+ wxFileTypeInfo(_T("text/html"),
+ _T("lynx %s"),
+ _T("lynx -dump %s | lpr"),
+ _T("HTML document (from fallback)"),
+ _T("htm"), _T("html"), NULL),
// must terminate the table with this!
wxFileTypeInfo()
wxFileType *filetype = m_mimeDatabase->GetFileTypeFromExtension(ext);
if ( !filetype )
{
- textCtrl << "Unknown extension '" << ext << "'\n";
+ textCtrl << _T("Unknown extension '") << ext << _T("'\n");
}
else
{
filetype->GetMimeType(&type);
filetype->GetDescription(&desc);
- wxString filename = "filename";
- filename << "." << ext;
+ wxString filename = _T("filename");
+ filename << _T(".") << ext;
wxFileType::MessageParameters params(filename, type);
filetype->GetOpenCommand(&open, params);
- textCtrl << "MIME information about extension '" << ext << "'\n"
- << "\tMIME type: " << ( !type ? wxT("unknown")
+ textCtrl << _T("MIME information about extension '") << ext << _T("'\n")
+ << _T("\tMIME type: ") << ( !type ? wxT("unknown")
: type.c_str() ) << '\n'
- << "\tDescription: " << ( !desc ? wxT("") : desc.c_str() )
+ << _T("\tDescription: ") << ( !desc ? wxT("") : desc.c_str() )
<< '\n'
- << "\tCommand to open: " << ( !open ? wxT("no") : open.c_str() )
+ << _T("\tCommand to open: ") << ( !open ? wxT("no") : open.c_str() )
<< '\n';
delete filetype;
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << "\nTest byte order macros:\n\n";
+ textCtrl << _T("\nTest byte order macros:\n\n");
if (wxBYTE_ORDER == wxLITTLE_ENDIAN)
- textCtrl << "This is a little endian system.\n\n";
+ textCtrl << _T("This is a little endian system.\n\n");
else
- textCtrl << "This is a big endian system.\n\n";
+ textCtrl << _T("This is a big endian system.\n\n");
wxString text;
wxInt32 var = 0xF1F2F3F4;
- text = "";
+ text = _T("");
text.Printf( _T("Value of wxInt32 is now: %#x.\n\n"), var );
textCtrl.WriteText( text );
- text = "";
+ text = _T("");
text.Printf( _T("Value of swapped wxInt32 is: %#x.\n\n"), wxINT32_SWAP_ALWAYS( var ) );
textCtrl.WriteText( text );
- text = "";
+ text = _T("");
text.Printf( _T("Value of wxInt32 swapped on little endian is: %#x.\n\n"), wxINT32_SWAP_ON_LE( var ) );
textCtrl.WriteText( text );
- text = "";
+ text = _T("");
text.Printf( _T("Value of wxInt32 swapped on big endian is: %#x.\n\n"), wxINT32_SWAP_ON_BE( var ) );
textCtrl.WriteText( text );
}
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << "\nTest class wxTime:\n";
+ textCtrl << _T("\nTest class wxTime:\n");
wxTime now;
- textCtrl << "It is now " << (wxString) now << "\n";
+ textCtrl << _T("It is now ") << (wxString) now << _T("\n");
}
void MyApp::DoDateDemo(wxCommandEvent& WXUNUSED(event))
wxTextCtrl& textCtrl = * GetTextCtrl();
textCtrl.Clear();
- textCtrl << "\nTest class wxDate" << "\n";
+ textCtrl << _T("\nTest class wxDate") << _T("\n");
// Various versions of the constructors
// and various output
wxDate x(10,20,1962);
- textCtrl << x.FormatDate(wxFULL) << " (full)\n";
+ textCtrl << x.FormatDate(wxFULL) << _T(" (full)\n");
// constuctor with a string, just printing the day of the week
- wxDate y("8/8/1988");
+ wxDate y(_T("8/8/1988"));
- textCtrl << y.FormatDate(wxDAY) << " (just day)\n";
+ textCtrl << y.FormatDate(wxDAY) << _T(" (just day)\n");
// constructor with a julian
wxDate z( 2450000L );
- textCtrl << z.FormatDate(wxFULL) << " (full)\n";
+ textCtrl << z.FormatDate(wxFULL) << _T(" (full)\n");
// using date addition and subtraction
wxDate a = x + 10;
- textCtrl << a.FormatDate(wxFULL) << " (full)\n";
+ textCtrl << a.FormatDate(wxFULL) << _T(" (full)\n");
a = a - 25;
- textCtrl << a.FormatDate(wxEUROPEAN) << " (European)\n";
+ textCtrl << a.FormatDate(wxEUROPEAN) << _T(" (European)\n");
// Using subtraction of two date objects
- wxDate a1 = wxString("7/13/1991");
+ wxDate a1 = wxString(_T("7/13/1991"));
wxDate a2 = a1 + 14;
- textCtrl << (a1-a2) << "\n";
- textCtrl << (a2+=10) << "\n";
+ textCtrl << (a1-a2) << _T("\n");
+ textCtrl << (a2+=10) << _T("\n");
a1++;
- textCtrl << "Tomorrow= " << a1.FormatDate(wxFULL) << "\n";
+ textCtrl << _T("Tomorrow= ") << a1.FormatDate(wxFULL) << _T("\n");
- wxDate tmpDate1("08/01/1991");
- wxDate tmpDate2("07/14/1991");
- textCtrl << "a1 (7-14-91) < 8-01-91 ? ==> " << ((a1 < tmpDate1) ? "TRUE" : "FALSE") << "\n";
- textCtrl << "a1 (7-14-91) > 8-01-91 ? ==> " << ((a1 > tmpDate1) ? "TRUE" : "FALSE") << "\n";
- textCtrl << "a1 (7-14-91)== 7-14-91 ? ==> " << ((a1==tmpDate2) ? "TRUE" : "FALSE") << "\n";
+ wxDate tmpDate1(_T("08/01/1991"));
+ wxDate tmpDate2(_T("07/14/1991"));
+ textCtrl << _T("a1 (7-14-91) < 8-01-91 ? ==> ") << ((a1 < tmpDate1) ? _T("TRUE") : _T("FALSE")) << _T("\n");
+ textCtrl << _T("a1 (7-14-91) > 8-01-91 ? ==> ") << ((a1 > tmpDate1) ? _T("TRUE") : _T("FALSE")) << _T("\n");
+ textCtrl << _T("a1 (7-14-91)== 7-14-91 ? ==> ") << ((a1==tmpDate2) ? _T("TRUE") : _T("FALSE")) << _T("\n");
wxDate a3 = a1;
- textCtrl << "a1 (7-14-91)== a3 (7-14-91) ? ==> " << ((a1==a3) ? "TRUE" : "FALSE") << "\n";
+ textCtrl << _T("a1 (7-14-91)== a3 (7-14-91) ? ==> ") << ((a1==a3) ? _T("TRUE") : _T("FALSE")) << _T("\n");
wxDate a4 = a1;
- textCtrl << "a1 (7-14-91)== a4 (7-15-91) ? ==> " << ((a1==++a4) ? "TRUE" : "FALSE") << "\n";
+ textCtrl << _T("a1 (7-14-91)== a4 (7-15-91) ? ==> ") << ((a1==++a4) ? _T("TRUE") : _T("FALSE")) << _T("\n");
- wxDate a5 = wxString("today");
- textCtrl << "Today is: " << a5 << "\n";
- a4 = "TODAY";
- textCtrl << "Today (a4) is: " << a4 << "\n";
+ wxDate a5 = wxString(_T("today"));
+ textCtrl << _T("Today is: ") << a5 << _T("\n");
+ a4 = _T("TODAY");
+ textCtrl << _T("Today (a4) is: ") << a4 << _T("\n");
- textCtrl << "Today + 4 is: " << (a4+=4) << "\n";
- a4 = "TODAY";
- textCtrl << "Today - 4 is: " << (a4-=4) << "\n";
+ textCtrl << _T("Today + 4 is: ") << (a4+=4) << _T("\n");
+ a4 = _T("TODAY");
+ textCtrl << _T("Today - 4 is: ") << (a4-=4) << _T("\n");
- textCtrl << "=========== Leap Year Test ===========\n";
- a1 = "1/15/1992";
- textCtrl << a1.FormatDate(wxFULL) << " " << ((a1.IsLeapYear()) ? "Leap" : "non-Leap");
- textCtrl << " " << "day of year: " << a1.GetDayOfYear() << "\n";
+ textCtrl << _T("=========== Leap Year Test ===========\n");
+ a1 = _T("1/15/1992");
+ textCtrl << a1.FormatDate(wxFULL) << _T(" ") << ((a1.IsLeapYear()) ? _T("Leap") : _T("non-Leap"));
+ textCtrl << _T(" ") << _T("day of year: ") << a1.GetDayOfYear() << _T("\n");
- a1 = "2/16/1993";
- textCtrl << a1.FormatDate(wxFULL) << " " << ((a1.IsLeapYear()) ? "Leap" : "non-Leap");
- textCtrl << " " << "day of year: " << a1.GetDayOfYear() << "\n";
+ a1 = _T("2/16/1993");
+ textCtrl << a1.FormatDate(wxFULL) << _T(" ") << ((a1.IsLeapYear()) ? _T("Leap") : _T("non-Leap"));
+ textCtrl << _T(" ") << _T("day of year: ") << a1.GetDayOfYear() << _T("\n");
- textCtrl << "================== string assignment test ====================\n";
+ textCtrl << _T("================== string assignment test ====================\n");
wxString date_string=a1;
- textCtrl << "a1 as a string (s/b 2/16/1993) ==> " << date_string << "\n";
+ textCtrl << _T("a1 as a string (s/b 2/16/1993) ==> ") << date_string << _T("\n");
- textCtrl << "================== SetFormat test ============================\n";
+ textCtrl << _T("================== SetFormat test ============================\n");
a1.SetFormat(wxFULL);
- textCtrl << "a1 (s/b FULL format) ==> " << a1 << "\n";
+ textCtrl << _T("a1 (s/b FULL format) ==> ") << a1 << _T("\n");
a1.SetFormat(wxEUROPEAN);
- textCtrl << "a1 (s/b EUROPEAN format) ==> " << a1 << "\n";
+ textCtrl << _T("a1 (s/b EUROPEAN format) ==> ") << a1 << _T("\n");
- textCtrl << "================== SetOption test ============================\n";
- textCtrl << "Date abbreviation ON\n";
+ textCtrl << _T("================== SetOption test ============================\n");
+ textCtrl << _T("Date abbreviation ON\n");
a1.SetOption(wxDATE_ABBR);
a1.SetFormat(wxMONTH);
- textCtrl << "a1 (s/b MONTH format) ==> " << a1 << "\n";
+ textCtrl << _T("a1 (s/b MONTH format) ==> ") << a1 << _T("\n");
a1.SetFormat(wxDAY);
- textCtrl << "a1 (s/b DAY format) ==> " << a1 << "\n";
+ textCtrl << _T("a1 (s/b DAY format) ==> ") << a1 << _T("\n");
a1.SetFormat(wxFULL);
- textCtrl << "a1 (s/b FULL format) ==> " << a1 << "\n";
+ textCtrl << _T("a1 (s/b FULL format) ==> ") << a1 << _T("\n");
a1.SetFormat(wxEUROPEAN);
- textCtrl << "a1 (s/b EUROPEAN format) ==> " << a1 << "\n";
- textCtrl << "Century suppression ON\n";
+ textCtrl << _T("a1 (s/b EUROPEAN format) ==> ") << a1 << _T("\n");
+ textCtrl << _T("Century suppression ON\n");
a1.SetOption(wxNO_CENTURY);
a1.SetFormat(wxMDY);
- textCtrl << "a1 (s/b MDY format) ==> " << a1 << "\n";
- textCtrl << "Century suppression OFF\n";
+ textCtrl << _T("a1 (s/b MDY format) ==> ") << a1 << _T("\n");
+ textCtrl << _T("Century suppression OFF\n");
a1.SetOption(wxNO_CENTURY,FALSE);
- textCtrl << "a1 (s/b MDY format) ==> " << a1 << "\n";
- textCtrl << "Century suppression ON\n";
+ textCtrl << _T("a1 (s/b MDY format) ==> ") << a1 << _T("\n");
+ textCtrl << _T("Century suppression ON\n");
a1.SetOption(wxNO_CENTURY);
- textCtrl << "a1 (s/b MDY format) ==> " << a1 << "\n";
+ textCtrl << _T("a1 (s/b MDY format) ==> ") << a1 << _T("\n");
a1.SetFormat(wxFULL);
- textCtrl << "a1 (s/b FULL format) ==> " << a1 << "\n";
-
- textCtrl << "\n=============== Version 4.0 Enhancement Test =================\n";
-
- wxDate v4("11/26/1966");
- textCtrl << "\n---------- Set Stuff -----------\n";
- textCtrl << "First, 'Set' to today..." << "\n";
- textCtrl << "Before 'Set' => " << v4 << "\n";
- textCtrl << "After 'Set' => " << v4.Set() << "\n\n";
-
- textCtrl << "Set to 11/26/66 => " << v4.Set(11,26,1966) << "\n";
- textCtrl << "Current Julian => " << v4.GetJulianDate() << "\n";
- textCtrl << "Set to Julian 2450000L => " << v4.Set(2450000L) << "\n";
- textCtrl << "See! => " << v4.GetJulianDate() << "\n";
-
- textCtrl << "---------- Add Stuff -----------\n";
- textCtrl << "Start => " << v4 << "\n";
- textCtrl << "Add 4 Weeks => " << v4.AddWeeks(4) << "\n";
- textCtrl << "Sub 1 Month => " << v4.AddMonths(-1) << "\n";
- textCtrl << "Add 2 Years => " << v4.AddYears(2) << "\n";
-
- textCtrl << "---------- Misc Stuff -----------\n";
- textCtrl << "The date aboves' day of the month is => " << v4.GetDay() << "\n";
- textCtrl << "There are " << v4.GetDaysInMonth() << " days in this month.\n";
- textCtrl << "The first day of this month lands on " << v4.GetFirstDayOfMonth() << "\n";
- textCtrl << "This day happens to be " << v4.GetDayOfWeekName() << "\n";
- textCtrl << "the " << v4.GetDayOfWeek() << " day of the week," << "\n";
- textCtrl << "on the " << v4.GetWeekOfYear() << " week of the year," << "\n";
- textCtrl << "on the " << v4.GetWeekOfMonth() << " week of the month, " << "\n";
- textCtrl << "(which is " << v4.GetMonthName() << ")\n";
- textCtrl << "the "<< v4.GetMonth() << "th month in the year.\n";
- textCtrl << "The year alone is " << v4.GetYear() << "\n";
-
- textCtrl << "---------- First and Last Stuff -----------\n";
+ textCtrl << _T("a1 (s/b FULL format) ==> ") << a1 << _T("\n");
+
+ textCtrl << _T("\n=============== Version 4.0 Enhancement Test =================\n");
+
+ wxDate v4(_T("11/26/1966"));
+ textCtrl << _T("\n---------- Set Stuff -----------\n");
+ textCtrl << _T("First, 'Set' to today...") << _T("\n");
+ textCtrl << _T("Before 'Set' => ") << v4 << _T("\n");
+ textCtrl << _T("After 'Set' => ") << v4.Set() << _T("\n\n");
+
+ textCtrl << _T("Set to 11/26/66 => ") << v4.Set(11,26,1966) << _T("\n");
+ textCtrl << _T("Current Julian => ") << v4.GetJulianDate() << _T("\n");
+ textCtrl << _T("Set to Julian 2450000L => ") << v4.Set(2450000L) << _T("\n");
+ textCtrl << _T("See! => ") << v4.GetJulianDate() << _T("\n");
+
+ textCtrl << _T("---------- Add Stuff -----------\n");
+ textCtrl << _T("Start => ") << v4 << _T("\n");
+ textCtrl << _T("Add 4 Weeks => ") << v4.AddWeeks(4) << _T("\n");
+ textCtrl << _T("Sub 1 Month => ") << v4.AddMonths(-1) << _T("\n");
+ textCtrl << _T("Add 2 Years => ") << v4.AddYears(2) << _T("\n");
+
+ textCtrl << _T("---------- Misc Stuff -----------\n");
+ textCtrl << _T("The date aboves' day of the month is => ") << v4.GetDay() << _T("\n");
+ textCtrl << _T("There are ") << v4.GetDaysInMonth() << _T(" days in this month.\n");
+ textCtrl << _T("The first day of this month lands on ") << v4.GetFirstDayOfMonth() << _T("\n");
+ textCtrl << _T("This day happens to be ") << v4.GetDayOfWeekName() << _T("\n");
+ textCtrl << _T("the ") << v4.GetDayOfWeek() << _T(" day of the week,") << _T("\n");
+ textCtrl << _T("on the ") << v4.GetWeekOfYear() << _T(" week of the year,") << _T("\n");
+ textCtrl << _T("on the ") << v4.GetWeekOfMonth() << _T(" week of the month, ") << _T("\n");
+ textCtrl << _T("(which is ") << v4.GetMonthName() << _T(")\n");
+ textCtrl << _T("the ")<< v4.GetMonth() << _T("th month in the year.\n");
+ textCtrl << _T("The year alone is ") << v4.GetYear() << _T("\n");
+
+ textCtrl << _T("---------- First and Last Stuff -----------\n");
v4.Set();
- textCtrl << "The first date of this month is " << v4.GetMonthStart() << "\n";
- textCtrl << "The last date of this month is " << v4.GetMonthEnd() << "\n";
- textCtrl << "The first date of this year is " << v4.GetYearStart() << "\n";
- textCtrl << "The last date of this year is " << v4.GetYearEnd() << "\n";
+ textCtrl << _T("The first date of this month is ") << v4.GetMonthStart() << _T("\n");
+ textCtrl << _T("The last date of this month is ") << v4.GetMonthEnd() << _T("\n");
+ textCtrl << _T("The first date of this year is ") << v4.GetYearStart() << _T("\n");
+ textCtrl << _T("The last date of this year is ") << v4.GetYearEnd() << _T("\n");
}
#endif // wxUSE_TIMEDATE
{
wxTextCtrl& textCtrl = * GetTextCtrl();
- wxVariant var1 = "String value";
- textCtrl << "var1 = " << var1.MakeString() << "\n";
+ wxVariant var1 = _T("String value");
+ textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
// Conversion
wxString str = var1.MakeString();
var1 = 123.456;
- textCtrl << "var1 = " << var1.GetReal() << "\n";
+ textCtrl << _T("var1 = ") << var1.GetReal() << _T("\n");
// Implicit conversion
double v = var1;
var1 = 9876L;
- textCtrl << "var1 = " << var1.GetLong() << "\n";
+ textCtrl << _T("var1 = ") << var1.GetLong() << _T("\n");
// Implicit conversion
long l = var1;
wxStringList stringList;
stringList.Add(_T("one")); stringList.Add(_T("two")); stringList.Add(_T("three"));
var1 = stringList;
- textCtrl << "var1 = " << var1.MakeString() << "\n";
+ textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
var1.ClearList();
var1.Append(wxVariant(1.2345));
- var1.Append(wxVariant("hello"));
+ var1.Append(wxVariant(_T("hello")));
var1.Append(wxVariant(54321L));
- textCtrl << "var1 = " << var1.MakeString() << "\n";
+ textCtrl << _T("var1 = ") << var1.MakeString() << _T("\n");
size_t n = var1.GetCount();
size_t i;
for (i = (size_t) 0; i < n; i++)
{
- textCtrl << "var1[" << (int) i << "] (type " << var1[i].GetType() << ") = " << var1[i].MakeString() << "\n";
+ textCtrl << _T("var1[") << (int) i << _T("] (type ") << var1[i].GetType() << _T(") = ") << var1[i].MakeString() << _T("\n");
}
}
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event) )
{
- wxMessageDialog dialog(this, "Tests various wxWindows types",
- "About Types", wxYES_NO|wxCANCEL);
+ wxMessageDialog dialog(this, _T("Tests various wxWindows types"),
+ _T("About Types"), wxYES_NO|wxCANCEL);
dialog.ShowModal();
}