#include "wx/generic/choicdgg.h"
// 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 len = strlen(copyMessage);
- char *currentMessage = copyMessage;
+ size_t len = wxStrlen(copyMessage);
+ wxChar *currentMessage = copyMessage;
// wxWindow *lastWindow = parent;
while (i < len) {
- while ((i < len) && (copyMessage[i] != '\n')) i++;
+ while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
// Overloaded for backward compatibility
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 width, int height )
{
return ans;
}
-char *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
- const wxString *choices, char **client_data, wxWindow *parent,
- int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
- int WXUNUSED(width), int WXUNUSED(height) )
+wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
+ const wxString *choices, wxChar **client_data, wxWindow *parent,
+ int WXUNUSED(x), int WXUNUSED(y), bool WXUNUSED(centre),
+ int WXUNUSED(width), int WXUNUSED(height) )
{
wxSingleChoiceDialog dialog(parent, message, caption, n, choices, client_data);
if ( dialog.ShowModal() == wxID_OK )
}
// Overloaded for backward compatibility
-char *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
- char *choices[], char **client_data, wxWindow *parent,
- int x, int y, bool centre,
- int width, int height )
+wxChar *wxGetSingleChoiceData( const wxString& message, const wxString& caption, int n,
+ wxChar *choices[], wxChar **client_data, wxWindow *parent,
+ int x, int y, bool centre,
+ int width, int height )
{
wxString *strings = new wxString[n];
int 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);
delete[] strings;
return data;
#endif
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)
{
Create(parent, message, caption, n, choices, clientData, style);
}
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)
{
Create(parent, message, caption, choices, clientData, style);
}
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()];
int i;
bool wxSingleChoiceDialog::Create( wxWindow *WXUNUSED(parent), const wxString& message,
const wxString& WXUNUSED(caption), int n,
- const wxString *choices, char **clientData, long style,
+ const wxString *choices, wxChar **clientData, long style,
const wxPoint& WXUNUSED(pos) )
{
m_dialogStyle = style;
m_selection = 0;
- m_stringSelection = "";
+ m_stringSelection = _T("");
m_clientData = NULL;
wxBeginBusyCursor();
topSizer->SetBorder(10, 10);
wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
- messageSizer->SetName("messageSizer");
+ messageSizer->SetName(_T("messageSizer"));
// bool centre = ((style & wxCENTRE) == wxCENTRE);
wxRowColSizer *listBoxSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
listBoxSizer->AddSizerChild(listBox);
- listBoxSizer->SetName("listBoxSizer");
+ listBoxSizer->SetName(_T("listBoxSizer"));
// Create constraints for the text sizer
wxLayoutConstraints *textC = new wxLayoutConstraints;
// Insert another spacer
wxSpacingSizer *spacingSizer2 = new wxSpacingSizer(topSizer, wxBelow, listBoxSizer, 10);
- spacingSizer->SetName("spacingSizer2");
+ spacingSizer->SetName(_T("spacingSizer2"));
// Insert a sizer for the buttons
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
- buttonSizer->SetName("buttonSizer");
+ buttonSizer->SetName(_T("buttonSizer"));
buttonSizer->SetSpacing(12,0);
// Specify constraints for the button sizer
{
m_selection = listBox->GetSelection();
m_stringSelection = listBox->GetStringSelection();
- m_clientData = (char*)listBox->GetClientData(m_selection);
+ m_clientData = (wxChar*)listBox->GetClientData(m_selection);
}
EndModal(wxID_OK);
{
m_selection = listBox->GetSelection();
m_stringSelection = listBox->GetStringSelection();
- m_clientData = (char*)listBox->GetClientData(m_selection);
+ m_clientData = (wxChar*)listBox->GetClientData(m_selection);
}
EndModal(wxID_OK);
// For PS_PRINTER action this depends on a Unix-style print spooler
// since the wx_printer_file can be destroyed during a session
// @@@ TODO: a Windows-style answer for non-Unix
- char userId[256];
+ wxChar userId[256];
wxGetUserId (userId, sizeof (userId) / sizeof (char));
- char tmp[256];
- strcpy (tmp, "/tmp/preview_");
- strcat (tmp, userId);
+ wxChar tmp[256];
+ wxStrcpy (tmp, _T("/tmp/preview_"));
+ wxStrcat (tmp, userId);
m_printData.SetFilename(tmp);
#endif
- char tmp2[256];
- strcpy(tmp2, m_printData.GetFilename());
- strcat (tmp2, ".ps");
+ wxChar tmp2[256];
+ wxStrcpy(tmp2, m_printData.GetFilename());
+ wxStrcat (tmp2, _T(".ps"));
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() )
{
m_ok = FALSE;
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;
void wxPostScriptDC::DestroyClippingRegion()
{
- wxCHECK_RET( m_ok && m_pstream, "invalid postscript dc" );
+ wxCHECK_RET( m_ok && m_pstream, _T("invalid postscript dc") );
wxDC::DestroyClippingRegion();
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))
{
- 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
{
- wxFAIL_MSG( "wxPostScriptDC::GetPixel not implemented." );
+ wxFAIL_MSG( _T("wxPostScriptDC::GetPixel not implemented.") );
return FALSE;
}
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)
{
- 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;
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 dy = y1 - yc;
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 (ea>=360 || ea<=-360) ea=ea-int(ea/360)*360;
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;
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;
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)
return;
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)
{
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)
{
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)
{
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;
{
for (int i = 0; i < ww; i++)
{
- char buffer[5];
+ wxChar buffer[5];
buffer[2] = 0;
wxDecToHex( image.GetRed(i,j), buffer );
*m_pstream << buffer;
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;
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;
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;
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 );
*m_pstream << XLOG2DEV(x) << " " << YLOG2DEV(by) << " moveto\n";
*m_pstream << "(";
- int len = strlen ((char *)(const char *)text);
+ wxWX2MBbuf textbuf = text.mb_str();
+ int len = strlen (textbuf);
int i;
for (i = 0; i < len; i++)
{
- int c = (unsigned char) text[i];
+ int c = (unsigned char) textbuf[i];
if ( c == ')' || c == '(' || c == '\\')
{
*m_pstream << "\\" << (char) c;
void wxPostScriptDC::SetLogicalFunction (int WXUNUSED(function))
{
- wxFAIL_MSG( "wxPostScriptDC::SetLogicalFunction not implemented." );
+ wxFAIL_MSG( _T("wxPostScriptDC::SetLogicalFunction not implemented.") );
}
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 );
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_signY = (yBottomUp ? 1 : -1);
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 w = 0;
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() == "")
{
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())
{
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)
{
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 << "%%Title: " << (const char *) m_title << "\n";
+ *m_pstream << "%%Title: " << m_title.mb_str() << "\n";
*m_pstream << "%%Creator: " << wxTheApp->argv[0] << "\n";
*m_pstream << "%%CreationDate: " << wxNow() << "\n";
- char userID[256];
+ wxChar userID[256];
if ( wxGetEmailAddress(userID, sizeof(userID)) )
{
- *m_pstream << "%%For: " << (char *)userID;
- char userName[245];
+ *m_pstream << "%%For: " << MBSTRINGCAST wxConv_libc.cWX2MB(userID);
+ wxChar userName[245];
if (wxGetUserName(userName, sizeof(userName)))
- *m_pstream << " (" << (char *)userName << ")";
+ *m_pstream << " (" << MBSTRINGCAST wxConv_libc.cWX2MB(userName) << ")";
*m_pstream << "\n";
}
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>
delete m_pstream;
m_pstream = (ofstream *) NULL;
- char *tmp_file = wxGetTempFileName("ps");
+ wxChar *tmp_file = wxGetTempFileName("ps");
// Paste header Before wx_printer_file
wxConcatFiles (header_file, m_printData.GetFilename(), tmp_file);
case wxPRINT_MODE_PREVIEW:
{
- char *argv[3];
- argv[0] = (char*) (const char*) previewCommand;
- argv[1] = (char*) (const char*) filename;
- argv[2] = (char*) (char *) NULL;
+ wxChar *argv[3];
+ argv[0] = WXSTRINGCAST previewCommand;
+ argv[1] = WXSTRINGCAST filename;
+ argv[2] = (wxChar*) NULL;
wxExecute (argv, TRUE);
wxRemoveFile(m_printData.GetFilename());
}
case wxPRINT_MODE_PRINTER:
{
- char *argv[4];
+ wxChar *argv[4];
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
// are blank, we get an annoying and confusing message from lpr.
- char * opts = (char*) (const char*) printerOptions;
+ wxChar * opts = WXSTRINGCAST printerOptions;
if (opts && *opts)
argv[argc++] = opts;
- argv[argc++] = (char*) (const char*) filename;
- argv[argc++] = (char *) NULL;
+ argv[argc++] = WXSTRINGCAST filename;
+ argv[argc++] = (wxChar *) NULL;
wxExecute (argv, TRUE);
wxRemoveFile(filename);
}
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";
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";
}
long xsrc, long ysrc,
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 */
if (!fontToUse) fontToUse = (wxFont*) &m_font;
- wxCHECK_RET( fontToUse, "GetTextExtent: no font defined" );
- wxCHECK_RET( x, "GetTextExtent: x == NULL" );
- wxCHECK_RET( y, "GetTextExtent: y == NULL" );
+ wxCHECK_RET( fontToUse, _T("GetTextExtent: no font defined") );
+ wxCHECK_RET( x, _T("GetTextExtent: x == NULL") );
+ wxCHECK_RET( y, _T("GetTextExtent: y == NULL") );
+
+ wxWX2MBbuf strbuf = string.mb_str();
#if !USE_AFM_FOR_POSTSCRIPT
/* Provide a VERY rough estimate (avoid using it).
{
height = fontToUse->GetPointSize();
}
- *x = strlen (string) * height * 72 / 120;
+ *x = strlen (strbuf) * height * 72 / 120;
*y = (long) (height * 1.32); /* allow for descender */
if (descent) *descent = 0;
if (externalLeading) *externalLeading = 0;
long widthSum=0;
long height=Size; /* by default */
unsigned char *p;
- for(p=(unsigned char *)(const char *)string; *p; p++)
+ for(p=(unsigned char *)strbuf; *p; p++)
{
if(lastWidths[*p]== INT_MIN)
{
m_paths.Clear();
m_names.Clear();
- ADD_SECTION("/", _("The Computer") )
+ ADD_SECTION(_T("/"), _("The Computer") )
wxGetHomeDir(&home);
ADD_SECTION(home, _("My Home") )
- ADD_SECTION("/mnt", _("Mounted Devices") )
- ADD_SECTION("/usr", _("User") )
- ADD_SECTION("/usr/local", _("User Local") )
- ADD_SECTION("/var", _("Variables") )
- ADD_SECTION("/etc", _("Etcetera") )
- ADD_SECTION("/tmp", _("Temporary") )
+ ADD_SECTION(_T("/mnt"), _("Mounted Devices") )
+ ADD_SECTION(_T("/usr"), _("User") )
+ ADD_SECTION(_T("/usr/local"), _("User Local") )
+ ADD_SECTION(_T("/var"), _("Variables") )
+ ADD_SECTION(_T("/etc"), _("Etcetera") )
+ ADD_SECTION(_T("/tmp"), _("Temporary") )
}
#undef ADD_SECTION
fontWeight = wxFontWeightStringToInt(WXSTRINGCAST weightChoice->GetStringSelection());
int fontStyle = 0;
fontStyle = wxFontStyleStringToInt(WXSTRINGCAST styleChoice->GetStringSelection());
- int fontSize = atoi(pointSizeChoice->GetStringSelection());
+ int fontSize = wxAtoi(pointSizeChoice->GetStringSelection());
int fontUnderline = underLineCheckBox->GetValue();
dialogFont = wxFont(fontSize, fontFamily, fontStyle, fontWeight, (fontUnderline != 0));
- if (colourChoice->GetStringSelection() != "")
+ if (colourChoice->GetStringSelection() != _T(""))
{
wxColour *col = (wxColour*) NULL;
col = wxTheColourDatabase->FindColour(colourChoice->GetStringSelection());
PaintFont(dc);
}
-char *wxFontWeightIntToString(int weight)
+wxChar *wxFontWeightIntToString(int weight)
{
switch (weight)
{
case wxLIGHT:
- return "Light";
+ return _T("Light");
case wxBOLD:
- return "Bold";
+ return _T("Bold");
case wxNORMAL:
default:
- return "Normal";
+ return _T("Normal");
}
- return "Normal";
+ return _T("Normal");
}
-char *wxFontStyleIntToString(int style)
+wxChar *wxFontStyleIntToString(int style)
{
switch (style)
{
case wxITALIC:
- return "Italic";
+ return _T("Italic");
case wxSLANT:
- return "Slant";
+ return _T("Slant");
case wxNORMAL:
default:
- return "Normal";
+ return _T("Normal");
}
- return "Normal";
+ return _T("Normal");
}
-char *wxFontFamilyIntToString(int family)
+wxChar *wxFontFamilyIntToString(int family)
{
switch (family)
{
case wxROMAN:
- return "Roman";
+ return _T("Roman");
case wxDECORATIVE:
- return "Decorative";
+ return _T("Decorative");
case wxMODERN:
- return "Modern";
+ return _T("Modern");
case wxSCRIPT:
- return "Script";
+ return _T("Script");
case wxTELETYPE:
- return "Teletype";
+ return _T("Teletype");
case wxSWISS:
default:
- return "Swiss";
+ return _T("Swiss");
}
- return "Swiss";
+ return _T("Swiss");
}
-int wxFontFamilyStringToInt(char *family)
+int wxFontFamilyStringToInt(wxChar *family)
{
if (!family)
return wxSWISS;
- if (strcmp(family, "Roman") == 0)
+ if (wxStrcmp(family, _T("Roman")) == 0)
return wxROMAN;
- else if (strcmp(family, "Decorative") == 0)
+ else if (wxStrcmp(family, _T("Decorative")) == 0)
return wxDECORATIVE;
- else if (strcmp(family, "Modern") == 0)
+ else if (wxStrcmp(family, _T("Modern")) == 0)
return wxMODERN;
- else if (strcmp(family, "Script") == 0)
+ else if (wxStrcmp(family, _T("Script")) == 0)
return wxSCRIPT;
- else if (strcmp(family, "Teletype") == 0)
+ else if (wxStrcmp(family, _T("Teletype")) == 0)
return wxTELETYPE;
else return wxSWISS;
}
-int wxFontStyleStringToInt(char *style)
+int wxFontStyleStringToInt(wxChar *style)
{
if (!style)
return wxNORMAL;
- if (strcmp(style, "Italic") == 0)
+ if (wxStrcmp(style, _T("Italic")) == 0)
return wxITALIC;
- else if (strcmp(style, "Slant") == 0)
+ else if (wxStrcmp(style, _T("Slant")) == 0)
return wxSLANT;
else
return wxNORMAL;
}
-int wxFontWeightStringToInt(char *weight)
+int wxFontWeightStringToInt(wxChar *weight)
{
if (!weight)
return wxNORMAL;
- if (strcmp(weight, "Bold") == 0)
+ if (wxStrcmp(weight, _T("Bold")) == 0)
return wxBOLD;
- else if (strcmp(weight, "Light") == 0)
+ else if (wxStrcmp(weight, _T("Light")) == 0)
return wxLIGHT;
else
return wxNORMAL;
if (!cell)
return;
- static char szEdit[300];
+ static wxChar szEdit[300];
wxClientDC dc(this);
dc.BeginDrawing();
dc.SetBackgroundMode(wxTRANSPARENT);
dc.SetBrush(cell->GetBackgroundBrush());
- strcpy(szEdit, m_textItem->GetValue());
+ wxStrcpy(szEdit, m_textItem->GetValue());
wxRect rect;
rect = m_currentRect;
rect.width -= 5;
rect.height -= 4;
- DrawTextRect(& dc, " ", &rect, wxLEFT);
+ DrawTextRect(& dc, _T(" "), &rect, wxLEFT);
DrawTextRect(& dc, szEdit, &rect, cell->GetAlignment());
dc.DestroyClippingRegion();
{
wxString lockfile;
wxGetHomeDir(&lockfile);
- lockfile << WXEXTHELP_SEPARATOR << ".netscape/lock";
+ lockfile << WXEXTHELP_SEPARATOR << _T(".netscape/lock");
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
// non-existing location if(wxFileExists(lockfile))
{
long success;
- command << m_BrowserName << " -remote openURL("
- << "file://" << m_MapFile
- << WXEXTHELP_SEPARATOR << relativeURL << ")";
+ command << m_BrowserName << _T(" -remote openURL(")
+ << _T("file://") << m_MapFile
+ << WXEXTHELP_SEPARATOR << relativeURL << _T(")");
success = wxExecute(command);
if(success != 0 ) // returns PID on success
return TRUE;
}
}
command = m_BrowserName;
- command << " file://"
+ command << _T(" file://")
<< m_MapFile << WXEXTHELP_SEPARATOR << relativeURL;
return wxExecute(command) != 0;
}
file = ifile;
if(! wxIsAbsolutePath(file))
{
- char* f = wxGetWorkingDirectory();
+ wxChar* f = wxGetWorkingDirectory();
file = f;
delete[] f; // wxGetWorkingDirectory returns new memory
file << WXEXTHELP_SEPARATOR << ifile;
else
{
newfile = WXEXTHELP_SEPARATOR;
- const char *cptr = wxGetLocale()->GetName().c_str();
- while(*cptr && *cptr != '_')
+ const wxChar *cptr = wxGetLocale()->GetName().c_str();
+ while(*cptr && *cptr != _T('_'))
newfile << *(cptr++);
if(wxDirExists(newfile))
file = newfile;
m_MapList = new wxList;
m_NumOfEntries = 0;
- FILE *input = fopen(mapFile.c_str(),"rt");
+ FILE *input = fopen(mapFile.fn_str(),"rt");
if(! input)
return FALSE;
do
{
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();
}
{
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;
if (bitmap.IsKindOf(CLASSINFO(wxIcon)))
{
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 );
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();
width = bm->GetWidth();
{
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();
void wxListMainWindow::DeleteColumn( int col )
{
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;
wxNode *node = m_columns.Nth( col );
// New dialog box implementations
// 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 len = strlen(copyMessage);
- char *currentMessage = copyMessage;
+ size_t len = wxStrlen(copyMessage);
+ wxChar *currentMessage = copyMessage;
// wxWindow *lastWindow = parent;
while (i < len) {
- while ((i < len) && (copyMessage[i] != '\n')) i++;
+ while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
topSizer->SetBorder(10, 10);
wxRowColSizer *messageSizer = new wxRowColSizer(topSizer, wxSIZER_COLS, 100);
- messageSizer->SetName("messageSizer");
+ messageSizer->SetName(_T("messageSizer"));
// bool centre = ((style & wxCENTRE) == wxCENTRE);
wxSpacingSizer *spacingSizer = new wxSpacingSizer(topSizer, wxBelow, messageSizer, 20);
wxRowColSizer *buttonSizer = new wxRowColSizer(topSizer, wxSIZER_ROWS);
- buttonSizer->SetName("buttonSizer");
+ buttonSizer->SetName(_T("buttonSizer"));
buttonSizer->SetSpacing(12,0);
// Specify constraints for the button sizer
wxString f = wxFileSelector(_("PostScript file"),
wxPathOnly(wxThePrintSetupData->GetPrinterFile()),
wxFileNameFromPath(wxThePrintSetupData->GetPrinterFile()),
- "ps", "*.ps", 0, this);
+ _T("ps"), _T("*.ps"), 0, this);
if ( f.IsEmpty() )
return;
{
if (m_printDialogData.GetEnablePageNumbers())
{
- if(m_fromText) m_printDialogData.SetFromPage(atoi(m_fromText->GetValue()));
- if(m_toText) m_printDialogData.SetToPage(atoi(m_toText->GetValue()));
+ if(m_fromText) m_printDialogData.SetFromPage(wxAtoi(m_fromText->GetValue()));
+ if(m_toText) m_printDialogData.SetToPage(wxAtoi(m_toText->GetValue()));
}
if(m_rangeRadioBox)
{
m_printDialogData.SetFromPage(1);
m_printDialogData.SetToPage(32000);
}
- m_printDialogData.SetNoCopies(atoi(m_noCopiesText->GetValue()));
+ m_printDialogData.SetNoCopies(wxAtoi(m_noCopiesText->GetValue()));
m_printDialogData.SetPrintToFile(m_printToFileCheckBox->GetValue());
return TRUE;
bool wxGenericPageSetupDialog::TransferDataFromWindow()
{
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)
- 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)
{
Copy((wxPropertyValue& )copyFrom);
}
-wxPropertyValue::wxPropertyValue(const char *val)
+wxPropertyValue::wxPropertyValue(const wxChar *val)
{
m_modifiedFlag = FALSE;
m_type = wxPropertyValueString;
m_modifiedFlag = FALSE;
m_type = wxPropertyValueString;
- m_value.string = copystring((const char *)val);
+ m_value.string = copystring((const wxChar *)val);
m_clientData = NULL;
m_next = NULL;
m_last = NULL;
}
// Pointer versions: we have a pointer to the real C++ value.
-wxPropertyValue::wxPropertyValue(char **val)
+wxPropertyValue::wxPropertyValue(wxChar **val)
{
m_modifiedFlag = FALSE;
m_type = wxPropertyValueStringPtr;
return ;
case wxPropertyValueStringPtr:
{
- char** s = copyFrom.StringValuePtr();
+ wxChar** s = copyFrom.StringValuePtr();
(*this) = s;
return ;
}
case wxPropertyValueReal:
{
float f = m_value.real;
- sprintf(wxBuffer, "%.6g", (double)f);
+ wxSprintf(wxBuffer, _T("%.6g"), (double)f);
stream << wxBuffer;
break;
}
if (fabs(f) < 0.00001)
f = 0.0;
*/
- sprintf(wxBuffer, "%.6g", f);
+ wxSprintf(wxBuffer, _T("%.6g"), f);
stream << wxBuffer;
break;
}
{
// stream << "\"";
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++)
{
- char ch = m_value.string[i];
+ char ch = strbuf[i];
// if (ch == '"' || ch == '\\')
// stream << "\\";
stream << ch;
}
case wxPropertyValueStringPtr:
{
- wxFAIL_MSG( "wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented" );
+ wxFAIL_MSG( _T("wxPropertyValue::WritePropertyType( wxPropertyValueStringPtr ) not implemented") );
/*
int i;
int len = strlen(*(m_value.stringPtr));
// void wxPropertyValue::operator=(const char *val)
void wxPropertyValue::operator=(const wxString& val1)
{
- const char *val = (const char *)val1;
+ const wxChar *val = (const wxChar *)val1;
m_modifiedFlag = TRUE;
if (m_type == wxPropertyValueNull)
m_next = NULL;
}
-void wxPropertyValue::operator=(const char **val)
+void wxPropertyValue::operator=(const wxChar **val)
{
m_modifiedFlag = TRUE;
m_type = wxPropertyValueStringPtr;
if (val)
- m_value.stringPtr = (char **)val;
+ m_value.stringPtr = (wxChar **)val;
else
m_value.stringPtr = NULL;
m_clientData = NULL;
return m_value.boolPtr;
}
-char *wxPropertyValue::StringValue(void) const {
+wxChar *wxPropertyValue::StringValue(void) const {
if (m_type == wxPropertyValueString)
return m_value.string;
else if (m_type == wxPropertyValueStringPtr)
else return NULL;
}
-char **wxPropertyValue::StringValuePtr(void) const
+wxChar **wxPropertyValue::StringValuePtr(void) const
{
return m_value.stringPtr;
}
// Add a 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
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)
return NULL;
else
void wxPropertyValidatorRegistry::RegisterValidator(const wxString& typeName, wxPropertyValidator *validator)
{
- Put((const char*) typeName, validator);
+ Put((const wxChar*) typeName, validator);
}
wxPropertyValidator *wxPropertyValidatorRegistry::GetValidator(const wxString& typeName)
{
- return (wxPropertyValidator *)Get((const char*) typeName);
+ return (wxPropertyValidator *)Get((const wxChar*) typeName);
}
void wxPropertyValidatorRegistry::ClearRegistry(void)
wxPropertyValidator::~wxPropertyValidator(void)
{}
-bool wxPropertyValidator::StringToFloat (char *s, float *number) {
+bool wxPropertyValidator::StringToFloat (wxChar *s, float *number) {
double num;
bool ok = StringToDouble (s, &num);
*number = (float) num;
return ok;
}
-bool wxPropertyValidator::StringToDouble (char *s, double *number) {
+bool wxPropertyValidator::StringToDouble (wxChar *s, double *number) {
bool ok = TRUE;
- char *value_ptr;
- *number = strtod (s, &value_ptr);
+ wxChar *value_ptr;
+ *number = wxStrtod (s, &value_ptr);
if (value_ptr) {
- int len = strlen (value_ptr);
+ int len = wxStrlen (value_ptr);
for (int i = 0; i < len; i++) {
- ok = (isspace (value_ptr[i]) != 0);
+ ok = (wxIsspace (value_ptr[i]) != 0);
if (!ok) return FALSE;
}
}
return ok;
}
-bool wxPropertyValidator::StringToInt (char *s, int *number) {
+bool wxPropertyValidator::StringToInt (wxChar *s, int *number) {
long num;
bool ok = StringToLong (s, &num);
*number = (int) num;
return ok;
}
-bool wxPropertyValidator::StringToLong (char *s, long *number) {
+bool wxPropertyValidator::StringToLong (wxChar *s, long *number) {
bool ok = TRUE;
- char *value_ptr;
- *number = strtol (s, &value_ptr, 10);
+ wxChar *value_ptr;
+ *number = wxStrtol (s, &value_ptr, 10);
if (value_ptr) {
- int len = strlen (value_ptr);
+ int len = wxStrlen (value_ptr);
for (int i = 0; i < len; i++) {
- ok = (isspace (value_ptr[i]) != 0);
+ ok = (wxIsspace (value_ptr[i]) != 0);
if (!ok) return FALSE;
}
}
return ok;
}
-char *wxPropertyValidator::FloatToString (float number) {
- static char buf[20];
- sprintf (buf, "%.6g", number);
+wxChar *wxPropertyValidator::FloatToString (float number) {
+ static wxChar buf[20];
+ wxSprintf (buf, _T("%.6g"), number);
return buf;
}
-char *wxPropertyValidator::DoubleToString (double number) {
- static char buf[20];
- sprintf (buf, "%.6g", number);
+wxChar *wxPropertyValidator::DoubleToString (double number) {
+ static wxChar buf[20];
+ wxSprintf (buf, _T("%.6g"), number);
return buf;
}
-char *wxPropertyValidator::IntToString (int number) {
+wxChar *wxPropertyValidator::IntToString (int number) {
return ::IntToString (number);
}
-char *wxPropertyValidator::LongToString (long number) {
+wxChar *wxPropertyValidator::LongToString (long number) {
return ::LongToString (number);
}
-
-
if (win.GetName() == "")
return;
- if (strcmp(win.GetName(), "ok") == 0)
+ if (wxStrcmp(win.GetName(), _T("ok")) == 0)
OnOk(event);
- else if (strcmp(win.GetName(), "cancel") == 0)
+ else if (wxStrcmp(win.GetName(), _T("cancel")) == 0)
OnCancel(event);
- else if (strcmp(win.GetName(), "help") == 0)
+ else if (wxStrcmp(win.GetName(), _T("help")) == 0)
OnHelp(event);
- else if (strcmp(win.GetName(), "update") == 0)
+ else if (wxStrcmp(win.GetName(), _T("update")) == 0)
OnUpdate(event);
- else if (strcmp(win.GetName(), "revert") == 0)
+ else if (wxStrcmp(win.GetName(), _T("revert")) == 0)
OnRevert(event);
else
{
float val = 0.0;
if (!StringToFloat(WXSTRINGCAST value, &val))
{
- char buf[200];
- sprintf(buf, "Value %s is not a valid real number!", (const char *)value);
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value %s is not a valid real number!"), (const wxChar *)value);
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (val < m_realMin || val > m_realMax)
{
- char buf[200];
- sprintf(buf, "Value must be a real number between %.2f and %.2f!", m_realMin, m_realMax);
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax);
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (value.Length() == 0)
return FALSE;
- float f = (float)atof((const char *)value);
+ float f = (float)wxAtof((const wxChar *)value);
property->GetValue() = f;
return TRUE;
}
if (!StringToLong(WXSTRINGCAST value, &val))
{
- char buf[200];
- sprintf(buf, "Value %s is not a valid integer!", (const char *)value);
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value %s is not a valid integer!"), (const wxChar *)value);
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
}
if (value.Length() == 0)
return FALSE;
- long i = atol((const char *)value);
+ long i = wxAtol((const wxChar *)value);
property->GetValue() = i;
}
else if (m_propertyWindow->IsKindOf(CLASSINFO(wxSlider)))
float val = 0.0;
if (!StringToFloat(WXSTRINGCAST value, &val))
{
- char buf[200];
- sprintf(buf, "Value %s is not a valid real number!", value.GetData());
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value %s is not a valid real number!"), value.GetData());
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (!view->GetValueText())
return FALSE;
- if (strlen(view->GetValueText()->GetValue()) == 0)
+ if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE;
wxString value(view->GetValueText()->GetValue());
- float f = (float)atof(value.GetData());
+ float f = (float)wxAtof(value.GetData());
property->GetValue() = f;
return TRUE;
}
long val = 0;
if (!StringToLong(WXSTRINGCAST value, &val))
{
- char buf[200];
- sprintf(buf, "Value %s is not a valid integer!", value.GetData());
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value %s is not a valid integer!"), value.GetData());
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
if (val < m_integerMin || val > m_integerMax)
{
- char buf[200];
- sprintf(buf, "Value must be an integer between %ld and %ld!", m_integerMin, m_integerMax);
- wxMessageBox(buf, "Property value error", wxOK | wxICON_EXCLAMATION, parentWindow);
+ wxChar buf[200];
+ wxSprintf(buf, _T("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax);
+ wxMessageBox(buf, _T("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow);
return FALSE;
}
return TRUE;
if (!view->GetValueText())
return FALSE;
- if (strlen(view->GetValueText()->GetValue()) == 0)
+ if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE;
wxString value(view->GetValueText()->GetValue());
- long val = (long)atoi(value.GetData());
+ long val = (long)wxAtoi(value.GetData());
property->GetValue() = (long)val;
return TRUE;
}
if (!view->GetValueText())
return FALSE;
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 TRUE;
if (!view->GetValueText())
return FALSE;
- if (strlen(view->GetValueText()->GetValue()) == 0)
+ if (wxStrlen(view->GetValueText()->GetValue()) == 0)
return FALSE;
wxString value(view->GetValueText()->GetValue());
bool boolValue = FALSE;
- if (value == "True")
+ if (value == _T("True"))
boolValue = TRUE;
else
boolValue = FALSE;
view->ShowListBoxControl(TRUE);
view->GetValueList()->Enable(TRUE);
- view->GetValueList()->Append("True");
- view->GetValueList()->Append("False");
- char *currentString = copystring(view->GetValueText()->GetValue());
+ view->GetValueList()->Append(_T("True"));
+ view->GetValueList()->Append(_T("False"));
+ wxChar *currentString = copystring(view->GetValueText()->GetValue());
view->GetValueList()->SetStringSelection(currentString);
delete[] currentString;
}
wxNode *node = m_strings->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
view->GetValueList()->Append(s);
node = node->Next();
}
- char *currentString = property->GetValue().StringValue();
+ wxChar *currentString = property->GetValue().StringValue();
view->GetValueList()->SetStringSelection(currentString);
}
return TRUE;
return FALSE;
wxNode *node = m_strings->First();
- char *currentString = property->GetValue().StringValue();
+ wxChar *currentString = property->GetValue().StringValue();
while (node)
{
- char *s = (char *)node->Data();
- if (strcmp(s, currentString) == 0)
+ wxChar *s = (wxChar *)node->Data();
+ if (wxStrcmp(s, currentString) == 0)
{
- char *nextString = NULL;
+ wxChar *nextString = NULL;
if (node->Next())
- nextString = (char *)node->Next()->Data();
+ nextString = (wxChar *)node->Next()->Data();
else
- nextString = (char *)m_strings->First()->Data();
+ nextString = (wxChar *)m_strings->First()->Data();
property->GetValue() = wxString(nextString);
view->DisplayProperty(property);
view->UpdatePropertyDisplayInList(property);
if (!view->GetValueText())
return;
- char *s = property->GetValue().StringValue();
+ wxChar *s = property->GetValue().StringValue();
int r = 0;
int g = 0;
int b = 0;
wxColourData retData = dialog.GetColourData();
col = retData.GetColour();
- char buf[7];
+ wxChar buf[7];
wxDecToHex(col.Red(), buf);
wxDecToHex(col.Green(), buf+2);
wxDecToHex(col.Blue(), buf+4);
wxPropertyValue *expr = property->GetValue().GetFirst();
while (expr)
{
- char *s = expr->StringValue();
+ wxChar *s = expr->StringValue();
if (s)
stringList->Add(s);
expr = expr->GetNext();
}
- wxString title("Editing ");
+ wxString title(_T("Editing "));
title += property->GetName();
if (EditStringList(parentWindow, stringList, title.GetData()))
wxNode *node = stringList->First();
while (node)
{
- char *s = (char *)node->Data();
+ wxChar *s = (wxChar *)node->Data();
oldValue.Append(new wxPropertyValue(s));
node = node->Next();
bool wxPropertyStringListEditorDialog::sm_dialogCancelled = FALSE;
// 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 largeButtonHeight = 25;
return;
m_listBox->Delete(sel);
- delete[] (char *)node->Data();
+ delete[] (wxChar *)node->Data();
delete node;
m_currentSelection = -1;
m_stringText->SetValue("");
{
SaveCurrentSelection();
- char *initialText = "";
+ wxChar *initialText = _T("");
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_listBox->SetSelection(m_currentSelection);
ShowCurrentSelection();
}
else
{
- wxFAIL_MSG("splitter: attempt to remove a non-existent window");
+ wxFAIL_MSG(_T("splitter: attempt to remove a non-existent window"));
return FALSE;
}
// Replace a window with another one
bool wxSplitterWindow::ReplaceWindow(wxWindow *winOld, wxWindow *winNew)
{
- wxCHECK_MSG( winOld, FALSE, "use one of Split() functions instead" );
- wxCHECK_MSG( winNew, FALSE, "use Unsplit() functions instead" );
+ wxCHECK_MSG( winOld, FALSE, _T("use one of Split() functions instead") );
+ wxCHECK_MSG( winNew, FALSE, _T("use Unsplit() functions instead") );
if ( winOld == m_windowTwo )
{
}
else
{
- wxFAIL_MSG("splitter: attempt to replace a non-existent window");
+ wxFAIL_MSG(_T("splitter: attempt to replace a non-existent window"));
return FALSE;
}
#endif
// 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 len = strlen(copyMessage);
- char *currentMessage = copyMessage;
+ size_t len = wxStrlen(copyMessage);
+ wxChar *currentMessage = copyMessage;
// wxWindow *lastWindow = parent;
while (i < len) {
- while ((i < len) && (copyMessage[i] != '\n')) i++;
+ while ((i < len) && (copyMessage[i] != _T('\n'))) i++;
if (i < len) copyMessage[i] = 0;
wxStaticText *mess = new wxStaticText(parent, -1, currentMessage);
delete m_data;
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)
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);
}
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();
}
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();
}
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();
}
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();
}
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);
wxGenericTreeItem *pItem = item.m_pItem;
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;
pItem->SetImage(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;
pItem->SetSelectedImage(image);
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);
}
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;
pItem->SetHasPlus(has);
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
wxGenericTreeItem *pItem = item.m_pItem;
bool wxTreeCtrl::IsVisible(const wxTreeItemId& WXUNUSED(item)) const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return TRUE;
}
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();
}
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();
}
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();
}
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();
}
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();
}
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;
return GetNextChild(item, cookie);
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();
if ( (size_t)cookie < children.Count() )
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();
return (children.IsEmpty() ? wxTreeItemId() : wxTreeItemId(children.Last()));
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 *parent = i->GetParent();
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 *parent = i->GetParent();
wxTreeItemId wxTreeCtrl::GetFirstVisibleItem() const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return wxTreeItemId();
}
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();
}
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();
}
int image, int selImage,
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);
m_anchor = new wxGenericTreeItem((wxGenericTreeItem *)NULL, text, dc,
int index = parent->GetChildren().Index(idPrevious.m_pItem);
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);
}
void wxTreeCtrl::ScrollTo(const wxTreeItemId& WXUNUSED(item))
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
}
wxTextCtrl *wxTreeCtrl::EditLabel( const wxTreeItemId& WXUNUSED(item),
wxClassInfo* WXUNUSED(textCtrlClass) )
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return (wxTextCtrl*)NULL;
}
wxTextCtrl *wxTreeCtrl::GetEditControl() const
{
- wxFAIL_MSG("not implemented");
+ wxFAIL_MSG(_T("not implemented"));
return (wxTextCtrl*)NULL;
}
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!
static int tree_ctrl_compare_func(wxGenericTreeItem **item1,
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);
}
int wxTreeCtrl::OnCompareItems(const wxTreeItemId& item1,
const wxTreeItemId& item2)
{
- return strcmp(GetItemText(item1), GetItemText(item2));
+ return wxStrcmp(GetItemText(item1), GetItemText(item2));
}
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;
wxCHECK_RET( !s_treeBeingSorted,
- "wxTreeCtrl::SortChildren is not reentrant" );
+ _T("wxTreeCtrl::SortChildren is not reentrant") );
wxArrayTreeItems& children = item->GetChildren();
if ( children.Count() > 1 )
}
else
{
- wxFAIL_MSG("wxDC::GetFont() failed!");
+ wxFAIL_MSG(_T("wxDC::GetFont() failed!"));
}
}