All files compile in Unicode mode, but I have only converted things near

points of compiler warnings/errors, they have not been exhaustively
reviewed.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2201 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Ove Kaaven
1999-04-16 14:19:32 +00:00
parent 9aa521548d
commit 87138c520c
17 changed files with 306 additions and 304 deletions

View File

@@ -34,17 +34,17 @@
#include "wx/generic/choicdgg.h" #include "wx/generic/choicdgg.h"
// Split message, using constraints to position controls // Split message, using constraints to position controls
static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer) static void wxSplitMessage2(const wxChar *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
{ {
char *copyMessage = copystring(message); wxChar *copyMessage = copystring(message);
size_t i = 0; size_t i = 0;
size_t len = strlen(copyMessage); size_t len = wxStrlen(copyMessage);
char *currentMessage = copyMessage; wxChar *currentMessage = copyMessage;
// wxWindow *lastWindow = parent; // wxWindow *lastWindow = parent;
while (i < len) { while (i < len) {
while ((i < len) && (copyMessage[i] != '\n')) i++; while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
if (i < len) copyMessage[i] = 0; if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage); wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
@@ -114,7 +114,7 @@ int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, in
// Overloaded for backward compatibility // Overloaded for backward compatibility
int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, int n, int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, int n,
char *choices[], wxWindow *parent, wxChar *choices[], wxWindow *parent,
int x, int y, bool centre, int x, int y, bool centre,
int width, int height ) int width, int height )
{ {
@@ -130,8 +130,8 @@ int wxGetSingleChoiceIndex( const wxString& message, const wxString& caption, in
return ans; return ans;
} }
char *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n, wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
const wxString *choices, char **client_data, wxWindow *parent, const wxString *choices, wxChar **client_data, wxWindow *parent,
int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre), int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
int WXUNUSED(width), int WXUNUSED(height) ) int WXUNUSED(width), int WXUNUSED(height) )
{ {
@@ -145,8 +145,8 @@ char *wxGetSingleChoiceData( const wxString& message, const wxString& caption, i
} }
// Overloaded for backward compatibility // Overloaded for backward compatibility
char *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n, wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
char *choices[], char **client_data, wxWindow *parent, wxChar *choices[], wxChar **client_data, wxWindow *parent,
int x, int y, bool centre, int x, int y, bool centre,
int width, int height ) int width, int height )
{ {
@@ -156,7 +156,7 @@ char *wxGetSingleChoiceData( const wxString& message, const wxString& caption, i
{ {
strings[i] = choices[i]; strings[i] = choices[i];
} }
char *data = wxGetSingleChoiceData(message, caption, n, (const wxString *)strings, client_data, parent, wxChar *data = wxGetSingleChoiceData(message, caption, n, (const wxString *)strings, client_data, parent,
x, y, centre, width, height); x, y, centre, width, height);
delete[] strings; delete[] strings;
return data; return data;
@@ -202,21 +202,21 @@ IMPLEMENT_CLASS(wxSingleChoiceDialog, wxDialog)
#endif #endif
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
int n, const wxString *choices, char **clientData, long style, const wxPoint& pos): int n, const wxString *choices, wxChar **clientData, long style, const wxPoint& pos):
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL) wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL|wxTAB_TRAVERSAL)
{ {
Create(parent, message, caption, n, choices, clientData, style); Create(parent, message, caption, n, choices, clientData, style);
} }
wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption, wxSingleChoiceDialog::wxSingleChoiceDialog(wxWindow *parent, const wxString& message, const wxString& caption,
const wxStringList& choices, char **clientData, long style, const wxPoint& pos): const wxStringList& choices, wxChar **clientData, long style, const wxPoint& pos):
wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL) wxDialog(parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL)
{ {
Create(parent, message, caption, choices, clientData, style); Create(parent, message, caption, choices, clientData, style);
} }
bool wxSingleChoiceDialog::Create(wxWindow *parent, const wxString& message, const wxString& caption, bool wxSingleChoiceDialog::Create(wxWindow *parent, const wxString& message, const wxString& caption,
const wxStringList& choices, char **clientData, long style, const wxPoint& pos) const wxStringList& choices, wxChar **clientData, long style, const wxPoint& pos)
{ {
wxString *strings = new wxString[choices.Number()]; wxString *strings = new wxString[choices.Number()];
int i; int i;
@@ -231,12 +231,12 @@ bool wxSingleChoiceDialog::Create(wxWindow *parent, const wxString& message, con
bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& message, bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& message,
const wxString& WXUNUSED(caption), int n, const wxString& WXUNUSED(caption), int n,
const wxString *choices, char **clientData, long style, const wxString *choices, wxChar **clientData, long style,
const wxPoint& WXUNUSED(pos) ) const wxPoint& WXUNUSED(pos) )
{ {
m_dialogStyle = style; m_dialogStyle = style;
m_selection = 0; m_selection = 0;
m_stringSelection = ""; m_stringSelection = _T("");
m_clientData = NULL; m_clientData = NULL;
wxBeginBusyCursor(); wxBeginBusyCursor();
@@ -245,7 +245,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
topSizer->SetBorder(10, 10); topSizer->SetBorder(10, 10);
wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100); wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
messageSizer->SetName("messageSizer"); messageSizer->SetName(_T("messageSizer"));
// bool centre = ((style & wxCENTRE) == wxCENTRE); // bool centre = ((style & wxCENTRE) == wxCENTRE);
@@ -269,7 +269,7 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
wxRowColSizer *listBoxSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS); wxRowColSizer *listBoxSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
listBoxSizer->AddSizerChild(listBox); listBoxSizer->AddSizerChild(listBox);
listBoxSizer->SetName("listBoxSizer"); listBoxSizer->SetName(_T("listBoxSizer"));
// Create constraints for the text sizer // Create constraints for the text sizer
wxLayoutConstraints *textC = new wxLayoutConstraints; wxLayoutConstraints *textC = new wxLayoutConstraints;
@@ -279,11 +279,11 @@ bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& m
// Insert another spacer // Insert another spacer
wxSpacingSizer *spacingSizer2 = new wxSpacingSizer(topSizer, wxBelow, listBoxSizer, 10); wxSpacingSizer *spacingSizer2 = new wxSpacingSizer(topSizer, wxBelow, listBoxSizer, 10);
spacingSizer->SetName("spacingSizer2"); spacingSizer->SetName(_T("spacingSizer2"));
// Insert a sizer for the buttons // Insert a sizer for the buttons
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS); wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
buttonSizer->SetName("buttonSizer"); buttonSizer->SetName(_T("buttonSizer"));
buttonSizer->SetSpacing(12,0); buttonSizer->SetSpacing(12,0);
// Specify constraints for the button sizer // Specify constraints for the button sizer
@@ -339,7 +339,7 @@ void wxSingleChoiceDialog::OnOK(wxCommandEvent& WXUNUSED(event))
{ {
m_selection = listBox->GetSelection(); m_selection = listBox->GetSelection();
m_stringSelection = listBox->GetStringSelection(); m_stringSelection = listBox->GetStringSelection();
m_clientData = (char*)listBox->GetClientData(m_selection); m_clientData = (wxChar*)listBox->GetClientData(m_selection);
} }
EndModal(wxID_OK); EndModal(wxID_OK);
@@ -352,7 +352,7 @@ void wxSingleChoiceDialog::OnListBoxDClick(wxCommandEvent& WXUNUSED(event))
{ {
m_selection = listBox->GetSelection(); m_selection = listBox->GetSelection();
m_stringSelection = listBox->GetStringSelection(); m_stringSelection = listBox->GetStringSelection();
m_clientData = (char*)listBox->GetClientData(m_selection); m_clientData = (wxChar*)listBox->GetClientData(m_selection);
} }
EndModal(wxID_OK); EndModal(wxID_OK);

View File

