From 9e05364039a615196ff8c6e222e116f96892a172 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 18 Dec 2002 06:24:15 +0000 Subject: [PATCH 1/1] More unicode fixes git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@18319 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/gizmos/dynamicsash.h | 6 +++-- contrib/include/wx/ogl/basic.h | 2 +- contrib/include/wx/ogl/basicp.h | 2 +- contrib/include/wx/ogl/constrnt.h | 9 ++++--- contrib/include/wx/ogl/drawn.h | 4 ++-- contrib/include/wx/ogl/lines.h | 7 +++--- contrib/include/wx/ogl/mfutils.h | 4 ++-- contrib/src/gizmos/dynamicsash.cpp | 4 ++++ contrib/src/ogl/basic.cpp | 18 +++++++------- contrib/src/ogl/basic2.cpp | 10 ++++---- contrib/src/ogl/bmpshape.cpp | 2 +- contrib/src/ogl/composit.cpp | 18 +++++++------- contrib/src/ogl/constrnt.cpp | 32 ++++++++++++------------- contrib/src/ogl/divided.cpp | 2 +- contrib/src/ogl/drawn.cpp | 4 ++-- contrib/src/ogl/lines.cpp | 8 +++---- contrib/src/ogl/mfutils.cpp | 6 ++--- contrib/src/ogl/misc.cpp | 6 ++--- 18 files changed, 77 insertions(+), 67 deletions(-) diff --git a/contrib/include/wx/gizmos/dynamicsash.h b/contrib/include/wx/gizmos/dynamicsash.h index a3b2f22363..6ad05841c3 100644 --- a/contrib/include/wx/gizmos/dynamicsash.h +++ b/contrib/include/wx/gizmos/dynamicsash.h @@ -142,19 +142,21 @@ typedef void (wxEvtHandler::*wxDynamicSashUnifyEventFunction)(wxDynamicSashSplit /* wxDynamicSashWindow. See above. */ +extern const wxChar* GIZMODLLEXPORT wxDynamicSashWindowNameStr; + class GIZMODLLEXPORT wxDynamicSashWindow : public wxWindow { public: wxDynamicSashWindow(); wxDynamicSashWindow(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const wxString& name = "dynamicSashWindow"); + const wxString& name = wxDynamicSashWindowNameStr); virtual ~wxDynamicSashWindow(); virtual bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCLIP_CHILDREN | wxDS_MANAGE_SCROLLBARS | wxDS_DRAG_CORNER, - const wxString& name = "dynamicSashWindow"); + const wxString& name = wxDynamicSashWindowNameStr); virtual wxScrollBar *GetHScrollBar(const wxWindow *child) const; virtual wxScrollBar *GetVScrollBar(const wxWindow *child) const; diff --git a/contrib/include/wx/ogl/basic.h b/contrib/include/wx/ogl/basic.h index a765fbe09d..eeaead4b10 100644 --- a/contrib/include/wx/ogl/basic.h +++ b/contrib/include/wx/ogl/basic.h @@ -353,7 +353,7 @@ class wxShape: public wxShapeEvtHandler virtual int GetRegionId(const wxString& name); // Construct names for regions, unique even for children of a composite. - virtual void NameRegions(const wxString& parentName = ""); + virtual void NameRegions(const wxString& parentName = wxEmptyString); // Get list of regions inline wxList& GetRegions() const { return (wxList&) m_regions; } diff --git a/contrib/include/wx/ogl/basicp.h b/contrib/include/wx/ogl/basicp.h index a1d60cedee..c0927c0c17 100644 --- a/contrib/include/wx/ogl/basicp.h +++ b/contrib/include/wx/ogl/basicp.h @@ -22,7 +22,7 @@ class wxShapeTextLine: public wxObject { DECLARE_DYNAMIC_CLASS(wxShapeTextLine) public: - wxShapeTextLine(double the_x = 0.0, double the_y = 0.0, const wxString& the_line = ""); + wxShapeTextLine(double the_x = 0.0, double the_y = 0.0, const wxString& the_line = wxEmptyString); ~wxShapeTextLine(); inline double GetX() const { return m_x; } diff --git a/contrib/include/wx/ogl/constrnt.h b/contrib/include/wx/ogl/constrnt.h index b70bd2f32f..bd0616e491 100644 --- a/contrib/include/wx/ogl/constrnt.h +++ b/contrib/include/wx/ogl/constrnt.h @@ -25,7 +25,8 @@ class wxOGLConstraintType: public wxObject { DECLARE_DYNAMIC_CLASS(wxOGLConstraintType) public: - wxOGLConstraintType(int type = 0, const wxString& name = "", const wxString& phrase = ""); + wxOGLConstraintType(int type = 0, const wxString& name = wxEmptyString, + const wxString& phrase = wxEmptyString); ~wxOGLConstraintType(); public: @@ -60,8 +61,10 @@ class wxOGLConstraint: public wxObject { DECLARE_DYNAMIC_CLASS(wxOGLConstraint) public: - wxOGLConstraint() { m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; m_constraintName = ""; m_constraintId = 0; - m_constrainingObject = NULL; } + wxOGLConstraint() { + m_xSpacing = 0.0; m_ySpacing = 0.0; m_constraintType = 0; + m_constraintName = wxEmptyString; m_constraintId = 0; + m_constrainingObject = NULL; } wxOGLConstraint(int type, wxShape *constraining, wxList& constrained); ~wxOGLConstraint(); diff --git a/contrib/include/wx/ogl/drawn.h b/contrib/include/wx/ogl/drawn.h index dafde44d21..dd7ba01ffd 100644 --- a/contrib/include/wx/ogl/drawn.h +++ b/contrib/include/wx/ogl/drawn.h @@ -48,7 +48,7 @@ class wxPseudoMetaFile: public wxObject // Rotate about the given axis by theta radians from the x axis. void Rotate(double x, double y, double theta); - bool LoadFromMetaFile(char *filename, double *width, double *height); + bool LoadFromMetaFile(const wxString& filename, double *width, double *height); void GetBounds(double *minX, double *minY, double *maxX, double *maxY); @@ -157,7 +157,7 @@ class wxDrawnShape: public wxRectangleShape inline double GetRotation() const { return m_rotation; } void SetSize(double w, double h, bool recursive = TRUE); - bool LoadFromMetaFile(char *filename); + bool LoadFromMetaFile(const wxString& filename); inline void SetSaveToFile(bool save) { m_saveToFile = save; } inline wxPseudoMetaFile& GetMetaFile(int which = 0) const { return (wxPseudoMetaFile&) m_metafiles[which]; } diff --git a/contrib/include/wx/ogl/lines.h b/contrib/include/wx/ogl/lines.h index 22d7a3b22c..d274c88f0b 100644 --- a/contrib/include/wx/ogl/lines.h +++ b/contrib/include/wx/ogl/lines.h @@ -51,7 +51,7 @@ class wxArrowHead: public wxObject DECLARE_DYNAMIC_CLASS(wxArrowHead) public: - wxArrowHead(WXTYPE type = 0, int end = 0, double size = 0.0, double dist = 0.0, const wxString& name = "", wxPseudoMetaFile *mf = NULL, + wxArrowHead(WXTYPE type = 0, int end = 0, double size = 0.0, double dist = 0.0, const wxString& name = wxEmptyString, wxPseudoMetaFile *mf = NULL, long arrowId = -1); ~wxArrowHead(); wxArrowHead(wxArrowHead& toCopy); @@ -210,8 +210,9 @@ class wxLineShape: public wxShape // Add an arrowhead. wxArrowHead *AddArrow(WXTYPE type, int end = ARROW_POSITION_END, - double arrowSize = 10.0, double xOffset = 0.0, const wxString& name = "", - wxPseudoMetaFile *mf = NULL, long arrowId = -1); + double arrowSize = 10.0, double xOffset = 0.0, + const wxString& name = wxEmptyString, + wxPseudoMetaFile *mf = NULL, long arrowId = -1); // Add an arrowhead in the position indicated by the reference // list of arrowheads, which contains all legal arrowheads for this diff --git a/contrib/include/wx/ogl/mfutils.h b/contrib/include/wx/ogl/mfutils.h index 27ceb4b618..7e8a6e6a8a 100644 --- a/contrib/include/wx/ogl/mfutils.h +++ b/contrib/include/wx/ogl/mfutils.h @@ -195,7 +195,7 @@ class wxXMetaFile: public wxObject wxList metaRecords; wxList gdiObjects; // List of wxMetaRecord objects created with Create..., // referenced by position in list by SelectObject - wxXMetaFile(char *file = NULL); + wxXMetaFile(const wxChar* file = NULL); ~wxXMetaFile(void); // After this is called, the metafile cannot be used for anything @@ -204,7 +204,7 @@ class wxXMetaFile: public wxObject bool Play(wxDC *dc); inline bool Ok(void) const { return ok; } - bool ReadFile(char *file); + bool ReadFile(const wxChar *file); }; #endif diff --git a/contrib/src/gizmos/dynamicsash.cpp b/contrib/src/gizmos/dynamicsash.cpp index 53b1123f7c..6e80bbacb4 100644 --- a/contrib/src/gizmos/dynamicsash.cpp +++ b/contrib/src/gizmos/dynamicsash.cpp @@ -29,6 +29,10 @@ #include "wx/gizmos/dynamicsash.h" + +const wxChar* wxDynamicSashWindowNameStr = wxT("dynamicSashWindow"); + + /* wxDynamicSashWindow works by internally storing a tree of Implementation objects (wxDynamicSsahWindowImpl) and Leaf objects diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 261243d542..b18c4ad517 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -286,7 +286,7 @@ wxShape::wxShape(wxShapeCanvas *can) m_brush = wxWHITE_BRUSH; m_font = g_oglNormalFont; m_textColour = wxBLACK; - m_textColourName = "BLACK"; + m_textColourName = wxT("BLACK"); m_visible = FALSE; m_selected = FALSE; m_attachmentMode = ATTACHMENT_MODE_NONE; @@ -305,7 +305,7 @@ wxShape::wxShape(wxShapeCanvas *can) m_shadowBrush = wxBLACK_BRUSH; m_textMarginX = 5; m_textMarginY = 5; - m_regionName = "0"; + m_regionName = wxT("0"); m_centreResize = TRUE; m_maintainAspectRatio = FALSE; m_highlighted = FALSE; @@ -319,10 +319,10 @@ wxShape::wxShape(wxShapeCanvas *can) // the region eventually (the duplication is for compatibility) wxShapeRegion *region = new wxShapeRegion; m_regions.Append(region); - region->SetName("0"); + region->SetName(wxT("0")); region->SetFont(g_oglNormalFont); region->SetFormatMode(FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT); - region->SetColour("BLACK"); + region->SetColour(wxT("BLACK")); } wxShape::~wxShape() @@ -616,7 +616,7 @@ void wxShape::FormatText(wxDC& dc, const wxString& s, int i) node = stringList->First(); while (node) { - char *s = (char *)node->Data(); + wxChar *s = (wxChar *)node->Data(); wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s); region->GetFormattedText().Append((wxObject *)line); node = node->Next(); @@ -776,7 +776,7 @@ wxString wxShape::GetTextColour(int regionId) const { wxNode *node = m_regions.Nth(regionId); if (!node) - return wxString(""); + return wxEmptyString; wxShapeRegion *region = (wxShapeRegion *)node->Data(); return region->GetColour(); } @@ -794,7 +794,7 @@ wxString wxShape::GetRegionName(int regionId) { wxNode *node = m_regions.Nth(regionId); if (!node) - return wxString(""); + return wxEmptyString; wxShapeRegion *region = (wxShapeRegion *)node->Data(); return region->GetName(); } @@ -822,7 +822,7 @@ void wxShape::NameRegions(const wxString& parentName) for (int i = 0; i < n; i++) { if (parentName.Length() > 0) - buff << parentName << "." << i; + buff << parentName << wxT(".") << i; else buff << i; SetRegionName(buff, i); @@ -834,7 +834,7 @@ void wxShape::NameRegions(const wxString& parentName) buff.Empty(); wxShape *child = (wxShape *)node->Data(); if (parentName.Length() > 0) - buff << parentName << "." << j; + buff << parentName << wxT(".") << j; else buff << j; child->NameRegions(buff); diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index 33ed98da8a..e12fa3e07c 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -1761,7 +1761,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxShapeRegion, wxObject) wxShapeRegion::wxShapeRegion() { - m_regionText = ""; + m_regionText = wxEmptyString; m_font = g_oglNormalFont; m_minHeight = 5.0; m_minWidth = 5.0; @@ -1773,9 +1773,9 @@ wxShapeRegion::wxShapeRegion() m_regionProportionX = -1.0; m_regionProportionY = -1.0; m_formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT; - m_regionName = ""; - m_textColour = "BLACK"; - m_penColour = "BLACK"; + m_regionName = wxEmptyString; + m_textColour = wxT("BLACK"); + m_penColour = wxT("BLACK"); m_penStyle = wxSOLID; m_actualColourObject = NULL; m_actualPenObject = NULL; @@ -1897,7 +1897,7 @@ wxPen *wxShapeRegion::GetActualPen() return m_actualPenObject; if (!m_penColour) return NULL; - if (m_penColour == "Invisible") + if (m_penColour == wxT("Invisible")) return NULL; m_actualPenObject = wxThePenList->FindOrCreatePen(m_penColour, 1, m_penStyle); return m_actualPenObject; diff --git a/contrib/src/ogl/bmpshape.cpp b/contrib/src/ogl/bmpshape.cpp index 7125c98300..7b2dfac377 100644 --- a/contrib/src/ogl/bmpshape.cpp +++ b/contrib/src/ogl/bmpshape.cpp @@ -41,7 +41,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxBitmapShape, wxShape) wxBitmapShape::wxBitmapShape():wxRectangleShape(100.0, 50.0) { - m_filename = ""; + m_filename = wxEmptyString; } wxBitmapShape::~wxBitmapShape() diff --git a/contrib/src/ogl/composit.cpp b/contrib/src/ogl/composit.cpp index 3602cac170..7834012aaf 100644 --- a/contrib/src/ogl/composit.cpp +++ b/contrib/src/ogl/composit.cpp @@ -827,10 +827,10 @@ wxDivisionShape::wxDivisionShape() m_handleSide = DIVISION_SIDE_NONE; m_leftSidePen = wxBLACK_PEN; m_topSidePen = wxBLACK_PEN; - m_leftSideColour = "BLACK"; - m_topSideColour = "BLACK"; - m_leftSideStyle = "Solid"; - m_topSideStyle = "Solid"; + m_leftSideColour = wxT("BLACK"); + m_topSideColour = wxT("BLACK"); + m_leftSideStyle = wxT("Solid"); + m_topSideStyle = wxT("Solid"); ClearRegions(); } @@ -1574,11 +1574,11 @@ bool wxDivisionShape::ResizeAdjoining(int side, double newPos, bool test) class OGLPopupDivisionMenu : public wxMenu { public: OGLPopupDivisionMenu() : wxMenu() { - Append(DIVISION_MENU_SPLIT_HORIZONTALLY, "Split horizontally"); - Append(DIVISION_MENU_SPLIT_VERTICALLY, "Split vertically"); + Append(DIVISION_MENU_SPLIT_HORIZONTALLY, wxT("Split horizontally")); + Append(DIVISION_MENU_SPLIT_VERTICALLY, wxT("Split vertically")); AppendSeparator(); - Append(DIVISION_MENU_EDIT_LEFT_EDGE, "Edit left edge"); - Append(DIVISION_MENU_EDIT_TOP_EDGE, "Edit top edge"); + Append(DIVISION_MENU_EDIT_LEFT_EDGE, wxT("Edit left edge")); + Append(DIVISION_MENU_EDIT_TOP_EDGE, wxT("Edit top edge")); } void OnMenu(wxCommandEvent& event); @@ -1626,7 +1626,7 @@ void OGLPopupDivisionMenu::OnMenu(wxCommandEvent& event) void wxDivisionShape::EditEdge(int side) { - wxMessageBox("EditEdge() not implemented", "OGL", wxOK); + wxMessageBox(wxT("EditEdge() not implemented"), wxT("OGL"), wxOK); #if 0 wxBeginBusyCursor(); diff --git a/contrib/src/ogl/constrnt.cpp b/contrib/src/ogl/constrnt.cpp index c2addad443..e79d3ed4d0 100644 --- a/contrib/src/ogl/constrnt.cpp +++ b/contrib/src/ogl/constrnt.cpp @@ -58,51 +58,51 @@ void OGLInitializeConstraintTypes() wxOGLConstraintTypes = new wxList(wxKEY_INTEGER); wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_VERTICALLY, - new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, "Centre vertically", "centred vertically w.r.t.")); + new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, wxT("Centre vertically"), wxT("centred vertically w.r.t."))); wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_HORIZONTALLY, - new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, "Centre horizontally", "centred horizontally w.r.t.")); + new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, wxT("Centre horizontally"), wxT("centred horizontally w.r.t."))); wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_BOTH, - new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, "Centre", "centred w.r.t.")); + new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, wxT("Centre"), wxT("centred w.r.t."))); wxOGLConstraintTypes->Append(gyCONSTRAINT_LEFT_OF, - new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, "Left of", "left of")); + new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, wxT("Left of"), wxT("left of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_RIGHT_OF, - new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, "Right of", "right of")); + new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, wxT("Right of"), wxT("right of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ABOVE, - new wxOGLConstraintType(gyCONSTRAINT_ABOVE, "Above", "above")); + new wxOGLConstraintType(gyCONSTRAINT_ABOVE, wxT("Above"), wxT("above"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_BELOW, - new wxOGLConstraintType(gyCONSTRAINT_BELOW, "Below", "below")); + new wxOGLConstraintType(gyCONSTRAINT_BELOW, wxT("Below"), wxT("below"))); // Alignment wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_TOP, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, "Top-aligned", "aligned to the top of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, wxT("Top-aligned"), wxT("aligned to the top of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_BOTTOM, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, "Bottom-aligned", "aligned to the bottom of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, wxT("Bottom-aligned"), wxT("aligned to the bottom of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_LEFT, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, "Left-aligned", "aligned to the left of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, wxT("Left-aligned"), wxT("aligned to the left of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_RIGHT, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, "Right-aligned", "aligned to the right of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, wxT("Right-aligned"), wxT("aligned to the right of"))); // Mid-alignment wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_TOP, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, "Top-midaligned", "centred on the top of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, wxT("Top-midaligned"), wxT("centred on the top of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_BOTTOM, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, "Bottom-midaligned", "centred on the bottom of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, wxT("Bottom-midaligned"), wxT("centred on the bottom of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_LEFT, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, "Left-midaligned", "centred on the left of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, wxT("Left-midaligned"), wxT("centred on the left of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_RIGHT, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, "Right-midaligned", "centred on the right of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, wxT("Right-midaligned"), wxT("centred on the right of"))); } void OGLCleanUpConstraintTypes() @@ -137,7 +137,7 @@ wxOGLConstraint::wxOGLConstraint(int type, wxShape *constraining, wxList& constr m_constrainingObject = constraining; m_constraintId = 0; - m_constraintName = "noname"; + m_constraintName = wxT("noname"); wxNode *node = constrained.First(); while (node) diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 146ca96d68..aa929c8b55 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -434,7 +434,7 @@ void wxDividedShape::ReadAttributes(wxExpr *clause) void wxDividedShape::EditRegions() { - wxMessageBox("EditRegions() is unimplemented.", "OGL", wxOK); + wxMessageBox(wxT("EditRegions() is unimplemented."), wxT("OGL"), wxOK); // TODO #if 0 diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index 07a3036997..800d78db17 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -292,7 +292,7 @@ void wxDrawnShape::Copy(wxShape& copy) drawnCopy.m_currentAngle = m_currentAngle; } -bool wxDrawnShape::LoadFromMetaFile(char *filename) +bool wxDrawnShape::LoadFromMetaFile(const wxString& filename) { return m_metafiles[0].LoadFromMetaFile(filename, &m_width, &m_height); } @@ -1825,7 +1825,7 @@ void wxPseudoMetaFile::Copy(wxPseudoMetaFile& copy) * */ -bool wxPseudoMetaFile::LoadFromMetaFile(char *filename, double *rwidth, double *rheight) +bool wxPseudoMetaFile::LoadFromMetaFile(const wxString& filename, double *rwidth, double *rheight) { if (!wxFileExists(filename)) return NULL; diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index 7c816e5414..73710978f7 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -77,17 +77,17 @@ wxLineShape::wxLineShape() // and make the three line regions. ClearRegions(); wxShapeRegion *newRegion = new wxShapeRegion; - newRegion->SetName("Middle"); + newRegion->SetName(wxT("Middle")); newRegion->SetSize(150, 50); m_regions.Append((wxObject *)newRegion); newRegion = new wxShapeRegion; - newRegion->SetName("Start"); + newRegion->SetName(wxT("Start")); newRegion->SetSize(150, 50); m_regions.Append((wxObject *)newRegion); newRegion = new wxShapeRegion; - newRegion->SetName("End"); + newRegion->SetName(wxT("End")); newRegion->SetSize(150, 50); m_regions.Append((wxObject *)newRegion); @@ -234,7 +234,7 @@ void wxLineShape::FormatText(wxDC& dc, const wxString& s, int i) node = string_list->First(); while (node) { - char *s = (char *)node->Data(); + wxChar *s = (wxChar *)node->Data(); wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s); region->GetFormattedText().Append((wxObject *)line); node = node->Next(); diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index a565739380..2d752cb1b5 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -98,7 +98,7 @@ wxMetaRecord::~wxMetaRecord(void) if (stringParam) delete[] stringParam; } -wxXMetaFile::wxXMetaFile(char *file) +wxXMetaFile::wxXMetaFile(const wxChar *file) { ok = FALSE; top = 0.0; @@ -162,11 +162,11 @@ int AddMetaRecordHandle(wxMetaRecord *record) return (HandleTableSize - 1); } -bool wxXMetaFile::ReadFile(char *file) +bool wxXMetaFile::ReadFile(const wxChar *file) { HandleTableSize = 0; - FILE *handle = fopen(file, "rb"); + FILE *handle = wxFopen(file, wxT("rb")); if (!handle) return FALSE; // Read placeable metafile header, if any diff --git a/contrib/src/ogl/misc.cpp b/contrib/src/ogl/misc.cpp index 76bf00cc4f..c6dc4c8d7e 100644 --- a/contrib/src/ogl/misc.cpp +++ b/contrib/src/ogl/misc.cpp @@ -423,7 +423,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double { wxString oldBuffer(buffer); - char *s = (char *)node->Data(); + wxChar *s = (wxChar *)node->Data(); if (!s) { // FORCE NEW LINE @@ -435,7 +435,7 @@ wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double else { if (buffer.Length() != 0) - buffer += " "; + buffer += wxT(" "); buffer += s; dc.GetTextExtent(buffer, &x, &y); @@ -782,7 +782,7 @@ void UpdateListBox(wxListBox *item, wxList *list) wxNode *node = list->First(); while (node) { - char *s = (char *)node->Data(); + wxChar *s = (wxChar *)node->Data(); item->Append(s); node = node->Next(); } -- 2.45.2