SetAutoLayout(TRUE);
wxString date;
- date.Printf("Selected date: %s",
+ date.Printf(wxT("Selected date: %s"),
wxDateTime::Today().FormatISODate().c_str());
m_date = new wxStaticText(this, -1, date);
m_calendar = new wxCalendarCtrl(this, Calendar_CalCtrl,
void MyPanel::OnCalendar(wxCalendarEvent& event)
{
- wxLogMessage("Selected %s from calendar",
+ wxLogMessage(wxT("Selected %s from calendar"),
event.GetDate().FormatISODate().c_str());
}
void MyPanel::OnCalendarChange(wxCalendarEvent& event)
{
wxString s;
- s.Printf("Selected date: %s", event.GetDate().FormatISODate().c_str());
+ s.Printf(wxT("Selected date: %s"), event.GetDate().FormatISODate().c_str());
m_date->SetLabel(s);
}
void MyPanel::OnCalMonthChange(wxCalendarEvent& WXUNUSED(event))
{
- wxLogStatus("Calendar month changed");
+ wxLogStatus(wxT("Calendar month changed"));
}
void MyPanel::OnCalYearChange(wxCalendarEvent& WXUNUSED(event))
{
- wxLogStatus("Calendar year changed");
+ wxLogStatus(wxT("Calendar year changed"));
}
void MyPanel::OnCalendarWeekDayClick(wxCalendarEvent& event)
{
- wxLogMessage("Clicked on %s",
+ wxLogMessage(wxT("Clicked on %s"),
wxDateTime::GetWeekDayName(event.GetWeekDay()).c_str());
}
m_calendar->Refresh();
}
-
void CheckListBoxFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(wxT("Demo of wxCheckListBox control\n"
- "© Vadim Zeitlin 1998-1999"),
+ wxMessageBox(wxT("Demo of wxCheckListBox control\n© Vadim Zeitlin 1998-1999"),
wxT("About wxCheckListBox"),
wxICON_INFORMATION, this);
}
wxString s;
if ( pConfig->Read("TestValue", &s) )
{
- wxLogStatus(this, "TestValue from config is '%s'", s.c_str());
+ wxLogStatus(this, wxT("TestValue from config is '%s'"), s.c_str());
}
else
{
- wxLogStatus(this, "TestValue not found in the config");
+ wxLogStatus(this, wxT("TestValue not found in the config"));
}
}
// being flushed -- test it
{
wxBusyCursor bc;
- wxLogMessage("This is some message - everything is ok so far.");
- wxLogMessage("Another message...\n... this one is on multiple lines");
- wxLogWarning("And then something went wrong!");
+ wxLogMessage(wxT("This is some message - everything is ok so far."));
+ wxLogMessage(wxT("Another message...\n... this one is on multiple lines"));
+ wxLogWarning(wxT("And then something went wrong!"));
// and if ~wxBusyCursor doesn't do it, then call it manually
wxYield();
}
- wxLogError("Intermediary error handler decided to abort.");
- wxLogError("The top level caller detected an unrecoverable error.");
+ wxLogError(wxT("Intermediary error handler decided to abort."));
+ wxLogError(wxT("The top level caller detected an unrecoverable error."));
wxLog::FlushActive();
- wxLogMessage("And this is the same dialog but with only one message.");
+ wxLogMessage(wxT("And this is the same dialog but with only one message."));
}
void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
this);
if ( !!pwd )
{
- wxMessageBox(wxString::Format("Your password is '%s'", pwd.c_str()),
+ wxMessageBox(wxString::Format(wxT("Your password is '%s'"), pwd.c_str()),
"Got password", wxOK | wxICON_INFORMATION, this);
}
}
if ( count )
{
wxString msg;
- msg.Printf("You selected %u items:\n", count);
+ msg.Printf(wxT("You selected %u items:\n"), count);
for ( size_t n = 0; n < count; n++ )
{
- msg += wxString::Format("\t%u: %u (%s)\n", n, selections[n],
+ msg += wxString::Format(wxT("\t%u: %u (%s)\n"), n, selections[n],
choices[selections[n]].c_str());
}
wxLogMessage(msg);
dialog2.ShowModal();
}
#else
- wxLogError("Sorry, generic dir dialog not available:\n"
- "set wxUSE_DIRDLGG to 1 and recompile");
+ wxLogError(wxT("Sorry, generic dir dialog not available:\n")
+ wxT("set wxUSE_DIRDLGG to 1 and recompile"));
#endif
}
if ( !cont )
{
- wxLogStatus("Progress dialog aborted!");
+ wxLogStatus(wxT("Progress dialog aborted!"));
}
else
{
- wxLogStatus("Countdown from %d finished", max);
+ wxLogStatus(wxT("Countdown from %d finished"), max);
}
}
if ( type == wxEVT_COMMAND_FIND || type == wxEVT_COMMAND_FIND_NEXT )
{
- wxLogMessage("Find %s'%s' (flags: %s)",
+ wxLogMessage(wxT("Find %s'%s' (flags: %s)"),
type == wxEVT_COMMAND_FIND_NEXT ? "next " : "",
event.GetFindString().c_str(),
DecodeFindDialogEventFlags(event.GetFlags()).c_str());
else if ( type == wxEVT_COMMAND_FIND_REPLACE ||
type == wxEVT_COMMAND_FIND_REPLACE_ALL )
{
- wxLogMessage("Replace %s'%s' with '%s' (flags: %s)",
+ wxLogMessage(wxT("Replace %s'%s' with '%s' (flags: %s)"),
type == wxEVT_COMMAND_FIND_REPLACE_ALL ? "all " : "",
event.GetFindString().c_str(),
event.GetReplaceString().c_str(),
}
else if ( type == wxEVT_COMMAND_FIND_CLOSE )
{
- wxLogMessage("Find dialog is being closed.");
+ wxLogMessage(wxT("Find dialog is being closed."));
event.GetDialog()->Destroy();
}
else
{
- wxLogError("Unknown find dialog event!");
+ wxLogError(wxT("Unknown find dialog event!"));
}
}
if ( !m_dial->IsOk() )
{
- wxLogError("The sample can't run on this system.");
+ wxLogError(wxT("The sample can't run on this system."));
wxLog::GetActiveTarget()->Flush();
void MyApp::OnConnected(wxDialUpEvent& event)
{
- const char *msg;
+ const wxChar *msg;
if ( event.IsOwnEvent() )
{
- msg = event.IsConnectedEvent() ? "Successfully connected"
- : "Dialing failed";
+ msg = event.IsConnectedEvent() ? wxT("Successfully connected")
+ : wxT("Dialing failed");
- wxLogStatus("");
+ wxLogStatus(wxT(""));
}
else
{
- msg = event.IsConnectedEvent() ? "Just connected!"
- : "Disconnected";
+ msg = event.IsConnectedEvent() ? wxT("Just connected!")
+ : wxT("Disconnected");
}
wxLogMessage(msg);
{
if ( wxGetApp().GetDialer()->HangUp() )
{
- wxLogStatus(this, "Connection was succesfully terminated.");
+ wxLogStatus(this, wxT("Connection was succesfully terminated."));
}
else
{
- wxLogStatus(this, "Failed to hang up.");
+ wxLogStatus(this, wxT("Failed to hang up."));
}
}
void MyFrame::OnDial(wxCommandEvent& WXUNUSED(event))
{
- wxLogStatus(this, "Preparing to dial...");
+ wxLogStatus(this, wxT("Preparing to dial..."));
wxYield();
wxBeginBusyCursor();
if ( wxGetApp().GetDialer()->Dial() )
{
- wxLogStatus(this, "Dialing...");
+ wxLogStatus(this, wxT("Dialing..."));
}
else
{
- wxLogStatus(this, "Dialing attempt failed.");
+ wxLogStatus(this, wxT("Dialing attempt failed."));
}
wxEndBusyCursor();
void MyFrame::OnCheck(wxCommandEvent& WXUNUSED(event))
{
if(wxGetApp().GetDialer()->IsOnline())
- wxLogMessage("Network is online.");
+ wxLogMessage(wxT("Network is online."));
else
- wxLogMessage("Network is offline.");
+ wxLogMessage(wxT("Network is offline."));
}
void MyFrame::OnEnumISPs(wxCommandEvent& WXUNUSED(event))
size_t nCount = wxGetApp().GetDialer()->GetISPNames(names);
if ( nCount == 0 )
{
- wxLogWarning("No ISPs found.");
+ wxLogWarning(wxT("No ISPs found."));
}
else
{
#define USE_METAFILES
#endif // Windows
+#define USE_RESOURCES 0
+#if !wxUSE_RESOURCES
+#undef USE_RESOURCES
+#define USE_RESOURCES 0
+#endif
+
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/image.h"
#include "wx/clipbrd.h"
#include "wx/colordlg.h"
-#include "wx/resource.h"
+#if USE_RESOURCES
+ #include "wx/resource.h"
+#else
+ #include "wx/sizer.h"
+#endif
#ifdef USE_METAFILES
#include "wx/metafile.h"
// Define a custom dtop target accepting URLs
// ----------------------------------------------------------------------------
-class WXDLLEXPORT URLDropTarget : public wxDropTarget
+class URLDropTarget : public wxDropTarget
{
public:
URLDropTarget() { SetDataObject(new wxURLDataObject); }
const wxColour& col)
: DnDShape(pos, size, col)
{
- wxLogMessage("DnDTriangularShape is being created");
+ wxLogMessage(wxT("DnDTriangularShape is being created"));
}
virtual ~DnDTriangularShape()
{
- wxLogMessage("DnDTriangularShape is being deleted");
+ wxLogMessage(wxT("DnDTriangularShape is being deleted"));
}
virtual Kind GetKind() const { return Triangle; }
const wxColour& col)
: DnDShape(pos, size, col)
{
- wxLogMessage("DnDRectangularShape is being created");
+ wxLogMessage(wxT("DnDRectangularShape is being created"));
}
virtual ~DnDRectangularShape()
{
- wxLogMessage("DnDRectangularShape is being deleted");
+ wxLogMessage(wxT("DnDRectangularShape is being deleted"));
}
virtual Kind GetKind() const { return Rectangle; }
const wxColour& col)
: DnDShape(pos, size, col)
{
- wxLogMessage("DnDEllipticShape is being created");
+ wxLogMessage(wxT("DnDEllipticShape is being created"));
}
virtual ~DnDEllipticShape()
{
- wxLogMessage("DnDEllipticShape is being deleted");
+ wxLogMessage(wxT("DnDEllipticShape is being deleted"));
}
virtual Kind GetKind() const { return Ellipse; }
// A wxDataObject specialisation for the application-specific data
// ----------------------------------------------------------------------------
-static const char *shapeFormatId = "wxShape";
+static const wxChar *shapeFormatId = wxT("wxShape");
class DnDShapeDataObject : public wxDataObject
{
else
{
wxASSERT_MSG( m_dobjBitmap.IsSupported(format),
- "unexpected format" );
+ wxT("unexpected format") );
if ( !m_hasBitmap )
CreateBitmap();
else
{
wxASSERT_MSG( m_dobjBitmap.IsSupported(format),
- "unexpected format" );
+ wxT("unexpected format") );
if ( !m_hasBitmap )
CreateBitmap();
virtual bool SetData(const wxDataFormat& format,
size_t len, const void *buf)
{
- wxCHECK_MSG( format == m_formatShape, FALSE, "unsupported format" );
+ wxCHECK_MSG( format == m_formatShape, FALSE,
+ wxT( "unsupported format") );
delete m_shape;
m_shape = DnDShape::New(buf);
{
if ( !GetData() )
{
- wxLogError("Failed to get drag and drop data");
+ wxLogError(wxT("Failed to get drag and drop data"));
return wxDragNone;
}
// `Main program' equivalent, creating windows and returning main app frame
bool DnDApp::OnInit()
{
+#if USE_RESOURCES
// load our ressources
wxPathList pathList;
pathList.Add(".");
wxString path = pathList.FindValidPath("dnd.wxr");
if ( !path )
{
- wxLogError("Can't find the resource file dnd.wxr in the current "
- "directory, aborting.");
+ wxLogError(wxT("Can't find the resource file dnd.wxr in the current ")
+ wxT("directory, aborting."));
return FALSE;
}
wxDefaultResourceTable->ParseResourceFile(path);
+#endif
// switch on trace messages
#if defined(__WXGTK__)
{
(new DnDShapeFrame(this))->Show(TRUE);
- wxLogStatus(this, "Double click the new frame to select a shape for it");
+ wxLogStatus(this, wxT("Double click the new frame to select a shape for it"));
}
void DnDFrame::OnDrag(wxCommandEvent& WXUNUSED(event))
wxClipboardLocker locker;
if ( !locker )
{
- wxLogError("Can't open clipboard");
+ wxLogError(wxT("Can't open clipboard"));
}
else
{
if ( !wxTheClipboard->AddData(dobj) )
{
- wxLogError("Can't copy file(s) to the clipboard");
+ wxLogError(wxT("Can't copy file(s) to the clipboard"));
}
else
{
- wxLogStatus(this, "%d file%s copied to the clipboard",
- count, count == 1 ? "" : "s");
+ wxLogStatus(this, wxT("%d file%s copied to the clipboard"),
+ count, count == 1 ? wxT("") : wxT("s"));
}
}
}
else
{
- wxLogStatus(this, "Aborted");
+ wxLogStatus(this, wxT("Aborted"));
}
#else // !MSW
- wxLogError("Sorry, not implemented");
+ wxLogError(wxT("Sorry, not implemented"));
#endif // MSW/!MSW
}
// ----------------------------------------------------------------------------
DnDShapeDialog::DnDShapeDialog(wxFrame *parent, DnDShape *shape)
+#if !USE_RESOURCES
+ :wxDialog( parent, 6001, wxT("Choose Shape"), wxPoint( 10, 10 ),
+ wxSize( 40, 40 ),
+ wxRAISED_BORDER|wxCAPTION|wxTHICK_FRAME|wxSYSTEM_MENU )
+#endif
{
m_shape = shape;
-
+#if USE_RESOURCES
LoadFromResource(parent, "dialogShape");
m_textX = (wxTextCtrl *)wxFindWindowByName("textX", this);
m_textH = (wxTextCtrl *)wxFindWindowByName("textH", this);
m_radio = (wxRadioBox *)wxFindWindowByName("radio", this);
+#else
+ wxBoxSizer* topSizer = new wxBoxSizer( wxVERTICAL );
+
+ // radio box
+ wxBoxSizer* shapesSizer = new wxBoxSizer( wxHORIZONTAL );
+ const wxString choices[] = { wxT("None"), wxT("Triangle"),
+ wxT("Rectangle"), wxT("Ellipse") };
+
+ m_radio = new wxRadioBox( this, -1, wxT("&Shape"),
+ wxDefaultPosition, wxDefaultSize, 4, choices, 4,
+ wxRA_SPECIFY_COLS );
+ shapesSizer->Add( m_radio, 0, wxGROW|wxALL, 5 );
+ topSizer->Add( shapesSizer, 0, wxALL, 2 );
+
+ // attributes
+ wxStaticBox* box = new wxStaticBox( this, -1, wxT("&Attributes") );
+ wxStaticBoxSizer* attrSizer = new wxStaticBoxSizer( box, wxHORIZONTAL );
+ wxFlexGridSizer* xywhSizer = new wxFlexGridSizer( 4, 2 );
+
+ wxStaticText* st;
+
+ st = new wxStaticText( this, -1, wxT("Position &X:") );
+ m_textX = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition,
+ wxSize( 30, 20 ) );
+ xywhSizer->Add( st, 1, wxGROW|wxALL, 2 );
+ xywhSizer->Add( m_textX, 1, wxGROW|wxALL, 2 );
+
+ st = new wxStaticText( this, -1, wxT("Size &width:") );
+ m_textW = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition,
+ wxSize( 30, 20 ) );
+ xywhSizer->Add( st, 1, wxGROW|wxALL, 2 );
+ xywhSizer->Add( m_textW, 1, wxGROW|wxALL, 2 );
+
+ st = new wxStaticText( this, -1, wxT("&Y:") );
+ m_textY = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition,
+ wxSize( 30, 20 ) );
+ xywhSizer->Add( st, 1, wxALL|wxALIGN_RIGHT, 2 );
+ xywhSizer->Add( m_textY, 1, wxGROW|wxALL, 2 );
+
+ st = new wxStaticText( this, -1, wxT("&height:") );
+ m_textH = new wxTextCtrl( this, -1, wxEmptyString, wxDefaultPosition,
+ wxSize( 30, 20 ) );
+ xywhSizer->Add( st, 1, wxALL|wxALIGN_RIGHT, 2 );
+ xywhSizer->Add( m_textH, 1, wxGROW|wxALL, 2 );
+
+ wxButton* col = new wxButton( this, Button_Colour, wxT("&Colour...") );
+ attrSizer->Add( xywhSizer, 1, wxGROW );
+ attrSizer->Add( col, 0, wxALL|wxALIGN_CENTRE_VERTICAL, 2 );
+ topSizer->Add( attrSizer, 0, wxGROW|wxALL, 5 );
+
+ // buttons
+ wxBoxSizer* buttonSizer = new wxBoxSizer( wxHORIZONTAL );
+ wxButton* bt;
+ bt = new wxButton( this, wxID_OK, wxT("Ok") );
+ buttonSizer->Add( bt, 0, wxALL, 2 );
+ bt = new wxButton( this, wxID_CANCEL, wxT("Cancel") );
+ buttonSizer->Add( bt, 0, wxALL, 2 );
+ topSizer->Add( buttonSizer, 0, wxALL|wxALIGN_RIGHT, 2 );
+
+ SetAutoLayout( TRUE );
+ SetSizer( topSizer );
+ topSizer->Fit( this );
+#endif
}
DnDShape *DnDShapeDialog::GetShape() const
{
m_shapeKind = (DnDShape::Kind)m_radio->GetSelection();
- m_pos.x = atoi(m_textX->GetValue());
- m_pos.y = atoi(m_textY->GetValue());
- m_size.x = atoi(m_textW->GetValue());
- m_size.y = atoi(m_textH->GetValue());
+ m_pos.x = wxAtoi(m_textX->GetValue());
+ m_pos.y = wxAtoi(m_textY->GetValue());
+ m_size.x = wxAtoi(m_textW->GetValue());
+ m_size.y = wxAtoi(m_textH->GetValue());
if ( !m_pos.x || !m_pos.y || !m_size.x || !m_size.y )
{
{
default:
case wxDragError:
- wxLogError("An error occured during drag and drop operation");
+ wxLogError(wxT("An error occured during drag and drop operation"));
break;
case wxDragNone:
wxPoint pt(x, y);
wxString s;
- s.Printf("Shape dropped at (%ld, %ld)", pt.x, pt.y);
+ s.Printf(wxT("Shape dropped at (%ld, %ld)"), pt.x, pt.y);
SetStatusText(s);
shape->Move(pt);
wxClipboardLocker clipLocker;
if ( !clipLocker )
{
- wxLogError("Can't open the clipboard");
+ wxLogError(wxT("Can't open the clipboard"));
return;
}
wxClipboardLocker clipLocker;
if ( !clipLocker )
{
- wxLogError("Can't open the clipboard");
+ wxLogError(wxT("Can't open the clipboard"));
return;
}
}
else
{
- wxLogStatus("No shape on the clipboard");
+ wxLogStatus(wxT("No shape on the clipboard"));
}
}
wxColour(dump.r, dump.g, dump.b));
default:
- wxFAIL_MSG("invalid shape!");
+ wxFAIL_MSG(wxT("invalid shape!"));
return NULL;
}
}
for (i = 1; i < 4; i++)
{
wxString filename;
- filename.Printf("%s%d.png", (const char*) rootName, i);
+ filename.Printf(wxT("%s%d.png"), (const wxChar*)rootName, i);
if (image.LoadFile(filename, wxBITMAP_TYPE_PNG))
{
DragShape* newShape = new DragShape(image.ConvertToBitmap());
if ( !LoadImages() )
{
- wxLogError("Can't load one of the bitmap files needed for this sample "
- "from the current or parent directory, please copy them "
- "there.");
+ wxLogError(wxT("Can't load one of the bitmap files needed ")
+ wxT("for this sample from the current or parent ")
+ wxT("directory, please copy them there."));
// stop here
DeleteBitmaps();
{
dc.SetPen( wxPen( "black", width, wxSOLID) );
dc.SetBrush( *wxRED_BRUSH );
- dc.DrawText(wxString::Format("Testing lines of width %d", width), x + 10, y - 10);
+ 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);
for ( int n = -180; n < 180; n += 30 )
{
- text.Printf(" %d rotated text", n);
+ text.Printf(wxT(" %d rotated text"), n);
dc.DrawRotatedText(text , 400, 400, n);
}
long height;
long descent;
dc.GetTextExtent( "This is Swiss 18pt text.", &length, &height, &descent );
- text.Printf( "Dimensions are length %ld, height %ld, descent %ld", length, height, descent );
+ text.Printf( wxT("Dimensions are length %ld, height %ld, descent %ld"), length, height, descent );
dc.DrawText( text, 110, 80 );
- text.Printf( "CharHeight() returns: %d", dc.GetCharHeight() );
+ text.Printf( wxT("CharHeight() returns: %d"), dc.GetCharHeight() );
dc.DrawText( text, 110, 120 );
dc.DrawRectangle( 100, 40, 4, height );
int rop;
} rasterOperations[] =
{
- { "wxAND", wxAND },
- { "wxAND_INVERT", wxAND_INVERT },
- { "wxAND_REVERSE", wxAND_REVERSE },
- { "wxCLEAR", wxCLEAR },
- { "wxCOPY", wxCOPY },
- { "wxEQUIV", wxEQUIV },
- { "wxINVERT", wxINVERT },
- { "wxNAND", wxNAND },
- { "wxNO_OP", wxNO_OP },
- { "wxOR", wxOR },
- { "wxOR_INVERT", wxOR_INVERT },
- { "wxOR_REVERSE", wxOR_REVERSE },
- { "wxSET", wxSET },
- { "wxSRC_INVERT", wxSRC_INVERT },
- { "wxXOR", wxXOR },
+ { wxT("wxAND"), wxAND },
+ { wxT("wxAND_INVERT"), wxAND_INVERT },
+ { wxT("wxAND_REVERSE"), wxAND_REVERSE },
+ { wxT("wxCLEAR"), wxCLEAR },
+ { wxT("wxCOPY"), wxCOPY },
+ { wxT("wxEQUIV"), wxEQUIV },
+ { wxT("wxINVERT"), wxINVERT },
+ { wxT("wxNAND"), wxNAND },
+ { wxT("wxNO_OP"), wxNO_OP },
+ { wxT("wxOR"), wxOR },
+ { wxT("wxOR_INVERT"), wxOR_INVERT },
+ { wxT("wxOR_REVERSE"), wxOR_REVERSE },
+ { wxT("wxSET"), wxSET },
+ { wxT("wxSRC_INVERT"), wxSRC_INVERT },
+ { wxT("wxXOR"), wxXOR },
};
void MyCanvas::DrawImages(wxDC& dc)
long x = dc.DeviceToLogicalX( pos.x );
long y = dc.DeviceToLogicalY( pos.y );
wxString str;
- str.Printf( "Current mouse position: %d,%d", (int)x, (int)y );
+ str.Printf( wxT("Current mouse position: %d,%d"), (int)x, (int)y );
m_owner->SetStatusText( str );
}
const wxString& encoding)
{
wxString text;
- text.Printf("Encoding %d: %s (available in facename '%s')\n",
+ text.Printf(wxT("Encoding %d: %s (available in facename '%s')\n"),
++m_n, encoding.c_str(), facename.c_str());
m_text += text;
return TRUE;
fontEnumerator.EnumerateEncodings();
- wxLogMessage("Enumerating all available encodings:\n%s",
+ wxLogMessage(wxT("Enumerating all available encodings:\n%s"),
fontEnumerator.GetText().c_str());
}
int nFacenames = fontEnumerator.GetFacenames().GetCount();
if ( !silent )
{
- wxLogStatus(this, "Found %d %sfonts",
- nFacenames, fixedWidthOnly ? "fixed width " : "");
+ wxLogStatus(this, wxT("Found %d %sfonts"),
+ nFacenames, fixedWidthOnly ? wxT("fixed width ") : wxT(""));
}
wxString facename;
}
else if ( !silent )
{
- wxLogWarning("No such fonts found.");
+ wxLogWarning(wxT("No such fonts found."));
}
return FALSE;
if ( fontInfo.IsEmpty() )
{
- wxLogError("Native font info string is empty!");
+ wxLogError(wxT("Native font info string is empty!"));
}
else
{
wxFont *font = wxFont::New(fontInfo);
if ( fontInfo != font->GetNativeFontInfoDesc() )
- wxLogError("wxNativeFontInfo ToString()/FromString() broken!");
+ wxLogError(wxT("wxNativeFontInfo ToString()/FromString() broken!"));
else
- wxLogError("wxNativeFontInfo works: %s", fontInfo.c_str());
+ wxLogError(wxT("wxNativeFontInfo works: %s"), fontInfo.c_str());
delete font;
}
}
if ( line.Left(len) == prefix )
{
// found!
- const char *pc = line.c_str() + len;
+ const wxChar *pc = line.c_str() + len;
if ( *pc == '"' )
pc++;
if ( !charset )
{
- wxLogError("The file '%s' doesn't contain charset information.",
+ wxLogError(wxT("The file '%s' doesn't contain charset information."),
filename.c_str());
return;
wxFontEncoding fontenc = wxTheFontMapper->CharsetToEncoding(charset);
if ( fontenc == wxFONTENCODING_SYSTEM )
{
- wxLogError("Charset '%s' is unsupported.", charset.c_str());
+ wxLogError(wxT("Charset '%s' is unsupported."), charset.c_str());
return;
}
}
else
{
- wxLogWarning("Cannot convert from '%s' to '%s'.",
+ wxLogWarning(wxT("Cannot convert from '%s' to '%s'."),
wxFontMapper::GetEncodingDescription(fontenc).c_str(),
wxFontMapper::GetEncodingDescription(encAlt).c_str());
}
}
else
- wxLogWarning("No fonts for encoding '%s' on this system.",
+ wxLogWarning(wxT("No fonts for encoding '%s' on this system."),
wxFontMapper::GetEncodingDescription(fontenc).c_str());
}
}
else
{
- wxLogWarning("No fonts for encoding '%s' on this system.",
+ wxLogWarning(wxT("No fonts for encoding '%s' on this system."),
wxFontMapper::GetEncodingDescription(fontenc).c_str());
}
}
// output the font name/info
wxString fontInfo;
- fontInfo.Printf("Font size is %d points, family is %s, style %s, weight %s",
+ fontInfo.Printf(wxT("Font size is %d points, family is %s, style %s, weight %s"),
m_font.GetPointSize(),
m_font.GetFamilyString().c_str(),
m_font.GetStyleString().c_str(),
{
wxString fontDesc = m_font.GetNativeFontInfoDesc();
dc.SetFont(m_font);
- fontInfo.Printf("Native font info: %s", fontDesc.c_str());
+ fontInfo.Printf(wxT("Native font info: %s"), fontDesc.c_str());
dc.DrawText(fontInfo, 5, 5 + dc.GetCharHeight());
}
{
for ( int j = 0; j < 32; j++ )
{
- dc.DrawText(char(32*i + j), x + w*j, y + h*i);
+ dc.DrawText(wxChar(32*i + j), x + w*j, y + h*i);
}
}
top_builddir = ../..
program_dir = samples/help
-PROGRAM=help
+PROGRAM=demo
OBJECTS =demo.o
DEPFILES=demo.d
// using HTML help
if ( !frame->GetHelpController().Initialize("doc") )
{
- wxLogError("Cannot initialize the help system, aborting.");
+ wxLogError(wxT("Cannot initialize the help system, aborting."));
return FALSE;
}
#if wxUSE_MS_HTML_HELP
if( !frame->GetMSHtmlHelpController().Initialize("doc") )
{
- wxLogError("Cannot initialize the MS HTML Help system.");
+ wxLogError(wxT("Cannot initialize the MS HTML Help system."));
}
#endif
// you need to call Initialize in order to use wxBestHelpController
if( !frame->GetBestHelpController().Initialize("doc") )
{
- wxLogError("Cannot initialize the best help system, aborting.");
+ wxLogError(wxT("Cannot initialize the best help system, aborting."));
}
#endif
#if USE_OLD_HTML_HELP
if ( !frame->GetHtmlHelpController().Initialize("doc") )
{
- wxLogError("Cannot initialize the HTML help system, aborting.");
+ wxLogError(wxT("Cannot initialize the HTML help system, aborting."));
return FALSE;
}
// (zipped) form
if ( !frame->GetAdvancedHtmlHelpController().Initialize("doc") )
{
- wxLogError("Cannot initialize the advanced HTML help system, aborting.");
+ wxLogError(wxT("Cannot initialize the advanced HTML help system, aborting."));
return FALSE;
}
void MyFrame::OnBestHelp(wxCommandEvent& event)
{
-#if wxUSE_MS_HTML_HELP && wxUSE_HTML
+#if wxUSE_MS_HTML_HELP && wxUSE_WXHTML_HELP
ShowHelp(event.GetId(), m_bestHelp);
#endif
}
wxTextCtrl *text = new wxTextCtrl(this, -1, wxT("A demo text control"),
wxDefaultPosition, wxSize(300, 100),
wxTE_MULTILINE);
- text->SetHelpText(_("Type text here if you have got nothing more "
- "interesting to do"));
+ text->SetHelpText(_("Type text here if you have got nothing more interesting to do"));
sizerTop->Add(text, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sizerTop->Add(sizerRow, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
WXDIR = $(WXWIN)
PROGRAM=demo
-EXTRALIBS=htmlhelp.lib
+# EXTRALIBS=htmlhelp.lib
OBJECTS = $(PROGRAM).obj
!include $(WXDIR)\src\makeprog.vc
all:
cd $(WXDIR)\samples\html\about
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\help
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\helpview
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\printing
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\test
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\virtual
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\widget
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
cd $(WXDIR)\samples\html\zip
- nmake -f makefile.vc FINAL=$(FINAL)
+ nmake -f makefile.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
clean:
cd $(WXDIR)\samples\html\about
help = new wxHtmlHelpController;
if (argc < 2) {
- wxLogError("Usage : helpview <helpfile> [<more helpfiles>]");
- wxLogError(" helpfile may be .hhp, .zip or .htb");
+ wxLogError(wxT("Usage : helpview <helpfile> [<more helpfiles>]"));
+ wxLogError(wxT(" helpfile may be .hhp, .zip or .htb"));
return FALSE;
}
void MyFrame::OnPageOpen(wxCommandEvent& WXUNUSED(event))
{
- wxString p = wxFileSelector("Open HTML document", "", "", "", "HTML files|*.htm");
+ wxString p = wxFileSelector(wxT("Open HTML document"), wxT(""), wxT(""), wxT(""), wxT("HTML files|*.htm"));
if (p != wxEmptyString)
m_Html -> LoadPage(p);
}
int ax, ay;
int fl = 0;
- tag.ScanParam("X", "%i", &ax);
- tag.ScanParam("Y", "%i", &ay);
+ tag.ScanParam(wxT("X"), wxT("%i"), &ax);
+ tag.ScanParam(wxT("Y"), wxT("%i"), &ay);
if (tag.HasParam("FLOAT")) fl = ax;
wnd = new wxTextCtrl( m_WParser -> GetWindow(), -1, tag.GetParam("NAME"),
image.SetOption(wxBMP_FORMAT, bppvalues[bppselection]);
wxString deffilename = bppchoices[bppselection];
- deffilename.Replace(" ", "_");
- deffilename += ".bmp";
- wxString savefilename = wxFileSelector( "Save Image",
- "",
+ deffilename.Replace(wxT(" "), wxT("_"));
+ deffilename += wxT(".bmp");
+ wxString savefilename = wxFileSelector( wxT("Save Image"),
+ wxT(""),
deffilename,
- (const char *)NULL,
- "BMP files (*.bmp)|*.bmp|"
- "PNG files (*.png)|*.png|"
- "JPEG files (*.jpg)|*.jpg|"
- "GIF files (*.gif)|*.gif|"
- "TIFF files (*.tif)|*.tif|"
- "PCX files (*.pcx)|*.pcx",
+ (const wxChar *)NULL,
+ wxT("BMP files (*.bmp)|*.bmp|")
+ wxT("PNG files (*.png)|*.png|")
+ wxT("JPEG files (*.jpg)|*.jpg|")
+ wxT("GIF files (*.gif)|*.gif|")
+ wxT("TIFF files (*.tif)|*.tif|")
+ wxT("PCX files (*.pcx)|*.pcx"),
wxSAVE);
if ( savefilename.empty() )
// try to find the directory with our images
wxString dir;
- if ( wxFile::Exists("./horse.png") )
+ if ( wxFile::Exists(wxT("./horse.png")) )
dir = "./";
- else if ( wxFile::Exists("../horse.png") )
+ else if ( wxFile::Exists(wxT("../horse.png")) )
dir = "../";
else
- wxLogWarning("Can't find image files in either '.' or '..'!");
+ wxLogWarning(wxT("Can't find image files in either '.' or '..'!"));
wxImage image = bitmap.ConvertToImage();
#if wxUSE_LIBPNG
if ( !image.SaveFile( dir + wxString("test.png"), wxBITMAP_TYPE_PNG ))
- wxLogError("Can't save file");
+ wxLogError(wxT("Can't save file"));
image.Destroy();
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.png")) )
- wxLogError("Can't load PNG image");
+ wxLogError(wxT("Can't load PNG image"));
else
my_horse_png = new wxBitmap( image );
#endif // wxUSE_LIBPNG
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.jpg")) )
- wxLogError("Can't load JPG image");
+ wxLogError(wxT("Can't load JPG image"));
else
my_horse_jpeg = new wxBitmap( image );
#endif // wxUSE_LIBJPEG
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.gif")) )
- wxLogError("Can't load GIF image");
+ wxLogError(wxT("Can't load GIF image"));
else
my_horse_gif = new wxBitmap( image );
#endif
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.pcx"), wxBITMAP_TYPE_PCX ) )
- wxLogError("Can't load PCX image");
+ wxLogError(wxT("Can't load PCX image"));
else
my_horse_pcx = new wxBitmap( image );
#endif
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.bmp"), wxBITMAP_TYPE_BMP ) )
- wxLogError("Can't load BMP image");
+ wxLogError(wxT("Can't load BMP image"));
else
my_horse_bmp = new wxBitmap( image );
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.xpm"), wxBITMAP_TYPE_XPM ) )
- wxLogError("Can't load XPM image");
+ wxLogError(wxT("Can't load XPM image"));
else
my_horse_xpm = new wxBitmap( image );
if ( !image.SaveFile( dir + wxString("test.xpm"), wxBITMAP_TYPE_XPM ))
- wxLogError("Can't save file");
+ wxLogError(wxT("Can't save file"));
#endif
#if wxUSE_PNM
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.pnm"), wxBITMAP_TYPE_PNM ) )
- wxLogError("Can't load PNM image");
+ wxLogError(wxT("Can't load PNM image"));
else
my_horse_pnm = new wxBitmap( image );
#endif
image.Destroy();
if ( !image.LoadFile( dir + wxString("horse.tif"), wxBITMAP_TYPE_TIF ) )
- wxLogError("Can't load TIFF image");
+ wxLogError(wxT("Can't load TIFF image"));
else
my_horse_tiff = new wxBitmap( image );
#endif
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,
wxLocale& m_locale);
public:
/* not needed any more, done in wxLocale ctor
m_locale.AddCatalog("wxstd"); // 1) for library messages
*/
- m_locale.AddCatalog("internat"); // 2) our private one
+ m_locale.AddCatalog(wxT("internat")); // 2) our private one
/* this catalog is installed in standard location on Linux systems,
it might not be installed on yours - just ignore the errrors
or comment out this line then */
}
// My frame constructor
-MyFrame::MyFrame(wxFrame *frame, const char *title, int x, int y, int w, int h,
- wxLocale& l)
+MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y,
+ int w, int h, wxLocale& l)
: wxFrame(frame, -1, title, wxPoint(x, y), wxSize(w, h)),
m_locale(l)
{
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
wxString localeInfo;
- localeInfo.Printf(_("Language: %s\n"
- "System locale name: %s\n"
- "Canonical locale name: %s\n"),
+ localeInfo.Printf(_("Language: %s\nSystem locale name: %s\nCanonical locale name: %s\n"),
m_locale.GetLocale(),
m_locale.GetSysName().c_str(),
m_locale.GetCanonicalName().c_str());
- wxMessageDialog(this, wxString(_("I18n sample\n"
- "(c) 1998, 1999 Vadim Zeitlin and Julian Smart"))
+ wxMessageDialog(this, wxString(_("I18n sample\n(c) 1998, 1999 Vadim Zeitlin and Julian Smart"))
+ wxT("\n\n") + localeInfo,
_("About Internat"), wxOK | wxICON_INFORMATION).ShowModal();
}
return;
int num;
- sscanf(str, "%d", &num);
+ wxSscanf(str, wxT("%d"), &num);
if ( num == 0 )
str = _("You've probably entered an invalid number.");
else if ( num == 9 ) // this message is not translated (not in catalog)
str = "You've found a bug in this program!";
else if ( num != 17 ) // a more implicit way to write _()
- str = wxGetTranslation("Bad luck! try again...");
+ str = wxGetTranslation(wxT("Bad luck! try again..."));
else {
str.Empty();
// string must be split in two -- otherwise the translation won't be found
{
// open a bogus file -- the error message should be also translated if you've
// got wxstd.mo somewhere in the search path
- wxFile file("NOTEXIST.ING");
+ wxFile file(wxT("NOTEXIST.ING"));
}
// to be the width of the MDI canvas border)
wxPoint pos1 = event.GetPosition(),
pos2 = GetPosition();
- wxLogStatus("position from event: (%d, %d), from frame (%d, %d)",
+ wxLogStatus(wxT("position from event: (%d, %d), from frame (%d, %d)"),
pos1.x, pos1.y, pos2.x, pos2.y);
event.Skip();
wxSize size1 = event.GetSize(),
size2 = GetSize(),
size3 = GetClientSize();
- wxLogStatus("size from event: %dx%d, from frame %dx%d, client %dx%d",
+ wxLogStatus(wxT("size from event: %dx%d, from frame %dx%d, client %dx%d"),
size1.x, size1.y, size2.x, size2.y, size3.x, size3.y);
event.Skip();
if ( title )
{
- title->Printf("Dummy menu &%d", ++m_countDummy);
+ title->Printf(wxT("Dummy menu &%d"), ++m_countDummy);
}
return menu;
wxMenuItemList::Node *node = menu->GetMenuItems().GetLast();
if ( !node )
{
- wxLogWarning("No last item in the last menu!");
+ wxLogWarning(wxT("No last item in the last menu!"));
return NULL;
}
if ( !GetMenuBar()->FindItem(id) )
return;
- wxString msg = wxString::Format("Menu command %d", id);
+ wxString msg = wxString::Format(wxT("Menu command %d"), id);
if ( GetMenuBar()->FindItem(id)->IsCheckable() )
{
- msg += wxString::Format(" (the item is currently %schecked)",
+ msg += wxString::Format(wxT(" (the item is currently %schecked)"),
event.IsChecked() ? "" : "not ");
}
if ( count == 2 )
{
// don't let delete the first 2 menus
- wxLogError("Can't delete any more menus");
+ wxLogError(wxT("Can't delete any more menus"));
}
else
{
wxMenuBar *mbar = GetMenuBar();
size_t count = mbar->GetMenuCount();
- wxLogMessage("The label of the last menu item is '%s'",
+ wxLogMessage(wxT("The label of the last menu item is '%s'"),
mbar->GetLabelTop(count - 1).c_str());
}
void MyFrame::OnDummy(wxCommandEvent& event)
{
- wxLogMessage("Dummy item #%d", event.GetId() - Menu_Dummy_First + 1);
+ wxLogMessage(wxT("Dummy item #%d"), event.GetId() - Menu_Dummy_First + 1);
}
void MyFrame::OnAppendMenuItem(wxCommandEvent& WXUNUSED(event))
size_t count = menu->GetMenuItemCount();
if ( !count )
{
- wxLogWarning("No items to delete!");
+ wxLogWarning(wxT("No items to delete!"));
}
else
{
if ( item )
{
- wxLogMessage("The label of the last menu item is '%s'",
+ wxLogMessage(wxT("The label of the last menu item is '%s'"),
item->GetLabel().c_str());
}
}
if ( ev.ShiftDown() ) logBuf << " (shift down)";
if ( ev.ControlDown() ) logBuf << " (control down)";
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
// you must call event skip if you want default grid processing
//
logBuf = "";
logBuf << "Left click at row " << ev.GetRow()
<< " col " << ev.GetCol();
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
// you must call event skip if you want default grid processing
// (cell highlighting etc.)
{
logBuf = "";
logBuf << "Resized row " << ev.GetRowOrCol();
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
ev.Skip();
}
{
logBuf = "";
logBuf << "Resized col " << ev.GetRowOrCol();
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
ev.Skip();
}
<< ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F')
<< ", AltDown: "<< (ev.AltDown() ? 'T':'F')
<< ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )";
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
// you must call Skip() if you want the default processing
// to occur in wxGrid
<< ", ShiftDown: "<< (ev.ShiftDown() ? 'T':'F')
<< ", AltDown: "<< (ev.AltDown() ? 'T':'F')
<< ", MetaDown: "<< (ev.MetaDown() ? 'T':'F') << " )";
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
ev.Skip();
}
<< " row " << ev.GetRow()
<< " col " << ev.GetCol();
- wxLogMessage( "%s", logBuf.c_str() );
+ wxLogMessage( wxT("%s"), logBuf.c_str() );
ev.Skip();
}
void GridFrame::OnEditorShown( wxGridEvent& ev )
{
- wxLogMessage( "Cell editor shown." );
+ wxLogMessage( wxT("Cell editor shown.") );
ev.Skip();
}
void GridFrame::OnEditorHidden( wxGridEvent& ev )
{
- wxLogMessage( "Cell editor hidden." );
+ wxLogMessage( wxT("Cell editor hidden.") );
ev.Skip();
}
int GetNumberCols() { return m_sizeGrid; }
wxString GetValue( int row, int col )
{
- return wxString::Format("(%d, %d)", row, col);
+ return wxString::Format(wxT("(%d, %d)"), row, col);
}
void SetValue( int , int , const wxString& ) { /* ignore */ }
{
wxString strSelection;
unsigned int nSel = event.GetSelection();
- strSelection.sprintf("item %d selected (%schecked)", nSel,
- m_pListBox->IsChecked(nSel) ? "" : "not ");
+ strSelection.sprintf(wxT("item %d selected (%schecked)"), nSel,
+ m_pListBox->IsChecked(nSel) ? wxT("") : wxT("not "));
SetStatusText(strSelection);
}
void OwnerDrawnFrame::OnListboxDblClick(wxCommandEvent& event)
{
wxString strSelection;
- strSelection.sprintf("item %d double clicked", m_pListBox->GetSelection());
+ strSelection.sprintf(wxT("item %d double clicked"),
+ m_pListBox->GetSelection());
wxMessageDialog dialog(this, strSelection);
dialog.ShowModal();
}
{
wxString strSelection;
unsigned int nItem = event.GetInt();
- strSelection.sprintf("item %d was %schecked", nItem,
- m_pListBox->IsChecked(nItem) ? "" : "un");
+ strSelection.sprintf(wxT("item %d was %schecked"), nItem,
+ m_pListBox->IsChecked(nItem) ? wxT("") : wxT("un"));
SetStatusText(strSelection);
}
void MyFrame::OnSaveFile(wxCommandEvent& WXUNUSED(event))
{
- wxString f = wxFileSelector( "Save Image", (const char *)NULL, (const char *)NULL,
- "png", "PNG files (*.png)|*.png" );
+ wxString f = wxFileSelector( wxT("Save Image"), (const wxChar *)NULL,
+ (const wxChar *)NULL,
+ wxT("png"), wxT("PNG files (*.png)|*.png") );
if (f == "") return;
void MyFrame::OnLoadFile(wxCommandEvent& WXUNUSED(event))
{
// Show file selector.
- wxString f = wxFileSelector("Open Image", (const char *) NULL, (const char *) NULL,"png",
- "PNG files (*.png)|*.png");
+ wxString f = wxFileSelector(wxT("Open Image"), (const wxChar *) NULL,
+ (const wxChar *) NULL, wxT("png"),
+ wxT("PNG files (*.png)|*.png"));
if (f == "")
return;
sheet->AddProperty(new wxProperty("bill", 25.0, "real", new wxRealListValidator(0.0, 100.0)));
sheet->AddProperty(new wxProperty("julian", "one", "string"));
sheet->AddProperty(new wxProperty("bitmap", "none", "string", new wxFilenameListValidator("Select a bitmap file", "*.bmp")));
- wxStringList *strings = new wxStringList("one", "two", "three", NULL);
+ wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringListValidator(strings)));
- wxStringList *strings2 = new wxStringList("earth", "fire", "wind", "water", NULL);
+ wxStringList *strings2 = new wxStringList(wxT("earth"), wxT("fire"), wxT("wind"), wxT("water"), NULL);
sheet->AddProperty(new wxProperty("string list", strings2, "stringlist"));
wxPropertyListView *view =
sheet->AddProperty(new wxProperty("tough choice", (bool)TRUE, "bool"));
sheet->AddProperty(new wxProperty("ian", (long)45, "integer", new wxIntegerFormValidator(-50, 50)));
sheet->AddProperty(new wxProperty("julian", "one", "string"));
- wxStringList *strings = new wxStringList("one", "two", "three", NULL);
+ wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL);
sheet->AddProperty(new wxProperty("constrained", "one", "string", new wxStringFormValidator(strings)));
wxPropertyFormView *view = new wxPropertyFormView(NULL);
if ( !m_image.Ok() )
{
- wxLogError("Can't load the test image, please copy it to the "
- "program directory");
+ wxLogError(wxT("Can't load the test image, please copy it to the ")
+ wxT("program directory"));
return FALSE;
}
wxPoint pt( event.GetPosition() );
int x,y;
CalcUnscrolledPosition( pt.x, pt.y, &x, &y );
- wxLogMessage( "Mouse down event at: %d %d, scrolled: %d %d", pt.x, pt.y, x, y );
+ wxLogMessage( wxT("Mouse down event at: %d %d, scrolled: %d %d"), pt.x, pt.y, x, y );
if ( !event.LeftIsDown() )
- wxLogMessage( "Error: LeftIsDown() should be TRUE if for LeftDown()" );
+ wxLogMessage( wxT("Error: LeftIsDown() should be TRUE if for LeftDown()") );
}
}
void MyCanvas::OnQueryPosition( wxCommandEvent &WXUNUSED(event) )
{
wxPoint pt( m_button->GetPosition() );
- wxLogMessage( "Position of ""Query position"" is %d %d", pt.x, pt.y );
+ wxLogMessage( wxT("Position of \"Query position\" is %d %d"), pt.x, pt.y );
pt = ClientToScreen( pt );
- wxLogMessage( "Position of ""Query position"" on screen is %d %d", pt.x, pt.y );
+ wxLogMessage( wxT("Position of \"Query position\" on screen is %d %d"), pt.x, pt.y );
}
void MyCanvas::OnAddButton( wxCommandEvent &WXUNUSED(event) )
{
- wxLogMessage( "Inserting button at position 10,70..." );
+ wxLogMessage( wxT("Inserting button at position 10,70...") );
wxButton *button = new wxButton( this, ID_NEWBUTTON, "new button", wxPoint(10,70), wxSize(80,25) );
wxPoint pt( button->GetPosition() );
- wxLogMessage( "-> Position after inserting %d %d", pt.x, pt.y );
+ wxLogMessage( wxT("-> Position after inserting %d %d"), pt.x, pt.y );
}
void MyCanvas::OnDeleteButton( wxCommandEvent &event )
{
- wxLogMessage( "Deleting button inserted with ""Add button""..." );
+ wxLogMessage( wxT("Deleting button inserted with \"Add button\"...") );
wxWindow *win = FindWindow( ID_NEWBUTTON );
if (win)
win->Destroy();
else
- wxLogMessage( "-> No window with id = ID_NEWBUTTON found." );
+ wxLogMessage( wxT("-> No window with id = ID_NEWBUTTON found.") );
}
void MyCanvas::OnMoveButton( wxCommandEvent &event )
{
- wxLogMessage( "Moving button 10 pixels downward.." );
+ wxLogMessage( wxT("Moving button 10 pixels downward..") );
wxWindow *win = FindWindow( event.GetId() );
wxPoint pt( win->GetPosition() );
- wxLogMessage( "-> Position before move is %d %d", pt.x, pt.y );
+ wxLogMessage( wxT("-> Position before move is %d %d"), pt.x, pt.y );
win->Move( -1, pt.y + 10 );
pt = win->GetPosition();
- wxLogMessage( "-> Position after move is %d %d", pt.x, pt.y );
+ wxLogMessage( wxT("-> Position after move is %d %d"), pt.x, pt.y );
}
void MyCanvas::OnScrollWin( wxCommandEvent &WXUNUSED(event) )
{
- wxLogMessage( "Scrolling 2 units up.\nThe white square and the controls should move equally!" );
+ wxLogMessage( wxT("Scrolling 2 units up.\nThe white square and the controls should move equally!") );
int x,y;
GetViewStart( &x, &y );
Scroll( -1, y+2 );
// Has the region on screen been exposed?
if (IsExposed(0,0,100,25))
{
- wxLogMessage( "Redraw first cell" );
+ wxLogMessage( wxT("Redraw first cell") );
dc.DrawRectangle( 0, 0, 100, 25 );
dc.DrawText( "First Cell", 5, 5 );
}
// Has the region on screen been exposed?
if (IsExposed(200,0,100,25))
{
- wxLogMessage( "Redraw second cell" );
+ wxLogMessage( wxT("Redraw second cell") );
dc.DrawRectangle( 200, 0, 100, 25 );
dc.DrawText( "Second Cell", 205, 5 );
}
all: client@PROGRAM_EXT@ server@PROGRAM_EXT@
-client@PROGRAM_EXT@: client.o ../../lib/@WX_TARGET_LIBRARY@
- $(CC) $(LDFLAGS) -o client@PROGRAM_EXT@ client.o $(LDLIBS)
+sockets_resources.o: sockets.rc
+ $(RESCOMP) $(RCINPUTSWITCH) $< $(RCOUTPUTSWITCH) $@ $(RESFLAGS)
+
+client@PROGRAM_EXT@: client.o ../../lib/@WX_TARGET_LIBRARY@ sockets_resources.o
+ $(CC) $(LDFLAGS) -o client@PROGRAM_EXT@ sockets_resources.o client.o $(LDLIBS)
server@PROGRAM_EXT@: server.o ../../lib/@WX_TARGET_LIBRARY@
- $(CC) $(LDFLAGS) -o server@PROGRAM_EXT@ server.o $(LDLIBS)
+ $(CC) $(LDFLAGS) -o server@PROGRAM_EXT@ sockets_resources.o server.o $(LDLIBS)
clean:
- rm -f client@PROGRAM_EXT@ server@PROGRAM_EXT@ client.o server.o core
+ rm -f client@PROGRAM_EXT@ server@PROGRAM_EXT@ sockets_resources.o client.o server.o core
// Make a textctrl for logging
m_text = new wxTextCtrl(this, -1,
- _("Welcome to wxSocket demo: Client\n"
- "Client ready\n"),
+ _("Welcome to wxSocket demo: Client\nClient ready\n"),
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY);
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_("wxSocket demo: Client\n"
- "(c) 1999 Guillermo Rodriguez Garcia\n"),
+ wxMessageBox(_("wxSocket demo: Client\n(c) 1999 Guillermo Rodriguez Garcia\n"),
_("About Client"),
wxOK | wxICON_INFORMATION, this);
}
void MyFrame::OnTest1(wxCommandEvent& WXUNUSED(event))
{
- const char *buf1;
- char *buf2;
+ const wxChar *buf1;
+ wxChar *buf2;
unsigned char len;
// Disable socket menu entries (exception: Close Session)
m_sock->SetFlags(wxSOCKET_WAITALL);
buf1 = _("Test string (less than 256 chars!)");
- len = wxStrlen(buf1) + 1;
- buf2 = new char[len];
+ len = (wxStrlen(buf1) + 1) * sizeof(wxChar);
+ buf2 = new wxChar[wxStrlen(buf1) + 1];
m_text->AppendText(_("Sending a test buffer to the server ..."));
m_sock->Write(&len, 1);
void MyFrame::OnTest2(wxCommandEvent& WXUNUSED(event))
{
- char *msg1;
- char *msg2;
+ const wxChar *msg1;
+ wxChar *msg2;
size_t len;
// Disable socket menu entries (exception: Close Session)
_("Test 2 ..."),
_("Yes I like wxWindows!"));
- msg1 = (char *)s.c_str();
- len = wxStrlen(msg1) + 1;
- msg2 = new char[len];
+ msg1 = s.c_str();
+ len = (wxStrlen(msg1) + 1) * sizeof(wxChar);
+ msg2 = new wxChar[wxStrlen(msg1) + 1];
m_text->AppendText(_("Sending the string with WriteMsg ..."));
m_sock->WriteMsg(msg1, len);
// Print the contents type and file size
wxString s;
- s.Printf(_("Contents type: %s\n"
- "File size: %i\n"
- "Starting to download...\n"),
+ s.Printf(_("Contents type: %s\nFile size: %i\nStarting to download...\n"),
url.GetProtocol().GetContentType().c_str(),
data->GetSize());
m_text->AppendText(s);
!include $(WXWIN)/src/makevc.env
all:
- nmake -f server.vc FINAL=$(FINAL)
- nmake -f client.vc FINAL=$(FINAL)
+ nmake -f server.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
+ nmake -f client.vc FINAL=$(FINAL) WXUSINGDLL=$(WXUSINGDLL)
clean:
nmake -f server.vc clean
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
{
- wxMessageBox(_("wxSocket demo: Server\n"
- "(c) 1999 Guillermo Rodriguez Garcia\n"),
+ wxMessageBox(_("wxSocket demo: Server\n(c) 1999 Guillermo Rodriguez Garcia\n"),
_("About Server"),
wxOK | wxICON_INFORMATION, this);
}
#define MAX_MSG_SIZE 10000
wxString s;
- char *buf = new char[MAX_MSG_SIZE];
+ wxChar *buf = new wxChar[MAX_MSG_SIZE];
wxUint32 len;
m_text->AppendText(_("Test 2 begins\n"));
// are not affected by them anyway.
// Read the message
- len = sock->ReadMsg(buf, MAX_MSG_SIZE).LastCount();
+ len = sock->ReadMsg(buf, MAX_MSG_SIZE * sizeof(wxChar)).LastCount();
s.Printf(_("Client says: %s\n"), buf);
m_text->AppendText(s);
m_text->AppendText(_("Sending the data back\n"));
void MyFrame::UpdateUIHorizontal(wxUpdateUIEvent& event)
{
- event.Enable( ( (!m_splitter->IsSplit()) || (m_splitter->GetSplitMode() != wxSPLIT_HORIZONTAL) ) );
+ bool foo = ( (!m_splitter->IsSplit()) || (m_splitter->GetSplitMode() != wxSPLIT_HORIZONTAL) );
+ if( !foo )
+ event.Enable( foo );
}
void MyFrame::UpdateUIVertical(wxUpdateUIEvent& event)
sb->SetFieldsCount(nFields, widths);
wxLogStatus(this,
- wxString::Format("Status bar now has %ld fields", nFields));
+ wxString::Format(wxT("Status bar now has %ld fields"),
+ nFields));
}
else
{
- wxLogStatus(this, "Cancelled");
+ wxLogStatus(this, wxT("Cancelled"));
}
}
text->Freeze();
for ( int i = 0; i < 100; i++ )
- text->AppendText(wxString::Format("Line %i\n", i));
+ text->AppendText(wxString::Format(wxT("Line %i\n"), i));
text->SetInsertionPoint(0);
long line, column, pos = GetInsertionPoint();
PositionToXY(pos, &column, &line);
- wxLogMessage( _T("Current position: %ld\n"
- "Current line, column: (%ld, %ld)\n"
- "Number of lines: %ld\n"
- "Current line length: %ld\n"
- "Total text length: %u (%ld)"),
+ wxLogMessage( _T("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"),
pos,
line, column,
GetNumberOfLines(),
{
#if wxUSE_FILE
// verify that the fil length is correct (it wasn't under Win95)
- wxFile file("dummy.txt");
- wxLogStatus(this, _T("Successfully saved file "
- "(text len = %ld, file size = %ld)"),
+ wxFile file(wxT("dummy.txt"));
+ wxLogStatus(this, _T("Successfully saved file (text len = %ld, file size = %ld)"),
m_panel->m_textrich->GetValue().length(),
file.Length());
#endif
{
wxString text;
- text.Printf("Thread 0x%x started (priority = %d).\n",
+ text.Printf(wxT("Thread 0x%x started (priority = %d).\n"),
GetId(), GetPriority());
WriteText(text);
// wxLogMessage(text); -- test wxLog thread safeness
if ( TestDestroy() )
break;
- text.Printf("[%u] Thread 0x%x here.\n", m_count, GetId());
+ text.Printf(wxT("[%u] Thread 0x%x here.\n"), m_count, GetId());
WriteText(text);
// wxSleep() can't be called from non-GUI thread!
wxThread::Sleep(1000);
}
- text.Printf("Thread 0x%x finished.\n", GetId());
+ text.Printf(wxT("Thread 0x%x finished.\n"), GetId());
WriteText(text);
// wxLogMessage(text); -- test wxLog thread safeness
break;
wxString text;
- text.Printf("[%u] Thread 0x%x here!!", m_count, GetId());
+ text.Printf(wxT("[%u] Thread 0x%x here!!"), m_count, GetId());
// create any type of command event here
wxCommandEvent event( wxEVT_COMMAND_MENU_SELECTED, WORKER_EVENT );
if ( thread->Create() != wxTHREAD_NO_ERROR )
{
- wxLogError("Can't create thread!");
+ wxLogError(wxT("Can't create thread!"));
}
wxCriticalSectionLocker enter(wxGetApp().m_critsect);
}
wxString msg;
- msg.Printf("%d new threads created.", count);
+ msg.Printf(wxT("%d new threads created."), count);
SetStatusText(msg, 1);
// ...and then start them
if ( thread->Run() != wxTHREAD_NO_ERROR )
{
- wxLogError("Can't start thread!");
+ wxLogError(wxT("Can't start thread!"));
}
SetStatusText("New thread started.", 1);
// stop the last thread
if ( wxGetApp().m_threads.IsEmpty() )
{
- wxLogError("No thread to stop!");
+ wxLogError(wxT("No thread to stop!"));
wxGetApp().m_critsect.Leave();
}
if ( n == count )
{
- wxLogError("No thread to resume!");
+ wxLogError(wxT("No thread to resume!"));
}
else
{
if ( n < 0 )
{
- wxLogError("No thread to pause!");
+ wxLogError(wxT("No thread to pause!"));
}
else
{
m_nRunning = nRunning;
m_nCount = nCount;
- wxLogStatus(this, "%u threads total, %u running.", nCount, nRunning);
+ wxLogStatus(this, wxT("%u threads total, %u running."), nCount, nRunning);
}
//else: avoid flicker - don't print anything
}
if ( thread->Create() != wxTHREAD_NO_ERROR )
{
- wxLogError("Can't create thread!");
+ wxLogError(wxT("Can't create thread!"));
}
m_dlgProgress = new wxProgressDialog
#endif
// verify that the item is ok and insult the user if it is not
-#define CHECK_ITEM( item ) if ( !item.IsOk() ) { \
- wxMessageBox("Please select some item first!", \
- "Tree sample error", \
- wxOK | wxICON_EXCLAMATION, \
- this); \
- return; \
+#define CHECK_ITEM( item ) if ( !item.IsOk() ) { \
+ wxMessageBox(wxT("Please select some item first!"), \
+ wxT("Tree sample error"), \
+ wxOK | wxICON_EXCLAMATION, \
+ this); \
+ return; \
}
BEGIN_EVENT_TABLE(MyFrame, wxFrame)
bool MyApp::OnInit()
{
// Create the main frame window
- MyFrame *frame = new MyFrame("wxTreeCtrl Test", 50, 50, 450, 600);
+ MyFrame *frame = new MyFrame(wxT("wxTreeCtrl Test"), 50, 50, 450, 600);
// Show the frame
frame->Show(TRUE);
*tree_menu = new wxMenu,
*item_menu = new wxMenu;
- file_menu->Append(TreeTest_About, "&About...");
+ file_menu->Append(TreeTest_About, wxT("&About..."));
file_menu->AppendSeparator();
- file_menu->Append(TreeTest_Quit, "E&xit\tAlt-X");
+ file_menu->Append(TreeTest_Quit, wxT("E&xit\tAlt-X"));
style_menu->Append(TreeTest_TogButtons, "Toggle &normal buttons");
style_menu->Append(TreeTest_TogTwist, "Toggle &twister buttons");
style_menu->Append(TreeTest_TogBorder, "Toggle &item border");
style_menu->Append(TreeTest_TogEdit, "Toggle &edit mode");
#ifndef NO_MULTIPLE_SELECTION
- style_menu->Append(TreeTest_ToggleSel, "Toggle &selection mode");
+ style_menu->Append(TreeTest_ToggleSel, wxT("Toggle &selection mode"));
#endif // NO_MULTIPLE_SELECTION
- style_menu->Append(TreeTest_ToggleImages, "Toggle show ima&ges");
- style_menu->Append(TreeTest_SetImageSize, "Set image si&ze...");
+ style_menu->Append(TreeTest_ToggleImages, wxT("Toggle show ima&ges"));
+ style_menu->Append(TreeTest_SetImageSize, wxT("Set image si&ze..."));
tree_menu->Append(TreeTest_Recreate, "&Recreate the tree");
tree_menu->Append(TreeTest_CollapseAndReset, "C&ollapse and reset");
for ( size_t n = 0; n < count; n++ )
{
- wxLogMessage("\t%s", m_treeCtrl->GetItemText(array.Item(n)).c_str());
+ wxLogMessage(wxT("\t%s"), m_treeCtrl->GetItemText(array.Item(n)).c_str());
}
}
static int s_num = 0;
wxString text;
- text.Printf("Item #%d", ++s_num);
+ text.Printf(wxT("Item #%d"), ++s_num);
m_treeCtrl->AppendItem(m_treeCtrl->GetRootItem(),
text /*,
{
// at depth 1 elements won't have any more children
if ( hasChildren )
- str.Printf("%s child %d", "Folder", n + 1);
+ str.Printf(wxT("%s child %d"), wxT("Folder"), n + 1);
else
- str.Printf("%s child %d.%d", "File", folder, n + 1);
+ str.Printf(wxT("%s child %d.%d"), wxT("File"), folder, n + 1);
// here we pass to AppendItem() normal and selected item images (we
// suppose that selected image follows the normal one in the enum)
// avoid repetition
-#define TREE_EVENT_HANDLER(name) \
-void MyTreeCtrl::name(wxTreeEvent& event) \
-{ \
- wxLogMessage(#name); \
- event.Skip(); \
+#define TREE_EVENT_HANDLER(name) \
+void MyTreeCtrl::name(wxTreeEvent& event) \
+{ \
+ wxLogMessage(wxT(#name)); \
+ event.Skip(); \
}
TREE_EVENT_HANDLER(OnBeginRDrag)
{
m_draggedItem = event.GetItem();
- wxLogMessage("OnBeginDrag: started dragging %s",
+ wxLogMessage(wxT("OnBeginDrag: started dragging %s"),
GetItemText(m_draggedItem).c_str());
event.Allow();
}
else
{
- wxLogMessage("OnBeginDrag: this item can't be dragged.");
+ wxLogMessage(wxT("OnBeginDrag: this item can't be dragged."));
}
}
if ( !itemDst.IsOk() )
{
- wxLogMessage("OnEndDrag: can't drop here.");
+ wxLogMessage(wxT("OnEndDrag: can't drop here."));
return;
}
wxString text = GetItemText(itemSrc);
- wxLogMessage("OnEndDrag: '%s' copied to '%s'.",
+ wxLogMessage(wxT("OnEndDrag: '%s' copied to '%s'."),
text.c_str(), GetItemText(itemDst).c_str());
// just do append here - we could also insert it just before/after the item
void MyTreeCtrl::OnBeginLabelEdit(wxTreeEvent& event)
{
- wxLogMessage("OnBeginLabelEdit");
+ wxLogMessage(wxT("OnBeginLabelEdit"));
// for testing, prevent this item's label editing
wxTreeItemId itemId = event.GetItem();
if ( IsTestItem(itemId) )
{
- wxMessageBox("You can't edit this item.");
+ wxMessageBox(wxT("You can't edit this item."));
event.Veto();
}
void MyTreeCtrl::OnEndLabelEdit(wxTreeEvent& event)
{
- wxLogMessage("OnEndLabelEdit");
+ wxLogMessage(wxT("OnEndLabelEdit"));
// don't allow anything except letters in the labels
if ( !event.GetLabel().IsWord() )
{
- wxMessageBox("The label should contain only letters.");
+ wxMessageBox(wxT("The label should contain only letters."));
event.Veto();
}
void MyTreeCtrl::OnItemCollapsing(wxTreeEvent& event)
{
- wxLogMessage("OnItemCollapsing");
+ wxLogMessage(wxT("OnItemCollapsing"));
// for testing, prevent the user from collapsing the first child folder
wxTreeItemId itemId = event.GetItem();
if ( IsTestItem(itemId) )
{
- wxMessageBox("You can't collapse this item.");
+ wxMessageBox(wxT("You can't collapse this item."));
event.Veto();
}
item->ShowInfo(this);
}
- wxLogMessage("OnItemActivated");
+ wxLogMessage(wxT("OnItemActivated"));
}
void MyTreeCtrl::OnItemRightClick(wxTreeEvent& event)
{
wxTreeItemId id = HitTest(event.GetPosition());
if ( !id )
- wxLogMessage("No item under mouse");
+ wxLogMessage(wxT("No item under mouse"));
else
{
MyTreeItemData *item = (MyTreeItemData *)GetItemData(id);
if ( item )
- wxLogMessage("Item '%s' under mouse", item->GetDesc());
+ wxLogMessage(wxT("Item '%s' under mouse"), item->GetDesc());
}
}
-static inline const char *Bool2String(bool b)
+static inline const wxChar *Bool2String(bool b)
{
- return b ? "" : "not ";
+ return b ? wxT("") : wxT("not ");
}
void MyTreeItemData::ShowInfo(wxTreeCtrl *tree)
{
- wxLogMessage("Item '%s': %sselected, %sexpanded, %sbold,\n"
- "%u children (%u immediately under this item).",
+ wxLogMessage(wxT("Item '%s': %sselected, %sexpanded, %sbold,\n")
+ wxT("%u children (%u immediately under this item)."),
m_desc.c_str(),
Bool2String(tree->IsSelected(GetId())),
Bool2String(tree->IsExpanded(GetId())),
MyTreeItemData(const wxString& desc) : m_desc(desc) { }
void ShowInfo(wxTreeCtrl *tree);
- const char *GetDesc() const { return m_desc.c_str(); }
+ const wxChar *GetDesc() const { return m_desc.c_str(); }
private:
wxString m_desc;
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input.Read( &ch, 1 );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
}
textCtrl.WriteText( "\n\n\n" );
for (ch2 = 0; ch2 < 10; ch2++)
{
file_input2.Read( &ch, 1 );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
}
textCtrl.WriteText( "\n\n\n" );
for (ch2 = 0; ch2 < 10; ch2++)
{
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
}
for (int j = 0; j < 2000; j++)
buf_input3.Read( &ch, 1 );
textCtrl.WriteText( "\n" );
buf_input3.SeekI( 3 );
buf_input3.Read( &ch, 1 );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "\n\n\n" );
}
{
file_input.Read( &ch, 1 );
textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "; stream.LastError() returns: " );
switch (file_input.LastError())
{
file_input.Read( &ch, 1 );
textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "; stream.LastError() returns: " );
switch (file_input.LastError())
{
{
ffile_input.Read( &ch, 1 );
textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "; stream.LastError() returns: " );
switch (ffile_input.LastError())
{
ffile_input.Read( &ch, 1 );
textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "; stream.LastError() returns: " );
switch (ffile_input.LastError())
{
{
buf_input.Read( &ch, 1 );
textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "; stream.LastError() returns: " );
switch (buf_input.LastError())
{
buf_input.Read( &ch, 1 );
textCtrl.WriteText( "Value read: " );
- textCtrl.WriteText( (char)(ch + '0') );
+ textCtrl.WriteText( (wxChar)(ch + '0') );
textCtrl.WriteText( "; stream.LastError() returns: " );
switch (buf_input.LastError())
{
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
}
- msg.Printf( "wxBufferedInputStream.LastRead() returns: %d\n", (int)buf_input.LastRead() );
+ msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
- msg.Printf( "wxBufferedInputStream.TellI() returns: %d\n", (int)buf_input.TellI() );
+ msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
textCtrl.WriteText( "\n\n" );
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
}
- msg.Printf( "wxBufferedInputStream.LastRead() returns: %d\n", (int)buf_input.LastRead() );
+ msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
- msg.Printf( "wxBufferedInputStream.TellI() returns: %d\n", (int)buf_input.TellI() );
+ msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
textCtrl.WriteText( "\n\n" );
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
}
- msg.Printf( "wxBufferedInputStream.LastRead() returns: %d\n", (int)buf_input.LastRead() );
+ msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
- msg.Printf( "wxBufferedInputStream.TellI() returns: %d\n", (int)buf_input.TellI() );
+ msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
textCtrl.WriteText( "\n\n" );
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
}
- msg.Printf( "wxBufferedInputStream.LastRead() returns: %d\n", (int)buf_input.LastRead() );
+ msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
- msg.Printf( "wxBufferedInputStream.TellI() returns: %d\n", (int)buf_input.TellI() );
+ msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
textCtrl.WriteText( "\n\n" );
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
}
- msg.Printf( "wxBufferedInputStream.LastRead() returns: %d\n", (int)buf_input.LastRead() );
+ msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
- msg.Printf( "wxBufferedInputStream.TellI() returns: %d\n", (int)buf_input.TellI() );
+ msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
textCtrl.WriteText( "\n\n" );
case wxSTREAM_WRITE_ERROR: textCtrl.WriteText( "wxSTREAM_WRITE_ERROR\n" ); break;
default: textCtrl.WriteText( "Huh?\n" ); break;
}
- msg.Printf( "wxBufferedInputStream.LastRead() returns: %d\n", (int)buf_input.LastRead() );
+ msg.Printf( wxT("wxBufferedInputStream.LastRead() returns: %d\n"), (int)buf_input.LastRead() );
textCtrl.WriteText( msg );
- msg.Printf( "wxBufferedInputStream.TellI() returns: %d\n", (int)buf_input.TellI() );
+ msg.Printf( wxT("wxBufferedInputStream.TellI() returns: %d\n"), (int)buf_input.TellI() );
textCtrl.WriteText( msg );
textCtrl.WriteText( "\n\n" );
}
wxFileInputStream file_input( wxString("test_wx.dat") );
ch = file_input.Peek();
- str.Printf( "First char peeked: %d\n", (int) ch );
+ str.Printf( wxT("First char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = file_input.GetC();
- str.Printf( "First char read: %d\n", (int) ch );
+ str.Printf( wxT("First char read: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = file_input.Peek();
- str.Printf( "Second char peeked: %d\n", (int) ch );
+ str.Printf( wxT("Second char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = file_input.GetC();
- str.Printf( "Second char read: %d\n", (int) ch );
+ str.Printf( wxT("Second char read: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = file_input.Peek();
- str.Printf( "Third char peeked: %d\n", (int) ch );
+ str.Printf( wxT("Third char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = file_input.GetC();
- str.Printf( "Third char read: %d\n", (int) ch );
+ str.Printf( wxT("Third char read: %d\n"), (int) ch );
textCtrl.WriteText( str );
wxMemoryInputStream input( buf, 10 );
ch = input.Peek();
- str.Printf( "First char peeked: %d\n", (int) ch );
+ str.Printf( wxT("First char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = input.GetC();
- str.Printf( "First char read: %d\n", (int) ch );
+ str.Printf( wxT("First char read: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = input.Peek();
- str.Printf( "Second char peeked: %d\n", (int) ch );
+ str.Printf( wxT("Second char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = input.GetC();
- str.Printf( "Second char read: %d\n", (int) ch );
+ str.Printf( wxT("Second char read: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = input.Peek();
- str.Printf( "Third char peeked: %d\n", (int) ch );
+ str.Printf( wxT("Third char peeked: %d\n"), (int) ch );
textCtrl.WriteText( str );
ch = input.GetC();
- str.Printf( "Third char read: %d\n", (int) ch );
+ str.Printf( wxT("Third char read: %d\n"), (int) ch );
textCtrl.WriteText( str );
}
printf( "\n\nConversion with wxConvLocal:\n" );
wxConvCurrent = &wxConvLocal;
printf( (const char*) str.mbc_str() );
-
+#if defined(__WXGTK__)
printf( "\n\nConversion with wxConvGdk:\n" );
wxConvCurrent = &wxConvGdk;
printf( (const char*) str.mbc_str() );
-
+#endif
printf( "\n\nConversion with wxConvLibc:\n" );
wxConvCurrent = &wxConvLibc;
printf( (const char*) str.mbc_str() );
filetype->GetOpenCommand(&open, params);
textCtrl << "MIME information about extension '" << ext << "'\n"
- << "\tMIME type: " << ( !type ? "unknown"
+ << "\tMIME type: " << ( !type ? wxT("unknown")
: type.c_str() ) << '\n'
- << "\tDescription: " << ( !desc ? "" : desc.c_str() )
+ << "\tDescription: " << ( !desc ? wxT("") : desc.c_str() )
<< '\n'
- << "\tCommand to open: " << ( !open ? "no" : open.c_str() )
+ << "\tCommand to open: " << ( !open ? wxT("no") : open.c_str() )
<< '\n';
delete filetype;
void MyFrame::OnWizardCancel(wxWizardEvent& WXUNUSED(event))
{
- wxLogStatus(this, "The wizard was cancelled.");
+ wxLogStatus(this, wxT("The wizard was cancelled."));
}