@@ -347,21 +347,21 @@ bool wxPostScriptDC::PrinterDialog(wxWindow *parent)
// For PS_PRINTER action this depends on a Unix-style print spooler // For PS_PRINTER action this depends on a Unix-style print spooler
// since the wx_printer_file can be destroyed during a session // since the wx_printer_file can be destroyed during a session
// @@@ TODO: a Windows-style answer for non-Unix // @@@ TODO: a Windows-style answer for non-Unix
char userId[256]; wxChar userId[256];
wxGetUserId (userId, sizeof (userId) / sizeof (char)); wxGetUserId (userId, sizeof (userId) / sizeof (char));
char tmp[256]; wxChar tmp[256];
strcpy (tmp, "/tmp/preview_"); wxStrcpy (tmp, _T("/tmp/preview_"));
strcat (tmp, userId); wxStrcat (tmp, userId);
m_printData.SetFilename(tmp); m_printData.SetFilename(tmp);
#endif #endif
char tmp2[256]; wxChar tmp2[256];
strcpy(tmp2, m_printData.GetFilename()); wxStrcpy(tmp2, m_printData.GetFilename());
strcat (tmp2, ".ps"); wxStrcat (tmp2, _T(".ps"));
m_printData.SetFilename(tmp2); m_printData.SetFilename(tmp2);
} }
else if ((m_printData.GetFilename() == "") && (m_printData.GetPrintMode() == wxPRINT_MODE_FILE)) else if ((m_printData.GetFilename() == _T("")) && (m_printData.GetPrintMode() == wxPRINT_MODE_FILE))
{ {
wxString file = wxSaveFileSelector (_("PostScript"), "ps"); wxString file = wxSaveFileSelector (_("PostScript"), _T("ps"));
if ( file.IsEmpty() ) if ( file.IsEmpty() )
{ {
m_ok = FALSE; m_ok = FALSE;
@@ -377,7 +377,7 @@ bool wxPostScriptDC::PrinterDialog(wxWindow *parent)
void wxPostScriptDC::SetClippingRegion (long x, long y, long w, long h) void wxPostScriptDC::SetClippingRegion (long x, long y, long w, long h)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_clipping) return; if (m_clipping) return;
@@ -399,7 +399,7 @@ void wxPostScriptDC::SetClippingRegion( const wxRegion &WXUNUSED(region) )
void wxPostScriptDC::DestroyClippingRegion() void wxPostScriptDC::DestroyClippingRegion()
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
wxDC::DestroyClippingRegion(); wxDC::DestroyClippingRegion();
@@ -412,28 +412,28 @@ void wxPostScriptDC::DestroyClippingRegion()
void wxPostScriptDC::Clear() void wxPostScriptDC::Clear()
{ {
wxFAIL_MSG( "wxPostScriptDC::Clear not implemented." ); wxFAIL_MSG( _T("wxPostScriptDC::Clear not implemented.") );
} }
void wxPostScriptDC::FloodFill (long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style)) void wxPostScriptDC::FloodFill (long WXUNUSED(x), long WXUNUSED(y), const wxColour &WXUNUSED(col), int WXUNUSED(style))
{ {
wxFAIL_MSG( "wxPostScriptDC::FloodFill not implemented." ); wxFAIL_MSG( _T("wxPostScriptDC::FloodFill not implemented.") );
} }
bool wxPostScriptDC::GetPixel (long WXUNUSED(x), long WXUNUSED(y), wxColour * WXUNUSED(col)) const bool wxPostScriptDC::GetPixel (long WXUNUSED(x), long WXUNUSED(y), wxColour * WXUNUSED(col)) const
{ {
wxFAIL_MSG( "wxPostScriptDC::GetPixel not implemented." ); wxFAIL_MSG( _T("wxPostScriptDC::GetPixel not implemented.") );
return FALSE; return FALSE;
} }
void wxPostScriptDC::CrossHair (long WXUNUSED(x), long WXUNUSED(y)) void wxPostScriptDC::CrossHair (long WXUNUSED(x), long WXUNUSED(y))
{ {
wxFAIL_MSG( "wxPostScriptDC::CrossHair not implemented." ); wxFAIL_MSG( _T("wxPostScriptDC::CrossHair not implemented.") );
} }
void wxPostScriptDC::DrawLine (long x1, long y1, long x2, long y2) void wxPostScriptDC::DrawLine (long x1, long y1, long x2, long y2)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return; if (m_pen.GetStyle() == wxTRANSPARENT) return;
@@ -452,7 +452,7 @@ void wxPostScriptDC::DrawLine (long x1, long y1, long x2, long y2)
void wxPostScriptDC::DrawArc (long x1, long y1, long x2, long y2, long xc, long yc) void wxPostScriptDC::DrawArc (long x1, long y1, long x2, long y2, long xc, long yc)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
long dx = x1 - xc; long dx = x1 - xc;
long dy = y1 - yc; long dy = y1 - yc;
@@ -515,7 +515,7 @@ void wxPostScriptDC::DrawArc (long x1, long y1, long x2, long y2, long xc, long
void wxPostScriptDC::DrawEllipticArc(long x,long y,long w,long h,double sa,double ea) void wxPostScriptDC::DrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (sa>=360 || sa<=-360) sa=sa-int(sa/360)*360; if (sa>=360 || sa<=-360) sa=sa-int(sa/360)*360;
if (ea>=360 || ea<=-360) ea=ea-int(ea/360)*360; if (ea>=360 || ea<=-360) ea=ea-int(ea/360)*360;
@@ -557,7 +557,7 @@ void wxPostScriptDC::DrawEllipticArc(long x,long y,long w,long h,double sa,doubl
void wxPostScriptDC::DrawPoint (long x, long y) void wxPostScriptDC::DrawPoint (long x, long y)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) return; if (m_pen.GetStyle() == wxTRANSPARENT) return;
@@ -573,7 +573,7 @@ void wxPostScriptDC::DrawPoint (long x, long y)
void wxPostScriptDC::DrawPolygon (int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle)) void wxPostScriptDC::DrawPolygon (int n, wxPoint points[], long xoffset, long yoffset, int WXUNUSED(fillStyle))
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (n <= 0) return; if (n <= 0) return;
@@ -623,7 +623,7 @@ void wxPostScriptDC::DrawPolygon (int n, wxPoint points[], long xoffset, long yo
void wxPostScriptDC::DrawLines (int n, wxPoint points[], long xoffset, long yoffset) void wxPostScriptDC::DrawLines (int n, wxPoint points[], long xoffset, long yoffset)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_pen.GetStyle() == wxTRANSPARENT) if (m_pen.GetStyle() == wxTRANSPARENT)
return; return;
@@ -653,7 +653,7 @@ void wxPostScriptDC::DrawLines (int n, wxPoint points[], long xoffset, long yoff
void wxPostScriptDC::DrawRectangle (long x, long y, long width, long height) void wxPostScriptDC::DrawRectangle (long x, long y, long width, long height)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_brush.GetStyle () != wxTRANSPARENT) if (m_brush.GetStyle () != wxTRANSPARENT)
{ {
@@ -690,7 +690,7 @@ void wxPostScriptDC::DrawRectangle (long x, long y, long width, long height)
void wxPostScriptDC::DrawRoundedRectangle (long x, long y, long width, long height, double radius) void wxPostScriptDC::DrawRoundedRectangle (long x, long y, long width, long height, double radius)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (radius < 0.0) if (radius < 0.0)
{ {
@@ -751,7 +751,7 @@ void wxPostScriptDC::DrawRoundedRectangle (long x, long y, long width, long heig
void wxPostScriptDC::DrawEllipse (long x, long y, long width, long height) void wxPostScriptDC::DrawEllipse (long x, long y, long width, long height)
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_brush.GetStyle () != wxTRANSPARENT) if (m_brush.GetStyle () != wxTRANSPARENT)
{ {
@@ -787,7 +787,7 @@ void wxPostScriptDC::DrawIcon( const wxIcon& icon, long x, long y )
void wxPostScriptDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool WXUNUSED(useMask) ) void wxPostScriptDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool WXUNUSED(useMask) )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (!bitmap.Ok()) return; if (!bitmap.Ok()) return;
@@ -822,7 +822,7 @@ void wxPostScriptDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool WX
{ {
for (int i = 0; i < ww; i++) for (int i = 0; i < ww; i++)
{ {
char buffer[5]; wxChar buffer[5];
buffer[2] = 0; buffer[2] = 0;
wxDecToHex( image.GetRed(i,j), buffer ); wxDecToHex( image.GetRed(i,j), buffer );
*m_pstream << buffer; *m_pstream << buffer;
@@ -841,7 +841,7 @@ void wxPostScriptDC::DrawBitmap( const wxBitmap& bitmap, long x, long y, bool WX
void wxPostScriptDC::SetFont( const wxFont& font ) void wxPostScriptDC::SetFont( const wxFont& font )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (!font.Ok()) return; if (!font.Ok()) return;
@@ -930,7 +930,7 @@ void wxPostScriptDC::SetFont( const wxFont& font )
void wxPostScriptDC::SetPen( const wxPen& pen ) void wxPostScriptDC::SetPen( const wxPen& pen )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (!pen.Ok()) return; if (!pen.Ok()) return;
@@ -1008,7 +1008,7 @@ void wxPostScriptDC::SetPen( const wxPen& pen )
void wxPostScriptDC::SetBrush( const wxBrush& brush ) void wxPostScriptDC::SetBrush( const wxBrush& brush )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (!brush.Ok()) return; if (!brush.Ok()) return;
@@ -1047,7 +1047,7 @@ void wxPostScriptDC::SetBrush( const wxBrush& brush )
void wxPostScriptDC::DrawText( const wxString& text, long x, long y, bool WXUNUSED(use16bit) ) void wxPostScriptDC::DrawText( const wxString& text, long x, long y, bool WXUNUSED(use16bit) )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
SetFont( m_font ); SetFont( m_font );
@@ -1090,11 +1090,12 @@ void wxPostScriptDC::DrawText( const wxString& text, long x, long y, bool WXUNUS
*m_pstream << XLOG2DEV(x) << " " << YLOG2DEV(by) << " moveto\n"; *m_pstream << XLOG2DEV(x) << " " << YLOG2DEV(by) << " moveto\n";
*m_pstream << "("; *m_pstream << "(";
int len = strlen ((char *)(const char *)text); wxWX2MBbuf textbuf = text.mb_str();
int len = strlen (textbuf);
int i; int i;
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
int c = (unsigned char) text[i]; int c = (unsigned char) textbuf[i];
if ( c == ')' || c == '(' || c == '\\') if ( c == ')' || c == '(' || c == '\\')
{ {
*m_pstream << "\\" << (char) c; *m_pstream << "\\" << (char) c;
@@ -1137,12 +1138,12 @@ void wxPostScriptDC::SetBackground (const wxBrush& brush)
void wxPostScriptDC::SetLogicalFunction (int WXUNUSED(function)) void wxPostScriptDC::SetLogicalFunction (int WXUNUSED(function))
{ {
wxFAIL_MSG( "wxPostScriptDC::SetLogicalFunction not implemented." ); wxFAIL_MSG( _T("wxPostScriptDC::SetLogicalFunction not implemented.") );
} }
void wxPostScriptDC::DrawSpline( wxList *points ) void wxPostScriptDC::DrawSpline( wxList *points )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
SetPen( m_pen ); SetPen( m_pen );
@@ -1205,7 +1206,7 @@ long wxPostScriptDC::GetCharWidth ()
void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp ) void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
m_signX = (xLeftRight ? 1 : -1); m_signX = (xLeftRight ? 1 : -1);
m_signY = (yBottomUp ? 1 : -1); m_signY = (yBottomUp ? 1 : -1);
@@ -1218,7 +1219,7 @@ void wxPostScriptDC::SetAxisOrientation( bool xLeftRight, bool yBottomUp )
void wxPostScriptDC::SetDeviceOrigin( long x, long y ) void wxPostScriptDC::SetDeviceOrigin( long x, long y )
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
int h = 0; int h = 0;
int w = 0; int w = 0;
@@ -1276,7 +1277,7 @@ wxSize wxPostScriptDC::GetPPI(void) const
bool wxPostScriptDC::StartDoc (const wxString& message) bool wxPostScriptDC::StartDoc (const wxString& message)
{ {
wxCHECK_MSG( m_ok, FALSE, "invalid postscript dc" ); wxCHECK_MSG( m_ok, FALSE, _T("invalid postscript dc") );
if (m_printData.GetFilename() == "") if (m_printData.GetFilename() == "")
{ {
@@ -1286,7 +1287,7 @@ bool wxPostScriptDC::StartDoc (const wxString& message)
m_ok = TRUE; m_ok = TRUE;
} }
m_pstream = new ofstream (m_printData.GetFilename()); m_pstream = new ofstream (m_printData.GetFilename().fn_str());
if (!m_pstream || !m_pstream->good()) if (!m_pstream || !m_pstream->good())
{ {
@@ -1313,7 +1314,7 @@ bool wxPostScriptDC::StartDoc (const wxString& message)
void wxPostScriptDC::EndDoc () void wxPostScriptDC::EndDoc ()
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
if (m_clipping) if (m_clipping)
{ {
@@ -1327,27 +1328,27 @@ void wxPostScriptDC::EndDoc ()
m_pstream = (ofstream *) NULL; m_pstream = (ofstream *) NULL;
} }
char *header_file = wxGetTempFileName("ps"); wxChar *header_file = wxGetTempFileName("ps");
m_pstream = new ofstream( header_file ); m_pstream = new ofstream( wxConv_file.cWX2MB(header_file) );
*m_pstream << "%!PS-Adobe-2.0\n"; /* PostScript magic strings */ *m_pstream << "%!PS-Adobe-2.0\n"; /* PostScript magic strings */
*m_pstream << "%%Title: " << (const char *) m_title << "\n"; *m_pstream << "%%Title: " << m_title.mb_str() << "\n";
*m_pstream << "%%Creator: " << wxTheApp->argv[0] << "\n"; *m_pstream << "%%Creator: " << wxTheApp->argv[0] << "\n";
*m_pstream << "%%CreationDate: " << wxNow() << "\n"; *m_pstream << "%%CreationDate: " << wxNow() << "\n";
char userID[256]; wxChar userID[256];
if ( wxGetEmailAddress(userID, sizeof(userID)) ) if ( wxGetEmailAddress(userID, sizeof(userID)) )
{ {
*m_pstream << "%%For: " << (char *)userID; *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID);
char userName[245]; wxChar userName[245];
if (wxGetUserName(userName, sizeof(userName))) if (wxGetUserName(userName, sizeof(userName)))
*m_pstream << " (" << (char *)userName << ")"; *m_pstream << " (" << MBSTRINGCAST wxConv_libc.cWX2MB(userName) << ")";
*m_pstream << "\n"; *m_pstream << "\n";
} }
else if ( wxGetUserName(userID, sizeof(userID)) ) else if ( wxGetUserName(userID, sizeof(userID)) )
{ {
*m_pstream << "%%For: " << (char *)userID << "\n"; *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID) << "\n";
} }
// THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com> // THE FOLLOWING HAS BEEN CONTRIBUTED BY Andy Fyfe <andy@hyperparallel.com>
@@ -1424,7 +1425,7 @@ void wxPostScriptDC::EndDoc ()
delete m_pstream; delete m_pstream;
m_pstream = (ofstream *) NULL; m_pstream = (ofstream *) NULL;
char *tmp_file = wxGetTempFileName("ps"); wxChar *tmp_file = wxGetTempFileName("ps");
// Paste header Before wx_printer_file // Paste header Before wx_printer_file
wxConcatFiles (header_file, m_printData.GetFilename(), tmp_file); wxConcatFiles (header_file, m_printData.GetFilename(), tmp_file);
@@ -1444,10 +1445,10 @@ void wxPostScriptDC::EndDoc ()
case wxPRINT_MODE_PREVIEW: case wxPRINT_MODE_PREVIEW:
{ {
char *argv[3]; wxChar *argv[3];
argv[0] = (char*) (const char*) previewCommand; argv[0] = WXSTRINGCAST previewCommand;
argv[1] = (char*) (const char*) filename; argv[1] = WXSTRINGCAST filename;
argv[2] = (char*) (char *) NULL; argv[2] = (wxChar*) NULL;
wxExecute (argv, TRUE); wxExecute (argv, TRUE);
wxRemoveFile(m_printData.GetFilename()); wxRemoveFile(m_printData.GetFilename());
} }
@@ -1455,18 +1456,18 @@ void wxPostScriptDC::EndDoc ()
case wxPRINT_MODE_PRINTER: case wxPRINT_MODE_PRINTER:
{ {
char *argv[4]; wxChar *argv[4];
int argc = 0; int argc = 0;
argv[argc++] = (char*) (const char*) printerCommand; argv[argc++] = WXSTRINGCAST printerCommand;
// !SM! If we simply assign to argv[1] here, if printer options // !SM! If we simply assign to argv[1] here, if printer options
// are blank, we get an annoying and confusing message from lpr. // are blank, we get an annoying and confusing message from lpr.
char * opts = (char*) (const char*) printerOptions; wxChar * opts = WXSTRINGCAST printerOptions;
if (opts && *opts) if (opts && *opts)
argv[argc++] = opts; argv[argc++] = opts;
argv[argc++] = (char*) (const char*) filename; argv[argc++] = WXSTRINGCAST filename;
argv[argc++] = (char *) NULL; argv[argc++] = (wxChar *) NULL;
wxExecute (argv, TRUE); wxExecute (argv, TRUE);
wxRemoveFile(filename); wxRemoveFile(filename);
} }
@@ -1482,7 +1483,7 @@ void wxPostScriptDC::EndDoc ()
void wxPostScriptDC::StartPage () void wxPostScriptDC::StartPage ()
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
*m_pstream << "%%Page: " << (wxPageNumber++) << "\n"; *m_pstream << "%%Page: " << (wxPageNumber++) << "\n";
@@ -1521,7 +1522,7 @@ void wxPostScriptDC::StartPage ()
void wxPostScriptDC::EndPage () void wxPostScriptDC::EndPage ()
{ {
wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" ); wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
*m_pstream << "showpage\n"; *m_pstream << "showpage\n";
} }
@@ -1532,9 +1533,9 @@ bool wxPostScriptDC::Blit( long xdest, long ydest,
long xsrc, long ysrc, long xsrc, long ysrc,
int rop, bool WXUNUSED(useMask) ) int rop, bool WXUNUSED(useMask) )
{ {
wxCHECK_MSG( m_ok && m_pstream, FALSE, "invalid postscript dc" ); wxCHECK_MSG( m_ok && m_pstream, FALSE, _T("invalid postscript dc") );
wxCHECK_MSG( source, FALSE, "invalid source dc" ); wxCHECK_MSG( source, FALSE, _T("invalid source dc") );
/* blit into a bitmap */ /* blit into a bitmap */
@@ -1567,9 +1568,11 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y,
if (!fontToUse) fontToUse = (wxFont*) &m_font; if (!fontToUse) fontToUse = (wxFont*) &m_font;
wxCHECK_RET( fontToUse, "GetTextExtent: no font defined" ); wxCHECK_RET( fontToUse, _T("GetTextExtent: no font defined") );
wxCHECK_RET( x, "GetTextExtent: x == NULL" ); wxCHECK_RET( x, _T("GetTextExtent: x == NULL") );
wxCHECK_RET( y, "GetTextExtent: y == NULL" ); wxCHECK_RET( y, _T("GetTextExtent: y == NULL") );
wxWX2MBbuf strbuf = string.mb_str();
#if !USE_AFM_FOR_POSTSCRIPT #if !USE_AFM_FOR_POSTSCRIPT
/* Provide a VERY rough estimate (avoid using it). /* Provide a VERY rough estimate (avoid using it).
@@ -1581,7 +1584,7 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y,
{ {
height = fontToUse->GetPointSize(); height = fontToUse->GetPointSize();
} }
*x = strlen (string) * height * 72 / 120; *x = strlen (strbuf) * height * 72 / 120;
*y = (long) (height * 1.32); /* allow for descender */ *y = (long) (height * 1.32); /* allow for descender */
if (descent) *descent = 0; if (descent) *descent = 0;
if (externalLeading) *externalLeading = 0; if (externalLeading) *externalLeading = 0;
@@ -1813,7 +1816,7 @@ void wxPostScriptDC::GetTextExtent( const wxString& string, long *x, long *y,
long widthSum=0; long widthSum=0;
long height=Size; /* by default */ long height=Size; /* by default */
unsigned char *p; unsigned char *p;
for(p=(unsigned char *)(const char *)string; *p; p++) for(p=(unsigned char *)strbuf; *p; p++)
{ {
if(lastWidths[*p]== INT_MIN) if(lastWidths[*p]== INT_MIN)
{ {

View File

@@ -220,15 +220,15 @@ void wxDirCtrl::SetupSections()
m_paths.Clear(); m_paths.Clear();
m_names.Clear(); m_names.Clear();
ADD_SECTION("/", _("The Computer") ) ADD_SECTION(_T("/"), _("The Computer") )
wxGetHomeDir(&home); wxGetHomeDir(&home);
ADD_SECTION(home, _("My Home") ) ADD_SECTION(home, _("My Home") )
ADD_SECTION("/mnt", _("Mounted Devices") ) ADD_SECTION(_T("/mnt"), _("Mounted Devices") )
ADD_SECTION("/usr", _("User") ) ADD_SECTION(_T("/usr"), _("User") )
ADD_SECTION("/usr/local", _("User Local") ) ADD_SECTION(_T("/usr/local"), _("User Local") )
ADD_SECTION("/var", _("Variables") ) ADD_SECTION(_T("/var"), _("Variables") )
ADD_SECTION("/etc", _("Etcetera") ) ADD_SECTION(_T("/etc"), _("Etcetera") )
ADD_SECTION("/tmp", _("Temporary") ) ADD_SECTION(_T("/tmp"), _("Temporary") )
} }
#undef ADD_SECTION #undef ADD_SECTION

View File

@@ -343,11 +343,11 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection()); fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
int fontStyle = 0; int fontStyle = 0;
fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection()); fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
int fontSize = atoi(pointSizeChoice->GetStringSelection()); int fontSize = wxAtoi(pointSizeChoice->GetStringSelection());
int fontUnderline = underLineCheckBox->GetValue(); int fontUnderline = underLineCheckBox->GetValue();
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0)); dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
if (colourChoice->GetStringSelection() != "") if (colourChoice->GetStringSelection() != _T(""))
{ {
wxColour *col = (wxColour*) NULL; wxColour *col = (wxColour*) NULL;
col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection()); col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
@@ -361,94 +361,94 @@ void wxGenericFontDialog::OnChangeFont(wxCommandEvent& WXUNUSED(event))
PaintFont(dc); PaintFont(dc);
} }
char *wxFontWeightIntToString(int weight) wxChar *wxFontWeightIntToString(int weight)
{ {
switch (weight) switch (weight)
{ {
case wxLIGHT: case wxLIGHT:
return "Light"; return _T("Light");
case wxBOLD: case wxBOLD:
return "Bold"; return _T("Bold");
case wxNORMAL: case wxNORMAL:
default: default:
return "Normal"; return _T("Normal");
} }
return "Normal"; return _T("Normal");
} }
char *wxFontStyleIntToString(int style) wxChar *wxFontStyleIntToString(int style)
{ {
switch (style) switch (style)
{ {
case wxITALIC: case wxITALIC:
return "Italic"; return _T("Italic");
case wxSLANT: case wxSLANT:
return "Slant"; return _T("Slant");
case wxNORMAL: case wxNORMAL:
default: default:
return "Normal"; return _T("Normal");
} }
return "Normal"; return _T("Normal");
} }
char *wxFontFamilyIntToString(int family) wxChar *wxFontFamilyIntToString(int family)
{ {
switch (family) switch (family)
{ {
case wxROMAN: case wxROMAN:
return "Roman"; return _T("Roman");
case wxDECORATIVE: case wxDECORATIVE:
return "Decorative"; return _T("Decorative");
case wxMODERN: case wxMODERN:
return "Modern"; return _T("Modern");
case wxSCRIPT: case wxSCRIPT:
return "Script"; return _T("Script");
case wxTELETYPE: case wxTELETYPE:
return "Teletype"; return _T("Teletype");
case wxSWISS: case wxSWISS:
default: default:
return "Swiss"; return _T("Swiss");
} }
return "Swiss"; return _T("Swiss");
} }
int wxFontFamilyStringToInt(char *family) int wxFontFamilyStringToInt(wxChar *family)
{ {
if (!family) if (!family)
return wxSWISS; return wxSWISS;
if (strcmp(family, "Roman") == 0) if (wxStrcmp(family, _T("Roman")) == 0)
return wxROMAN; return wxROMAN;
else if (strcmp(family, "Decorative") == 0) else if (wxStrcmp(family, _T("Decorative")) == 0)
return wxDECORATIVE; return wxDECORATIVE;
else if (strcmp(family, "Modern") == 0) else if (wxStrcmp(family, _T("Modern")) == 0)
return wxMODERN; return wxMODERN;
else if (strcmp(family, "Script") == 0) else if (wxStrcmp(family, _T("Script")) == 0)
return wxSCRIPT; return wxSCRIPT;
else if (strcmp(family, "Teletype") == 0) else if (wxStrcmp(family, _T("Teletype")) == 0)
return wxTELETYPE; return wxTELETYPE;
else return wxSWISS; else return wxSWISS;
} }
int wxFontStyleStringToInt(char *style) int wxFontStyleStringToInt(wxChar *style)
{ {
if (!style) if (!style)
return wxNORMAL; return wxNORMAL;
if (strcmp(style, "Italic") == 0) if (wxStrcmp(style, _T("Italic")) == 0)
return wxITALIC; return wxITALIC;
else if (strcmp(style, "Slant") == 0) else if (wxStrcmp(style, _T("Slant")) == 0)
return wxSLANT; return wxSLANT;
else else
return wxNORMAL; return wxNORMAL;
} }
int wxFontWeightStringToInt(char *weight) int wxFontWeightStringToInt(wxChar *weight)
{ {
if (!weight) if (!weight)
return wxNORMAL; return wxNORMAL;
if (strcmp(weight, "Bold") == 0) if (wxStrcmp(weight, _T("Bold")) == 0)
return wxBOLD; return wxBOLD;
else if (strcmp(weight, "Light") == 0) else if (wxStrcmp(weight, _T("Light")) == 0)
return wxLIGHT; return wxLIGHT;
else else
return wxNORMAL; return wxNORMAL;

View File

@@ -1512,7 +1512,7 @@ void wxGenericGrid::DrawCellText(void)
if (!cell) if (!cell)
return; return;
static char szEdit[300]; static wxChar szEdit[300];
wxClientDC dc(this); wxClientDC dc(this);
dc.BeginDrawing(); dc.BeginDrawing();
@@ -1522,7 +1522,7 @@ void wxGenericGrid::DrawCellText(void)
dc.SetBackgroundMode(wxTRANSPARENT); dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetBrush(cell->GetBackgroundBrush()); dc.SetBrush(cell->GetBackgroundBrush());
strcpy(szEdit, m_textItem->GetValue()); wxStrcpy(szEdit, m_textItem->GetValue());
wxRect rect; wxRect rect;
rect = m_currentRect; rect = m_currentRect;
@@ -1531,7 +1531,7 @@ void wxGenericGrid::DrawCellText(void)
rect.width -= 5; rect.width -= 5;
rect.height -= 4; rect.height -= 4;
DrawTextRect(& dc, " ", &rect, wxLEFT); DrawTextRect(& dc, _T(" "), &rect, wxLEFT);
DrawTextRect(& dc, szEdit, &rect, cell->GetAlignment()); DrawTextRect(& dc, szEdit, &rect, cell->GetAlignment());
dc.DestroyClippingRegion(); dc.DestroyClippingRegion();

View File

@@ -66,23 +66,23 @@ wxExtHelpController::DisplayHelp(wxString const &relativeURL)
{ {
wxString lockfile; wxString lockfile;
wxGetHomeDir(&lockfile); wxGetHomeDir(&lockfile);
lockfile << WXEXTHELP_SEPARATOR << ".netscape/lock"; lockfile << WXEXTHELP_SEPARATOR << _T(".netscape/lock");
struct stat statbuf; struct stat statbuf;
if(lstat(lockfile.c_str(), &statbuf) == 0) if(lstat(lockfile.fn_str(), &statbuf) == 0)
// cannot use wxFileExists, because it's a link pointing to a // cannot use wxFileExists, because it's a link pointing to a
// non-existing location if(wxFileExists(lockfile)) // non-existing location if(wxFileExists(lockfile))
{ {
long success; long success;
command << m_BrowserName << " -remote openURL(" command << m_BrowserName << _T(" -remote openURL(")
<< "file://" << m_MapFile << _T("file://") << m_MapFile
<< WXEXTHELP_SEPARATOR << relativeURL << ")"; << WXEXTHELP_SEPARATOR << relativeURL << _T(")");
success = wxExecute(command); success = wxExecute(command);
if(success != 0 ) // returns PID on success if(success != 0 ) // returns PID on success
return TRUE; return TRUE;
} }
} }
command = m_BrowserName; command = m_BrowserName;
command << " file://" command << _T(" file://")
<< m_MapFile << WXEXTHELP_SEPARATOR << relativeURL; << m_MapFile << WXEXTHELP_SEPARATOR << relativeURL;
return wxExecute(command) != 0; return wxExecute(command) != 0;
} }

View File

@@ -96,7 +96,7 @@ wxHTMLHelpControllerBase::LoadFile(const wxString& ifile)
file = ifile; file = ifile;
if(! wxIsAbsolutePath(file)) if(! wxIsAbsolutePath(file))
{ {
char* f = wxGetWorkingDirectory(); wxChar* f = wxGetWorkingDirectory();
file = f; file = f;
delete[] f; // wxGetWorkingDirectory returns new memory delete[] f; // wxGetWorkingDirectory returns new memory
file << WXEXTHELP_SEPARATOR << ifile; file << WXEXTHELP_SEPARATOR << ifile;
@@ -118,8 +118,8 @@ wxHTMLHelpControllerBase::LoadFile(const wxString& ifile)
else else
{ {
newfile = WXEXTHELP_SEPARATOR; newfile = WXEXTHELP_SEPARATOR;
const char *cptr = wxGetLocale()->GetName().c_str(); const wxChar *cptr = wxGetLocale()->GetName().c_str();
while(*cptr && *cptr != '_') while(*cptr && *cptr != _T('_'))
newfile << *(cptr++); newfile << *(cptr++);
if(wxDirExists(newfile)) if(wxDirExists(newfile))
file = newfile; file = newfile;
@@ -141,7 +141,7 @@ wxHTMLHelpControllerBase::LoadFile(const wxString& ifile)
m_MapList = new wxList; m_MapList = new wxList;
m_NumOfEntries = 0; m_NumOfEntries = 0;
FILE *input = fopen(mapFile.c_str(),"rt"); FILE *input = fopen(mapFile.fn_str(),"rt");
if(! input) if(! input)
return FALSE; return FALSE;
do do

View File

@@ -61,7 +61,7 @@ const wxBitmap *wxImageList::GetBitmap( int index ) const
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Nth( index );
wxCHECK_MSG( node, (wxBitmap *) NULL, "wrong index in image list" ); wxCHECK_MSG( node, (wxBitmap *) NULL, _T("wrong index in image list") );
return (wxBitmap*)node->Data(); return (wxBitmap*)node->Data();
} }
@@ -70,7 +70,7 @@ bool wxImageList::Replace( int index, const wxBitmap &bitmap )
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Nth( index );
wxCHECK_MSG( node, FALSE, "wrong index in image list" ); wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
wxBitmap* newBitmap = NULL; wxBitmap* newBitmap = NULL;
if (bitmap.IsKindOf(CLASSINFO(wxIcon))) if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
@@ -97,7 +97,7 @@ bool wxImageList::Remove( int index )
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Nth( index );
wxCHECK_MSG( node, FALSE, "wrong index in image list" ); wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
m_images.DeleteNode( node ); m_images.DeleteNode( node );
@@ -118,7 +118,7 @@ bool wxImageList::GetSize( int index, int &width, int &height ) const
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Nth( index );
wxCHECK_MSG( node, FALSE, "wrong index in image list" ); wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->Data(); wxBitmap *bm = (wxBitmap*)node->Data();
width = bm->GetWidth(); width = bm->GetWidth();
@@ -132,7 +132,7 @@ bool wxImageList::Draw( int index, wxDC &dc, int x, int y,
{ {
wxNode *node = m_images.Nth( index ); wxNode *node = m_images.Nth( index );
wxCHECK_MSG( node, FALSE, "wrong index in image list" ); wxCHECK_MSG( node, FALSE, _T("wrong index in image list") );
wxBitmap *bm = (wxBitmap*)node->Data(); wxBitmap *bm = (wxBitmap*)node->Data();

View File

@@ -2063,7 +2063,7 @@ void wxListMainWindow::DeleteItem( long index )
void wxListMainWindow::DeleteColumn( int col ) void wxListMainWindow::DeleteColumn( int col )
{ {
wxCHECK_RET( col < (int)m_columns.GetCount(), wxCHECK_RET( col < (int)m_columns.GetCount(),
"attempting to delete inexistent column in wxListView" ); _T("attempting to delete inexistent column in wxListView") );
m_dirty = TRUE; m_dirty = TRUE;
wxNode *node = m_columns.Nth( col ); wxNode *node = m_columns.Nth( col );

View File

@@ -39,17 +39,17 @@
// New dialog box implementations // New dialog box implementations
// Split message, using constraints to position controls // Split message, using constraints to position controls
void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer) void wxSplitMessage2(const wxChar *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
{ {
char *copyMessage = copystring(message); wxChar *copyMessage = copystring(message);
size_t i = 0; size_t i = 0;
size_t len = strlen(copyMessage); size_t len = wxStrlen(copyMessage);
char *currentMessage = copyMessage; wxChar *currentMessage = copyMessage;
// wxWindow *lastWindow = parent; // wxWindow *lastWindow = parent;
while (i < len) { while (i < len) {
while ((i < len) && (copyMessage[i] != '\n')) i++; while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
if (i < len) copyMessage[i] = 0; if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage); wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
@@ -99,7 +99,7 @@ wxGenericMessageDialog::wxGenericMessageDialog(wxWindow *parent, const wxString&
topSizer->SetBorder(10, 10); topSizer->SetBorder(10, 10);
wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100); wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
messageSizer->SetName("messageSizer"); messageSizer->SetName(_T("messageSizer"));
// bool centre = ((style & wxCENTRE) == wxCENTRE); // bool centre = ((style & wxCENTRE) == wxCENTRE);
@@ -110,7 +110,7 @@ wxGenericMessageDialog::wxGenericMessageDialog(wxWindow *parent, const wxString&
wxSpacingSizer *spacingSizer = new wxSpacingSizer(topSizer, wxBelow, messageSizer, 20); wxSpacingSizer *spacingSizer = new wxSpacingSizer(topSizer, wxBelow, messageSizer, 20);
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS); wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
buttonSizer->SetName("buttonSizer"); buttonSizer->SetName(_T("buttonSizer"));
buttonSizer->SetSpacing(12,0); buttonSizer->SetSpacing(12,0);
// Specify constraints for the button sizer // Specify constraints for the button sizer

View File

@@ -234,7 +234,7 @@ void wxGenericPrintDialog::OnOK(wxCommandEvent& WXUNUSED(event))
wxString f = wxFileSelector(_("PostScript file"), wxString f = wxFileSelector(_("PostScript file"),
wxPathOnly(wxThePrintSetupData->GetPrinterFile()), wxPathOnly(wxThePrintSetupData->GetPrinterFile()),
wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()), wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()),
"ps", "*.ps", 0, this); _T("ps"), _T("*.ps"), 0, this);
if ( f.IsEmpty() ) if ( f.IsEmpty() )
return; return;
@@ -325,8 +325,8 @@ bool wxGenericPrintDialog::TransferDataFromWindow()
{ {
if (m_printDialogData.GetEnablePageNumbers()) if (m_printDialogData.GetEnablePageNumbers())
{ {
if(m_fromText) m_printDialogData.SetFromPage(atoi(m_fromText->GetValue())); if(m_fromText) m_printDialogData.SetFromPage(wxAtoi(m_fromText->GetValue()));
if(m_toText) m_printDialogData.SetToPage(atoi(m_toText->GetValue())); if(m_toText) m_printDialogData.SetToPage(wxAtoi(m_toText->GetValue()));
} }
if(m_rangeRadioBox) if(m_rangeRadioBox)
{ {
@@ -341,7 +341,7 @@ bool wxGenericPrintDialog::TransferDataFromWindow()
m_printDialogData.SetFromPage(1); m_printDialogData.SetFromPage(1);
m_printDialogData.SetToPage(32000); m_printDialogData.SetToPage(32000);
} }
m_printDialogData.SetNoCopies(atoi(m_noCopiesText->GetValue())); m_printDialogData.SetNoCopies(wxAtoi(m_noCopiesText->GetValue()));
m_printDialogData.SetPrintToFile(m_printToFileCheckBox->GetValue()); m_printDialogData.SetPrintToFile(m_printToFileCheckBox->GetValue());
return TRUE; return TRUE;
@@ -690,9 +690,9 @@ bool wxGenericPageSetupDialog::TransferDataToWindow()
bool wxGenericPageSetupDialog::TransferDataFromWindow() bool wxGenericPageSetupDialog::TransferDataFromWindow()
{ {
if (m_marginLeftText && m_marginTopText) if (m_marginLeftText && m_marginTopText)
m_pageData.SetMarginTopLeft(wxPoint(atoi((const char *)m_marginLeftText->GetValue()),atoi((const char *)m_marginTopText->GetValue()))); m_pageData.SetMarginTopLeft(wxPoint(wxAtoi((const wxChar *)m_marginLeftText->GetValue()),wxAtoi((const wxChar *)m_marginTopText->GetValue())));
if (m_marginRightText && m_marginBottomText) if (m_marginRightText && m_marginBottomText)
m_pageData.SetMarginBottomRight(wxPoint(atoi((const char *)m_marginRightText->GetValue()),atoi((const char *)m_marginBottomText->GetValue()))); m_pageData.SetMarginBottomRight(wxPoint(wxAtoi((const wxChar *)m_marginRightText->GetValue()),wxAtoi((const wxChar *)m_marginBottomText->GetValue())));
if (m_orientationRadioBox) if (m_orientationRadioBox)
{ {

View File

@@ -63,7 +63,7 @@ wxPropertyValue::wxPropertyValue(const wxPropertyValue& copyFrom)
Copy((wxPropertyValue& )copyFrom); Copy((wxPropertyValue& )copyFrom);
} }
wxPropertyValue::wxPropertyValue(const char *val) wxPropertyValue::wxPropertyValue(const wxChar *val)
{ {
m_modifiedFlag = FALSE; m_modifiedFlag = FALSE;
m_type = wxPropertyValueString; m_type = wxPropertyValueString;
@@ -79,7 +79,7 @@ wxPropertyValue::wxPropertyValue(const wxString& val)
m_modifiedFlag = FALSE; m_modifiedFlag = FALSE;
m_type = wxPropertyValueString; m_type = wxPropertyValueString;
m_value.string = copystring((const char *)val); m_value.string = copystring((const wxChar *)val);
m_clientData = NULL; m_clientData = NULL;
m_next = NULL; m_next = NULL;
m_last = NULL; m_last = NULL;
@@ -122,7 +122,7 @@ wxPropertyValue::wxPropertyValue(double the_real)
} }
// Pointer versions: we have a pointer to the real C++ value. // Pointer versions: we have a pointer to the real C++ value.
wxPropertyValue::wxPropertyValue(char **val) wxPropertyValue::wxPropertyValue(wxChar **val)
{ {
m_modifiedFlag = FALSE; m_modifiedFlag = FALSE;
m_type = wxPropertyValueStringPtr; m_type = wxPropertyValueStringPtr;
@@ -382,7 +382,7 @@ void wxPropertyValue::Copy(wxPropertyValue& copyFrom)
return ; return ;
case wxPropertyValueStringPtr: case wxPropertyValueStringPtr:
{ {
char** s = copyFrom.StringValuePtr(); wxChar** s = copyFrom.StringValuePtr();
(*this) = s; (*this) = s;
return ; return ;
} }
@@ -515,7 +515,7 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe
case wxPropertyValueReal: case wxPropertyValueReal:
{ {
float f = m_value.real; float f = m_value.real;
sprintf(wxBuffer, "%.6g", (double)f); wxSprintf(wxBuffer, _T("%.6g"), (double)f);
stream << wxBuffer; stream << wxBuffer;
break; break;
} }
@@ -527,7 +527,7 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe
if (fabs(f) < 0.00001) if (fabs(f) < 0.00001)
f = 0.0; f = 0.0;
*/ */
sprintf(wxBuffer, "%.6g", f); wxSprintf(wxBuffer, _T("%.6g"), f);
stream << wxBuffer; stream << wxBuffer;
break; break;
} }
@@ -535,10 +535,11 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe
{ {
// stream << "\""; // stream << "\"";
int i; int i;
int len = strlen(m_value.string); wxWX2MBbuf strbuf = wxConv_libc.cWX2MB(m_value.string);
int len = strlen(strbuf);
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
{ {
char ch = m_value.string[i]; char ch = strbuf[i];
// if (ch == '"' || ch == '\\') // if (ch == '"' || ch == '\\')
// stream << "\\"; // stream << "\\";
stream << ch; stream << ch;
@@ -549,7 +550,7 @@ void wxPropertyValue::WritePropertyType(ostream& stream) // Write as any othe
} }
case wxPropertyValueStringPtr: case wxPropertyValueStringPtr:
{ {
wxFAIL_MSG( "wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented" ); wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
/* /*
int i; int i;
int len = strlen(*(m_value.stringPtr)); int len = strlen(*(m_value.stringPtr));
@@ -607,7 +608,7 @@ void wxPropertyValue::operator=(const wxPropertyValue& val)
// void wxPropertyValue::operator=(const char *val) // void wxPropertyValue::operator=(const char *val)
void wxPropertyValue::operator=(const wxString& val1) void wxPropertyValue::operator=(const wxString& val1)
{ {
const char *val = (const char *)val1; const wxChar *val = (const wxChar *)val1;
m_modifiedFlag = TRUE; m_modifiedFlag = TRUE;
if (m_type == wxPropertyValueNull) if (m_type == wxPropertyValueNull)
@@ -689,13 +690,13 @@ void wxPropertyValue::operator=(const float val)
m_next = NULL; m_next = NULL;
} }
void wxPropertyValue::operator=(const char **val) void wxPropertyValue::operator=(const wxChar **val)
{ {
m_modifiedFlag = TRUE; m_modifiedFlag = TRUE;
m_type = wxPropertyValueStringPtr; m_type = wxPropertyValueStringPtr;
if (val) if (val)
m_value.stringPtr = (char **)val; m_value.stringPtr = (wxChar **)val;
else else
m_value.stringPtr = NULL; m_value.stringPtr = NULL;
m_clientData = NULL; m_clientData = NULL;
@@ -787,7 +788,7 @@ bool *wxPropertyValue::BoolValuePtr(void) const
return m_value.boolPtr; return m_value.boolPtr;
} }
char *wxPropertyValue::StringValue(void) const { wxChar *wxPropertyValue::StringValue(void) const {
if (m_type == wxPropertyValueString) if (m_type == wxPropertyValueString)
return m_value.string; return m_value.string;
else if (m_type == wxPropertyValueStringPtr) else if (m_type == wxPropertyValueStringPtr)
@@ -795,7 +796,7 @@ char *wxPropertyValue::StringValue(void) const {
else return NULL; else return NULL;
} }
char **wxPropertyValue::StringValuePtr(void) const wxChar **wxPropertyValue::StringValuePtr(void) const
{ {
return m_value.stringPtr; return m_value.stringPtr;
} }
@@ -968,13 +969,13 @@ void wxPropertySheet::UpdateAllViews( wxPropertyView *WXUNUSED(thisView) )
// Add a property // Add a property
void wxPropertySheet::AddProperty(wxProperty *property) void wxPropertySheet::AddProperty(wxProperty *property)
{ {
m_properties.Append((const char*) property->GetName(), property); m_properties.Append((const wxChar*) property->GetName(), property);
} }
// Get property by name // Get property by name
wxProperty *wxPropertySheet::GetProperty(const wxString& name) const wxProperty *wxPropertySheet::GetProperty(const wxString& name) const
{ {
wxNode *node = m_properties.Find((const char*) name); wxNode *node = m_properties.Find((const wxChar*) name);
if (!node) if (!node)
return NULL; return NULL;
else else
@@ -1052,12 +1053,12 @@ wxPropertyValidatorRegistry::~wxPropertyValidatorRegistry(void)
void wxPropertyValidatorRegistry::RegisterValidator(const wxString& typeName, wxPropertyValidator *validator) void wxPropertyValidatorRegistry::RegisterValidator(const wxString& typeName, wxPropertyValidator *validator)
{ {
Put((const char*) typeName, validator); Put((const wxChar*) typeName, validator);
} }
wxPropertyValidator *wxPropertyValidatorRegistry::GetValidator(const wxString& typeName) wxPropertyValidator *wxPropertyValidatorRegistry::GetValidator(const wxString& typeName)
{ {
return (wxPropertyValidator *)Get((const char*) typeName); return (wxPropertyValidator *)Get((const wxChar*) typeName);
} }
void wxPropertyValidatorRegistry::ClearRegistry(void) void wxPropertyValidatorRegistry::ClearRegistry(void)
@@ -1086,66 +1087,64 @@ wxPropertyValidator::wxPropertyValidator(long flags)
wxPropertyValidator::~wxPropertyValidator(void) wxPropertyValidator::~wxPropertyValidator(void)
{} {}
bool wxPropertyValidator::StringToFloat (char *s, float *number) { bool wxPropertyValidator::StringToFloat (wxChar *s, float *number) {
double num; double num;
bool ok = StringToDouble (s, &num); bool ok = StringToDouble (s, &num);
*number = (float) num; *number = (float) num;
return ok; return ok;
} }
bool wxPropertyValidator::StringToDouble (char *s, double *number) { bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) {
bool ok = TRUE; bool ok = TRUE;
char *value_ptr; wxChar *value_ptr;
*number = strtod (s, &value_ptr); *number = wxStrtod (s, &value_ptr);
if (value_ptr) { if (value_ptr) {
int len = strlen (value_ptr); int len = wxStrlen (value_ptr);
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
ok = (isspace (value_ptr[i]) != 0); ok = (wxIsspace (value_ptr[i]) != 0);
if (!ok) return FALSE; if (!ok) return FALSE;
} }
} }
return ok; return ok;
} }
bool wxPropertyValidator::StringToInt (char *s, int *number) { bool wxPropertyValidator::StringToInt (wxChar *s, int *number) {
long num; long num;
bool ok = StringToLong (s, &num); bool ok = StringToLong (s, &num);
*number = (int) num; *number = (int) num;
return ok; return ok;
} }
bool wxPropertyValidator::StringToLong (char *s, long *number) { bool wxPropertyValidator::StringToLong (wxChar *s, long *number) {
bool ok = TRUE; bool ok = TRUE;
char *value_ptr; wxChar *value_ptr;
*number = strtol (s, &value_ptr, 10); *number = wxStrtol (s, &value_ptr, 10);
if (value_ptr) { if (value_ptr) {
int len = strlen (value_ptr); int len = wxStrlen (value_ptr);
for (int i = 0; i < len; i++) { for (int i = 0; i < len; i++) {
ok = (isspace (value_ptr[i]) != 0); ok = (wxIsspace (value_ptr[i]) != 0);
if (!ok) return FALSE; if (!ok) return FALSE;
} }
} }
return ok; return ok;
} }
char *wxPropertyValidator::FloatToString (float number) { wxChar *wxPropertyValidator::FloatToString (float number) {
static char buf[20]; static wxChar buf[20];
sprintf (buf, "%.6g", number); wxSprintf (buf, _T("%.6g"), number);
return buf; return buf;
} }
char *wxPropertyValidator::DoubleToString (double number) { wxChar *wxPropertyValidator::DoubleToString (double number) {
static char buf[20]; static wxChar buf[20];
sprintf (buf, "%.6g", number); wxSprintf (buf, _T("%.6g"), number);
return buf; return buf;
} }
char *wxPropertyValidator::IntToString (int number) { wxChar *wxPropertyValidator::IntToString (int number) {
return ::IntToString (number); return ::IntToString (number);
} }
char *wxPropertyValidator::LongToString (long number) { wxChar *wxPropertyValidator::LongToString (long number) {
return ::LongToString (number); return ::LongToString (number);
} }

View File

@@ -222,15 +222,15 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event)
if (win.GetName() == "") if (win.GetName() == "")
return; return;
if (strcmp(win.GetName(), "ok") == 0) if (wxStrcmp(win.GetName(), _T("ok")) == 0)
OnOk(event); OnOk(event);
else if (strcmp(win.GetName(), "cancel") == 0) else if (wxStrcmp(win.GetName(), _T("cancel")) == 0)
OnCancel(event); OnCancel(event);
else if (strcmp(win.GetName(), "help") == 0) else if (wxStrcmp(win.GetName(), _T("help")) == 0)
OnHelp(event); OnHelp(event);
else if (strcmp(win.GetName(), "update") == 0) else if (wxStrcmp(win.GetName(), _T("update")) == 0)
OnUpdate(event); OnUpdate(event);
else if (strcmp(win.GetName(), "revert") == 0) else if (wxStrcmp(win.GetName(), _T("revert")) == 0)
OnRevert(event); OnRevert(event);
else else
{ {
@@ -424,17 +424,17 @@ bool wxRealFormValidator::OnCheckValue( wxProperty *property, wxPropertyFormView
float val = 0.0; float val = 0.0;
if (!StringToFloat(WXSTRINGCAST value, &val)) if (!StringToFloat(WXSTRINGCAST value, &val))
{ {
char buf[200]; wxChar buf[200];
sprintf(buf, "Value %s is not a valid real number!", (const char *)value); wxSprintf(buf, _T("Value %s is not a valid real number!"), (const wxChar *)value);
wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
if (val < m_realMin || val > m_realMax) if (val < m_realMin || val > m_realMax)
{ {
char buf[200]; wxChar buf[200];
sprintf(buf, "Value must be a real number between %.2f and %.2f!", m_realMin, m_realMax); wxSprintf(buf, _T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax);
wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -453,7 +453,7 @@ bool wxRealFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormVi
if (value.Length() == 0) if (value.Length() == 0)
return FALSE; return FALSE;
float f = (float)atof((const char *)value); float f = (float)wxAtof((const wxChar *)value);
property->GetValue() = f; property->GetValue() = f;
return TRUE; return TRUE;
} }
@@ -495,9 +495,9 @@ bool wxIntegerFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVi
if (!StringToLong(WXSTRINGCAST value, &val)) if (!StringToLong(WXSTRINGCAST value, &val))
{ {
char buf[200]; wxChar buf[200];
sprintf(buf, "Value %s is not a valid integer!", (const char *)value); wxSprintf(buf, _T("Value %s is not a valid integer!"), (const wxChar *)value);
wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
} }
@@ -533,7 +533,7 @@ bool wxIntegerFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFor
if (value.Length() == 0) if (value.Length() == 0)
return FALSE; return FALSE;
long i = atol((const char *)value); long i = wxAtol((const wxChar *)value);
property->GetValue() = i; property->GetValue() = i;
} }
else if (m_propertyWindow->IsKindOf(CLASSINFO(wxSlider))) else if (m_propertyWindow->IsKindOf(CLASSINFO(wxSlider)))

View File

@@ -1027,9 +1027,9 @@ bool wxRealListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert
float val = 0.0; float val = 0.0;
if (!StringToFloat(WXSTRINGCAST value, &val)) if (!StringToFloat(WXSTRINGCAST value, &val))
{ {
char buf[200]; wxChar buf[200];
sprintf(buf, "Value %s is not a valid real number!", value.GetData()); wxSprintf(buf, _T("Value %s is not a valid real number!"), value.GetData());
wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
@@ -1051,11 +1051,11 @@ bool wxRealListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi
if (!view->GetValueText()) if (!view->GetValueText())
return FALSE; return FALSE;
if (strlen(view->GetValueText()->GetValue()) == 0) if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE; return FALSE;
wxString value(view->GetValueText()->GetValue()); wxString value(view->GetValueText()->GetValue());
float f = (float)atof(value.GetData()); float f = (float)wxAtof(value.GetData());
property->GetValue() = f; property->GetValue() = f;
return TRUE; return TRUE;
} }
@@ -1090,16 +1090,16 @@ bool wxIntegerListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxProp
long val = 0; long val = 0;
if (!StringToLong(WXSTRINGCAST value, &val)) if (!StringToLong(WXSTRINGCAST value, &val))
{ {
char buf[200]; wxChar buf[200];
sprintf(buf, "Value %s is not a valid integer!", value.GetData()); wxSprintf(buf, _T("Value %s is not a valid integer!"), value.GetData());
wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
if (val < m_integerMin || val > m_integerMax) if (val < m_integerMin || val > m_integerMax)
{ {
char buf[200]; wxChar buf[200];
sprintf(buf, "Value must be an integer between %ld and %ld!", m_integerMin, m_integerMax); wxSprintf(buf, _T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax);
wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -1113,11 +1113,11 @@ bool wxIntegerListValidator::OnRetrieveValue(wxProperty *property, wxPropertyLis
if (!view->GetValueText()) if (!view->GetValueText())
return FALSE; return FALSE;
if (strlen(view->GetValueText()->GetValue()) == 0) if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE; return FALSE;
wxString value(view->GetValueText()->GetValue()); wxString value(view->GetValueText()->GetValue());
long val = (long)atoi(value.GetData()); long val = (long)wxAtoi(value.GetData());
property->GetValue() = (long)val; property->GetValue() = (long)val;
return TRUE; return TRUE;
} }
@@ -1145,9 +1145,9 @@ bool wxBoolListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert
if (!view->GetValueText()) if (!view->GetValueText())
return FALSE; return FALSE;
wxString value(view->GetValueText()->GetValue()); wxString value(view->GetValueText()->GetValue());
if (value != "True" && value != "False") if (value != _T("True") && value != _T("False"))
{ {
wxMessageBox("Value must be True or False!", "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow); wxMessageBox(_T("Value must be True or False!"), _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
@@ -1161,12 +1161,12 @@ bool wxBoolListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi
if (!view->GetValueText()) if (!view->GetValueText())
return FALSE; return FALSE;
if (strlen(view->GetValueText()->GetValue()) == 0) if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE; return FALSE;
wxString value(view->GetValueText()->GetValue()); wxString value(view->GetValueText()->GetValue());
bool boolValue = FALSE; bool boolValue = FALSE;
if (value == "True") if (value == _T("True"))
boolValue = TRUE; boolValue = TRUE;
else else
boolValue = FALSE; boolValue = FALSE;
@@ -1209,9 +1209,9 @@ bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property)
view->ShowListBoxControl(TRUE); view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE); view->GetValueList()->Enable(TRUE);
view->GetValueList()->Append("True"); view->GetValueList()->Append(_T("True"));
view->GetValueList()->Append("False"); view->GetValueList()->Append(_T("False"));
char *currentString = copystring(view->GetValueText()->GetValue()); wxChar *currentString = copystring(view->GetValueText()->GetValue());
view->GetValueList()->SetStringSelection(currentString); view->GetValueList()->SetStringSelection(currentString);
delete[] currentString; delete[] currentString;
} }
@@ -1346,11 +1346,11 @@ bool wxStringListValidator::OnPrepareDetailControls(wxProperty *property, wxProp
wxNode *node = m_strings->First(); wxNode *node = m_strings->First();
while (node) while (node)
{ {
char *s = (char *)node->Data(); wxChar *s = (wxChar *)node->Data();
view->GetValueList()->Append(s); view->GetValueList()->Append(s);
node = node->Next(); node = node->Next();
} }
char *currentString = property->GetValue().StringValue(); wxChar *currentString = property->GetValue().StringValue();
view->GetValueList()->SetStringSelection(currentString); view->GetValueList()->SetStringSelection(currentString);
} }
return TRUE; return TRUE;
@@ -1382,17 +1382,17 @@ bool wxStringListValidator::OnDoubleClick(wxProperty *property, wxPropertyListVi
return FALSE; return FALSE;
wxNode *node = m_strings->First(); wxNode *node = m_strings->First();
char *currentString = property->GetValue().StringValue(); wxChar *currentString = property->GetValue().StringValue();
while (node) while (node)
{ {
char *s = (char *)node->Data(); wxChar *s = (wxChar *)node->Data();
if (strcmp(s, currentString) == 0) if (wxStrcmp(s, currentString) == 0)
{ {
char *nextString = NULL; wxChar *nextString = NULL;
if (node->Next()) if (node->Next())
nextString = (char *)node->Next()->Data(); nextString = (wxChar *)node->Next()->Data();
else else
nextString = (char *)m_strings->First()->Data(); nextString = (wxChar *)m_strings->First()->Data();
property->GetValue() = wxString(nextString); property->GetValue() = wxString(nextString);
view->DisplayProperty(property); view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property); view->UpdatePropertyDisplayInList(property);
@@ -1564,7 +1564,7 @@ void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *vie
if (!view->GetValueText()) if (!view->GetValueText())
return; return;
char *s = property->GetValue().StringValue(); wxChar *s = property->GetValue().StringValue();
int r = 0; int r = 0;
int g = 0; int g = 0;
int b = 0; int b = 0;
@@ -1593,7 +1593,7 @@ void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *vie
wxColourData retData = dialog.GetColourData(); wxColourData retData = dialog.GetColourData();
col = retData.GetColour(); col = retData.GetColour();
char buf[7]; wxChar buf[7];
wxDecToHex(col.Red(), buf); wxDecToHex(col.Red(), buf);
wxDecToHex(col.Green(), buf+2); wxDecToHex(col.Green(), buf+2);
wxDecToHex(col.Blue(), buf+4); wxDecToHex(col.Blue(), buf+4);
@@ -1670,13 +1670,13 @@ void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListVi
wxPropertyValue *expr = property->GetValue().GetFirst(); wxPropertyValue *expr = property->GetValue().GetFirst();
while (expr) while (expr)
{ {
char *s = expr->StringValue(); wxChar *s = expr->StringValue();
if (s) if (s)
stringList->Add(s); stringList->Add(s);
expr = expr->GetNext(); expr = expr->GetNext();
} }
wxString title("Editing "); wxString title(_T("Editing "));
title += property->GetName(); title += property->GetName();
if (EditStringList(parentWindow, stringList, title.GetData())) if (EditStringList(parentWindow, stringList, title.GetData()))
@@ -1686,7 +1686,7 @@ void wxListOfStringsListValidator::OnEdit(wxProperty *property, wxPropertyListVi
wxNode *node = stringList->First(); wxNode *node = stringList->First();
while (node) while (node)
{ {
char *s = (char *)node->Data(); wxChar *s = (wxChar *)node->Data();
oldValue.Append(new wxPropertyValue(s)); oldValue.Append(new wxPropertyValue(s));
node = node->Next(); node = node->Next();
@@ -1768,7 +1768,7 @@ class wxPropertyStringListEditorText: public wxTextCtrl
bool wxPropertyStringListEditorDialog::sm_dialogCancelled = FALSE; bool wxPropertyStringListEditorDialog::sm_dialogCancelled = FALSE;
// Edit the string list. // Edit the string list.
bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList *stringList, const char *title) bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title)
{ {
int largeButtonWidth = 60; int largeButtonWidth = 60;
int largeButtonHeight = 25; int largeButtonHeight = 25;
@@ -1884,7 +1884,7 @@ void wxPropertyStringListEditorDialog::OnDelete(wxCommandEvent& WXUNUSED(event))
return; return;
m_listBox->Delete(sel); m_listBox->Delete(sel);
delete[] (char *)node->Data(); delete[] (wxChar *)node->Data();
delete node; delete node;
m_currentSelection = -1; m_currentSelection = -1;
m_stringText->SetValue(""); m_stringText->SetValue("");
@@ -1894,9 +1894,9 @@ void wxPropertyStringListEditorDialog::OnAdd(wxCommandEvent& WXUNUSED(event))
{ {
SaveCurrentSelection(); SaveCurrentSelection();
char *initialText = ""; wxChar *initialText = _T("");
wxNode *node = m_stringList->Add(initialText); wxNode *node = m_stringList->Add(initialText);
m_listBox->Append(initialText, (char *)node); m_listBox->Append(initialText, (wxChar *)node);
m_currentSelection = m_stringList->Number() - 1; m_currentSelection = m_stringList->Number() - 1;
m_listBox->SetSelection(m_currentSelection); m_listBox->SetSelection(m_currentSelection);
ShowCurrentSelection(); ShowCurrentSelection();

View File

@@ -604,7 +604,7 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove)
} }
else else
{ {
wxFAIL_MSG("splitter: attempt to remove a non-existent window"); wxFAIL_MSG(_T("splitter: attempt to remove a non-existent window"));
return FALSE; return FALSE;
} }
@@ -619,8 +619,8 @@ bool wxSplitterWindow::Unsplit(wxWindow *toRemove)
// Replace a window with another one // Replace a window with another one
bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew) bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew)
{ {
wxCHECK_MSG( winOld, FALSE, "use one of Split() functions instead" ); wxCHECK_MSG( winOld, FALSE, _T("use one of Split() functions instead") );
wxCHECK_MSG( winNew, FALSE, "use Unsplit() functions instead" ); wxCHECK_MSG( winNew, FALSE, _T("use Unsplit() functions instead") );
if ( winOld == m_windowTwo ) if ( winOld == m_windowTwo )
{ {
@@ -632,7 +632,7 @@ bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew)
} }
else else
{ {
wxFAIL_MSG("splitter: attempt to replace a non-existent window"); wxFAIL_MSG(_T("splitter: attempt to replace a non-existent window"));
return FALSE; return FALSE;
} }

View File

@@ -45,17 +45,17 @@ IMPLEMENT_CLASS(wxTextEntryDialog, wxDialog)
#endif #endif
// Split message, using constraints to position controls // Split message, using constraints to position controls
static void wxSplitMessage2(const char *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer) static void wxSplitMessage2(const wxChar *message, wxList *messageList, wxWindow *parent, wxRowColSizer *sizer)
{ {
char *copyMessage = copystring(message); wxChar *copyMessage = copystring(message);
size_t i = 0; size_t i = 0;
size_t len = strlen(copyMessage); size_t len = wxStrlen(copyMessage);
char *currentMessage = copyMessage; wxChar *currentMessage = copyMessage;
// wxWindow *lastWindow = parent; // wxWindow *lastWindow = parent;
while (i < len) { while (i < len) {
while ((i < len) && (copyMessage[i] != '\n')) i++; while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
if (i < len) copyMessage[i] = 0; if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage); wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);

View File

@@ -197,7 +197,7 @@ wxGenericTreeItem::~wxGenericTreeItem()
delete m_data; delete m_data;
wxASSERT_MSG( m_children.IsEmpty(), wxASSERT_MSG( m_children.IsEmpty(),
"please call DeleteChildren() before deleting the item" ); _T("please call DeleteChildren() before deleting the item") );
} }
void wxGenericTreeItem::DeleteChildren(wxTreeCtrl *tree) void wxGenericTreeItem::DeleteChildren(wxTreeCtrl *tree)
@@ -408,7 +408,7 @@ void wxTreeCtrl::SetIndent(unsigned int indent)
size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively) size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
{ {
wxCHECK_MSG( item.IsOk(), 0u, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), 0u, _T("invalid tree item") );
return item.m_pItem->GetChildrenCount(recursively); return item.m_pItem->GetChildrenCount(recursively);
} }
@@ -419,35 +419,35 @@ size_t wxTreeCtrl::GetChildrenCount(const wxTreeItemId& item, bool recursively)
wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const wxString wxTreeCtrl::GetItemText(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), "", "invalid tree item" ); wxCHECK_MSG( item.IsOk(), _T(""), _T("invalid tree item") );
return item.m_pItem->GetText(); return item.m_pItem->GetText();
} }
int wxTreeCtrl::GetItemImage(const wxTreeItemId& item) const int wxTreeCtrl::GetItemImage(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), -1, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), -1, _T("invalid tree item") );
return item.m_pItem->GetImage(); return item.m_pItem->GetImage();
} }
int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const int wxTreeCtrl::GetItemSelectedImage(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), -1, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), -1, _T("invalid tree item") );
return item.m_pItem->GetSelectedImage(); return item.m_pItem->GetSelectedImage();
} }
wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const wxTreeItemData *wxTreeCtrl::GetItemData(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), NULL, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), NULL, _T("invalid tree item") );
return item.m_pItem->GetData(); return item.m_pItem->GetData();
} }
void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text) void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
{ {
wxCHECK_RET( item.IsOk(), "invalid tree item" ); wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
wxClientDC dc(this); wxClientDC dc(this);
wxGenericTreeItem *pItem = item.m_pItem; wxGenericTreeItem *pItem = item.m_pItem;
@@ -457,7 +457,7 @@ void wxTreeCtrl::SetItemText(const wxTreeItemId& item, const wxString& text)
void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image) void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image)
{ {
wxCHECK_RET( item.IsOk(), "invalid tree item" ); wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
wxGenericTreeItem *pItem = item.m_pItem; wxGenericTreeItem *pItem = item.m_pItem;
pItem->SetImage(image); pItem->SetImage(image);
@@ -466,7 +466,7 @@ void wxTreeCtrl::SetItemImage(const wxTreeItemId& item, int image)
void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image) void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
{ {
wxCHECK_RET( item.IsOk(), "invalid tree item" ); wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
wxGenericTreeItem *pItem = item.m_pItem; wxGenericTreeItem *pItem = item.m_pItem;
pItem->SetSelectedImage(image); pItem->SetSelectedImage(image);
@@ -475,14 +475,14 @@ void wxTreeCtrl::SetItemSelectedImage(const wxTreeItemId& item, int image)
void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data) void wxTreeCtrl::SetItemData(const wxTreeItemId& item, wxTreeItemData *data)
{ {
wxCHECK_RET( item.IsOk(), "invalid tree item" ); wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
item.m_pItem->SetData(data); item.m_pItem->SetData(data);
} }
void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has) void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has)
{ {
wxCHECK_RET( item.IsOk(), "invalid tree item" ); wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
wxGenericTreeItem *pItem = item.m_pItem; wxGenericTreeItem *pItem = item.m_pItem;
pItem->SetHasPlus(has); pItem->SetHasPlus(has);
@@ -491,7 +491,7 @@ void wxTreeCtrl::SetItemHasChildren(const wxTreeItemId& item, bool has)
void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold) void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
{ {
wxCHECK_RET( item.IsOk(), "invalid tree item" ); wxCHECK_RET( item.IsOk(), _T("invalid tree item") );
// avoid redrawing the tree if no real change // avoid redrawing the tree if no real change
wxGenericTreeItem *pItem = item.m_pItem; wxGenericTreeItem *pItem = item.m_pItem;
@@ -508,35 +508,35 @@ void wxTreeCtrl::SetItemBold(const wxTreeItemId& item, bool bold)
bool wxTreeCtrl::IsVisible(const wxTreeItemId& WXUNUSED(item)) const bool wxTreeCtrl::IsVisible(const wxTreeItemId& WXUNUSED(item)) const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
return TRUE; return TRUE;
} }
bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const bool wxTreeCtrl::ItemHasChildren(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
return !item.m_pItem->GetChildren().IsEmpty(); return !item.m_pItem->GetChildren().IsEmpty();
} }
bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const bool wxTreeCtrl::IsExpanded(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
return item.m_pItem->IsExpanded(); return item.m_pItem->IsExpanded();
} }
bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const bool wxTreeCtrl::IsSelected(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
return item.m_pItem->HasHilight(); return item.m_pItem->HasHilight();
} }
bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), FALSE, "invalid tree item" ); wxCHECK_MSG( item.IsOk(), FALSE, _T("invalid tree item") );
return item.m_pItem->IsBold(); return item.m_pItem->IsBold();
} }
@@ -547,14 +547,14 @@ bool wxTreeCtrl::IsBold(const wxTreeItemId& item) const
wxTreeItemId wxTreeCtrl::GetParent(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetParent(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
return item.m_pItem->GetParent(); return item.m_pItem->GetParent();
} }
wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) const wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
cookie = 0; cookie = 0;
return GetNextChild(item, cookie); return GetNextChild(item, cookie);
@@ -562,7 +562,7 @@ wxTreeItemId wxTreeCtrl::GetFirstChild(const wxTreeItemId& item, long& cookie) c
wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) const wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
wxArrayTreeItems& children = item.m_pItem->GetChildren(); wxArrayTreeItems& children = item.m_pItem->GetChildren();
if ( (size_t)cookie < children.Count() ) if ( (size_t)cookie < children.Count() )
@@ -578,7 +578,7 @@ wxTreeItemId wxTreeCtrl::GetNextChild(const wxTreeItemId& item, long& cookie) co
wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
wxArrayTreeItems& children = item.m_pItem->GetChildren(); wxArrayTreeItems& children = item.m_pItem->GetChildren();
return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last())); return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last()));
@@ -586,7 +586,7 @@ wxTreeItemId wxTreeCtrl::GetLastChild(const wxTreeItemId& item) const
wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
wxGenericTreeItem *i = item.m_pItem; wxGenericTreeItem *i = item.m_pItem;
wxGenericTreeItem *parent = i->GetParent(); wxGenericTreeItem *parent = i->GetParent();
@@ -606,7 +606,7 @@ wxTreeItemId wxTreeCtrl::GetNextSibling(const wxTreeItemId& item) const
wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
wxGenericTreeItem *i = item.m_pItem; wxGenericTreeItem *i = item.m_pItem;
wxGenericTreeItem *parent = i->GetParent(); wxGenericTreeItem *parent = i->GetParent();
@@ -626,25 +626,25 @@ wxTreeItemId wxTreeCtrl::GetPrevSibling(const wxTreeItemId& item) const
wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
return wxTreeItemId(); return wxTreeItemId();
} }
wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetNextVisible(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
return wxTreeItemId(); return wxTreeItemId();
} }
wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const wxTreeItemId wxTreeCtrl::GetPrevVisible(const wxTreeItemId& item) const
{ {
wxCHECK_MSG( item.IsOk(), wxTreeItemId(), "invalid tree item" ); wxCHECK_MSG( item.IsOk(), wxTreeItemId(), _T("invalid tree item") );
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
return wxTreeItemId(); return wxTreeItemId();
} }
@@ -688,7 +688,7 @@ wxTreeItemId wxTreeCtrl::AddRoot(const wxString& text,
int image, int selImage, int image, int selImage,
wxTreeItemData *data) wxTreeItemData *data)
{ {
wxCHECK_MSG( !m_anchor, wxTreeItemId(), "tree can have only one root" ); wxCHECK_MSG( !m_anchor, wxTreeItemId(), _T("tree can have only one root") );
wxClientDC dc(this); wxClientDC dc(this);
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc, m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc,
@@ -727,7 +727,7 @@ wxTreeItemId wxTreeCtrl::InsertItem(const wxTreeItemId& parentId,
int index = parent->GetChildren().Index(idPrevious.m_pItem); int index = parent->GetChildren().Index(idPrevious.m_pItem);
wxASSERT_MSG( index != wxNOT_FOUND, wxASSERT_MSG( index != wxNOT_FOUND,
"previous item in wxTreeCtrl::InsertItem() is not a sibling" ); _T("previous item in wxTreeCtrl::InsertItem() is not a sibling") );
return DoInsertItem(parentId, (size_t)index, text, image, selImage, data); return DoInsertItem(parentId, (size_t)index, text, image, selImage, data);
} }
@@ -954,27 +954,27 @@ void wxTreeCtrl::EnsureVisible(const wxTreeItemId& item)
void wxTreeCtrl::ScrollTo(const wxTreeItemId& WXUNUSED(item)) void wxTreeCtrl::ScrollTo(const wxTreeItemId& WXUNUSED(item))
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
} }
wxTextCtrl *wxTreeCtrl::EditLabel( const wxTreeItemId& WXUNUSED(item), wxTextCtrl *wxTreeCtrl::EditLabel( const wxTreeItemId& WXUNUSED(item),
wxClassInfo* WXUNUSED(textCtrlClass) ) wxClassInfo* WXUNUSED(textCtrlClass) )
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
return (wxTextCtrl*)NULL; return (wxTextCtrl*)NULL;
} }
wxTextCtrl *wxTreeCtrl::GetEditControl() const wxTextCtrl *wxTreeCtrl::GetEditControl() const
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
return (wxTextCtrl*)NULL; return (wxTextCtrl*)NULL;
} }
void wxTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item), bool WXUNUSED(discardChanges)) void wxTreeCtrl::EndEditLabel(const wxTreeItemId& WXUNUSED(item), bool WXUNUSED(discardChanges))
{ {
wxFAIL_MSG("not implemented"); wxFAIL_MSG(_T("not implemented"));
} }
// FIXME: tree sorting functions are not reentrant and not MT-safe! // FIXME: tree sorting functions are not reentrant and not MT-safe!
@@ -983,7 +983,7 @@ static wxTreeCtrl *s_treeBeingSorted = NULL;
static int tree_ctrl_compare_func(wxGenericTreeItem **item1, static int tree_ctrl_compare_func(wxGenericTreeItem **item1,
wxGenericTreeItem **item2) wxGenericTreeItem **item2)
{ {
wxCHECK_MSG( s_treeBeingSorted, 0, "bug in wxTreeCtrl::SortChildren()" ); wxCHECK_MSG( s_treeBeingSorted, 0, _T("bug in wxTreeCtrl::SortChildren()") );
return s_treeBeingSorted->OnCompareItems(*item1, *item2); return s_treeBeingSorted->OnCompareItems(*item1, *item2);
} }
@@ -991,17 +991,17 @@ static int tree_ctrl_compare_func(wxGenericTreeItem **item1,
int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1, int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
const wxTreeItemId& item2) const wxTreeItemId& item2)
{ {
return strcmp(GetItemText(item1), GetItemText(item2)); return wxStrcmp(GetItemText(item1), GetItemText(item2));
} }
void wxTreeCtrl::SortChildren(const wxTreeItemId& itemId) void wxTreeCtrl::SortChildren(const wxTreeItemId& itemId)
{ {
wxCHECK_RET( itemId.IsOk(), "invalid tree item" ); wxCHECK_RET( itemId.IsOk(), _T("invalid tree item") );
wxGenericTreeItem *item = itemId.m_pItem; wxGenericTreeItem *item = itemId.m_pItem;
wxCHECK_RET( !s_treeBeingSorted, wxCHECK_RET( !s_treeBeingSorted,
"wxTreeCtrl::SortChildren is not reentrant" ); _T("wxTreeCtrl::SortChildren is not reentrant") );
wxArrayTreeItems& children = item->GetChildren(); wxArrayTreeItems& children = item->GetChildren();
if ( children.Count() > 1 ) if ( children.Count() > 1 )
@@ -1092,7 +1092,7 @@ void wxTreeCtrl::PaintItem(wxGenericTreeItem *item, wxDC& dc)
} }
else else
{ {
wxFAIL_MSG("wxDC::GetFont() failed!"); wxFAIL_MSG(_T("wxDC::GetFont() failed!"));
} }
} }