#if wxUSE_PROLOGIO
wxDocument::SaveObject(stream);
- char buf[400];
- (void) wxGetTempFileName("diag", buf);
+ wxChar buf[400];
+ (void) wxGetTempFileName(_T("diag"), buf);
diagram.SaveFile(buf);
#if wxUSE_PROLOGIO
wxDocument::LoadObject(stream);
- char buf[400];
- (void) wxGetTempFileName("diag", buf);
+ wxChar buf[400];
+ (void) wxGetTempFileName(_T("diag"), buf);
wxTransferStreamToFile(stream, buf);
* 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)
{
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;
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;
{
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);
{
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);
// 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);
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);
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);
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();
}
* 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);
* 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.
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;
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();
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);
}
/*
{
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);
{
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;
}
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);
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
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));
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);
editMenu = NULL;
}
-void MyFrame::OnSize(wxSizeEvent& event)
+void MyFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
if (canvas && palette)
{
}
// 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
return TRUE;
}
-void EditorToolPalette::OnMouseEnter(int toolIndex)
+void EditorToolPalette::OnMouseEnter(int WXUNUSED(toolIndex))
{
}
{
// 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);
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();
// 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
{
// 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;
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
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
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;
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();
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));
}
}
{
}
-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;
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))
{
}
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);
// 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);
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
// 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
{
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());
{
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);
}
// 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();
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;
}
csDiagramDocument* doc = diagram->GetDocument();
((csDiagramView*)doc->GetFirstView())->SelectAll(FALSE);
- m_currentCmd = new csDiagramCommand("Paste", doc);
+ m_currentCmd = new csDiagramCommand(_T("Paste"), doc);
return TRUE;
}
// 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)
{
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));
csLabelEditingDialog::csLabelEditingDialog(wxWindow* parent)
{
- wxLoadFromResource(this, parent, "shape_label_dialog");
+ wxLoadFromResource(this, parent, _T("shape_label_dialog"));
// Accelerators
wxAcceleratorEntry entries[1];
// 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;
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;
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;
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;
}
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
{
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;
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;
}
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;
}
// 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());
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)
wxDocMDIParentFrame::OnCloseWindow(event);
}
-void csFrame::OnSize(wxSizeEvent& event)
+void csFrame::OnSize(wxSizeEvent& WXUNUSED(event))
{
wxLayoutAlgorithm layout;
layout.LayoutMDIFrame(this);
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);
}
}
// Create the project window
-bool csApp::CreateProjectWindow(wxFrame *parent)
+bool csApp::CreateProjectWindow(wxFrame *WXUNUSED(parent))
{
#if 0
// Create a layout window
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);
}
}
-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.
* 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);
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);
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();
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);
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)));
}
}
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
}
}
- 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);
// 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())
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();
}
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;
}
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;
{
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);
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);
{
}
-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();
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;
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)
{
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);
// 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();
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.
#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
// 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();
// 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);
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;
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);
// 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);
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 );
#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();
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 );
#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();
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;
#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__
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__
// 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);
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)
// 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);
// 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();
m_selections.DeleteObject(shape);
}
-void csDiagramView::OnSelectAll(wxCommandEvent& event)
+void csDiagramView::OnSelectAll(wxCommandEvent& WXUNUSED(event))
{
SelectAll(TRUE);
}
event.Enable(doc->GetCommandProcessor()->CanRedo());
}
-void csDiagramView::OnCut(wxCommandEvent& event)
+void csDiagramView::OnCut(wxCommandEvent& WXUNUSED(event))
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
DoCut(selections);
}
-void csDiagramView::OnClear(wxCommandEvent& event)
+void csDiagramView::OnClear(wxCommandEvent& WXUNUSED(event))
{
wxList selections;
FindSelectedShapes(selections);
DoCut(selections);
}
-void csDiagramView::OnCopy(wxCommandEvent& event)
+void csDiagramView::OnCopy(wxCommandEvent& WXUNUSED(event))
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
}
}
-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();
void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
{
- csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
+ /* csDiagramDocument *doc = */ (csDiagramDocument *)GetDocument();
int n = wxGetApp().GetDiagramClipboard().GetCount();
if (shapes.Number() > 0)
{
- csDiagramCommand* cmd = new csDiagramCommand("Cut", doc);
+ csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
wxNode* node = shapes.First();
while (node)
}
}
-void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& event)
+void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
if (!theBrush)
return;
- csDiagramCommand* cmd = new csDiagramCommand("Change colour", doc);
+ csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc);
wxNode* node = selections.First();
while (node)
}
}
-void csDiagramView::OnEditProperties(wxCommandEvent& event)
+void csDiagramView::OnEditProperties(wxCommandEvent& WXUNUSED(event))
{
wxShape *theShape = FindFirstSelectedShape();
if (theShape)
wxASSERT( combo != NULL );
wxString str(combo->GetValue());
- int newPointSize = atoi((const char*) str);
+ long newPointSize;
+ str.ToLong( &newPointSize );
if (newPointSize < 2)
return;
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)
}
-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));
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
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();
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);
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)
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)
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)
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();
// 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();
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(),
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);
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(),
}
}
-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);
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;
CaptureMouse();
}
-void csCanvas::OnEndDragLeft(double x, double y, int keys)
+void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys))
{
ReleaseMouse();
}
}
-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))
{
}
}
}
-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;
}
}
}
-void wxShape::OnDraw(wxDC& dc)
+void wxShape::OnDraw(wxDC& WXUNUSED(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))
{
}
case 2:
{
return (pt1.x <= pt2.x) ;
- break;
}
case 1:
case 3:
{
return (pt1.y <= pt2.y) ;
- break;
}
}
}
}
-void wxShape::OnHighlight(wxDC& dc)
+void wxShape::OnHighlight(wxDC& WXUNUSED(dc))
{
}
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();
#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
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
attachmentList->Append(pointExpr);
node = node->GetNext();
}
- clause->AddAttributeValue("user_attachments", attachmentList);
+ clause->AddAttributeValue(_T("user_attachments"), attachmentList);
}
// Write text regions
// 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
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
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.
}
}
- 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) == '#')
{
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();
// 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;
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)
regionTextColour = colourExpr->StringValue();
}
else
- regionTextColour = "BLACK";
+ regionTextColour = _T("BLACK");
if (penColourExpr)
penColour = penColourExpr->StringValue();
region->SetMinSize(minWidth, minHeight);
region->SetFormatMode(formatMode);
region->SetPenStyle(penStyle);
- if (penColour != "")
+ if (penColour != wxEmptyString)
region->SetPenColour(penColour);
region->m_textColour = regionTextColour;
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.
}
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).
!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)
{
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);
default:
{
return FALSE;
- break;
}
}
return TRUE;
// 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);
*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);
}
// 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)
{
{
}
-void wxTextShape::OnDraw(wxDC& dc)
+void wxTextShape::OnDraw(wxDC& WXUNUSED(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;
default:
{
return wxShape::GetAttachmentPosition(attachment, x, y, nth, no_arcs, line);
- break;
}
}
return TRUE;
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)
{
}
// Don't even attempt to draw any text - waste of time!
-void wxControlPoint::OnDrawContents(wxDC& dc)
+void wxControlPoint::OnDrawContents(wxDC& WXUNUSED(dc))
{
}
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;
// 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;
}
}
-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();
}
}
-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);
// 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;
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
((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;
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
((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);
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;
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())
{
// 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
{
}
-void wxShapeCanvas::OnPaint(wxPaintEvent& event)
+void wxShapeCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
*
*/
-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))
{
}
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;
// 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;
// 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);
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.
// 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)
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)
divisionsExpr->Append(new wxExpr(child->GetId()));
node = node->GetNext();
}
- clause->AddAttributeValue("divisions", divisionsExpr);
+ clause->AddAttributeValue(_T("divisions"), divisionsExpr);
}
}
{
// 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)
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;
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
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());
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
}
}
-void wxDivisionShape::EditEdge(int side)
+void wxDivisionShape::EditEdge(int WXUNUSED(side))
{
wxMessageBox(wxT("EditEdge() not implemented"), wxT("OGL"), wxOK);
node = node->GetNext();
}
return changed;
-
- return FALSE;
}
case gyCONSTRAINT_ABOVE:
{
node = node->GetNext();
}
return changed;
-
+ #if 0
+ // two returned values ?
return FALSE;
+ #endif
}
case gyCONSTRAINT_ALIGNED_TOP:
{
node = node->GetNext();
}
return changed;
-
+ #if 0
+ // two returned values ?
return FALSE;
+ #endif
}
case gyCONSTRAINT_MIDALIGNED_TOP:
{
}
return changed;
}
-
+ #if 0
+ // default value handled in main function body
default:
return FALSE;
+ #endif
}
return FALSE;
}
}
}
-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;
}
// 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);
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);
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);
// 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();
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();
}
#include <math.h>
-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
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);
{
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;
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)
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)
{
}
#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));
return expr;
}
-void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpSetGDI::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr)
{
switch (m_op)
{
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;
}
#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));
return expr;
}
-void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpSetClipping::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr)
{
switch (m_op)
{
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;
}
#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));
return expr;
}
-void wxOpDraw::ReadExpr(wxPseudoMetaFile *image, wxExpr *expr)
+void wxOpDraw::ReadExpr(wxPseudoMetaFile *WXUNUSED(image), wxExpr *expr)
{
switch (m_op)
{
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++)
delete[] actualPoints;
break;
- break;
}
default:
break;
}
}
-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++)
{
}
#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;
// 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;
// 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
*
*/
-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);
}
// 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) ;
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)
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)
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)
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)
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);
}
*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;
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;
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;
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();
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))
{
}
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);
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:
node = node->GetNext();
}
- clause->AddAttributeValue("arrows", arrow_list);
+ clause->AddAttributeValue(_T("arrows"), arrow_list);
}
}
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)
// 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;
}
-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;
}
}
-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;
dc.DrawRectangle(WXROUND(x1), WXROUND(y1), WXROUND(m_width), WXROUND(m_height));
}
-void wxLabelShape::OnDrawContents(wxDC& dc)
+void wxLabelShape::OnDrawContents(wxDC& WXUNUSED(dc))
{
}
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());
{
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)
if (key == (long) 0x9AC6CDD7)
{
- long hmf = getshort(handle);
+ /* long hmf = */ getshort(handle);
int iLeft, iTop, iRight, iBottom;
iLeft = getsignedshort(handle);
iTop = getsignedshort(handle);
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;
return FALSE;
}
- int mtHeaderSize = getshort(handle);
+ /* int mtHeaderSize = */ getshort(handle);
int mtVersion = getshort(handle);
if (mtVersion != 0x0300 && mtVersion != 0x0100)
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))
{
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;
{
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
}
}
-bool wxXMetaFile::SetClipboard(int width, int height)
+bool wxXMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height))
{
return FALSE;
}
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);
{
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);
}
{
wxBeginBusyCursor();
- wxExprDatabase database(wxExprInteger, "id");
+ wxExprDatabase database(wxExprInteger, _T("id"));
if (!database.Read(filename))
{
wxEndBusyCursor();
DeleteAllShapes();
database.BeginFind();
- wxExpr *header = database.FindClauseByFunctor("diagram");
+ wxExpr *header = database.FindClauseByFunctor(_T("diagram"));
if (header)
OnHeaderLoad(database, *header);
{
wxExpr *clause = (wxExpr *)node->GetData();
long id = -1;
- clause->GetAttributeValue("id", id);
+ clause->GetAttributeValue(_T("id"), id);
wxRegisterId(id);
node = node->Next();
}
{
// Find and create the node images
database.BeginFind();
- wxExpr *clause = database.FindClauseByFunctor("shape");
+ wxExpr *clause = database.FindClauseByFunctor(_T("shape"));
while (clause)
{
wxChar *type = NULL;
// 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();
if (type)
delete[] type;
- clause = database.FindClauseByFunctor("shape");
+ clause = database.FindClauseByFunctor(_T("shape"));
}
return;
}
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)
{
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)
{
m_shapeList->Append(shape);
}
- clause = database.FindClauseByFunctor("line");
+ clause = database.FindClauseByFunctor(_T("line"));
}
}
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();
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;
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();
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();
}
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();
}
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();
}
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();
}
}
- 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;
}
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();
}
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;
}
}
}
-void wxLineCrossings::DrawCrossings(wxDiagram& diagram, wxDC& dc)
+void wxLineCrossings::DrawCrossings(wxDiagram& WXUNUSED(diagram), wxDC& dc)
{
dc.SetBrush(*wxTRANSPARENT_BRUSH);
oglBuffer = NULL;
}
oglBuffer = NULL;
+
if (g_oglBullseyeCursor)
{
delete g_oglBullseyeCursor;
}
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();
// 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;