From 1484b5cc701329c54bbe70f2a155119fd86945c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 21 Aug 2003 09:05:56 +0000 Subject: [PATCH] Unicode compilation fixes for OGL (patch #791967) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/samples/ogl/ogledit/doc.cpp | 46 ++--- contrib/samples/ogl/ogledit/doc.h | 8 +- contrib/samples/ogl/ogledit/ogledit.cpp | 48 ++--- contrib/samples/ogl/ogledit/palette.cpp | 22 +-- contrib/samples/ogl/ogledit/palette.h | 11 +- contrib/samples/ogl/ogledit/view.cpp | 51 +++--- contrib/samples/ogl/studio/cspalette.cpp | 28 +-- contrib/samples/ogl/studio/cspalette.h | 5 +- contrib/samples/ogl/studio/csprint.cpp | 18 +- contrib/samples/ogl/studio/dialogs.cpp | 59 +++--- contrib/samples/ogl/studio/doc.cpp | 14 +- contrib/samples/ogl/studio/mainfrm.cpp | 16 +- contrib/samples/ogl/studio/project.cpp | 6 +- contrib/samples/ogl/studio/shapes.cpp | 82 ++++----- contrib/samples/ogl/studio/shapes.h | 2 +- contrib/samples/ogl/studio/studio.cpp | 224 +++++++++++------------ contrib/samples/ogl/studio/symbols.cpp | 32 ++-- contrib/samples/ogl/studio/view.cpp | 87 ++++----- contrib/src/ogl/basic.cpp | 195 ++++++++++---------- contrib/src/ogl/basic2.cpp | 41 +++-- contrib/src/ogl/bmpshape.cpp | 6 +- contrib/src/ogl/canvas.cpp | 18 +- contrib/src/ogl/composit.cpp | 56 +++--- contrib/src/ogl/constrnt.cpp | 14 +- contrib/src/ogl/divided.cpp | 14 +- contrib/src/ogl/drawn.cpp | 118 ++++++------ contrib/src/ogl/lines.cpp | 50 ++--- contrib/src/ogl/mfutils.cpp | 41 +++-- contrib/src/ogl/ogldiag.cpp | 72 ++++---- contrib/src/ogl/oglmisc.cpp | 5 +- 30 files changed, 708 insertions(+), 681 deletions(-) diff --git a/contrib/samples/ogl/ogledit/doc.cpp b/contrib/samples/ogl/ogledit/doc.cpp index 90545046d5..ecda6e4917 100644 --- a/contrib/samples/ogl/ogledit/doc.cpp +++ b/contrib/samples/ogl/ogledit/doc.cpp @@ -90,8 +90,8 @@ wxOutputStream& DiagramDocument::SaveObject(wxOutputStream& stream) #if wxUSE_PROLOGIO wxDocument::SaveObject(stream); - char buf[400]; - (void) wxGetTempFileName("diag", buf); + wxChar buf[400]; + (void) wxGetTempFileName(_T("diag"), buf); diagram.SaveFile(buf); @@ -109,8 +109,8 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream) #if wxUSE_PROLOGIO wxDocument::LoadObject(stream); - char buf[400]; - (void) wxGetTempFileName("diag", buf); + wxChar buf[400]; + (void) wxGetTempFileName(_T("diag"), buf); wxTransferStreamToFile(stream, buf); @@ -128,7 +128,7 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream) * Implementation of drawing command */ -DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy, +DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy, bool sel, wxShape *theShape, wxShape *fs, wxShape *ts): wxCommand(TRUE, name) { @@ -146,7 +146,7 @@ DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, w deleteShape = FALSE; } -DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape): +DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape): wxCommand(TRUE, name) { doc = ddoc; @@ -163,7 +163,7 @@ DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, w shapePen = NULL; } -DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape): +DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape): wxCommand(TRUE, name) { doc = ddoc; @@ -229,7 +229,7 @@ bool DiagramCommand::Do(void) { theShape = (wxShape *)shapeInfo->CreateObject(); theShape->AssignNewIds(); - theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxString(""))); + theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString)); theShape->SetCentreResize(FALSE); theShape->SetPen(wxBLACK_PEN); theShape->SetBrush(wxCYAN_BRUSH); @@ -260,7 +260,7 @@ bool DiagramCommand::Do(void) { theShape = (wxShape *)shapeInfo->CreateObject(); theShape->AssignNewIds(); - theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxString(""))); + theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString)); theShape->SetPen(wxBLACK_PEN); theShape->SetBrush(wxRED_BRUSH); @@ -269,7 +269,7 @@ bool DiagramCommand::Do(void) // Yes, you can have more than 2 control points, in which case // it becomes a multi-segment line. lineShape->MakeLineControlPoints(2); - lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_END, 10.0, 0.0, "Normal arrowhead"); + lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_END, 10.0, 0.0, _T("Normal arrowhead")); } doc->GetDiagram()->AddShape(theShape); @@ -323,7 +323,7 @@ bool DiagramCommand::Do(void) wxClientDC dc(shape->GetCanvas()); shape->GetCanvas()->PrepareDC(dc); - shape->FormatText(dc, (char*) (const char*) myHandler->label); + shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label); shape->Draw(dc); doc->Modify(TRUE); @@ -408,7 +408,7 @@ bool DiagramCommand::Undo(void) wxClientDC dc(shape->GetCanvas()); shape->GetCanvas()->PrepareDC(dc); - shape->FormatText(dc, (char*) (const char*) myHandler->label); + shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label); shape->Draw(dc); doc->Modify(TRUE); @@ -428,7 +428,7 @@ void DiagramCommand::RemoveLines(wxShape *shape) while (node) { wxLineShape *line = (wxLineShape *)node->Data(); - doc->GetCommandProcessor()->Submit(new DiagramCommand("Cut", OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line)); + doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line)); node = shape->GetLines().First(); } @@ -438,7 +438,7 @@ void DiagramCommand::RemoveLines(wxShape *shape) * MyEvtHandler: an event handler class for all shapes */ -void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment) +void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment)) { wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); @@ -488,7 +488,7 @@ void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment) * Implement connection of two shapes by right-dragging between them. */ -void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment) +void MyEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int attachment) { // Force attachment to be zero for now. Eventually we can deal with // the actual attachment point, e.g. a rectangle side if attachment mode is on. @@ -506,7 +506,7 @@ void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment GetShape()->GetCanvas()->CaptureMouse(); } -void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int attachment) +void MyEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int attachment) { // Force attachment to be zero for now attachment = 0; @@ -522,7 +522,7 @@ void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta dc.DrawLine((long) xp, (long) yp, (long) x, (long) y); } -void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) +void MyEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { GetShape()->GetCanvas()->ReleaseMouse(); MyCanvas *canvas = (MyCanvas *)GetShape()->GetCanvas(); @@ -534,17 +534,17 @@ void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) if (otherShape && !otherShape->IsKindOf(CLASSINFO(wxLineShape))) { canvas->view->GetDocument()->GetCommandProcessor()->Submit( - new DiagramCommand("wxLineShape", OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape), + new DiagramCommand(_T("wxLineShape"), OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape), 0.0, 0.0, FALSE, NULL, GetShape(), otherShape)); } } -void MyEvtHandler::OnEndSize(double x, double y) +void MyEvtHandler::OnEndSize(double WXUNUSED(x), double WXUNUSED(y)) { wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); - GetShape()->FormatText(dc, (char*) (const char*) label); + GetShape()->FormatText(dc, /* (char*) (const char*) */ label); } /* @@ -557,15 +557,15 @@ bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) { wxDiagram::OnShapeSave(db, shape, expr); MyEvtHandler *handler = (MyEvtHandler *)shape.GetEventHandler(); - expr.AddAttributeValueString("label", handler->label); + expr.AddAttributeValueString(_T("label"), handler->label); return TRUE; } bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) { wxDiagram::OnShapeLoad(db, shape, expr); - char *label = NULL; - expr.AssignAttributeValue("label", &label); + wxChar *label = NULL; + expr.AssignAttributeValue(_T("label"), &label); MyEvtHandler *handler = new MyEvtHandler(&shape, &shape, wxString(label)); shape.SetEventHandler(handler); diff --git a/contrib/samples/ogl/ogledit/doc.h b/contrib/samples/ogl/ogledit/doc.h index 93e98fec6c..50658ffa27 100644 --- a/contrib/samples/ogl/ogledit/doc.h +++ b/contrib/samples/ogl/ogledit/doc.h @@ -76,7 +76,7 @@ class MyEvtHandler: public wxShapeEvtHandler { public: wxString label; - MyEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = ""):wxShapeEvtHandler(prev, shape) + MyEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = wxEmptyString):wxShapeEvtHandler(prev, shape) { label = lab; } @@ -163,12 +163,12 @@ class DiagramCommand: public wxCommand wxString shapeLabel; public: // Multi-purpose constructor for creating, deleting shapes - DiagramCommand(char *name, int cmd, DiagramDocument *ddoc, wxClassInfo *shapeInfo = NULL, + DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, wxClassInfo *shapeInfo = NULL, double x = 0.0, double y = 0.0, bool sel = FALSE, wxShape *theShape = NULL, wxShape *fs = NULL, wxShape *ts = NULL); // Property-changing command constructors - DiagramCommand(char *name, int cmd, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape); - DiagramCommand(char *name, int cmd, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape); + DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape); + DiagramCommand(const wxString& name, int cmd, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape); ~DiagramCommand(void); diff --git a/contrib/samples/ogl/ogledit/ogledit.cpp b/contrib/samples/ogl/ogledit/ogledit.cpp index 3073114674..13e3770ee9 100644 --- a/contrib/samples/ogl/ogledit/ogledit.cpp +++ b/contrib/samples/ogl/ogledit/ogledit.cpp @@ -57,7 +57,7 @@ bool MyApp::OnInit(void) myDocManager = new wxDocManager; //// Create a template relating drawing documents to their views - (void) new wxDocTemplate(myDocManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View", + (void) new wxDocTemplate(myDocManager, _T("Diagram"), _T("*.dia"), wxEmptyString, _T("dia"), _T("Diagram Doc"), _T("Diagram View"), CLASSINFO(DiagramDocument), CLASSINFO(DiagramView)); // If we've only got one window, we only get to edit @@ -65,7 +65,7 @@ bool MyApp::OnInit(void) myDocManager->SetMaxDocsOpen(1); //// Create the main frame window - frame = new MyFrame(myDocManager, NULL, "OGLEdit Demo", wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE); + frame = new MyFrame(myDocManager, NULL, _T("OGLEdit Demo"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE); //// Give it an icon frame->SetIcon(wxICON(ogl)); @@ -74,47 +74,47 @@ bool MyApp::OnInit(void) wxMenu *file_menu = new wxMenu; wxMenu *edit_menu = NULL; - file_menu->Append(wxID_NEW, "&New..."); - file_menu->Append(wxID_OPEN, "&Open..."); + file_menu->Append(wxID_NEW, _T("&New...")); + file_menu->Append(wxID_OPEN, _T("&Open...")); - file_menu->Append(wxID_CLOSE, "&Close"); - file_menu->Append(wxID_SAVE, "&Save"); - file_menu->Append(wxID_SAVEAS, "Save &As..."); + file_menu->Append(wxID_CLOSE, _T("&Close")); + file_menu->Append(wxID_SAVE, _T("&Save")); + file_menu->Append(wxID_SAVEAS, _T("Save &As...")); file_menu->AppendSeparator(); - file_menu->Append(wxID_PRINT, "&Print..."); - file_menu->Append(wxID_PRINT_SETUP, "Print &Setup..."); - file_menu->Append(wxID_PREVIEW, "Print Pre&view"); + file_menu->Append(wxID_PRINT, _T("&Print...")); + file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); + file_menu->Append(wxID_PREVIEW, _T("Print Pre&view")); edit_menu = new wxMenu; - edit_menu->Append(wxID_UNDO, "&Undo"); - edit_menu->Append(wxID_REDO, "&Redo"); + edit_menu->Append(wxID_UNDO, _T("&Undo")); + edit_menu->Append(wxID_REDO, _T("&Redo")); edit_menu->AppendSeparator(); - edit_menu->Append(OGLEDIT_CUT, "&Cut"); + edit_menu->Append(OGLEDIT_CUT, _T("&Cut")); edit_menu->AppendSeparator(); - edit_menu->Append(OGLEDIT_CHANGE_BACKGROUND_COLOUR, "Change &background colour"); - edit_menu->Append(OGLEDIT_EDIT_LABEL, "Edit &label"); + edit_menu->Append(OGLEDIT_CHANGE_BACKGROUND_COLOUR, _T("Change &background colour")); + edit_menu->Append(OGLEDIT_EDIT_LABEL, _T("Edit &label")); frame->editMenu = edit_menu; file_menu->AppendSeparator(); - file_menu->Append(wxID_EXIT, "E&xit"); + file_menu->Append(wxID_EXIT, _T("E&xit")); // A nice touch: a history of files visited. Use this menu. myDocManager->FileHistoryUseMenu(file_menu); wxMenu *help_menu = new wxMenu; - help_menu->Append(OGLEDIT_ABOUT, "&About"); + help_menu->Append(OGLEDIT_ABOUT, _T("&About")); wxMenuBar *menu_bar = new wxMenuBar; - menu_bar->Append(file_menu, "&File"); + menu_bar->Append(file_menu, _T("&File")); if (edit_menu) - menu_bar->Append(edit_menu, "&Edit"); - menu_bar->Append(help_menu, "&Help"); + menu_bar->Append(edit_menu, _T("&Edit")); + menu_bar->Append(help_menu, _T("&Help")); frame->canvas = frame->CreateCanvas(NULL, frame); frame->palette = wxGetApp().CreatePalette(frame); - myDocManager->CreateDocument("", wxDOC_NEW); + myDocManager->CreateDocument(wxEmptyString, wxDOC_NEW); //// Associate the menu bar with the frame frame->SetMenuBar(menu_bar); @@ -155,7 +155,7 @@ MyFrame::MyFrame(wxDocManager *manager, wxFrame *frame, const wxString& title, editMenu = NULL; } -void MyFrame::OnSize(wxSizeEvent& event) +void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event)) { if (canvas && palette) { @@ -185,9 +185,9 @@ void MyFrame::OnCloseWindow(wxCloseEvent& event) } // Intercept menu commands -void MyFrame::OnAbout(wxCommandEvent& event) +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("OGLEdit Demo\nTo draw a shape, select a shape on the toolbar and left-click on the canvas.\nTo draw a line, right-drag between shapes.\nFor further details, see the OGL manual.\n (c) Julian Smart 1996", "About OGLEdit"); + (void)wxMessageBox(_T("OGLEdit Demo\nTo draw a shape, select a shape on the toolbar and left-click on the canvas.\nTo draw a line, right-drag between shapes.\nFor further details, see the OGL manual.\n (c) Julian Smart 1996"), _T("About OGLEdit")); } // Creates a canvas. Called by OnInit as a child of the main window diff --git a/contrib/samples/ogl/ogledit/palette.cpp b/contrib/samples/ogl/ogledit/palette.cpp index 8338fa24cf..7e50e81c50 100644 --- a/contrib/samples/ogl/ogledit/palette.cpp +++ b/contrib/samples/ogl/ogledit/palette.cpp @@ -75,7 +75,7 @@ bool EditorToolPalette::OnLeftClick(int toolIndex, bool toggled) return TRUE; } -void EditorToolPalette::OnMouseEnter(int toolIndex) +void EditorToolPalette::OnMouseEnter(int WXUNUSED(toolIndex)) { } @@ -88,11 +88,11 @@ EditorToolPalette *MyApp::CreatePalette(wxFrame *parent) { // Load palette bitmaps #ifdef __WXMSW__ - wxBitmap PaletteTool1("TOOL1"); - wxBitmap PaletteTool2("TOOL2"); - wxBitmap PaletteTool3("TOOL3"); - wxBitmap PaletteTool4("TOOL4"); - wxBitmap PaletteArrow("ARROWTOOL"); + wxBitmap PaletteTool1(_T("TOOL1")); + wxBitmap PaletteTool2(_T("TOOL2")); + wxBitmap PaletteTool3(_T("TOOL3")); + wxBitmap PaletteTool4(_T("TOOL4")); + wxBitmap PaletteArrow(_T("ARROWTOOL")); #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) wxBitmap PaletteTool1(tool1_xpm); wxBitmap PaletteTool2(tool2_xpm); @@ -106,11 +106,11 @@ EditorToolPalette *MyApp::CreatePalette(wxFrame *parent) palette->SetMargins(2, 2); palette->SetToolBitmapSize(wxSize(22, 22)); - palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, "Pointer"); - palette->AddTool(PALETTE_TOOL1, PaletteTool1, wxNullBitmap, TRUE, 0, -1, NULL, "Tool 1"); - palette->AddTool(PALETTE_TOOL2, PaletteTool2, wxNullBitmap, TRUE, 0, -1, NULL, "Tool 2"); - palette->AddTool(PALETTE_TOOL3, PaletteTool3, wxNullBitmap, TRUE, 0, -1, NULL, "Tool 3"); - palette->AddTool(PALETTE_TOOL4, PaletteTool4, wxNullBitmap, TRUE, 0, -1, NULL, "Tool 4"); + palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, _T("Pointer")); + palette->AddTool(PALETTE_TOOL1, PaletteTool1, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 1")); + palette->AddTool(PALETTE_TOOL2, PaletteTool2, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 2")); + palette->AddTool(PALETTE_TOOL3, PaletteTool3, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 3")); + palette->AddTool(PALETTE_TOOL4, PaletteTool4, wxNullBitmap, TRUE, 0, -1, NULL, _T("Tool 4")); palette->Realize(); diff --git a/contrib/samples/ogl/ogledit/palette.h b/contrib/samples/ogl/ogledit/palette.h index d49d7b4770..09b472ae9a 100644 --- a/contrib/samples/ogl/ogledit/palette.h +++ b/contrib/samples/ogl/ogledit/palette.h @@ -29,11 +29,14 @@ // TODO for wxWin: wxToolBar95 cannot be moved to a non-0,0 position! // Needs to have a parent window... // So use a simple toolbar at present. -#if 0 // def __WXGTK__ +// ABX: Simple toolbar is not available in default compilation +// so I use wxToolBar anyway +// #if 0 // def __WXGTK__ +// #define TOOLPALETTECLASS wxToolBar +// #else +// #define TOOLPALETTECLASS wxToolBarSimple +// #endif #define TOOLPALETTECLASS wxToolBar -#else -#define TOOLPALETTECLASS wxToolBarSimple -#endif class EditorToolPalette: public TOOLPALETTECLASS { diff --git a/contrib/samples/ogl/ogledit/view.cpp b/contrib/samples/ogl/ogledit/view.cpp index 7552a02271..3800e31106 100644 --- a/contrib/samples/ogl/ogledit/view.cpp +++ b/contrib/samples/ogl/ogledit/view.cpp @@ -45,7 +45,7 @@ END_EVENT_TABLE() // What to do when a view is created. Creates actual // windows for displaying the view. -bool DiagramView::OnCreate(wxDocument *doc, long flags) +bool DiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) { frame = GetMainFrame(); canvas = GetMainFrame()->canvas; @@ -105,16 +105,15 @@ void DiagramView::OnDraw(wxDC *dc) float posX, posY; // Calculate the position on the DC for centring the graphic - if (CENTER == TRUE) // center the drawing - { + #if 0 + // center the drawing posX = (float) ((w - (200 * actualScale)) / 2.0); posY = (float) ((h - (200 * actualScale)) / 2.0); - } - else // Use defined presets - { + #else + // Use defined presets posX = 10; posY = 35; - } + #endif // Set the scale and origin @@ -127,7 +126,7 @@ void DiagramView::OnDraw(wxDC *dc) wxDiagram *diagram_p=((DiagramDocument*)GetDocument())->GetDiagram(); // Get the current diagram if (diagram_p->GetShapeList()) { - wxCursor *old_cursor = NULL; + /* wxCursor *old_cursor = NULL; */ wxNode *current = diagram_p->GetShapeList()->First(); while (current) // Loop through the entire list of shapes @@ -143,14 +142,14 @@ void DiagramView::OnDraw(wxDC *dc) dc->EndDrawing(); // Allows optimization of drawing code under MS Windows. } -void DiagramView::OnUpdate(wxView *sender, wxObject *hint) +void DiagramView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)) { if (canvas) canvas->Refresh(); } // Clean up windows used for displaying the view. -bool DiagramView::OnClose(bool deleteWindow) +bool DiagramView::OnClose(bool WXUNUSED(deleteWindow)) { if (!GetDocument()->Close()) return FALSE; @@ -192,16 +191,16 @@ wxShape *DiagramView::FindSelectedShape(void) return theShape; } -void DiagramView::OnCut(wxCommandEvent& event) +void DiagramView::OnCut(wxCommandEvent& WXUNUSED(event)) { DiagramDocument *doc = (DiagramDocument *)GetDocument(); wxShape *theShape = FindSelectedShape(); if (theShape) - doc->GetCommandProcessor()->Submit(new DiagramCommand("Cut", OGLEDIT_CUT, doc, NULL, 0.0, 0.0, TRUE, theShape)); + doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, TRUE, theShape)); } -void DiagramView::OnChangeBackgroundColour(wxCommandEvent& event) +void DiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) { DiagramDocument *doc = (DiagramDocument *)GetDocument(); @@ -223,18 +222,18 @@ void DiagramView::OnChangeBackgroundColour(wxCommandEvent& event) dialog->Close(); if (theBrush) - doc->GetCommandProcessor()->Submit(new DiagramCommand("Change colour", OGLEDIT_CHANGE_BACKGROUND_COLOUR, doc, + doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Change colour"), OGLEDIT_CHANGE_BACKGROUND_COLOUR, doc, theBrush, theShape)); } } -void DiagramView::OnEditLabel(wxCommandEvent& event) +void DiagramView::OnEditLabel(wxCommandEvent& WXUNUSED(event)) { wxShape *theShape = FindSelectedShape(); if (theShape) { - wxString newLabel = wxGetTextFromUser("Enter new label", "Shape Label", ((MyEvtHandler *)theShape->GetEventHandler())->label); - GetDocument()->GetCommandProcessor()->Submit(new DiagramCommand("Edit label", OGLEDIT_EDIT_LABEL, (DiagramDocument*) GetDocument(), newLabel, theShape)); + wxString newLabel = wxGetTextFromUser(_T("Enter new label"), _T("Shape Label"), ((MyEvtHandler *)theShape->GetEventHandler())->label); + GetDocument()->GetCommandProcessor()->Submit(new DiagramCommand(_T("Edit label"), OGLEDIT_EDIT_LABEL, (DiagramDocument*) GetDocument(), newLabel, theShape)); } } @@ -261,7 +260,7 @@ MyCanvas::~MyCanvas(void) { } -void MyCanvas::OnLeftClick(double x, double y, int keys) +void MyCanvas::OnLeftClick(double x, double y, int WXUNUSED(keys)) { EditorToolPalette *palette = wxGetApp().frame->palette; wxClassInfo *info = NULL; @@ -293,36 +292,36 @@ void MyCanvas::OnLeftClick(double x, double y, int keys) if (info) { view->GetDocument()->GetCommandProcessor()->Submit( - new DiagramCommand((char*) info->GetClassName(), OGLEDIT_ADD_SHAPE, (DiagramDocument *)view->GetDocument(), info, + new DiagramCommand( info->GetClassName(), OGLEDIT_ADD_SHAPE, (DiagramDocument *)view->GetDocument(), info, x, y)); } } -void MyCanvas::OnRightClick(double x, double y, int keys) +void MyCanvas::OnRightClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void MyCanvas::OnDragLeft(bool draw, double x, double y, int keys) +void MyCanvas::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void MyCanvas::OnBeginDragLeft(double x, double y, int keys) +void MyCanvas::OnBeginDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void MyCanvas::OnEndDragLeft(double x, double y, int keys) +void MyCanvas::OnEndDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void MyCanvas::OnDragRight(bool draw, double x, double y, int keys) +void MyCanvas::OnDragRight(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void MyCanvas::OnBeginDragRight(double x, double y, int keys) +void MyCanvas::OnBeginDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void MyCanvas::OnEndDragRight(double x, double y, int keys) +void MyCanvas::OnEndDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } diff --git a/contrib/samples/ogl/studio/cspalette.cpp b/contrib/samples/ogl/studio/cspalette.cpp index 36ac64e236..d05f1b46ec 100644 --- a/contrib/samples/ogl/studio/cspalette.cpp +++ b/contrib/samples/ogl/studio/cspalette.cpp @@ -72,9 +72,9 @@ bool csEditorToolPalette::OnLeftClick(int toolIndex, bool toggled) void csEditorToolPalette::OnMouseEnter(int toolIndex) { - wxString msg(""); + wxString msg = wxEmptyString; if (toolIndex == PALETTE_ARROW) - msg = "Pointer"; + msg = _T("Pointer"); else if (toolIndex != -1) { csSymbol* symbol = wxGetApp().GetSymbolDatabase()->FindSymbol(toolIndex); @@ -115,8 +115,8 @@ bool csApp::CreatePalette(wxFrame *parent) // Load palette bitmaps #ifdef __WXMSW__ - wxBitmap PaletteArrow("arrowtool"); - wxBitmap TextTool("texttool"); + wxBitmap PaletteArrow(_T("arrowtool")); + wxBitmap TextTool(_T("texttool")); wxSize toolBitmapSize(32, 32); #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) wxBitmap PaletteArrow(arrow_xpm); @@ -130,37 +130,37 @@ bool csApp::CreatePalette(wxFrame *parent) palette->SetToolBitmapSize(toolBitmapSize); - palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, "Pointer"); - palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, TRUE, 0, -1, NULL, "Text"); + palette->AddTool(PALETTE_ARROW, PaletteArrow, wxNullBitmap, TRUE, 0, -1, NULL, _T("Pointer")); + palette->AddTool(PALETTE_TEXT_TOOL, TextTool, wxNullBitmap, TRUE, 0, -1, NULL, _T("Text")); char** symbols = new char*[20]; int noSymbols = 0; - symbols[noSymbols] = "Wide Rectangle"; + symbols[noSymbols] = _T("Wide Rectangle"); noSymbols ++; - symbols[noSymbols] = "Thin Rectangle"; + symbols[noSymbols] = _T("Thin Rectangle"); noSymbols ++; - symbols[noSymbols] = "Triangle"; + symbols[noSymbols] = _T("Triangle"); noSymbols ++; - symbols[noSymbols] = "Octagon"; + symbols[noSymbols] = _T("Octagon"); noSymbols ++; // For some reason, we're getting Gdk errors with // some shapes, such as ones that use DrawEllipse. #ifndef __WXGTK__ - symbols[noSymbols] = "Group"; + symbols[noSymbols] = _T("Group"); noSymbols ++; - symbols[noSymbols] = "Circle"; + symbols[noSymbols] = _T("Circle"); noSymbols ++; - symbols[noSymbols] = "Circle shadow"; + symbols[noSymbols] = _T("Circle shadow"); noSymbols ++; - symbols[noSymbols] = "SemiCircle"; + symbols[noSymbols] = _T("SemiCircle"); noSymbols ++; #endif diff --git a/contrib/samples/ogl/studio/cspalette.h b/contrib/samples/ogl/studio/cspalette.h index 9b2d9cccc0..2e36960736 100644 --- a/contrib/samples/ogl/studio/cspalette.h +++ b/contrib/samples/ogl/studio/cspalette.h @@ -28,7 +28,10 @@ // TODO for wxWin: wxToolBar95 cannot be moved to a non-0,0 position! // Needs to have a parent window... // So use a simple toolbar at present. -#define TOOLPALETTECLASS wxToolBarSimple +// ABX: Simple toolbar is not available in default compilation and is deprecated +// so I use wxToolBar anyway +// #define TOOLPALETTECLASS wxToolBarSimple +#define TOOLPALETTECLASS wxToolBar class csEditorToolPalette: public TOOLPALETTECLASS { diff --git a/contrib/samples/ogl/studio/csprint.cpp b/contrib/samples/ogl/studio/csprint.cpp index f3f65e85cc..d734476643 100644 --- a/contrib/samples/ogl/studio/csprint.cpp +++ b/contrib/samples/ogl/studio/csprint.cpp @@ -112,8 +112,8 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo wxShape* fromShape = (wxShape*) mapping.Get((long) lineShape->GetFrom()); wxShape* toShape = (wxShape*) mapping.Get((long) lineShape->GetTo()); - wxASSERT_MSG( (fromShape != NULL), "Could not find 'from' shape"); - wxASSERT_MSG( (toShape != NULL), "Could not find 'to' shape"); + wxASSERT_MSG( (fromShape != NULL), _T("Could not find 'from' shape")); + wxASSERT_MSG( (toShape != NULL), _T("Could not find 'to' shape")); fromShape->AddLine(newShape, toShape, newShape->GetAttachmentFrom(), newShape->GetAttachmentTo()); @@ -145,7 +145,7 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo { wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape); - wxASSERT_MSG( (newLineShape != NULL), "Could not find new line shape"); + wxASSERT_MSG( (newLineShape != NULL), _T("Could not find new line shape")); newLines.Append(newLineShape); } @@ -178,8 +178,8 @@ bool wxDiagramClipboard::CopyToClipboard(double scale) // Draw on metafile DC Redraw(mfDC); - int printWidth = mfDC.MaxX() - mfDC.MinX(); - int printHeight = mfDC.MaxY() - mfDC.MinY(); + /* int printWidth = */ mfDC.MaxX() - mfDC.MinX(); + /* int printHeight = */ mfDC.MaxY() - mfDC.MinY(); int maxX = (int)mfDC.MaxX(); int maxY = (int)mfDC.MaxY(); wxMetaFile *mf = mfDC.Close(); @@ -192,7 +192,7 @@ bool wxDiagramClipboard::CopyToClipboard(double scale) char buf[200]; sprintf(buf, "Sorry, could not allocate clipboard bitmap (%dx%d)", (maxX+10), (maxY+10)); - wxMessageBox(buf, "Clipboard copy problem"); + wxMessageBox(buf, _T("Clipboard copy problem")); return FALSE; } @@ -268,7 +268,7 @@ bool csDiagramClipboard::OnStartCopy(wxDiagram* diagramTo) csDiagramDocument* doc = diagram->GetDocument(); ((csDiagramView*)doc->GetFirstView())->SelectAll(FALSE); - m_currentCmd = new csDiagramCommand("Paste", doc); + m_currentCmd = new csDiagramCommand(_T("Paste"), doc); return TRUE; } @@ -299,7 +299,7 @@ bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo) // Use the command framework to add the shapes, if we're copying to a diagram and // not the clipboard. -bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxDC* dc) +bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxDC* WXUNUSED(dc)) { if (diagramTo == this) { @@ -308,7 +308,7 @@ bool csDiagramClipboard::OnAddShape(wxDiagram* diagramTo, wxShape* newShape, wxD else { csDiagram* diagram = (csDiagram*) diagramTo; - csDiagramDocument* doc = diagram->GetDocument(); + /* csDiagramDocument* doc = */ diagram->GetDocument(); if (newShape->IsKindOf(CLASSINFO(wxLineShape))) m_currentCmd->AddState(new csCommandState(ID_CS_ADD_LINE_SELECT, newShape, NULL)); diff --git a/contrib/samples/ogl/studio/dialogs.cpp b/contrib/samples/ogl/studio/dialogs.cpp index be54a49c57..6136b5863d 100644 --- a/contrib/samples/ogl/studio/dialogs.cpp +++ b/contrib/samples/ogl/studio/dialogs.cpp @@ -40,7 +40,7 @@ END_EVENT_TABLE() csLabelEditingDialog::csLabelEditingDialog(wxWindow* parent) { - wxLoadFromResource(this, parent, "shape_label_dialog"); + wxLoadFromResource(this, parent, _T("shape_label_dialog")); // Accelerators wxAcceleratorEntry entries[1]; @@ -90,7 +90,7 @@ END_EVENT_TABLE() // For 400x400 settings dialog, size your panels to about 375x325 in dialog editor csSettingsDialog::csSettingsDialog(wxWindow* parent): - wxDialog(parent, -1, "Settings", wxPoint(0, 0), wxSize(PROPERTY_DIALOG_WIDTH, PROPERTY_DIALOG_HEIGHT)) + wxDialog(parent, -1, _T("Settings"), wxPoint(0, 0), wxSize(PROPERTY_DIALOG_WIDTH, PROPERTY_DIALOG_HEIGHT)) { m_generalSettings = NULL; m_diagramSettings = NULL; @@ -100,22 +100,22 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent): m_generalSettings = new wxPanel; - bool success = wxLoadFromResource(m_generalSettings, m_notebook, "general_settings_dialog"); - wxASSERT_MSG( (success), "Could not load general settings panel."); - m_notebook->AddPage(m_generalSettings, "General", TRUE); + bool success = wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog")); + wxASSERT_MSG( (success), _T("Could not load general settings panel.")); + m_notebook->AddPage(m_generalSettings, _T("General"), TRUE); m_diagramSettings = new wxPanel; - success = wxLoadFromResource(m_diagramSettings, m_notebook, "diagram_settings_dialog"); - wxASSERT_MSG( (success), "Could not load diagram settings panel."); - m_notebook->AddPage(m_diagramSettings, "Diagram"); + success = wxLoadFromResource(m_diagramSettings, m_notebook, _T("diagram_settings_dialog")); + wxASSERT_MSG( (success), _T("Could not load diagram settings panel.")); + m_notebook->AddPage(m_diagramSettings, _T("Diagram")); int largeButtonWidth = 70; int largeButtonHeight = 22; - wxButton* okButton = new wxButton(this, wxID_OK, "OK", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton* cancelButton = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton* helpButton = new wxButton(this, wxID_HELP, "Help", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton* okButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _T("Cancel"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton* helpButton = new wxButton(this, wxID_HELP, _T("Help"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); // Constraints for the notebook wxLayoutConstraints *c = new wxLayoutConstraints; @@ -164,15 +164,15 @@ void csSettingsDialog::OnOK(wxCommandEvent& event) bool csSettingsDialog::TransferDataToWindow() { wxTextCtrl* gridSpacing = (wxTextCtrl*) m_diagramSettings->FindWindow(ID_GRID_SPACING); - wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), "Could not find grid spacing control."); + wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), _T("Could not find grid spacing control.")); wxChoice* gridStyle = (wxChoice*) m_diagramSettings->FindWindow(ID_GRID_STYLE); - wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), "Could not find grid style control."); + wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), _T("Could not find grid style control.")); gridStyle->SetSelection(wxGetApp().GetGridStyle()); wxString str; - str.Printf("%d", wxGetApp().GetGridSpacing()); + str.Printf(_T("%d"), wxGetApp().GetGridSpacing()); gridSpacing->SetValue(str); return TRUE; @@ -181,17 +181,20 @@ bool csSettingsDialog::TransferDataToWindow() bool csSettingsDialog::TransferDataFromWindow() { wxTextCtrl* gridSpacing = (wxTextCtrl*) m_diagramSettings->FindWindow(ID_GRID_SPACING); - wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), "Could not find grid spacing control."); + wxASSERT_MSG( (gridSpacing != (wxTextCtrl*) NULL), _T("Could not find grid spacing control.")); wxChoice* gridStyle = (wxChoice*) m_diagramSettings->FindWindow(ID_GRID_STYLE); - wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), "Could not find grid style control."); + wxASSERT_MSG( (gridStyle != (wxChoice*) NULL), _T("Could not find grid style control.")); wxGetApp().SetGridStyle(gridStyle->GetSelection()); - wxGetApp().SetGridSpacing(atoi(gridSpacing->GetValue())); + wxString str = gridSpacing->GetValue(); + long grid_spacing; + str.ToLong( &grid_spacing); + wxGetApp().SetGridSpacing(grid_spacing); if (wxGetApp().GetGridStyle() == csGRID_STYLE_DOTTED) { - wxMessageBox("Dotted grid style not yet implemented.", "Studio", wxICON_EXCLAMATION); + wxMessageBox(_T("Dotted grid style not yet implemented."), _T("Studio"), wxICON_EXCLAMATION); return FALSE; } @@ -259,30 +262,30 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin wxPoint(2, 2), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH - 4, SHAPE_PROPERTY_DIALOG_HEIGHT - 4)); m_generalPropertiesDialog = new csGeneralShapePropertiesDialog; - bool success = wxLoadFromResource(m_generalPropertiesDialog, m_notebook, "general_shape_properties_dialog"); - wxASSERT_MSG( (success), "Could not load general properties panel."); - m_notebook->AddPage(m_generalPropertiesDialog, "General"); + bool success = wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog")); + wxASSERT_MSG( (success), _T("Could not load general properties panel.")); + m_notebook->AddPage(m_generalPropertiesDialog, _T("General")); success = wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName); if (!success) { - wxMessageBox("Could not load the attribute dialog for this shape.", "Studio", wxICON_EXCLAMATION); + wxMessageBox(_T("Could not load the attribute dialog for this shape."), _T("Studio"), wxICON_EXCLAMATION); delete m_attributeDialog; m_attributeDialog = NULL; } else { - m_notebook->AddPage(m_attributeDialog, "Attributes"); + m_notebook->AddPage(m_attributeDialog, _T("Attributes")); } // Try the alternative dialog (test code) wxString str(attributeDialogName); - str += "1"; + str += _T("1"); m_alternativeAttributeDialog = new wxPanel; success = wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str); if (success) { - m_notebook->AddPage(m_alternativeAttributeDialog, "Attributes (alternative)"); + m_notebook->AddPage(m_alternativeAttributeDialog, _T("Attributes (alternative)")); } else { @@ -293,9 +296,9 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin int largeButtonWidth = 70; int largeButtonHeight = 22; - wxButton* okButton = new wxButton(this, wxID_OK, "OK", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton* cancelButton = new wxButton(this, wxID_CANCEL, "Cancel", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton* helpButton = new wxButton(this, wxID_HELP, "Help", wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton* okButton = new wxButton(this, wxID_OK, _T("OK"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton* cancelButton = new wxButton(this, wxID_CANCEL, _T("Cancel"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton* helpButton = new wxButton(this, wxID_HELP, _T("Help"), wxPoint(0, 0), wxSize(largeButtonWidth, largeButtonHeight)); // Constraints for the notebook wxLayoutConstraints *c = new wxLayoutConstraints; diff --git a/contrib/samples/ogl/studio/doc.cpp b/contrib/samples/ogl/studio/doc.cpp index acd6c5be7c..ea8e698b86 100644 --- a/contrib/samples/ogl/studio/doc.cpp +++ b/contrib/samples/ogl/studio/doc.cpp @@ -55,18 +55,18 @@ bool csDiagramDocument::OnCloseDocument() bool csDiagramDocument::OnSaveDocument(const wxString& file) { - if (file == "") + if (file == wxEmptyString) return FALSE; if (!m_diagram.SaveFile(file)) { wxString msgTitle; - if (wxTheApp->GetAppName() != "") + if (wxTheApp->GetAppName() != wxEmptyString) msgTitle = wxTheApp->GetAppName(); else - msgTitle = wxString("File error"); + msgTitle = wxString(_T("File error")); - (void)wxMessageBox("Sorry, could not open this file for saving.", msgTitle, wxOK | wxICON_EXCLAMATION, + (void)wxMessageBox(_T("Sorry, could not open this file for saving."), msgTitle, wxOK | wxICON_EXCLAMATION, GetDocumentWindow()); return FALSE; } @@ -82,15 +82,15 @@ bool csDiagramDocument::OnOpenDocument(const wxString& file) return FALSE; wxString msgTitle; - if (wxTheApp->GetAppName() != "") + if (wxTheApp->GetAppName() != wxEmptyString) msgTitle = wxTheApp->GetAppName(); else - msgTitle = wxString("File error"); + msgTitle = wxString(_T("File error")); m_diagram.DeleteAllShapes(); if (!m_diagram.LoadFile(file)) { - (void)wxMessageBox("Sorry, could not open this file.", msgTitle, wxOK|wxICON_EXCLAMATION, + (void)wxMessageBox(_T("Sorry, could not open this file."), msgTitle, wxOK|wxICON_EXCLAMATION, GetDocumentWindow()); return FALSE; } diff --git a/contrib/samples/ogl/studio/mainfrm.cpp b/contrib/samples/ogl/studio/mainfrm.cpp index 7cf28d4a6a..4000fc7e02 100644 --- a/contrib/samples/ogl/studio/mainfrm.cpp +++ b/contrib/samples/ogl/studio/mainfrm.cpp @@ -54,7 +54,7 @@ END_EVENT_TABLE() // Define my frame constructor csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): - wxDocMDIParentFrame(manager, parent, id, title, pos, size, style, "frame") + wxDocMDIParentFrame(manager, parent, id, title, pos, size, style, _T("frame")) { CreateToolBar(wxNO_BORDER|wxTB_FLAT|wxTB_HORIZONTAL); wxGetApp().InitToolBar(GetToolBar()); @@ -71,26 +71,26 @@ csFrame::csFrame(wxDocManager* manager, wxFrame *parent, wxWindowID id, const wx SetAcceleratorTable(accel); } -void csFrame::OnHelp(wxCommandEvent& event) +void csFrame::OnHelp(wxCommandEvent& WXUNUSED(event)) { wxGetApp().GetHelpController().DisplayContents(); } -void csFrame::OnSettings(wxCommandEvent& event) +void csFrame::OnSettings(wxCommandEvent& WXUNUSED(event)) { csSettingsDialog* dialog = new csSettingsDialog(this); - int ret = dialog->ShowModal(); + /* int ret = */ dialog->ShowModal(); dialog->Destroy(); } -void csFrame::OnQuit(wxCommandEvent& event) +void csFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } -void csFrame::OnAbout(wxCommandEvent& event) +void csFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { - (void)wxMessageBox("OGL Studio\n(c) 1999, Julian Smart", "About OGL Studio", wxICON_INFORMATION); + (void)wxMessageBox(_T("OGL Studio\n(c) 1999, Julian Smart"), _T("About OGL Studio"), wxICON_INFORMATION); } void csFrame::OnSashDragPaletteWindow(wxSashEvent& event) @@ -141,7 +141,7 @@ void csFrame::OnCloseWindow(wxCloseEvent& event) wxDocMDIParentFrame::OnCloseWindow(event); } -void csFrame::OnSize(wxSizeEvent& event) +void csFrame::OnSize(wxSizeEvent& WXUNUSED(event)) { wxLayoutAlgorithm layout; layout.LayoutMDIFrame(this); diff --git a/contrib/samples/ogl/studio/project.cpp b/contrib/samples/ogl/studio/project.cpp index cb269bcb66..8d6e0efd69 100644 --- a/contrib/samples/ogl/studio/project.cpp +++ b/contrib/samples/ogl/studio/project.cpp @@ -37,8 +37,8 @@ csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, wxWindowID id, const wxPo wxTreeCtrl(parent, id, pos, size, style), m_imageList(16, 16) { - m_imageList.Add(wxIcon("folder1")); - m_imageList.Add(wxIcon("file1")); + m_imageList.Add(wxIcon(_T("folder1"))); + m_imageList.Add(wxIcon(_T("file1"))); SetImageList(& m_imageList); } @@ -49,7 +49,7 @@ csProjectTreeCtrl::~csProjectTreeCtrl() } // Create the project window -bool csApp::CreateProjectWindow(wxFrame *parent) +bool csApp::CreateProjectWindow(wxFrame *WXUNUSED(parent)) { #if 0 // Create a layout window diff --git a/contrib/samples/ogl/studio/shapes.cpp b/contrib/samples/ogl/studio/shapes.cpp index 55c28dfe5c..3e421feeb4 100644 --- a/contrib/samples/ogl/studio/shapes.cpp +++ b/contrib/samples/ogl/studio/shapes.cpp @@ -84,7 +84,7 @@ void csEvtHandler::CopyData(wxShapeEvtHandler& copy) csCopy.m_label = m_label; } -void csEvtHandler::OnLeftClick(double x, double y, int keys, int attachment) +void csEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment)) { wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); @@ -163,7 +163,7 @@ void csEvtHandler::OnLeftClick(double x, double y, int keys, int attachment) } } -void csEvtHandler::OnRightClick(double x, double y, int keys, int attachment) +void csEvtHandler::OnRightClick(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { // Have to convert back to physical coordinates from logical coordinates. @@ -189,7 +189,7 @@ void csEvtHandler::OnRightClick(double x, double y, int keys, int attachment) * Implement connection of two shapes by right-dragging between them. */ -void csEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment) +void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int attachment) { wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); @@ -203,7 +203,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment GetShape()->GetCanvas()->CaptureMouse(); } -void csEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int attachment) +void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int attachment) { wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); @@ -216,7 +216,7 @@ void csEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta dc.DrawLine(xp, yp, x, y); } -void csEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) +void csEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int attachment) { GetShape()->GetCanvas()->ReleaseMouse(); csCanvas *canvas = (csCanvas *)GetShape()->GetCanvas(); @@ -230,7 +230,7 @@ void csEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) wxLineShape* theShape = new csLineShape; theShape->AssignNewIds(); - theShape->SetEventHandler(new csEvtHandler(theShape, theShape, wxString(""))); + theShape->SetEventHandler(new csEvtHandler(theShape, theShape, wxEmptyString)); theShape->SetPen(wxBLACK_PEN); theShape->SetBrush(wxRED_BRUSH); @@ -244,14 +244,14 @@ void csEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) lineShape->MakeLineControlPoints(2); if (haveArrow) - lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, "Normal arrowhead"); + lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead")); lineShape->SetFrom(GetShape()); lineShape->SetTo(otherShape); lineShape->SetAttachments(attachment, new_attachment); canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit( - new csDiagramCommand("Line", (csDiagramDocument *)canvas->GetView()->GetDocument(), + new csDiagramCommand(_T("Line"), (csDiagramDocument *)canvas->GetView()->GetDocument(), new csCommandState(ID_CS_ADD_LINE, lineShape, NULL))); } } @@ -409,7 +409,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment) newShape->SetX(xx); newShape->SetY(yy); - csDiagramCommand* cmd = new csDiagramCommand("Move", (csDiagramDocument*)canvas->GetView()->GetDocument(), + csDiagramCommand* cmd = new csDiagramCommand(_T("Move"), (csDiagramDocument*)canvas->GetView()->GetDocument(), new csCommandState(ID_CS_MOVE, newShape, GetShape())); // Move line points @@ -557,14 +557,14 @@ void csEvtHandler::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, i } } - csDiagramCommand* cmd = new csDiagramCommand("Size", (csDiagramDocument*)canvas->GetView()->GetDocument(), + csDiagramCommand* cmd = new csDiagramCommand(_T("Size"), (csDiagramDocument*)canvas->GetView()->GetDocument(), new csCommandState(ID_CS_SIZE, newShape, shape)); canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd); } -void csEvtHandler::OnEndSize(double x, double y) +void csEvtHandler::OnEndSize(double WXUNUSED(x), double WXUNUSED(y)) { wxClientDC dc(GetShape()->GetCanvas()); GetShape()->GetCanvas()->PrepareDC(dc); @@ -581,7 +581,7 @@ void csEvtHandler::OnChangeAttachment(int attachment, wxLineShape* line, wxList& // Problem. If we refresh after the attachment change, we'll get a flicker. // We really want to do both in a oner. - csDiagramCommand* cmd = new csDiagramCommand("Change attachment", (csDiagramDocument*)canvas->GetView()->GetDocument()); + csDiagramCommand* cmd = new csDiagramCommand(_T("Change attachment"), (csDiagramDocument*)canvas->GetView()->GetDocument()); wxLineShape* newLine = (wxLineShape*) line->CreateNewCopy(); if (line->GetTo() == GetShape()) @@ -600,7 +600,7 @@ void csEvtHandler::OnChangeAttachment(int attachment, wxLineShape* line, wxList& canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd); } -void csEvtHandler::OnLeftDoubleClick(double x, double y, int keys, int attachment) +void csEvtHandler::OnLeftDoubleClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment)) { EditProperties(); } @@ -623,60 +623,60 @@ bool csEvtHandler::EditProperties() if (shape->IsKindOf(CLASSINFO(csThinRectangleShape))) { attributeDialog = new csThinRectangleDialog; - attributeDialogName = "thin_rectangle"; - title = "Thin Rectangle Properties"; + attributeDialogName = _T("thin_rectangle"); + title = _T("Thin Rectangle Properties"); } else if (shape->IsKindOf(CLASSINFO(csWideRectangleShape))) { attributeDialog = new csWideRectangleDialog; - attributeDialogName = "wide_rectangle"; - title = "Wide Rectangle Properties"; + attributeDialogName = _T("wide_rectangle"); + title = _T("Wide Rectangle Properties"); } else if (shape->IsKindOf(CLASSINFO(csTriangleShape))) { attributeDialog = new csTriangleDialog; - attributeDialogName = "triangle"; - title = "Triangle Properties"; + attributeDialogName = _T("triangle"); + title = _T("Triangle Properties"); } else if (shape->IsKindOf(CLASSINFO(csSemiCircleShape))) { attributeDialog = new csSemiCircleDialog; - attributeDialogName = "semi_circle"; - title = "Semicircle Properties"; + attributeDialogName = _T("semi_circle"); + title = _T("Semicircle Properties"); } else if (shape->IsKindOf(CLASSINFO(csCircleShape))) { attributeDialog = new csCircleDialog; - attributeDialogName = "circle"; - title = "Circle Properties"; + attributeDialogName = _T("circle"); + title = _T("Circle Properties"); } else if (shape->IsKindOf(CLASSINFO(csCircleShadowShape))) { attributeDialog = new csCircleShadowDialog; - attributeDialogName = "circle_shadow"; - title = "Circle Shadow Properties"; + attributeDialogName = _T("circle_shadow"); + title = _T("Circle Shadow Properties"); } else if (shape->IsKindOf(CLASSINFO(csTextBoxShape))) { attributeDialog = new csTextBoxDialog; - attributeDialogName = "text_box"; - title = "Text Box Properties"; + attributeDialogName = _T("text_box"); + title = _T("Text Box Properties"); } else if (shape->IsKindOf(CLASSINFO(csGroupShape))) { attributeDialog = new csGroupDialog; - attributeDialogName = "group"; - title = "Group Properties"; + attributeDialogName = _T("group"); + title = _T("Group Properties"); } else if (shape->IsKindOf(CLASSINFO(csOctagonShape))) { attributeDialog = new csOctagonDialog; - attributeDialogName = "octagon"; - title = "Octagon Properties"; + attributeDialogName = _T("octagon"); + title = _T("Octagon Properties"); } else { - wxMessageBox("Unrecognised shape.", "Studio", wxICON_EXCLAMATION); + wxMessageBox(_T("Unrecognised shape."), _T("Studio"), wxICON_EXCLAMATION); return FALSE; } @@ -696,7 +696,7 @@ bool csEvtHandler::EditProperties() csEvtHandler* handler2 = (csEvtHandler *)newShape->GetEventHandler(); handler2->m_label = newLabel; - view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand("Edit properties", (csDiagramDocument*) view->GetDocument(), + view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand(_T("Edit properties"), (csDiagramDocument*) view->GetDocument(), new csCommandState(ID_CS_EDIT_PROPERTIES, newShape, shape))); return TRUE; @@ -710,15 +710,15 @@ bool csDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) { wxDiagram::OnShapeSave(db, shape, expr); csEvtHandler *handler = (csEvtHandler *)shape.GetEventHandler(); - expr.AddAttributeValueString("label", handler->m_label); + expr.AddAttributeValueString(_T("label"), handler->m_label); return TRUE; } bool csDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) { wxDiagram::OnShapeLoad(db, shape, expr); - wxString label(""); - expr.GetAttributeValue("label", label); + wxString label = wxEmptyString; + expr.GetAttributeValue(_T("label"), label); csEvtHandler *handler = new csEvtHandler(&shape, &shape, label); shape.SetEventHandler(handler); @@ -979,7 +979,7 @@ IMPLEMENT_DYNAMIC_CLASS(csGroupShape, wxRectangleShape) csGroupShape::csGroupShape() { - SetPen(wxThePenList->FindOrCreatePen("BLACK", 1, wxDOT)); + SetPen(wxThePenList->FindOrCreatePen(_T("BLACK"), 1, wxDOT)); SetBrush(wxTRANSPARENT_BRUSH); SetSize(csSTANDARD_SHAPE_WIDTH, csSTANDARD_SHAPE_WIDTH); @@ -1049,7 +1049,7 @@ csLineShape::csLineShape() { } -bool csLineShape::OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, const wxRealPoint& pt) +bool csLineShape::OnMoveMiddleControlPoint(wxDC& WXUNUSED(dc), wxLineControlPoint* lpt, const wxRealPoint& pt) { csDiagramView* view = ((csCanvas*)GetCanvas())->GetView(); @@ -1063,7 +1063,7 @@ bool csLineShape::OnMoveMiddleControlPoint(wxDC& dc, wxLineControlPoint* lpt, co lpt->SetX(lpt->m_originalPos.x); lpt->SetY(lpt->m_originalPos.y); lpt->m_point->x = lpt->m_originalPos.x; lpt->m_point->y = lpt->m_originalPos.y; - view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand("Move line point", (csDiagramDocument*) view->GetDocument(), + view->GetDocument()->GetCommandProcessor()->Submit(new csDiagramCommand(_T("Move line point"), (csDiagramDocument*) view->GetDocument(), new csCommandState(ID_CS_MOVE_LINE_POINT, newShape, this))); return TRUE; @@ -1160,12 +1160,12 @@ void studioShapeEditProc(wxMenu& menu, wxCommandEvent& event) if (event.GetId() == ID_CS_ROTATE_CLOCKWISE) { theta += ninetyDegrees; - opStr = "Rotate clockwise"; + opStr = _T("Rotate clockwise"); } else { theta -= ninetyDegrees; - opStr = "Rotate anticlockwise"; + opStr = _T("Rotate anticlockwise"); } if (theta >= 2.0*myPi || theta < 0.0) diff --git a/contrib/samples/ogl/studio/shapes.h b/contrib/samples/ogl/studio/shapes.h index 6238dcef7c..117721dfbe 100644 --- a/contrib/samples/ogl/studio/shapes.h +++ b/contrib/samples/ogl/studio/shapes.h @@ -226,7 +226,7 @@ class csEvtHandler: public wxShapeEvtHandler { DECLARE_DYNAMIC_CLASS(csEvtHandler) public: - csEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = ""); + csEvtHandler(wxShapeEvtHandler *prev = NULL, wxShape *shape = NULL, const wxString& lab = wxEmptyString); ~csEvtHandler(); void OnLeftClick(double x, double y, int keys = 0, int attachment = 0); diff --git a/contrib/samples/ogl/studio/studio.cpp b/contrib/samples/ogl/studio/studio.cpp index ed6069c2a2..48c0b44fd1 100644 --- a/contrib/samples/ogl/studio/studio.cpp +++ b/contrib/samples/ogl/studio/studio.cpp @@ -92,13 +92,13 @@ csApp::~csApp() // Initialise this in OnInit, not statically bool csApp::OnInit(void) { - if (!wxResourceParseFile("studio_resources.wxr")) + if (!wxResourceParseFile(_T("studio_resources.wxr"))) { - wxMessageBox("Could not find or parse resource file: studio_resources.wxr", "Studio"); + wxMessageBox(_T("Could not find or parse resource file: studio_resources.wxr"), _T("Studio")); return FALSE; } - m_helpController.Initialize("studio.hlp"); + m_helpController.Initialize(_T("studio.hlp")); ReadOptions(); @@ -110,7 +110,7 @@ bool csApp::OnInit(void) m_docManager = new wxDocManager; //// Create a template relating drawing documents to their views - (void) new wxDocTemplate(m_docManager, "Diagram", "*.dia", "", "dia", "Diagram Doc", "Diagram View", + (void) new wxDocTemplate(m_docManager, _T("Diagram"), _T("*.dia"), wxEmptyString, _T("dia"), _T("Diagram Doc"), _T("Diagram View"), CLASSINFO(csDiagramDocument), CLASSINFO(csDiagramView)); // Create the main frame window. @@ -121,7 +121,7 @@ bool csApp::OnInit(void) #define wxDEFAULT_FRAME_STYLE_NO_CLIP \ (wxSYSTEM_MENU | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION) - csFrame* frame = new csFrame(m_docManager, NULL, -1, "OGL Studio", m_mainFramePos, m_mainFrameSize, + csFrame* frame = new csFrame(m_docManager, NULL, -1, _T("OGL Studio"), m_mainFramePos, m_mainFrameSize, wxDEFAULT_FRAME_STYLE_NO_CLIP | wxHSCROLL | wxVSCROLL); // Give it an icon @@ -130,38 +130,38 @@ bool csApp::OnInit(void) // Make a menubar wxMenu *fileMenu = new wxMenu; - fileMenu->Append(wxID_NEW, "&New...\tCtrl+N"); - fileMenu->Append(wxID_OPEN, "&Open...\tCtrl+O"); + fileMenu->Append(wxID_NEW, _T("&New...\tCtrl+N")); + fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O")); fileMenu->AppendSeparator(); - fileMenu->Append(wxID_PRINT, "&Print...\tCtrl+P"); - fileMenu->Append(wxID_PRINT_SETUP, "Print &Setup..."); - fileMenu->Append(wxID_PREVIEW, "Print Pre&view"); + fileMenu->Append(wxID_PRINT, _T("&Print...\tCtrl+P")); + fileMenu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); + fileMenu->Append(wxID_PREVIEW, _T("Print Pre&view")); fileMenu->AppendSeparator(); - fileMenu->Append(wxID_EXIT, "E&xit"); + fileMenu->Append(wxID_EXIT, _T("E&xit")); // A history of files visited. Use this menu. m_docManager->FileHistoryUseMenu(fileMenu); wxMenu *viewMenu = new wxMenu; - viewMenu->Append(ID_CS_SETTINGS, "&Settings..."); + viewMenu->Append(ID_CS_SETTINGS, _T("&Settings...")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(wxID_HELP, "&Help Contents\tF1"); - helpMenu->Append(ID_CS_ABOUT, "&About"); + helpMenu->Append(wxID_HELP, _T("&Help Contents\tF1")); + helpMenu->Append(ID_CS_ABOUT, _T("&About")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(fileMenu, "&File"); - menuBar->Append(viewMenu, "&View"); - menuBar->Append(helpMenu, "&Help"); + menuBar->Append(fileMenu, _T("&File")); + menuBar->Append(viewMenu, _T("&View")); + menuBar->Append(helpMenu, _T("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menuBar); // Load the file history - wxConfig config("OGL Studio", "wxWindows"); + wxConfig config(_T("OGL Studio"), _T("wxWindows")); m_docManager->FileHistoryLoad(config); frame->CreateStatusBar(); @@ -177,12 +177,12 @@ bool csApp::OnInit(void) // Create the shape editing menu m_shapeEditMenu = new ShapeEditMenu; - m_shapeEditMenu->Append(ID_CS_EDIT_PROPERTIES, "Edit properties"); + m_shapeEditMenu->Append(ID_CS_EDIT_PROPERTIES, _T("Edit properties")); m_shapeEditMenu->AppendSeparator(); - m_shapeEditMenu->Append(ID_CS_ROTATE_CLOCKWISE, "Rotate clockwise"); - m_shapeEditMenu->Append(ID_CS_ROTATE_ANTICLOCKWISE, "Rotate anticlockwise"); + m_shapeEditMenu->Append(ID_CS_ROTATE_CLOCKWISE, _T("Rotate clockwise")); + m_shapeEditMenu->Append(ID_CS_ROTATE_ANTICLOCKWISE, _T("Rotate anticlockwise")); m_shapeEditMenu->AppendSeparator(); - m_shapeEditMenu->Append(ID_CS_CUT, "Cut"); + m_shapeEditMenu->Append(ID_CS_CUT, _T("Cut")); frame->Show(TRUE); @@ -217,48 +217,48 @@ int csApp::OnExit(void) wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** editMenuRet) { //// Make a child frame - csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), -1, "Child Frame", + csMDIChildFrame *subframe = new csMDIChildFrame(doc, view, ((wxDocMDIParentFrame*)GetTopWindow()), -1, _T("Child Frame"), wxPoint(10, 10), wxSize(300, 300), wxDEFAULT_FRAME_STYLE); #ifdef __WXMSW__ - subframe->SetIcon(wxString("chart")); + subframe->SetIcon(wxString(_T("chart"))); #endif #ifdef __X__ - subframe->SetIcon(wxIcon("doc.xbm")); + subframe->SetIcon(wxIcon(_T("doc.xbm"))); #endif //// Make a menubar wxMenu *fileMenu = new wxMenu; - fileMenu->Append(wxID_NEW, "&New...\tCtrl+N"); - fileMenu->Append(wxID_OPEN, "&Open...\tCtrl+O"); - fileMenu->Append(wxID_CLOSE, "&Close\tCtrl+W"); - fileMenu->Append(wxID_SAVE, "&Save\tCtrl+S"); - fileMenu->Append(wxID_SAVEAS, "Save &As...\tF12"); + fileMenu->Append(wxID_NEW, _T("&New...\tCtrl+N")); + fileMenu->Append(wxID_OPEN, _T("&Open...\tCtrl+O")); + fileMenu->Append(wxID_CLOSE, _T("&Close\tCtrl+W")); + fileMenu->Append(wxID_SAVE, _T("&Save\tCtrl+S")); + fileMenu->Append(wxID_SAVEAS, _T("Save &As...\tF12")); fileMenu->AppendSeparator(); - fileMenu->Append(wxID_PRINT, "&Print...\tCtrl+P"); - fileMenu->Append(wxID_PRINT_SETUP, "Print &Setup..."); - fileMenu->Append(wxID_PREVIEW, "Print Pre&view"); + fileMenu->Append(wxID_PRINT, _T("&Print...\tCtrl+P")); + fileMenu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); + fileMenu->Append(wxID_PREVIEW, _T("Print Pre&view")); fileMenu->AppendSeparator(); - fileMenu->Append(wxID_EXIT, "E&xit"); + fileMenu->Append(wxID_EXIT, _T("E&xit")); wxMenu *editMenu = NULL; editMenu = new wxMenu; - editMenu->Append(wxID_UNDO, "&Undo\tCtrl+Z"); - editMenu->Append(wxID_REDO, "&Redo\tCtrl+Y"); + editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z")); + editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y")); editMenu->AppendSeparator(); - editMenu->Append(wxID_CUT, "Cu&t\tCtrl+X"); - editMenu->Append(wxID_COPY, "&Copy\tCtrl+C"); - editMenu->Append(wxID_PASTE, "&Paste\tCtrl+V"); - editMenu->Append(wxID_DUPLICATE, "&Duplicate\tCtrl+D"); + editMenu->Append(wxID_CUT, _T("Cu&t\tCtrl+X")); + editMenu->Append(wxID_COPY, _T("&Copy\tCtrl+C")); + editMenu->Append(wxID_PASTE, _T("&Paste\tCtrl+V")); + editMenu->Append(wxID_DUPLICATE, _T("&Duplicate\tCtrl+D")); editMenu->AppendSeparator(); - editMenu->Append(wxID_CLEAR, "Cle&ar\tDelete"); - editMenu->Append(ID_CS_SELECT_ALL, "Select A&ll\tCtrl+A"); + editMenu->Append(wxID_CLEAR, _T("Cle&ar\tDelete")); + editMenu->Append(ID_CS_SELECT_ALL, _T("Select A&ll\tCtrl+A")); editMenu->AppendSeparator(); - editMenu->Append(ID_CS_EDIT_PROPERTIES, "Edit P&roperties..."); + editMenu->Append(ID_CS_EDIT_PROPERTIES, _T("Edit P&roperties...")); *editMenuRet = editMenu; @@ -268,18 +268,18 @@ wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** doc->GetCommandProcessor()->SetEditMenu(editMenu); wxMenu *viewMenu = new wxMenu; - viewMenu->Append(ID_CS_SETTINGS, "&Settings..."); + viewMenu->Append(ID_CS_SETTINGS, _T("&Settings...")); wxMenu *helpMenu = new wxMenu; - helpMenu->Append(wxID_HELP, "&Help Contents\tF1"); - helpMenu->Append(ID_CS_ABOUT, "&About"); + helpMenu->Append(wxID_HELP, _T("&Help Contents\tF1")); + helpMenu->Append(ID_CS_ABOUT, _T("&About")); wxMenuBar *menuBar = new wxMenuBar; - menuBar->Append(fileMenu, "&File"); - menuBar->Append(editMenu, "&Edit"); - menuBar->Append(viewMenu, "&View"); - menuBar->Append(helpMenu, "&Help"); + menuBar->Append(fileMenu, _T("&File")); + menuBar->Append(editMenu, _T("&Edit")); + menuBar->Append(viewMenu, _T("&View")); + menuBar->Append(helpMenu, _T("&Help")); //// Associate the menu bar with the frame subframe->SetMenuBar(menuBar); @@ -296,7 +296,7 @@ csCanvas *csApp::CreateCanvas(wxView *view, wxFrame *parent) // Non-retained canvas csCanvas *canvas = new csCanvas((csDiagramView*) view, parent, 1000, wxPoint(0, 0), wxSize(width, height), wxSUNKEN_BORDER); - wxColour bgColour("WHITE"); + wxColour bgColour(_T("WHITE")); canvas->SetBackgroundColour(bgColour); wxCursor cursor(wxCURSOR_HAND); @@ -313,16 +313,16 @@ void csApp::InitToolBar(wxToolBar* toolBar) wxBitmap* bitmaps[10]; #ifdef __WXMSW__ - bitmaps[0] = new wxBitmap("new", wxBITMAP_TYPE_RESOURCE); - bitmaps[1] = new wxBitmap("open", wxBITMAP_TYPE_RESOURCE); - bitmaps[2] = new wxBitmap("save", wxBITMAP_TYPE_RESOURCE); - bitmaps[3] = new wxBitmap("copy", wxBITMAP_TYPE_RESOURCE); - bitmaps[4] = new wxBitmap("cut", wxBITMAP_TYPE_RESOURCE); - bitmaps[5] = new wxBitmap("paste", wxBITMAP_TYPE_RESOURCE); - bitmaps[6] = new wxBitmap("print", wxBITMAP_TYPE_RESOURCE); - bitmaps[7] = new wxBitmap("help", wxBITMAP_TYPE_RESOURCE); - bitmaps[8] = new wxBitmap("undo", wxBITMAP_TYPE_RESOURCE); - bitmaps[9] = new wxBitmap("redo", wxBITMAP_TYPE_RESOURCE); + bitmaps[0] = new wxBitmap(_T("new"), wxBITMAP_TYPE_RESOURCE); + bitmaps[1] = new wxBitmap(_T("open"), wxBITMAP_TYPE_RESOURCE); + bitmaps[2] = new wxBitmap(_T("save"), wxBITMAP_TYPE_RESOURCE); + bitmaps[3] = new wxBitmap(_T("copy"), wxBITMAP_TYPE_RESOURCE); + bitmaps[4] = new wxBitmap(_T("cut"), wxBITMAP_TYPE_RESOURCE); + bitmaps[5] = new wxBitmap(_T("paste"), wxBITMAP_TYPE_RESOURCE); + bitmaps[6] = new wxBitmap(_T("print"), wxBITMAP_TYPE_RESOURCE); + bitmaps[7] = new wxBitmap(_T("help"), wxBITMAP_TYPE_RESOURCE); + bitmaps[8] = new wxBitmap(_T("undo"), wxBITMAP_TYPE_RESOURCE); + bitmaps[9] = new wxBitmap(_T("redo"), wxBITMAP_TYPE_RESOURCE); #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) bitmaps[0] = new wxBitmap( new_xpm ); bitmaps[1] = new wxBitmap( open_xpm ); @@ -338,20 +338,20 @@ void csApp::InitToolBar(wxToolBar* toolBar) #error "Not implemented for this platform." #endif - toolBar->AddTool(wxID_NEW, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, "New file"); - toolBar->AddTool(wxID_OPEN, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, "Open file"); - toolBar->AddTool(wxID_SAVE, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, "Save file"); + toolBar->AddTool(wxID_NEW, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, _T("New file")); + toolBar->AddTool(wxID_OPEN, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, _T("Open file")); + toolBar->AddTool(wxID_SAVE, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, _T("Save file")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_PRINT, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, "Print"); + toolBar->AddTool(wxID_PRINT, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, _T("Print")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_COPY, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, "Copy"); - toolBar->AddTool(wxID_CUT, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, "Cut"); - toolBar->AddTool(wxID_PASTE, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, "Paste"); + toolBar->AddTool(wxID_COPY, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, _T("Copy")); + toolBar->AddTool(wxID_CUT, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, _T("Cut")); + toolBar->AddTool(wxID_PASTE, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, _T("Paste")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_UNDO, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, "Undo"); - toolBar->AddTool(wxID_REDO, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, "Redo"); + toolBar->AddTool(wxID_UNDO, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, _T("Undo")); + toolBar->AddTool(wxID_REDO, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, _T("Redo")); toolBar->AddSeparator(); - toolBar->AddTool(wxID_HELP, *bitmaps[7], wxNullBitmap, FALSE, -1, -1, NULL, "Help"); + toolBar->AddTool(wxID_HELP, *bitmaps[7], wxNullBitmap, FALSE, -1, -1, NULL, _T("Help")); toolBar->Realize(); @@ -385,17 +385,17 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) wxBitmap* bitmaps[11]; #ifdef __WXMSW__ - bitmaps[0] = new wxBitmap("alignl", wxBITMAP_TYPE_RESOURCE); - bitmaps[1] = new wxBitmap("alignr", wxBITMAP_TYPE_RESOURCE); - bitmaps[2] = new wxBitmap("alignt", wxBITMAP_TYPE_RESOURCE); - bitmaps[3] = new wxBitmap("alignb", wxBITMAP_TYPE_RESOURCE); - bitmaps[4] = new wxBitmap("horiz", wxBITMAP_TYPE_RESOURCE); - bitmaps[5] = new wxBitmap("vert", wxBITMAP_TYPE_RESOURCE); - bitmaps[6] = new wxBitmap("copysize", wxBITMAP_TYPE_RESOURCE); - bitmaps[7] = new wxBitmap("linearrow", wxBITMAP_TYPE_RESOURCE); - bitmaps[8] = new wxBitmap("newpoint", wxBITMAP_TYPE_RESOURCE); - bitmaps[9] = new wxBitmap("cutpoint", wxBITMAP_TYPE_RESOURCE); - bitmaps[10] = new wxBitmap("straighten", wxBITMAP_TYPE_RESOURCE); + bitmaps[0] = new wxBitmap(_T("alignl"), wxBITMAP_TYPE_RESOURCE); + bitmaps[1] = new wxBitmap(_T("alignr"), wxBITMAP_TYPE_RESOURCE); + bitmaps[2] = new wxBitmap(_T("alignt"), wxBITMAP_TYPE_RESOURCE); + bitmaps[3] = new wxBitmap(_T("alignb"), wxBITMAP_TYPE_RESOURCE); + bitmaps[4] = new wxBitmap(_T("horiz"), wxBITMAP_TYPE_RESOURCE); + bitmaps[5] = new wxBitmap(_T("vert"), wxBITMAP_TYPE_RESOURCE); + bitmaps[6] = new wxBitmap(_T("copysize"), wxBITMAP_TYPE_RESOURCE); + bitmaps[7] = new wxBitmap(_T("linearrow"), wxBITMAP_TYPE_RESOURCE); + bitmaps[8] = new wxBitmap(_T("newpoint"), wxBITMAP_TYPE_RESOURCE); + bitmaps[9] = new wxBitmap(_T("cutpoint"), wxBITMAP_TYPE_RESOURCE); + bitmaps[10] = new wxBitmap(_T("straighten"), wxBITMAP_TYPE_RESOURCE); #elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXMAC__) bitmaps[0] = new wxBitmap( alignl_xpm ); bitmaps[1] = new wxBitmap( alignr_xpm ); @@ -412,18 +412,18 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) #error "Not implemented for this platform." #endif - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNL, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, "Align left"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNR, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, "Align right"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNT, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, "Align top"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNB, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, "Align bottom"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, "Align horizontally"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, "Align vertically"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, "Copy size"); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNL, *bitmaps[0], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align left")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNR, *bitmaps[1], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align right")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNT, *bitmaps[2], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align top")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGNB, *bitmaps[3], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align bottom")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_HORIZ, *bitmaps[4], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align horizontally")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_ALIGN_VERT, *bitmaps[5], wxNullBitmap, FALSE, -1, -1, NULL, _T("Align vertically")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_COPY_SIZE, *bitmaps[6], wxNullBitmap, FALSE, -1, -1, NULL, _T("Copy size")); m_diagramToolBar->AddSeparator(); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW, *bitmaps[7], wxNullBitmap, TRUE, -1, -1, NULL, "Toggle arrow"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_NEW_POINT, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, "New line point"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_CUT_POINT, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, "Cut line point"); - m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN, *bitmaps[10], wxNullBitmap, FALSE, -1, -1, NULL, "Straighten lines"); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_LINE_ARROW, *bitmaps[7], wxNullBitmap, TRUE, -1, -1, NULL, _T("Toggle arrow")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_NEW_POINT, *bitmaps[8], wxNullBitmap, FALSE, -1, -1, NULL, _T("New line point")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_CUT_POINT, *bitmaps[9], wxNullBitmap, FALSE, -1, -1, NULL, _T("Cut line point")); + m_diagramToolBar->AddTool(DIAGRAM_TOOLBAR_STRAIGHTEN, *bitmaps[10], wxNullBitmap, FALSE, -1, -1, NULL, _T("Straighten lines")); m_diagramToolBar->Realize(); @@ -436,7 +436,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) wxString *pointSizes = new wxString[maxPointSize]; for (i = 1; i <= maxPointSize; i++) { - pointSizes[i-1].Printf("%d", i); + pointSizes[i-1].Printf(_T("%d"), i); } int controlX = 260; @@ -453,7 +453,7 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) #endif m_pointSizeComboBox = new wxComboBox(m_diagramToolBar, ID_WINDOW_POINT_SIZE_COMBOBOX, - "", wxPoint(controlX, 1), wxSize(pointSizeW, pointSizeH), maxPointSize, pointSizes); + wxEmptyString, wxPoint(controlX, 1), wxSize(pointSizeW, pointSizeH), maxPointSize, pointSizes); delete[] pointSizes; #ifdef __WXGTK__ @@ -470,13 +470,13 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) wxString *zoomStrings = new wxString[noStrings]; for (i = 0; i < noStrings; i ++) { - zoomStrings[noStrings - i - 1].Printf("%d%%", (i*increment + minZoom)); + zoomStrings[noStrings - i - 1].Printf(_T("%d%%"), (i*increment + minZoom)); } controlX += pointSizeW + 10; m_zoomComboBox = new wxComboBox(m_diagramToolBar, ID_WINDOW_ZOOM_COMBOBOX, - "", wxPoint(controlX, 1), wxSize(zoomW, zoomH), noStrings, zoomStrings); + wxEmptyString, wxPoint(controlX, 1), wxSize(zoomW, zoomH), noStrings, zoomStrings); delete[] zoomStrings; #ifdef __WXGTK__ @@ -493,28 +493,28 @@ void csApp::CreateDiagramToolBar(wxFrame* parent) // Read/write configuration information bool csApp::ReadOptions() { - wxConfig config("OGL Studio", "wxWindows"); + wxConfig config(_T("OGL Studio"), _T("wxWindows")); - config.Read("mainX", & m_mainFramePos.x); - config.Read("mainY", & m_mainFramePos.y); - config.Read("mainWidth", & m_mainFrameSize.x); - config.Read("mainHeight", & m_mainFrameSize.y); - config.Read("gridStyle", & m_gridStyle); - config.Read("gridSpacing", & m_gridSpacing); + config.Read(_T("mainX"), & m_mainFramePos.x); + config.Read(_T("mainY"), & m_mainFramePos.y); + config.Read(_T("mainWidth"), & m_mainFrameSize.x); + config.Read(_T("mainHeight"), & m_mainFrameSize.y); + config.Read(_T("gridStyle"), & m_gridStyle); + config.Read(_T("gridSpacing"), & m_gridSpacing); return TRUE; } bool csApp::WriteOptions() { - wxConfig config("OGL Studio", "wxWindows"); - - config.Write("mainX", (long) m_mainFramePos.x); - config.Write("mainY", (long) m_mainFramePos.y); - config.Write("mainWidth", (long) m_mainFrameSize.x); - config.Write("mainHeight", (long) m_mainFrameSize.y); - config.Write("gridStyle", (long) m_gridStyle); - config.Write("gridSpacing", (long) m_gridSpacing); + wxConfig config(_T("OGL Studio"), _T("wxWindows")); + + config.Write(_T("mainX"), (long) m_mainFramePos.x); + config.Write(_T("mainY"), (long) m_mainFramePos.y); + config.Write(_T("mainWidth"), (long) m_mainFrameSize.x); + config.Write(_T("mainHeight"), (long) m_mainFrameSize.y); + config.Write(_T("gridStyle"), (long) m_gridStyle); + config.Write(_T("gridSpacing"), (long) m_gridSpacing); m_docManager->FileHistorySave(config); diff --git a/contrib/samples/ogl/studio/symbols.cpp b/contrib/samples/ogl/studio/symbols.cpp index 2744355589..8bc2778ef0 100644 --- a/contrib/samples/ogl/studio/symbols.cpp +++ b/contrib/samples/ogl/studio/symbols.cpp @@ -120,51 +120,51 @@ void csApp::InitSymbols() wxShape* shape = new csCircleShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Circle", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Circle"), shape)); shape = new csCircleShadowShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Circle shadow", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Circle shadow"), shape)); shape = new csThinRectangleShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Thin Rectangle", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Thin Rectangle"), shape)); shape = new csWideRectangleShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Wide Rectangle", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Wide Rectangle"), shape)); shape = new csSemiCircleShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("SemiCircle", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("SemiCircle"), shape)); shape = new csTriangleShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Triangle", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Triangle"), shape)); shape = new csOctagonShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Octagon", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Octagon"), shape)); shape = new csGroupShape(); shape->AssignNewIds(); - shape->SetEventHandler(new csEvtHandler(shape, shape, wxString(""))); + shape->SetEventHandler(new csEvtHandler(shape, shape, wxEmptyString)); - m_symbolDatabase->AddSymbol(new csSymbol("Group", shape)); + m_symbolDatabase->AddSymbol(new csSymbol(_T("Group"), shape)); } wxBitmap* csSymbolDatabase::CreateToolBitmap(csSymbol* symbol, const wxSize& toolSize) diff --git a/contrib/samples/ogl/studio/view.cpp b/contrib/samples/ogl/studio/view.cpp index 92fde551e1..c00189d947 100644 --- a/contrib/samples/ogl/studio/view.cpp +++ b/contrib/samples/ogl/studio/view.cpp @@ -87,7 +87,7 @@ END_EVENT_TABLE() // What to do when a view is created. Creates actual // windows for displaying the view. -bool csDiagramView::OnCreate(wxDocument *doc, long flags) +bool csDiagramView::OnCreate(wxDocument *doc, long WXUNUSED(flags)) { wxMenu* editMenu; frame = wxGetApp().CreateChildFrame(doc, this, &editMenu); @@ -141,11 +141,11 @@ csDiagramView::~csDiagramView(void) // Sneakily gets used for default print/preview // as well as drawing on the screen. -void csDiagramView::OnDraw(wxDC *dc) +void csDiagramView::OnDraw(wxDC *WXUNUSED(dc)) { } -void csDiagramView::OnUpdate(wxView *sender, wxObject *hint) +void csDiagramView::OnUpdate(wxView *WXUNUSED(sender), wxObject *WXUNUSED(hint)) { if (canvas) canvas->Refresh(); @@ -190,7 +190,7 @@ void csDiagramView::SelectShape(wxShape* shape, bool select) m_selections.DeleteObject(shape); } -void csDiagramView::OnSelectAll(wxCommandEvent& event) +void csDiagramView::OnSelectAll(wxCommandEvent& WXUNUSED(event)) { SelectAll(TRUE); } @@ -240,7 +240,7 @@ void csDiagramView::OnRedoUpdate(wxUpdateUIEvent& event) event.Enable(doc->GetCommandProcessor()->CanRedo()); } -void csDiagramView::OnCut(wxCommandEvent& event) +void csDiagramView::OnCut(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); @@ -253,7 +253,7 @@ void csDiagramView::OnCut(wxCommandEvent& event) DoCut(selections); } -void csDiagramView::OnClear(wxCommandEvent& event) +void csDiagramView::OnClear(wxCommandEvent& WXUNUSED(event)) { wxList selections; FindSelectedShapes(selections); @@ -261,7 +261,7 @@ void csDiagramView::OnClear(wxCommandEvent& event) DoCut(selections); } -void csDiagramView::OnCopy(wxCommandEvent& event) +void csDiagramView::OnCopy(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); @@ -275,14 +275,14 @@ void csDiagramView::OnCopy(wxCommandEvent& event) } } -void csDiagramView::OnPaste(wxCommandEvent& event) +void csDiagramView::OnPaste(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); wxGetApp().GetDiagramClipboard().Paste(doc->GetDiagram()); } -void csDiagramView::OnDuplicate(wxCommandEvent& event) +void csDiagramView::OnDuplicate(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); @@ -311,7 +311,7 @@ void csDiagramView::OnCopyUpdate(wxUpdateUIEvent& event) void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event) { - csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); + /* csDiagramDocument *doc = */ (csDiagramDocument *)GetDocument(); int n = wxGetApp().GetDiagramClipboard().GetCount(); @@ -329,7 +329,7 @@ void csDiagramView::DoCut(wxList& shapes) if (shapes.Number() > 0) { - csDiagramCommand* cmd = new csDiagramCommand("Cut", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc); wxNode* node = shapes.First(); while (node) @@ -379,7 +379,7 @@ void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxSt } } -void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event) +void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); @@ -408,7 +408,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event) if (!theBrush) return; - csDiagramCommand* cmd = new csDiagramCommand("Change colour", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc); wxNode* node = selections.First(); while (node) @@ -426,7 +426,7 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event) } } -void csDiagramView::OnEditProperties(wxCommandEvent& event) +void csDiagramView::OnEditProperties(wxCommandEvent& WXUNUSED(event)) { wxShape *theShape = FindFirstSelectedShape(); if (theShape) @@ -459,7 +459,8 @@ void csDiagramView::OnPointSizeComboText(wxCommandEvent& event) wxASSERT( combo != NULL ); wxString str(combo->GetValue()); - int newPointSize = atoi((const char*) str); + long newPointSize; + str.ToLong( &newPointSize ); if (newPointSize < 2) return; @@ -476,7 +477,7 @@ void csDiagramView::ApplyPointSize(int pointSize) if (selections.Number() > 0) { - csDiagramCommand* cmd = new csDiagramCommand("Point size", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc); wxNode* node = selections.First(); while (node) @@ -560,16 +561,16 @@ void csDiagramView::SelectAll(bool select) } -void csDiagramView::OnToggleArrowTool(wxCommandEvent& event) +void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); bool state = wxGetApp().GetDiagramToolBar()->GetToolState(DIAGRAM_TOOLBAR_LINE_ARROW); wxString stateName; if (state) - stateName = "Arrow on"; + stateName = _T("Arrow on"); else - stateName = "Arrow off"; + stateName = _T("Arrow off"); wxList selections; FindSelectedShapes(selections, CLASSINFO(wxLineShape)); @@ -590,7 +591,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& event) if (theShape->GetArrows().Number() == 0) { newShape = (wxLineShape*) theShape->CreateNewCopy(); - newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, "Normal arrowhead"); + newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead")); } } else @@ -665,7 +666,7 @@ void csDiagramView::OnAlign(wxCommandEvent& event) return; csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - csDiagramCommand* cmd = new csDiagramCommand("Align", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("Align"), doc); node = selections.First(); wxShape* firstShape = (wxShape*) node->Data(); @@ -681,8 +682,8 @@ void csDiagramView::OnAlign(wxCommandEvent& event) wxShape* shape = (wxShape*) node->Data(); if (shape != firstShape) { - double x1 = shape->GetX(); - double y1 = shape->GetY(); + /* double x1 = */ shape->GetX(); + /* double y1 = */ shape->GetY(); double width1, height1; shape->GetBoundingBoxMax(& width1, & height1); @@ -745,10 +746,10 @@ void csDiagramView::OnAlignUpdate(wxUpdateUIEvent& event) event.Enable( (m_selections.Number() > 1) ) ; } -void csDiagramView::OnNewLinePoint(wxCommandEvent& event) +void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - csDiagramCommand* cmd = new csDiagramCommand("New line point", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc); wxNode* node = m_selections.First(); while (node) @@ -766,10 +767,10 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& event) doc->GetCommandProcessor()->Submit(cmd); } -void csDiagramView::OnCutLinePoint(wxCommandEvent& event) +void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - csDiagramCommand* cmd = new csDiagramCommand("Cut line point", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc); wxNode* node = m_selections.First(); while (node) @@ -787,10 +788,10 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& event) doc->GetCommandProcessor()->Submit(cmd); } -void csDiagramView::OnStraightenLines(wxCommandEvent& event) +void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event)) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - csDiagramCommand* cmd = new csDiagramCommand("Straighten lines", doc); + csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc); wxNode* node = m_selections.First(); while (node) @@ -861,7 +862,7 @@ void csCanvas::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2) dc.DrawRectangle((long) x1, (long) y1, (long) (x2 - x1), (long) (y2 - y1)); } -void csCanvas::OnLeftClick(double x, double y, int keys) +void csCanvas::OnLeftClick(double x, double y, int WXUNUSED(keys)) { csEditorToolPalette *palette = wxGetApp().GetDiagramPalette(); @@ -881,8 +882,8 @@ void csCanvas::OnLeftClick(double x, double y, int keys) // Ask for a label and create a new free-floating text region csLabelEditingDialog* dialog = new csLabelEditingDialog(GetParent()); - dialog->SetShapeLabel(""); - dialog->SetTitle("New text box"); + dialog->SetShapeLabel( wxEmptyString ); + dialog->SetTitle(_T("New text box")); if (dialog->ShowModal() == wxID_CANCEL) { dialog->Destroy(); @@ -898,7 +899,8 @@ void csCanvas::OnLeftClick(double x, double y, int keys) wxComboBox* comboBox = wxGetApp().GetPointSizeComboBox(); wxString str(comboBox->GetValue()); - int pointSize = atoi((const char*) str); + long pointSize; + str.ToLong( &pointSize ); wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize, shape->GetFont()->GetFamily(), @@ -912,7 +914,7 @@ void csCanvas::OnLeftClick(double x, double y, int keys) shape->SetX(x); shape->SetY(y); - csDiagramCommand* cmd = new csDiagramCommand("Text box", + csDiagramCommand* cmd = new csDiagramCommand(_T("Text box"), (csDiagramDocument *)GetView()->GetDocument(), new csCommandState(ID_CS_ADD_SHAPE, shape, NULL)); GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd); @@ -929,7 +931,8 @@ void csCanvas::OnLeftClick(double x, double y, int keys) wxComboBox* comboBox = wxGetApp().GetPointSizeComboBox(); wxString str(comboBox->GetValue()); - int pointSize = atoi((const char*) str); + long pointSize; + str.ToLong( &pointSize ); wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize, symbol->GetShape()->GetFont()->GetFamily(), @@ -953,14 +956,14 @@ void csCanvas::OnLeftClick(double x, double y, int keys) } } -void csCanvas::OnRightClick(double x, double y, int keys) +void csCanvas::OnRightClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } // Initial point static double sg_initialX, sg_initialY; -void csCanvas::OnDragLeft(bool draw, double x, double y, int keys) +void csCanvas::OnDragLeft(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys)) { wxClientDC dc(this); PrepareDC(dc); @@ -969,7 +972,7 @@ void csCanvas::OnDragLeft(bool draw, double x, double y, int keys) DrawOutline(dc, sg_initialX, sg_initialY, x, y); } -void csCanvas::OnBeginDragLeft(double x, double y, int keys) +void csCanvas::OnBeginDragLeft(double x, double y, int WXUNUSED(keys)) { sg_initialX = x; sg_initialY = y; @@ -982,7 +985,7 @@ void csCanvas::OnBeginDragLeft(double x, double y, int keys) CaptureMouse(); } -void csCanvas::OnEndDragLeft(double x, double y, int keys) +void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys)) { ReleaseMouse(); @@ -1015,15 +1018,15 @@ void csCanvas::OnEndDragLeft(double x, double y, int keys) } } -void csCanvas::OnDragRight(bool draw, double x, double y, int keys) +void csCanvas::OnDragRight(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void csCanvas::OnBeginDragRight(double x, double y, int keys) +void csCanvas::OnBeginDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void csCanvas::OnEndDragRight(double x, double y, int keys) +void csCanvas::OnEndDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 2d16def3c1..95f6993b8b 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -682,9 +682,9 @@ void wxShape::Recentre(wxDC& dc) } } -bool wxShape::GetPerimeterPoint(double x1, double y1, - double x2, double y2, - double *x3, double *y3) +bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), + double WXUNUSED(x2), double WXUNUSED(y2), + double *WXUNUSED(x3), double *WXUNUSED(y3)) { return FALSE; } @@ -890,7 +890,7 @@ void wxShape::AssignNewIds() } } -void wxShape::OnDraw(wxDC& dc) +void wxShape::OnDraw(wxDC& WXUNUSED(dc)) { } @@ -938,16 +938,16 @@ void wxShape::DrawContents(wxDC& dc) GetEventHandler()->OnDrawContents(dc); } -void wxShape::OnSize(double x, double y) +void wxShape::OnSize(double WXUNUSED(x), double WXUNUSED(y)) { } -bool wxShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display) +bool wxShape::OnMovePre(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) { return TRUE; } -void wxShape::OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display) +void wxShape::OnMovePost(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) { } @@ -1058,13 +1058,11 @@ bool wxShape::AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, co case 2: { return (pt1.x <= pt2.x) ; - break; } case 1: case 3: { return (pt1.y <= pt2.y) ; - break; } } @@ -1260,7 +1258,7 @@ void wxShape::SortLines(int attachment, wxList& linesToSort) } } -void wxShape::OnHighlight(wxDC& dc) +void wxShape::OnHighlight(wxDC& WXUNUSED(dc)) { } @@ -1572,7 +1570,7 @@ void wxShape::AddText(const wxString& string) m_formatted = FALSE; } -void wxShape::SetSize(double x, double y, bool recursive) +void wxShape::SetSize(double x, double y, bool WXUNUSED(recursive)) { SetAttachmentSize(x, y); SetDefaultRegionSize(); @@ -1692,44 +1690,44 @@ void wxShape::RemoveLine(wxLineShape *line) #if wxUSE_PROLOGIO void wxShape::WriteAttributes(wxExpr *clause) { - clause->AddAttributeValueString("type", GetClassInfo()->GetClassName()); - clause->AddAttributeValue("id", m_id); + clause->AddAttributeValueString(_T("type"), GetClassInfo()->GetClassName()); + clause->AddAttributeValue(_T("id"), m_id); if (m_pen) { int penWidth = m_pen->GetWidth(); int penStyle = m_pen->GetStyle(); if (penWidth != 1) - clause->AddAttributeValue("pen_width", (long)penWidth); + clause->AddAttributeValue(_T("pen_width"), (long)penWidth); if (penStyle != wxSOLID) - clause->AddAttributeValue("pen_style", (long)penStyle); + clause->AddAttributeValue(_T("pen_style"), (long)penStyle); wxString penColour = wxTheColourDatabase->FindName(m_pen->GetColour()); - if (penColour == "") + if (penColour == wxEmptyString) { wxString hex(oglColourToHex(m_pen->GetColour())); - hex = wxString("#") + hex; - clause->AddAttributeValueString("pen_colour", hex); + hex = wxString(_T("#")) + hex; + clause->AddAttributeValueString(_T("pen_colour"), hex); } - else if (penColour != "BLACK") - clause->AddAttributeValueString("pen_colour", penColour); + else if (penColour != _T("BLACK")) + clause->AddAttributeValueString(_T("pen_colour"), penColour); } if (m_brush) { wxString brushColour = wxTheColourDatabase->FindName(m_brush->GetColour()); - if (brushColour == "") + if (brushColour == wxEmptyString) { wxString hex(oglColourToHex(m_brush->GetColour())); - hex = wxString("#") + hex; - clause->AddAttributeValueString("brush_colour", hex); + hex = wxString(_T("#")) + hex; + clause->AddAttributeValueString(_T("brush_colour"), hex); } - else if (brushColour != "WHITE") - clause->AddAttributeValueString("brush_colour", brushColour); + else if (brushColour != _T("WHITE")) + clause->AddAttributeValueString(_T("brush_colour"), brushColour); if (m_brush->GetStyle() != wxSOLID) - clause->AddAttributeValue("brush_style", (long)m_brush->GetStyle()); + clause->AddAttributeValue(_T("brush_style"), (long)m_brush->GetStyle()); } // Output line ids @@ -1746,40 +1744,40 @@ void wxShape::WriteAttributes(wxExpr *clause) list->Append(id_expr); node = node->GetNext(); } - clause->AddAttributeValue("arcs", list); + clause->AddAttributeValue(_T("arcs"), list); } // Miscellaneous members if (m_attachmentMode != 0) - clause->AddAttributeValue("use_attachments", (long)m_attachmentMode); + clause->AddAttributeValue(_T("use_attachments"), (long)m_attachmentMode); if (m_sensitivity != OP_ALL) - clause->AddAttributeValue("sensitivity", (long)m_sensitivity); + clause->AddAttributeValue(_T("sensitivity"), (long)m_sensitivity); if (!m_spaceAttachments) - clause->AddAttributeValue("space_attachments", (long)m_spaceAttachments); + clause->AddAttributeValue(_T("space_attachments"), (long)m_spaceAttachments); if (m_fixedWidth) - clause->AddAttributeValue("fixed_width", (long)m_fixedWidth); + clause->AddAttributeValue(_T("fixed_width"), (long)m_fixedWidth); if (m_fixedHeight) - clause->AddAttributeValue("fixed_height", (long)m_fixedHeight); + clause->AddAttributeValue(_T("fixed_height"), (long)m_fixedHeight); if (m_shadowMode != SHADOW_NONE) - clause->AddAttributeValue("shadow_mode", (long)m_shadowMode); + clause->AddAttributeValue(_T("shadow_mode"), (long)m_shadowMode); if (m_centreResize != TRUE) - clause->AddAttributeValue("centre_resize", (long)0); - clause->AddAttributeValue("maintain_aspect_ratio", (long) m_maintainAspectRatio); + clause->AddAttributeValue(_T("centre_resize"), (long)0); + clause->AddAttributeValue(_T("maintain_aspect_ratio"), (long) m_maintainAspectRatio); if (m_highlighted != FALSE) - clause->AddAttributeValue("hilite", (long)m_highlighted); + clause->AddAttributeValue(_T("hilite"), (long)m_highlighted); if (m_parent) // For composite objects - clause->AddAttributeValue("parent", (long)m_parent->GetId()); + clause->AddAttributeValue(_T("parent"), (long)m_parent->GetId()); if (m_rotation != 0.0) - clause->AddAttributeValue("rotation", m_rotation); + clause->AddAttributeValue(_T("rotation"), m_rotation); if (!this->IsKindOf(CLASSINFO(wxLineShape))) { - clause->AddAttributeValue("neck_length", (long) m_branchNeckLength); - clause->AddAttributeValue("stem_length", (long) m_branchStemLength); - clause->AddAttributeValue("branch_spacing", (long) m_branchSpacing); - clause->AddAttributeValue("branch_style", (long) m_branchStyle); + clause->AddAttributeValue(_T("neck_length"), (long) m_branchNeckLength); + clause->AddAttributeValue(_T("stem_length"), (long) m_branchStemLength); + clause->AddAttributeValue(_T("branch_spacing"), (long) m_branchSpacing); + clause->AddAttributeValue(_T("branch_style"), (long) m_branchStyle); } // Write user-defined attachment points, if any @@ -1797,7 +1795,7 @@ void wxShape::WriteAttributes(wxExpr *clause) attachmentList->Append(pointExpr); node = node->GetNext(); } - clause->AddAttributeValue("user_attachments", attachmentList); + clause->AddAttributeValue(_T("user_attachments"), attachmentList); } // Write text regions @@ -1809,14 +1807,14 @@ void wxShape::WriteRegions(wxExpr *clause) // Output regions as region1 = (...), region2 = (...), etc // and formatted text as text1 = (...), text2 = (...) etc. int regionNo = 1; - char regionNameBuf[20]; - char textNameBuf[20]; + wxChar regionNameBuf[20]; + wxChar textNameBuf[20]; wxNode *node = m_regions.GetFirst(); while (node) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); - sprintf(regionNameBuf, "region%d", regionNo); - sprintf(textNameBuf, "text%d", regionNo); + wxSprintf(regionNameBuf, _T("region%d"), regionNo); + wxSprintf(textNameBuf, _T("text%d"), regionNo); // Original text and region attributes: // region1 = (regionName regionText x y width height minWidth minHeight proportionX proportionY @@ -1874,15 +1872,15 @@ void wxShape::WriteRegions(wxExpr *clause) void wxShape::ReadAttributes(wxExpr *clause) { - clause->GetAttributeValue("id", m_id); + clause->GetAttributeValue(_T("id"), m_id); wxRegisterId(m_id); - clause->GetAttributeValue("x", m_xpos); - clause->GetAttributeValue("y", m_ypos); + clause->GetAttributeValue(_T("x"), m_xpos); + clause->GetAttributeValue(_T("y"), m_ypos); // Input text strings (FOR COMPATIBILITY WITH OLD FILES ONLY. SEE REGION CODE BELOW.) ClearText(); - wxExpr *strings = clause->AttributeValue("text"); + wxExpr *strings = clause->AttributeValue(_T("text")); if (strings && strings->Type() == wxExprList) { m_formatted = TRUE; // Assume text is formatted unless we prove otherwise @@ -1892,7 +1890,7 @@ void wxShape::ReadAttributes(wxExpr *clause) wxExpr *string_expr = node; double the_x = 0.0; double the_y = 0.0; - wxString the_string(""); + wxString the_string = wxEmptyString; // string_expr can either be a string, or a list of // 3 elements: x, y, and string. @@ -1931,78 +1929,78 @@ void wxShape::ReadAttributes(wxExpr *clause) } } - wxString pen_string = ""; - wxString brush_string = ""; + wxString pen_string = wxEmptyString; + wxString brush_string = wxEmptyString; int pen_width = 1; int pen_style = wxSOLID; int brush_style = wxSOLID; m_attachmentMode = ATTACHMENT_MODE_NONE; - clause->GetAttributeValue("pen_colour", pen_string); - clause->GetAttributeValue("text_colour", m_textColourName); + clause->GetAttributeValue(_T("pen_colour"), pen_string); + clause->GetAttributeValue(_T("text_colour"), m_textColourName); SetTextColour(m_textColourName); - clause->GetAttributeValue("region_name", m_regionName); + clause->GetAttributeValue(_T("region_name"), m_regionName); - clause->GetAttributeValue("brush_colour", brush_string); - clause->GetAttributeValue("pen_width", pen_width); - clause->GetAttributeValue("pen_style", pen_style); - clause->GetAttributeValue("brush_style", brush_style); + clause->GetAttributeValue(_T("brush_colour"), brush_string); + clause->GetAttributeValue(_T("pen_width"), pen_width); + clause->GetAttributeValue(_T("pen_style"), pen_style); + clause->GetAttributeValue(_T("brush_style"), brush_style); int iVal = (int) m_attachmentMode; - clause->GetAttributeValue("use_attachments", iVal); + clause->GetAttributeValue(_T("use_attachments"), iVal); m_attachmentMode = iVal; - clause->GetAttributeValue("sensitivity", m_sensitivity); + clause->GetAttributeValue(_T("sensitivity"), m_sensitivity); iVal = (int) m_spaceAttachments; - clause->GetAttributeValue("space_attachments", iVal); + clause->GetAttributeValue(_T("space_attachments"), iVal); m_spaceAttachments = (iVal != 0); iVal = (int) m_fixedWidth; - clause->GetAttributeValue("fixed_width", iVal); + clause->GetAttributeValue(_T("fixed_width"), iVal); m_fixedWidth = (iVal != 0); iVal = (int) m_fixedHeight; - clause->GetAttributeValue("fixed_height", iVal); + clause->GetAttributeValue(_T("fixed_height"), iVal); m_fixedHeight = (iVal != 0); - clause->GetAttributeValue("format_mode", m_formatMode); - clause->GetAttributeValue("shadow_mode", m_shadowMode); + clause->GetAttributeValue(_T("format_mode"), m_formatMode); + clause->GetAttributeValue(_T("shadow_mode"), m_shadowMode); iVal = m_branchNeckLength; - clause->GetAttributeValue("neck_length", iVal); + clause->GetAttributeValue(_T("neck_length"), iVal); m_branchNeckLength = iVal; iVal = m_branchStemLength; - clause->GetAttributeValue("stem_length", iVal); + clause->GetAttributeValue(_T("stem_length"), iVal); m_branchStemLength = iVal; iVal = m_branchSpacing; - clause->GetAttributeValue("branch_spacing", iVal); + clause->GetAttributeValue(_T("branch_spacing"), iVal); m_branchSpacing = iVal; - clause->GetAttributeValue("branch_style", m_branchStyle); + clause->GetAttributeValue(_T("branch_style"), m_branchStyle); iVal = (int) m_centreResize; - clause->GetAttributeValue("centre_resize", iVal); + clause->GetAttributeValue(_T("centre_resize"), iVal); m_centreResize = (iVal != 0); iVal = (int) m_maintainAspectRatio; - clause->GetAttributeValue("maintain_aspect_ratio", iVal); + clause->GetAttributeValue(_T("maintain_aspect_ratio"), iVal); m_maintainAspectRatio = (iVal != 0); iVal = (int) m_highlighted; - clause->GetAttributeValue("hilite", iVal); + clause->GetAttributeValue(_T("hilite"), iVal); m_highlighted = (iVal != 0); - clause->GetAttributeValue("rotation", m_rotation); + clause->GetAttributeValue(_T("rotation"), m_rotation); - if (pen_string == "") - pen_string = "BLACK"; - if (brush_string == "") - brush_string = "WHITE"; + if (pen_string == wxEmptyString) + pen_string = _T("BLACK"); + if (brush_string == wxEmptyString) + brush_string = _T("WHITE"); if (pen_string.GetChar(0) == '#') { @@ -2027,11 +2025,11 @@ void wxShape::ReadAttributes(wxExpr *clause) m_brush = wxWHITE_BRUSH; int point_size = 10; - clause->GetAttributeValue("point_size", point_size); + clause->GetAttributeValue(_T("point_size"), point_size); SetFont(oglMatchFont(point_size)); // Read user-defined attachment points, if any - wxExpr *attachmentList = clause->AttributeValue("user_attachments"); + wxExpr *attachmentList = clause->AttributeValue(_T("user_attachments")); if (attachmentList) { wxExpr *pointExpr = attachmentList->GetFirst(); @@ -2063,25 +2061,25 @@ void wxShape::ReadRegions(wxExpr *clause) // region1 = (regionName regionText x y width height minWidth minHeight proportionX proportionY // formatMode fontSize fontFamily fontStyle fontWeight textColour) int regionNo = 1; - char regionNameBuf[20]; - char textNameBuf[20]; + wxChar regionNameBuf[20]; + wxChar textNameBuf[20]; wxExpr *regionExpr = NULL; wxExpr *textExpr = NULL; - sprintf(regionNameBuf, "region%d", regionNo); - sprintf(textNameBuf, "text%d", regionNo); + wxSprintf(regionNameBuf, _T("region%d"), regionNo); + wxSprintf(textNameBuf, _T("text%d"), regionNo); m_formatted = TRUE; // Assume text is formatted unless we prove otherwise - while ((regionExpr = clause->AttributeValue(regionNameBuf))) + while ((regionExpr = clause->AttributeValue(regionNameBuf)) != NULL) { /* * Get the region information * */ - wxString regionName(""); - wxString regionText(""); + wxString regionName = wxEmptyString; + wxString regionText = wxEmptyString; double x = 0.0; double y = 0.0; double width = 0.0; @@ -2095,8 +2093,8 @@ void wxShape::ReadRegions(wxExpr *clause) int fontFamily = wxSWISS; int fontStyle = wxNORMAL; int fontWeight = wxNORMAL; - wxString regionTextColour(""); - wxString penColour(""); + wxString regionTextColour = wxEmptyString; + wxString penColour = wxEmptyString; int penStyle = wxSOLID; if (regionExpr->Type() == wxExprList) @@ -2146,7 +2144,7 @@ void wxShape::ReadRegions(wxExpr *clause) regionTextColour = colourExpr->StringValue(); } else - regionTextColour = "BLACK"; + regionTextColour = _T("BLACK"); if (penColourExpr) penColour = penColourExpr->StringValue(); @@ -2163,7 +2161,7 @@ void wxShape::ReadRegions(wxExpr *clause) region->SetMinSize(minWidth, minHeight); region->SetFormatMode(formatMode); region->SetPenStyle(penStyle); - if (penColour != "") + if (penColour != wxEmptyString) region->SetPenColour(penColour); region->m_textColour = regionTextColour; @@ -2185,7 +2183,7 @@ void wxShape::ReadRegions(wxExpr *clause) wxExpr *string_expr = node; double the_x = 0.0; double the_y = 0.0; - wxString the_string(""); + wxString the_string = wxEmptyString; // string_expr can either be a string, or a list of // 3 elements: x, y, and string. @@ -2227,8 +2225,8 @@ void wxShape::ReadRegions(wxExpr *clause) } regionNo ++; - sprintf(regionNameBuf, "region%d", regionNo); - sprintf(textNameBuf, "text%d", regionNo); + wxSprintf(regionNameBuf, _T("region%d"), regionNo); + wxSprintf(textNameBuf, _T("text%d"), regionNo); } // Compatibility: check for no regions (old file). @@ -2239,7 +2237,7 @@ void wxShape::ReadRegions(wxExpr *clause) !this->IsKindOf(CLASSINFO(wxCompositeShape))) { wxShapeRegion *newRegion = new wxShapeRegion; - newRegion->SetName("0"); + newRegion->SetName(_T("0")); m_regions.Append((wxObject *)newRegion); if (m_text.GetCount() > 0) { @@ -2715,7 +2713,7 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, double left = (double)(m_xpos - w/2.0); double right = (double)(m_xpos + w/2.0); - bool isEnd = (line && line->IsEnd(this)); + /* bool isEnd = */ (line && line->IsEnd(this)); int physicalAttachment = LogicalToPhysicalAttachment(attachment); @@ -2757,7 +2755,6 @@ bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, default: { return FALSE; - break; } } return TRUE; diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index 19c6bac3c5..39093dd57e 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -320,7 +320,7 @@ bool wxPolygonShape::HitTest(double x, double y, int *attachment, double *distan // Really need to be able to reset the shape! Otherwise, if the // points ever go to zero, we've lost it, and can't resize. -void wxPolygonShape::SetSize(double new_width, double new_height, bool recursive) +void wxPolygonShape::SetSize(double new_width, double new_height, bool WXUNUSED(recursive)) { SetAttachmentSize(new_width, new_height); @@ -906,7 +906,7 @@ void wxRectangleShape::GetBoundingBoxMin(double *the_width, double *the_height) *the_height = m_height; } -void wxRectangleShape::SetSize(double x, double y, bool recursive) +void wxRectangleShape::SetSize(double x, double y, bool WXUNUSED(recursive)) { SetAttachmentSize(x, y); m_width = (double)wxMax(x, 1.0); @@ -920,7 +920,7 @@ void wxRectangleShape::SetCornerRadius(double rad) } // Assume (x1, y1) is centre of box (most generally, line end at box) -bool wxRectangleShape::GetPerimeterPoint(double x1, double y1, +bool wxRectangleShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), double x2, double y2, double *x3, double *y3) { @@ -995,7 +995,7 @@ wxTextShape::wxTextShape(double width, double height): { } -void wxTextShape::OnDraw(wxDC& dc) +void wxTextShape::OnDraw(wxDC& WXUNUSED(dc)) { } @@ -1063,7 +1063,7 @@ void wxEllipseShape::OnDraw(wxDC& dc) dc.DrawEllipse((long) (m_xpos - GetWidth()/2), (long) (m_ypos - GetHeight()/2), (long) GetWidth(), (long) GetHeight()); } -void wxEllipseShape::SetSize(double x, double y, bool recursive) +void wxEllipseShape::SetSize(double x, double y, bool WXUNUSED(recursive)) { SetAttachmentSize(x, y); m_width = x; @@ -1175,7 +1175,6 @@ bool wxEllipseShape::GetAttachmentPosition(int attachment, double *x, double *y, default: { return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line); - break; } } return TRUE; @@ -1198,7 +1197,7 @@ void wxCircleShape::Copy(wxShape& copy) wxEllipseShape::Copy(copy); } -bool wxCircleShape::GetPerimeterPoint(double x1, double y1, +bool wxCircleShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), double x2, double y2, double *x3, double *y3) { @@ -1242,7 +1241,7 @@ wxControlPoint::~wxControlPoint() } // Don't even attempt to draw any text - waste of time! -void wxControlPoint::OnDrawContents(wxDC& dc) +void wxControlPoint::OnDrawContents(wxDC& WXUNUSED(dc)) { } @@ -1279,8 +1278,8 @@ int wxControlPoint::GetNumberOfAttachments() const return 1; } -bool wxControlPoint::GetAttachmentPosition(int attachment, double *x, double *y, - int nth, int no_arcs, wxLineShape *line) +bool wxControlPoint::GetAttachmentPosition(int WXUNUSED(attachment), double *x, double *y, + int WXUNUSED(nth), int WXUNUSED(no_arcs), wxLineShape *WXUNUSED(line)) { *x = m_xpos; *y = m_ypos; return TRUE; @@ -1288,7 +1287,7 @@ bool wxControlPoint::GetAttachmentPosition(int attachment, double *x, double *y, // Control points ('handles') redirect control to the actual shape, to make it easier // to override sizing behaviour. -void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y, int keys, int attachment) +void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), double x, double y, int keys, int WXUNUSED(attachment)) { double bound_x; double bound_y; @@ -1395,7 +1394,7 @@ void wxShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y } } -void wxShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) +void wxShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys, int WXUNUSED(attachment)) { m_canvas->CaptureMouse(); @@ -1527,7 +1526,7 @@ void wxShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int } } -void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) +void wxShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -1624,7 +1623,7 @@ void wxPolygonControlPoint::OnEndDragLeft(double x, double y, int keys, int atta // Control points ('handles') redirect control to the actual shape, to make it easier // to override sizing behaviour. -void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y, int keys, int attachment) +void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxPolygonControlPoint* ppt = (wxPolygonControlPoint*) pt; @@ -1637,7 +1636,7 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, d dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); - if (0) // keys & KEY_CTRL) + #if 0 // keys & KEY_CTRL) { // TODO: mend this code. Currently we rely on altering the // actual points, but we should assume we're not, as per @@ -1652,16 +1651,17 @@ void wxPolygonShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, d ((wxPolygonShape *)this)->CalculateBoundingBox(); ((wxPolygonShape *)this)->CalculatePolygonCentre(); } - else + #else { ppt->CalculateNewSize(x, y); } + #endif this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), ppt->GetNewSize().x, ppt->GetNewSize().y); } -void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) +void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxPolygonControlPoint* ppt = (wxPolygonControlPoint*) pt; @@ -1688,7 +1688,7 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); - if (0) // keys & KEY_CTRL) + #if 0 // keys & KEY_CTRL) { // TODO: mend this code. Currently we rely on altering the // actual points, but we should assume we're not, as per @@ -1703,10 +1703,11 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double ((wxPolygonShape *)this)->CalculateBoundingBox(); ((wxPolygonShape *)this)->CalculatePolygonCentre(); } - else + #else { ppt->CalculateNewSize(x, y); } + #endif this->GetEventHandler()->OnDrawOutline(dc, this->GetX(), this->GetY(), ppt->GetNewSize().x, ppt->GetNewSize().y); @@ -1714,7 +1715,7 @@ void wxPolygonShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double m_canvas->CaptureMouse(); } -void wxPolygonShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) +void wxPolygonShape::OnSizingEndDragLeft(wxControlPoint* pt, double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment)) { wxPolygonControlPoint* ppt = (wxPolygonControlPoint*) pt; diff --git a/contrib/src/ogl/bmpshape.cpp b/contrib/src/ogl/bmpshape.cpp index a82ff25e9b..f0b1c9ca06 100644 --- a/contrib/src/ogl/bmpshape.cpp +++ b/contrib/src/ogl/bmpshape.cpp @@ -60,7 +60,7 @@ void wxBitmapShape::OnDraw(wxDC& dc) dc.Blit((long) x, (long) y, m_bitmap.GetWidth(), m_bitmap.GetHeight(), &tempDC, 0, 0); } -void wxBitmapShape::SetSize(double w, double h, bool recursive) +void wxBitmapShape::SetSize(double w, double h, bool WXUNUSED(recursive)) { if (m_bitmap.Ok()) { @@ -81,13 +81,13 @@ void wxBitmapShape::WriteAttributes(wxExpr *clause) // Can't really save the bitmap; so instantiate the bitmap // at a higher level in the application, from a symbol library. wxRectangleShape::WriteAttributes(clause); - clause->AddAttributeValueString("filename", m_filename); + clause->AddAttributeValueString(_T("filename"), m_filename); } void wxBitmapShape::ReadAttributes(wxExpr *clause) { wxRectangleShape::ReadAttributes(clause); - clause->GetAttributeValue("filename", m_filename); + clause->GetAttributeValue(_T("filename"), m_filename); } #endif diff --git a/contrib/src/ogl/canvas.cpp b/contrib/src/ogl/canvas.cpp index 167a09ea6f..d4ba237e52 100644 --- a/contrib/src/ogl/canvas.cpp +++ b/contrib/src/ogl/canvas.cpp @@ -82,7 +82,7 @@ wxShapeCanvas::~wxShapeCanvas() { } -void wxShapeCanvas::OnPaint(wxPaintEvent& event) +void wxShapeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); @@ -469,35 +469,35 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn * */ -void wxShapeCanvas::OnLeftClick(double x, double y, int keys) +void wxShapeCanvas::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnRightClick(double x, double y, int keys) +void wxShapeCanvas::OnRightClick(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnDragLeft(bool draw, double x, double y, int keys) +void wxShapeCanvas::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnBeginDragLeft(double x, double y, int keys) +void wxShapeCanvas::OnBeginDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnEndDragLeft(double x, double y, int keys) +void wxShapeCanvas::OnEndDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnDragRight(bool draw, double x, double y, int keys) +void wxShapeCanvas::OnDragRight(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnBeginDragRight(double x, double y, int keys) +void wxShapeCanvas::OnBeginDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } -void wxShapeCanvas::OnEndDragRight(double x, double y, int keys) +void wxShapeCanvas::OnEndDragRight(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys)) { } diff --git a/contrib/src/ogl/composit.cpp b/contrib/src/ogl/composit.cpp index 96b3684794..724c10d6db 100644 --- a/contrib/src/ogl/composit.cpp +++ b/contrib/src/ogl/composit.cpp @@ -154,7 +154,7 @@ void wxCompositeShape::OnErase(wxDC& dc) static double objectStartX = 0.0; static double objectStartY = 0.0; -void wxCompositeShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment) +void wxCompositeShape::OnDragLeft(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { double xx = x; double yy = y; @@ -174,7 +174,7 @@ void wxCompositeShape::OnDragLeft(bool draw, double x, double y, int keys, int a // wxShape::OnDragLeft(draw, x, y, keys, attachment); } -void wxCompositeShape::OnBeginDragLeft(double x, double y, int keys, int attachment) +void wxCompositeShape::OnBeginDragLeft(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { objectStartX = x; objectStartY = y; @@ -202,7 +202,7 @@ void wxCompositeShape::OnBeginDragLeft(double x, double y, int keys, int attachm // wxShape::OnBeginDragLeft(x, y, keys, attachment); } -void wxCompositeShape::OnEndDragLeft(double x, double y, int keys, int attachment) +void wxCompositeShape::OnEndDragLeft(double x, double y, int keys, int WXUNUSED(attachment)) { // wxShape::OnEndDragLeft(x, y, keys, attachment); @@ -229,7 +229,7 @@ void wxCompositeShape::OnEndDragLeft(double x, double y, int keys, int attachmen if (m_canvas && !m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc); } -void wxCompositeShape::OnRightClick(double x, double y, int keys, int attachment) +void wxCompositeShape::OnRightClick(double x, double y, int keys, int WXUNUSED(attachment)) { // If we get a ctrl-right click, this means send the message to // the division, so we can invoke a user interface for dealing with regions. @@ -606,12 +606,12 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause) // Output constraints as constraint1 = (...), constraint2 = (...), etc. int constraintNo = 1; - char m_constraintNameBuf[20]; + wxChar m_constraintNameBuf[20]; wxNode *node = m_constraints.GetFirst(); while (node) { wxOGLConstraint *constraint = (wxOGLConstraint *)node->GetData(); - sprintf(m_constraintNameBuf, "constraint%d", constraintNo); + wxSprintf(m_constraintNameBuf, _T("constraint%d"), constraintNo); // Each constraint is stored in the form // (type name id xspacing yspacing m_constrainingObjectId constrainedObjectIdList) @@ -648,7 +648,7 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause) childrenExpr->Append(new wxExpr(child->GetId())); node = node->GetNext(); } - clause->AddAttributeValue("children", childrenExpr); + clause->AddAttributeValue(_T("children"), childrenExpr); // Write the ids of all the division images if (m_divisions.GetCount() > 0) @@ -661,7 +661,7 @@ void wxCompositeShape::WriteAttributes(wxExpr *clause) divisionsExpr->Append(new wxExpr(child->GetId())); node = node->GetNext(); } - clause->AddAttributeValue("divisions", divisionsExpr); + clause->AddAttributeValue(_T("divisions"), divisionsExpr); } } @@ -680,12 +680,12 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) { // Constraints are output as constraint1 = (...), constraint2 = (...), etc. int constraintNo = 1; - char m_constraintNameBuf[20]; + wxChar m_constraintNameBuf[20]; bool haveConstraints = TRUE; while (haveConstraints) { - sprintf(m_constraintNameBuf, "constraint%d", constraintNo); + wxSprintf(m_constraintNameBuf, _T("constraint%d"), constraintNo); wxExpr *constraintExpr = NULL; clause->GetAttributeValue(m_constraintNameBuf, &constraintExpr); if (!constraintExpr) @@ -696,7 +696,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) int cType = 0; double cXSpacing = 0.0; double cYSpacing = 0.0; - wxString cName(""); + wxString cName = wxEmptyString; long cId = 0; wxShape *m_constrainingObject = NULL; wxList m_constrainedObjects; @@ -718,7 +718,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) cName = nameExpr->StringValue(); cId = idExpr->IntegerValue(); - wxExpr *objExpr1 = database->HashFind("node_image", constrainingExpr->IntegerValue()); + wxExpr *objExpr1 = database->HashFind(_T("node_image"), constrainingExpr->IntegerValue()); if (objExpr1 && objExpr1->GetClientData()) m_constrainingObject = (wxShape *)objExpr1->GetClientData(); else @@ -729,7 +729,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) while (currentIdExpr) { long currentId = currentIdExpr->IntegerValue(); - wxExpr *objExpr2 = database->HashFind("node_image", currentId); + wxExpr *objExpr2 = database->HashFind(_T("node_image"), currentId); if (objExpr2 && objExpr2->GetClientData()) { m_constrainedObjects.Append((wxShape *)objExpr2->GetClientData()); @@ -989,30 +989,30 @@ void wxDivisionShape::WriteAttributes(wxExpr *clause) wxCompositeShape::WriteAttributes(clause); if (m_leftSide) - clause->AddAttributeValue("left_side", (long)m_leftSide->GetId()); + clause->AddAttributeValue(_T("left_side"), (long)m_leftSide->GetId()); if (m_topSide) - clause->AddAttributeValue("top_side", (long)m_topSide->GetId()); + clause->AddAttributeValue(_T("top_side"), (long)m_topSide->GetId()); if (m_rightSide) - clause->AddAttributeValue("right_side", (long)m_rightSide->GetId()); + clause->AddAttributeValue(_T("right_side"), (long)m_rightSide->GetId()); if (m_bottomSide) - clause->AddAttributeValue("bottom_side", (long)m_bottomSide->GetId()); + clause->AddAttributeValue(_T("bottom_side"), (long)m_bottomSide->GetId()); - clause->AddAttributeValue("handle_side", (long)m_handleSide); - clause->AddAttributeValueString("left_colour", m_leftSideColour); - clause->AddAttributeValueString("top_colour", m_topSideColour); - clause->AddAttributeValueString("left_style", m_leftSideStyle); - clause->AddAttributeValueString("top_style", m_topSideStyle); + clause->AddAttributeValue(_T("handle_side"), (long)m_handleSide); + clause->AddAttributeValueString(_T("left_colour"), m_leftSideColour); + clause->AddAttributeValueString(_T("top_colour"), m_topSideColour); + clause->AddAttributeValueString(_T("left_style"), m_leftSideStyle); + clause->AddAttributeValueString(_T("top_style"), m_topSideStyle); } void wxDivisionShape::ReadAttributes(wxExpr *clause) { wxCompositeShape::ReadAttributes(clause); - clause->GetAttributeValue("handle_side", m_handleSide); - clause->GetAttributeValue("left_colour", m_leftSideColour); - clause->GetAttributeValue("top_colour", m_topSideColour); - clause->GetAttributeValue("left_style", m_leftSideStyle); - clause->GetAttributeValue("top_style", m_topSideStyle); + clause->GetAttributeValue(_T("handle_side"), m_handleSide); + clause->GetAttributeValue(_T("left_colour"), m_leftSideColour); + clause->GetAttributeValue(_T("top_colour"), m_topSideColour); + clause->GetAttributeValue(_T("left_style"), m_leftSideStyle); + clause->GetAttributeValue(_T("top_style"), m_topSideStyle); } #endif @@ -1622,7 +1622,7 @@ void OGLPopupDivisionMenu::OnMenu(wxCommandEvent& event) } } -void wxDivisionShape::EditEdge(int side) +void wxDivisionShape::EditEdge(int WXUNUSED(side)) { wxMessageBox(wxT("EditEdge() not implemented"), wxT("OGL"), wxOK); diff --git a/contrib/src/ogl/constrnt.cpp b/contrib/src/ogl/constrnt.cpp index c5e5650f09..ddd736d643 100644 --- a/contrib/src/ogl/constrnt.cpp +++ b/contrib/src/ogl/constrnt.cpp @@ -386,8 +386,6 @@ bool wxOGLConstraint::Evaluate() node = node->GetNext(); } return changed; - - return FALSE; } case gyCONSTRAINT_ABOVE: { @@ -480,8 +478,10 @@ bool wxOGLConstraint::Evaluate() node = node->GetNext(); } return changed; - + #if 0 + // two returned values ? return FALSE; + #endif } case gyCONSTRAINT_ALIGNED_TOP: { @@ -568,8 +568,10 @@ bool wxOGLConstraint::Evaluate() node = node->GetNext(); } return changed; - + #if 0 + // two returned values ? return FALSE; + #endif } case gyCONSTRAINT_MIDALIGNED_TOP: { @@ -611,9 +613,11 @@ bool wxOGLConstraint::Evaluate() } return changed; } - + #if 0 + // default value handled in main function body default: return FALSE; + #endif } return FALSE; } diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 2b16d5749c..92448da749 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -137,7 +137,7 @@ void wxDividedShape::OnDrawContents(wxDC& dc) } } -void wxDividedShape::SetSize(double w, double h, bool recursive) +void wxDividedShape::SetSize(double w, double h, bool WXUNUSED(recursive)) { SetAttachmentSize(w, h); m_width = w; @@ -589,7 +589,7 @@ wxDividedShapeControlPoint::~wxDividedShapeControlPoint() } // Implement resizing of divided object division -void wxDividedShapeControlPoint::OnDragLeft(bool draw, double x, double y, int keys, int attachment) +void wxDividedShapeControlPoint::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED(x), double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -607,7 +607,7 @@ void wxDividedShapeControlPoint::OnDragLeft(bool draw, double x, double y, int k dc.DrawLine(WXROUND(x1), WXROUND(y1), WXROUND(x2), WXROUND(y2)); } -void wxDividedShapeControlPoint::OnBeginDragLeft(double x, double y, int keys, int attachment) +void wxDividedShapeControlPoint::OnBeginDragLeft(double WXUNUSED(x), double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -626,7 +626,7 @@ void wxDividedShapeControlPoint::OnBeginDragLeft(double x, double y, int keys, i m_canvas->CaptureMouse(); } -void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int attachment) +void wxDividedShapeControlPoint::OnEndDragLeft(double WXUNUSED(x), double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); @@ -652,7 +652,10 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int // Save values double thisRegionTop = 0.0; + #if 0 + // this variable is not readed later double thisRegionBottom = 0.0; + #endif double nextRegionBottom = 0.0; node = dividedObject->GetRegions().GetFirst(); @@ -667,7 +670,10 @@ void wxDividedShapeControlPoint::OnEndDragLeft(double x, double y, int keys, int if (region == thisRegion) { thisRegionTop = currentY; + #if 0 + // no need for assignment if value is not used later thisRegionBottom = actualY; + #endif if (node->GetNext()) nextRegion = (wxShapeRegion *)node->GetNext()->GetData(); } diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index 4801501c5e..15b1863a49 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -34,9 +34,9 @@ #include -static void IntToHex(unsigned int dec, char *buf); -static unsigned long HexToInt(char *buf); -extern char *oglBuffer; +static void IntToHex(unsigned int dec, wxChar *buf); +static unsigned long HexToInt(wxChar *buf); +extern wxChar *oglBuffer; #define gyTYPE_PEN 40 #define gyTYPE_BRUSH 41 @@ -76,7 +76,7 @@ void wxDrawnShape::OnDraw(wxDC& dc) m_metafiles[m_currentAngle].Draw(dc, m_xpos, m_ypos); } -void wxDrawnShape::SetSize(double w, double h, bool recursive) +void wxDrawnShape::SetSize(double w, double h, bool WXUNUSED(recursive)) { SetAttachmentSize(w, h); @@ -238,8 +238,8 @@ void wxDrawnShape::WriteAttributes(wxExpr *clause) { wxRectangleShape::WriteAttributes(clause); - clause->AddAttributeValue("current_angle", (long)m_currentAngle); - clause->AddAttributeValue("save_metafile", (long)m_saveToFile); + clause->AddAttributeValue(_T("current_angle"), (long)m_currentAngle); + clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile); if (m_saveToFile) { int i = 0; @@ -256,8 +256,8 @@ void wxDrawnShape::ReadAttributes(wxExpr *clause) wxRectangleShape::ReadAttributes(clause); int iVal = (int) m_saveToFile; - clause->GetAttributeValue("save_metafile", iVal); - clause->GetAttributeValue("current_angle", m_currentAngle); + clause->GetAttributeValue(_T("save_metafile"), iVal); + clause->GetAttributeValue(_T("current_angle"), m_currentAngle); m_saveToFile = (iVal != 0); if (m_saveToFile) @@ -419,7 +419,7 @@ wxOpSetGDI::wxOpSetGDI(int theOp, wxPseudoMetaFile *theImage, int theGdiIndex, i m_mode = theMode; } -void wxOpSetGDI::Do(wxDC& dc, double xoffset, double yoffset) +void wxOpSetGDI::Do(wxDC& dc, double WXUNUSED(xoffset), double WXUNUSED(yoffset)) { switch (m_op) { @@ -520,7 +520,7 @@ wxDrawOp *wxOpSetGDI::Copy(wxPseudoMetaFile *newImage) } #if wxUSE_PROLOGIO -wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *image) +wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *WXUNUSED(image)) { wxExpr *expr = new wxExpr(wxExprList); expr->Append(new wxExpr((long)m_op)); @@ -552,7 +552,7 @@ wxExpr *wxOpSetGDI::WriteExpr(wxPseudoMetaFile *image) return expr; } -void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr) { switch (m_op) { @@ -596,7 +596,7 @@ wxOpSetClipping::wxOpSetClipping(int theOp, double theX1, double theY1, m_y2 = theY2; } -wxDrawOp *wxOpSetClipping::Copy(wxPseudoMetaFile *newImage) +wxDrawOp *wxOpSetClipping::Copy(wxPseudoMetaFile *WXUNUSED(newImage)) { wxOpSetClipping *newOp = new wxOpSetClipping(m_op, m_x1, m_y1, m_x2, m_y2); return newOp; @@ -636,7 +636,7 @@ void wxOpSetClipping::Translate(double x, double y) } #if wxUSE_PROLOGIO -wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *image) +wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *WXUNUSED(image)) { wxExpr *expr = new wxExpr(wxExprList); expr->Append(new wxExpr((long)m_op)); @@ -656,7 +656,7 @@ wxExpr *wxOpSetClipping::WriteExpr(wxPseudoMetaFile *image) return expr; } -void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr) { switch (m_op) { @@ -698,7 +698,7 @@ wxOpDraw::~wxOpDraw() if (m_textString) delete[] m_textString; } -wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *newImage) +wxDrawOp *wxOpDraw::Copy(wxPseudoMetaFile *WXUNUSED(newImage)) { wxOpDraw *newOp = new wxOpDraw(m_op, m_x1, m_y1, m_x2, m_y2, m_radius, m_textString); newOp->m_x3 = m_x3; @@ -882,7 +882,7 @@ void wxOpDraw::Rotate(double x, double y, double theta, double sinTheta, double } #if wxUSE_PROLOGIO -wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image) +wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *WXUNUSED(image)) { wxExpr *expr = new wxExpr(wxExprList); expr->Append(new wxExpr((long)m_op)); @@ -939,7 +939,7 @@ wxExpr *wxOpDraw::WriteExpr(wxPseudoMetaFile *image) return expr; } -void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpDraw::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr) { switch (m_op) { @@ -1011,7 +1011,7 @@ wxOpPolyDraw::~wxOpPolyDraw() delete[] m_points; } -wxDrawOp *wxOpPolyDraw::Copy(wxPseudoMetaFile *newImage) +wxDrawOp *wxOpPolyDraw::Copy(wxPseudoMetaFile *WXUNUSED(newImage)) { wxRealPoint *newPoints = new wxRealPoint[m_noPoints]; for (int i = 0; i < m_noPoints; i++) @@ -1071,7 +1071,6 @@ void wxOpPolyDraw::Do(wxDC& dc, double xoffset, double yoffset) delete[] actualPoints; break; - break; } default: break; @@ -1096,7 +1095,7 @@ void wxOpPolyDraw::Translate(double x, double y) } } -void wxOpPolyDraw::Rotate(double x, double y, double theta, double sinTheta, double cosTheta) +void wxOpPolyDraw::Rotate(double x, double y, double WXUNUSED(theta), double sinTheta, double cosTheta) { for (int i = 0; i < m_noPoints; i++) { @@ -1108,15 +1107,15 @@ void wxOpPolyDraw::Rotate(double x, double y, double theta, double sinTheta, dou } #if wxUSE_PROLOGIO -wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image) +wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *WXUNUSED(image)) { wxExpr *expr = new wxExpr(wxExprList); expr->Append(new wxExpr((long)m_op)); expr->Append(new wxExpr((long)m_noPoints)); // char buf1[9]; - char buf2[5]; - char buf3[5]; + wxChar buf2[5]; + wxChar buf3[5]; oglBuffer[0] = 0; @@ -1143,20 +1142,20 @@ wxExpr *wxOpPolyDraw::WriteExpr(wxPseudoMetaFile *image) // Don't overrun the buffer if ((i*8) < 3000) { - strcat(oglBuffer, buf2); - strcat(oglBuffer, buf3); + wxStrcat(oglBuffer, buf2); + wxStrcat(oglBuffer, buf3); } } expr->Append(new wxExpr(wxExprString, oglBuffer)); return expr; } -void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) +void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr) { m_noPoints = (int)expr->Nth(1)->IntegerValue(); - char buf1[5]; - char buf2[5]; + wxChar buf1[5]; + wxChar buf2[5]; m_points = new wxRealPoint[m_noPoints]; int i = 0; @@ -1185,7 +1184,7 @@ void wxOpPolyDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr) // Scale -32K -> +32K long signedX = unSignedX - 32767; long signedY = unSignedY - 32767; -#ifdef __WXMSW__ +#if defined(__WXMSW__) && 0 int testX = (signed int)unSignedX; int testY = (signed int)unSignedY; #endif @@ -1285,11 +1284,12 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1, * */ -static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', - 'C', 'D', 'E', 'F' }; +static char hexArray[] = { + _T('0'), _T('1'), _T('2'), _T('3'), _T('4'), _T('5'), _T('6'), _T('7'), + _T('8'), _T('9'), _T('A'), _T('B'), _T('C'), _T('D'), _T('E'), _T('F') }; // Convert unsigned 16-bit integer to 4-character hex string -static void IntToHex(unsigned int dec, char *buf) +static void IntToHex(unsigned int dec, wxChar *buf) { int digit1 = (int)(dec/4096); int digit2 = (int)((dec - (digit1*4096))/256); @@ -1304,50 +1304,54 @@ static void IntToHex(unsigned int dec, char *buf) } // One hex digit to decimal number -static int HexToInt1(char hex) +static int HexToInt1(wxChar hex) { switch (hex) { - case '0': + case _T('0'): return 0; - case '1': + case _T('1'): return 1; - case '2': + case _T('2'): return 2; - case '3': + case _T('3'): return 3; - case '4': + case _T('4'): return 4; - case '5': + case _T('5'): return 5; - case '6': + case _T('6'): return 6; - case '7': + case _T('7'): return 7; - case '8': + case _T('8'): return 8; - case '9': + case _T('9'): return 9; - case 'A': + case _T('A'): return 10; - case 'B': + case _T('B'): return 11; - case 'C': + case _T('C'): return 12; - case 'D': + case _T('D'): return 13; - case 'E': + case _T('E'): return 14; - case 'F': + case _T('F'): return 15; + #if 0 + // handling this default outside switch removes warning under Borland default: return 0; + #endif } + return 0; } // 4-digit hex string to unsigned integer -static unsigned long HexToInt(char *buf) +static unsigned long HexToInt(wxChar *buf) { long d1 = (long)(HexToInt1(buf[0])*4096.0) ; long d2 = (long)(HexToInt1(buf[1])*256.0) ; @@ -1475,12 +1479,12 @@ void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle) clause->AddAttributeValue(outlineStr, (long)m_outlineOp); // Write GDI objects - char buf[50]; + wxChar buf[50]; int i = 1; wxNode *node = m_gdiObjects.GetFirst(); while (node) { - sprintf(buf, "gdi%d_%d", whichAngle, i); + wxSprintf(buf, _T("gdi%d_%d"), whichAngle, i); wxObject *obj = (wxObject *)node->GetData(); wxExpr *expr = NULL; if (obj) @@ -1538,7 +1542,7 @@ void wxPseudoMetaFile::WriteAttributes(wxExpr *clause, int whichAngle) node = m_ops.GetFirst(); while (node) { - sprintf(buf, "op%d_%d", whichAngle, i); + wxSprintf(buf, _T("op%d_%d"), whichAngle, i); wxDrawOp *op = (wxDrawOp *)node->GetData(); wxExpr *expr = op->WriteExpr(this); if (expr) @@ -1604,12 +1608,12 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) m_rotateable = (iVal != 0); // Read GDI objects - char buf[50]; + wxChar buf[50]; int i = 1; bool keepGoing = TRUE; while (keepGoing) { - sprintf(buf, "gdi%d_%d", whichAngle, i); + wxSprintf(buf, _T("gdi%d_%d"), whichAngle, i); wxExpr *expr = NULL; clause->GetAttributeValue(buf, &expr); if (!expr) @@ -1675,7 +1679,7 @@ void wxPseudoMetaFile::ReadAttributes(wxExpr *clause, int whichAngle) i = 1; while (keepGoing) { - sprintf(buf, "op%d_%d", whichAngle, i); + wxSprintf(buf, _T("op%d_%d"), whichAngle, i); wxExpr *expr = NULL; clause->GetAttributeValue(buf, &expr); if (!expr) @@ -2415,7 +2419,7 @@ void wxPseudoMetaFile::DrawSpline(int n, wxPoint pts[]) void wxPseudoMetaFile::SetClippingRect(const wxRect& rect) { - wxOpSetClipping* theOp = new wxOpSetClipping(DRAWOP_SET_CLIPPING_RECT, + /* wxOpSetClipping* theOp = */ new wxOpSetClipping(DRAWOP_SET_CLIPPING_RECT, (double) rect.x, (double) rect.y, (double) rect.width, (double) rect.height); } diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index b0f0d6dca2..850c19434b 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -962,7 +962,7 @@ void wxLineShape::FindNth(wxShape *image, int *nth, int *no_arcs, bool incoming) *no_arcs = num; } -void wxLineShape::OnDrawOutline(wxDC& dc, double x, double y, double w, double h) +void wxLineShape::OnDrawOutline(wxDC& dc, double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(w), double WXUNUSED(h)) { wxPen *old_pen = m_pen; wxBrush *old_brush = m_brush; @@ -979,7 +979,7 @@ void wxLineShape::OnDrawOutline(wxDC& dc, double x, double y, double w, double h else SetBrush(NULL); } -bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display) +bool wxLineShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool WXUNUSED(display)) { double x_offset = x - old_x; double y_offset = y - old_y; @@ -1038,9 +1038,9 @@ void wxLineShape::OnMoveLink(wxDC& dc, bool moveControlPoints) FindLineEndPoints(&end_x, &end_y, &other_end_x, &other_end_y); wxNode *first = m_lineControlPoints->GetFirst(); - wxRealPoint *first_point = (wxRealPoint *)first->GetData(); + /* wxRealPoint *first_point = */ (wxRealPoint *)first->GetData(); wxNode *last = m_lineControlPoints->GetLast(); - wxRealPoint *last_point = (wxRealPoint *)last->GetData(); + /* wxRealPoint *last_point = */ (wxRealPoint *)last->GetData(); /* This is redundant, surely? Done by SetEnds. first_point->x = end_x; first_point->y = end_y; @@ -1095,9 +1095,9 @@ void wxLineShape::FindLineEndPoints(double *fromX, double *fromY, double *toX, d double other_end_x, other_end_y; wxNode *first = m_lineControlPoints->GetFirst(); - wxRealPoint *first_point = (wxRealPoint *)first->GetData(); + /* wxRealPoint *first_point = */ (wxRealPoint *)first->GetData(); wxNode *last = m_lineControlPoints->GetLast(); - wxRealPoint *last_point = (wxRealPoint *)last->GetData(); + /* wxRealPoint *last_point = */ (wxRealPoint *)last->GetData(); wxNode *second = first->GetNext(); wxRealPoint *second_point = (wxRealPoint *)second->GetData(); @@ -1240,15 +1240,15 @@ void wxLineShape::OnEraseControlPoints(wxDC& dc) wxShape::OnEraseControlPoints(dc); } -void wxLineShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment) +void wxLineShape::OnDragLeft(bool WXUNUSED(draw), double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment)) { } -void wxLineShape::OnBeginDragLeft(double x, double y, int keys, int attachment) +void wxLineShape::OnBeginDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment)) { } -void wxLineShape::OnEndDragLeft(double x, double y, int keys, int attachment) +void wxLineShape::OnEndDragLeft(double WXUNUSED(x), double WXUNUSED(y), int WXUNUSED(keys), int WXUNUSED(attachment)) { } @@ -1371,23 +1371,23 @@ void wxLineShape::WriteAttributes(wxExpr *clause) wxShape::WriteAttributes(clause); if (m_from) - clause->AddAttributeValue("from", m_from->GetId()); + clause->AddAttributeValue(_T("from"), m_from->GetId()); if (m_to) - clause->AddAttributeValue("to", m_to->GetId()); + clause->AddAttributeValue(_T("to"), m_to->GetId()); if (m_attachmentTo != 0) - clause->AddAttributeValue("attachment_to", (long)m_attachmentTo); + clause->AddAttributeValue(_T("attachment_to"), (long)m_attachmentTo); if (m_attachmentFrom != 0) - clause->AddAttributeValue("attachment_from", (long)m_attachmentFrom); + clause->AddAttributeValue(_T("attachment_from"), (long)m_attachmentFrom); if (m_alignmentStart != 0) - clause->AddAttributeValue("align_start", (long)m_alignmentStart); + clause->AddAttributeValue(_T("align_start"), (long)m_alignmentStart); if (m_alignmentEnd != 0) - clause->AddAttributeValue("align_end", (long)m_alignmentEnd); + clause->AddAttributeValue(_T("align_end"), (long)m_alignmentEnd); - clause->AddAttributeValue("is_spline", (long)m_isSpline); + clause->AddAttributeValue(_T("is_spline"), (long)m_isSpline); if (m_maintainStraightLines) - clause->AddAttributeValue("keep_lines_straight", (long)m_maintainStraightLines); + clause->AddAttributeValue(_T("keep_lines_straight"), (long)m_maintainStraightLines); // Make a list of lists for the (sp)line controls wxExpr *list = new wxExpr(wxExprList); @@ -1404,7 +1404,7 @@ void wxLineShape::WriteAttributes(wxExpr *clause) node = node->GetNext(); } - clause->AddAttributeValue("controls", list); + clause->AddAttributeValue(_T("controls"), list); // Write arc arrows in new OGL format, if there are any. // This is a list of lists. Each sublist comprises: @@ -1432,7 +1432,7 @@ void wxLineShape::WriteAttributes(wxExpr *clause) node = node->GetNext(); } - clause->AddAttributeValue("arrows", arrow_list); + clause->AddAttributeValue(_T("arrows"), arrow_list); } } @@ -1455,7 +1455,7 @@ void wxLineShape::ReadAttributes(wxExpr *clause) if (m_regions.GetCount() == 0) { wxShapeRegion *newRegion = new wxShapeRegion; - newRegion->SetName("Middle"); + newRegion->SetName(_T("Middle")); newRegion->SetSize(150, 50); m_regions.Append((wxObject *)newRegion); if (m_text.GetCount() > 0) @@ -1726,7 +1726,7 @@ void wxLineControlPoint::OnEndDragLeft(double x, double y, int keys, int attachm // Control points ('handles') redirect control to the actual shape, to make it easier // to override sizing behaviour. -void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y, int keys, int attachment) +void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxLineControlPoint* lpt = (wxLineControlPoint*) pt; @@ -1768,7 +1768,7 @@ void wxLineShape::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, doub } -void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) +void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxLineControlPoint* lpt = (wxLineControlPoint*) pt; @@ -1816,7 +1816,7 @@ void wxLineShape::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, } } -void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) +void wxLineShape::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment)) { wxLineControlPoint* lpt = (wxLineControlPoint*) pt; @@ -2439,7 +2439,7 @@ void wxLabelShape::OnDraw(wxDC& dc) dc.DrawRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height)); } -void wxLabelShape::OnDrawContents(wxDC& dc) +void wxLabelShape::OnDrawContents(wxDC& WXUNUSED(dc)) { } @@ -2463,7 +2463,7 @@ bool wxLabelShape::OnMovePre(wxDC& dc, double x, double y, double old_x, double return m_lineShape->OnLabelMovePre(dc, this, x, y, old_x, old_y, display); } -bool wxLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, double y, double old_x, double old_y, bool display) +bool wxLineShape::OnLabelMovePre(wxDC& dc, wxLabelShape* labelShape, double x, double y, double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) { labelShape->m_shapeRegion->SetSize(labelShape->GetWidth(), labelShape->GetHeight()); diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 0f3e33e2c4..17111d481e 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -59,7 +59,10 @@ static int getsignedshort(FILE *fp) { int c, c1; c = getc(fp); c1 = getc(fp); +#if 0 + // this is not used value, no need to execute it int testRes = ((unsigned int) c) + (((unsigned int) c1) << 8); +#endif unsigned long res1 = ((unsigned int) c) + (((unsigned int) c1) << 8); int res = 0; if (res1 > 32767) @@ -175,7 +178,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) if (key == (long) 0x9AC6CDD7) { - long hmf = getshort(handle); + /* long hmf = */ getshort(handle); int iLeft, iTop, iRight, iBottom; iLeft = getsignedshort(handle); iTop = getsignedshort(handle); @@ -187,9 +190,9 @@ bool wxXMetaFile::ReadFile(const wxChar *file) right = (double)iRight; bottom = (double)iBottom; - int inch = getshort(handle); - long reserved = getint(handle); - int checksum = getshort(handle); + /* int inch = */ getshort(handle); + /* long reserved = */ getint(handle); + /* int checksum = */ getshort(handle); /* double widthInUnits = (double)right - left; double heightInUnits = (double)bottom - top; @@ -208,7 +211,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) return FALSE; } - int mtHeaderSize = getshort(handle); + /* int mtHeaderSize = */ getshort(handle); int mtVersion = getshort(handle); if (mtVersion != 0x0300 && mtVersion != 0x0100) @@ -217,10 +220,10 @@ bool wxXMetaFile::ReadFile(const wxChar *file) return FALSE; } - long mtSize = getint(handle); - int mtNoObjects = getshort(handle); - long mtMaxRecord = getint(handle); - int mtNoParameters = getshort(handle); + /* long mtSize = */ getint(handle); + /* int mtNoObjects = */ getshort(handle); + /* long mtMaxRecord = */ getint(handle); + /* int mtNoParameters = */ getshort(handle); while (!feof(handle)) { @@ -533,7 +536,7 @@ bool wxXMetaFile::ReadFile(const wxChar *file) wxMetaRecord *rec = new wxMetaRecord(META_CREATEPENINDIRECT); int msStyle = getshort(handle); // Style: 2 bytes int x = getshort(handle); // X: 2 bytes - int y = getshort(handle); // Y: 2 bytes + /* int y = */ getshort(handle); // Y: 2 bytes long colorref = getint(handle); // COLORREF 4 bytes int style; @@ -565,17 +568,17 @@ bool wxXMetaFile::ReadFile(const wxChar *file) { wxMetaRecord *rec = new wxMetaRecord(META_CREATEFONTINDIRECT); int lfHeight = getshort(handle); // 2 bytes - int lfWidth = getshort(handle); // 2 bytes - int lfEsc = getshort(handle); // 2 bytes - int lfOrient = getshort(handle); // 2 bytes + /* int lfWidth = */ getshort(handle); // 2 bytes + /* int lfEsc = */ getshort(handle); // 2 bytes + /* int lfOrient = */ getshort(handle); // 2 bytes int lfWeight = getshort(handle); // 2 bytes char lfItalic = getc(handle); // 1 byte char lfUnderline = getc(handle); // 1 byte - char lfStrikeout = getc(handle); // 1 byte - char lfCharSet = getc(handle); // 1 byte - char lfOutPrecision = getc(handle); // 1 byte - char lfClipPrecision = getc(handle); // 1 byte - char lfQuality = getc(handle); // 1 byte + /* char lfStrikeout = */ getc(handle); // 1 byte + /* char lfCharSet = */ getc(handle); // 1 byte + /* char lfOutPrecision = */ getc(handle); // 1 byte + /* char lfClipPrecision = */ getc(handle); // 1 byte + /* char lfQuality = */ getc(handle); // 1 byte char lfPitchAndFamily = getc(handle); // 1 byte (18th) char lfFacename[32]; // Read the rest of the record, which is total record size @@ -740,7 +743,7 @@ wxXMetaFile::~wxXMetaFile(void) } } -bool wxXMetaFile::SetClipboard(int width, int height) +bool wxXMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) { return FALSE; } diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index ebebf6b620..1f7be29092 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -219,7 +219,7 @@ bool wxDiagram::SaveFile(const wxString& filename) wxExprDatabase *database = new wxExprDatabase; // First write the diagram type - wxExpr *header = new wxExpr("diagram"); + wxExpr *header = new wxExpr(_T("diagram")); OnHeaderSave(*database, *header); database->Append(header); @@ -233,9 +233,9 @@ bool wxDiagram::SaveFile(const wxString& filename) { wxExpr *expr = NULL; if (shape->IsKindOf(CLASSINFO(wxLineShape))) - expr = new wxExpr("line"); + expr = new wxExpr(_T("line")); else - expr = new wxExpr("shape"); + expr = new wxExpr(_T("shape")); OnShapeSave(*database, *shape, *expr); } @@ -292,7 +292,7 @@ bool wxDiagram::LoadFile(const wxString& filename) { wxBeginBusyCursor(); - wxExprDatabase database(wxExprInteger, "id"); + wxExprDatabase database(wxExprInteger, _T("id")); if (!database.Read(filename)) { wxEndBusyCursor(); @@ -302,7 +302,7 @@ bool wxDiagram::LoadFile(const wxString& filename) DeleteAllShapes(); database.BeginFind(); - wxExpr *header = database.FindClauseByFunctor("diagram"); + wxExpr *header = database.FindClauseByFunctor(_T("diagram")); if (header) OnHeaderLoad(database, *header); @@ -313,7 +313,7 @@ bool wxDiagram::LoadFile(const wxString& filename) { wxExpr *clause = (wxExpr *)node->GetData(); long id = -1; - clause->GetAttributeValue("id", id); + clause->GetAttributeValue(_T("id"), id); wxRegisterId(id); node = node->Next(); } @@ -333,7 +333,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) { // Find and create the node images database.BeginFind(); - wxExpr *clause = database.FindClauseByFunctor("shape"); + wxExpr *clause = database.FindClauseByFunctor(_T("shape")); while (clause) { wxChar *type = NULL; @@ -355,7 +355,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) // If child of composite, link up if (parentId > -1) { - wxExpr *parentExpr = database.HashFind("shape", parentId); + wxExpr *parentExpr = database.HashFind(_T("shape"), parentId); if (parentExpr && parentExpr->GetClientData()) { wxShape *parent = (wxShape *)parentExpr->GetClientData(); @@ -369,7 +369,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) if (type) delete[] type; - clause = database.FindClauseByFunctor("shape"); + clause = database.FindClauseByFunctor(_T("shape")); } return; } @@ -377,14 +377,14 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) void wxDiagram::ReadLines(wxExprDatabase& database) { database.BeginFind(); - wxExpr *clause = database.FindClauseByFunctor("line"); + wxExpr *clause = database.FindClauseByFunctor(_T("line")); while (clause) { wxString type; long parentId = -1; - clause->GetAttributeValue("type", type); - clause->GetAttributeValue("parent", parentId); + clause->GetAttributeValue(_T("type"), type); + clause->GetAttributeValue(_T("parent"), parentId); wxClassInfo *classInfo = wxClassInfo::FindClass(type); if (classInfo) { @@ -395,16 +395,16 @@ void wxDiagram::ReadLines(wxExprDatabase& database) shape->SetCanvas(GetCanvas()); long image_to = -1; long image_from = -1; - clause->GetAttributeValue("to", image_to); - clause->GetAttributeValue("from", image_from); + clause->GetAttributeValue(_T("to"), image_to); + clause->GetAttributeValue(_T("from"), image_from); - wxExpr *image_to_expr = database.HashFind("shape", image_to); + wxExpr *image_to_expr = database.HashFind(_T("shape"), image_to); if (!image_to_expr) { // Error } - wxExpr *image_from_expr = database.HashFind("shape", image_from); + wxExpr *image_from_expr = database.HashFind(_T("shape"), image_from); if (!image_from_expr) { @@ -426,7 +426,7 @@ void wxDiagram::ReadLines(wxExprDatabase& database) m_shapeList->Append(shape); } - clause = database.FindClauseByFunctor("line"); + clause = database.FindClauseByFunctor(_T("line")); } } @@ -436,7 +436,7 @@ void wxDiagram::ReadLines(wxExprDatabase& database) void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) { database.BeginFind(); - wxExpr *clause = database.FindClauseByFunctor("shape"); + wxExpr *clause = database.FindClauseByFunctor(_T("shape")); while (clause) { wxShape *image = (wxShape *)clause->GetClientData(); @@ -446,7 +446,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) wxExpr *divisionExpr = NULL; // Find the list of divisions in the composite - clause->GetAttributeValue("divisions", &divisionExpr); + clause->GetAttributeValue(_T("divisions"), &divisionExpr); if (divisionExpr) { int i = 0; @@ -454,7 +454,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) while (idExpr) { long divisionId = idExpr->IntegerValue(); - wxExpr *childExpr = database.HashFind("shape", divisionId); + wxExpr *childExpr = database.HashFind(_T("shape"), divisionId); if (childExpr && childExpr->GetClientData()) { wxDivisionShape *child = (wxDivisionShape *)childExpr->GetClientData(); @@ -465,13 +465,13 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) long topSideId = -1; long rightSideId = -1; long bottomSideId = -1; - childExpr->GetAttributeValue("left_side", leftSideId); - childExpr->GetAttributeValue("top_side", topSideId); - childExpr->GetAttributeValue("right_side", rightSideId); - childExpr->GetAttributeValue("bottom_side", bottomSideId); + childExpr->GetAttributeValue(_T("left_side"), leftSideId); + childExpr->GetAttributeValue(_T("top_side"), topSideId); + childExpr->GetAttributeValue(_T("right_side"), rightSideId); + childExpr->GetAttributeValue(_T("bottom_side"), bottomSideId); if (leftSideId > -1) { - wxExpr *leftExpr = database.HashFind("shape", leftSideId); + wxExpr *leftExpr = database.HashFind(_T("shape"), leftSideId); if (leftExpr && leftExpr->GetClientData()) { wxDivisionShape *leftSide = (wxDivisionShape *)leftExpr->GetClientData(); @@ -480,7 +480,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) } if (topSideId > -1) { - wxExpr *topExpr = database.HashFind("shape", topSideId); + wxExpr *topExpr = database.HashFind(_T("shape"), topSideId); if (topExpr && topExpr->GetClientData()) { wxDivisionShape *topSide = (wxDivisionShape *)topExpr->GetClientData(); @@ -489,7 +489,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) } if (rightSideId > -1) { - wxExpr *rightExpr = database.HashFind("shape", rightSideId); + wxExpr *rightExpr = database.HashFind(_T("shape"), rightSideId); if (rightExpr && rightExpr->GetClientData()) { wxDivisionShape *rightSide = (wxDivisionShape *)rightExpr->GetClientData(); @@ -498,7 +498,7 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) } if (bottomSideId > -1) { - wxExpr *bottomExpr = database.HashFind("shape", bottomSideId); + wxExpr *bottomExpr = database.HashFind(_T("shape"), bottomSideId); if (bottomExpr && bottomExpr->GetClientData()) { wxDivisionShape *bottomSide = (wxDivisionShape *)bottomExpr->GetClientData(); @@ -512,17 +512,17 @@ void wxDiagram::ReadContainerGeometry(wxExprDatabase& database) } } - clause = database.FindClauseByFunctor("shape"); + clause = database.FindClauseByFunctor(_T("shape")); } } // Allow for modifying file -bool wxDiagram::OnDatabaseLoad(wxExprDatabase& db) +bool wxDiagram::OnDatabaseLoad(wxExprDatabase& WXUNUSED(db)) { return TRUE; } -bool wxDiagram::OnDatabaseSave(wxExprDatabase& db) +bool wxDiagram::OnDatabaseSave(wxExprDatabase& WXUNUSED(db)) { return TRUE; } @@ -538,7 +538,7 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) while (node) { wxShape *childShape = (wxShape *)node->GetData(); - wxExpr *childExpr = new wxExpr("shape"); + wxExpr *childExpr = new wxExpr(_T("shape")); OnShapeSave(db, *childShape, *childExpr); node = node->Next(); } @@ -547,18 +547,18 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) return TRUE; } -bool wxDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr) +bool wxDiagram::OnShapeLoad(wxExprDatabase& WXUNUSED(db), wxShape& shape, wxExpr& expr) { shape.ReadAttributes(&expr); return TRUE; } -bool wxDiagram::OnHeaderSave(wxExprDatabase& db, wxExpr& expr) +bool wxDiagram::OnHeaderSave(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr)) { return TRUE; } -bool wxDiagram::OnHeaderLoad(wxExprDatabase& db, wxExpr& expr) +bool wxDiagram::OnHeaderLoad(wxExprDatabase& WXUNUSED(db), wxExpr& WXUNUSED(expr)) { return TRUE; } @@ -667,7 +667,7 @@ void wxLineCrossings::FindCrossings(wxDiagram& diagram) } } -void wxLineCrossings::DrawCrossings(wxDiagram& diagram, wxDC& dc) +void wxLineCrossings::DrawCrossings(wxDiagram& WXUNUSED(diagram), wxDC& dc) { dc.SetBrush(*wxTRANSPARENT_BRUSH); diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index 7de32c2c77..cd4cfb0339 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -83,6 +83,7 @@ void wxOGLCleanUp() oglBuffer = NULL; } oglBuffer = NULL; + if (g_oglBullseyeCursor) { delete g_oglBullseyeCursor; @@ -340,7 +341,7 @@ void oglCentreTextNoClipping(wxDC& dc, wxList *text_list, } void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, - double m_xpos, double m_ypos, double width, double height, + double WXUNUSED(m_xpos), double WXUNUSED(m_ypos), double WXUNUSED(width), double WXUNUSED(height), double *actual_width, double *actual_height) { int n = text_list->GetCount(); @@ -377,7 +378,7 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, // Format a string to a list of strings that fit in the given box. // Interpret %n and 10 or 13 as a new line. -wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double height, int formatMode) +wxStringList *oglFormatText(wxDC& dc, const wxString& text, double width, double WXUNUSED(height), int formatMode) { // First, parse the string into a list of words wxStringList word_list; -- 2.45.2