Unicode compilation fixes for OGL (patch #791967)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23065 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -90,8 +90,8 @@ wxOutputStream& DiagramDocument::SaveObject(wxOutputStream& stream)
|
||||
#if wxUSE_PROLOGIO
|
||||
|
||||
wxDocument::SaveObject(stream);
|
||||
char buf[400];
|
||||
(void) wxGetTempFileName("diag", buf);
|
||||
wxChar buf[400];
|
||||
(void) wxGetTempFileName(_T("diag"), buf);
|
||||
|
||||
diagram.SaveFile(buf);
|
||||
|
||||
@@ -109,8 +109,8 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream)
|
||||
#if wxUSE_PROLOGIO
|
||||
wxDocument::LoadObject(stream);
|
||||
|
||||
char buf[400];
|
||||
(void) wxGetTempFileName("diag", buf);
|
||||
wxChar buf[400];
|
||||
(void) wxGetTempFileName(_T("diag"), buf);
|
||||
|
||||
wxTransferStreamToFile(stream, buf);
|
||||
|
||||
@@ -128,7 +128,7 @@ wxInputStream& DiagramDocument::LoadObject(wxInputStream& stream)
|
||||
* Implementation of drawing command
|
||||
*/
|
||||
|
||||
DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy,
|
||||
DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxClassInfo *info, double xx, double yy,
|
||||
bool sel, wxShape *theShape, wxShape *fs, wxShape *ts):
|
||||
wxCommand(TRUE, name)
|
||||
{
|
||||
@@ -146,7 +146,7 @@ DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, w
|
||||
deleteShape = FALSE;
|
||||
}
|
||||
|
||||
DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape):
|
||||
DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, wxBrush *backgroundColour, wxShape *theShape):
|
||||
wxCommand(TRUE, name)
|
||||
{
|
||||
doc = ddoc;
|
||||
@@ -163,7 +163,7 @@ DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, w
|
||||
shapePen = NULL;
|
||||
}
|
||||
|
||||
DiagramCommand::DiagramCommand(char *name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape):
|
||||
DiagramCommand::DiagramCommand(const wxString& name, int command, DiagramDocument *ddoc, const wxString& lab, wxShape *theShape):
|
||||
wxCommand(TRUE, name)
|
||||
{
|
||||
doc = ddoc;
|
||||
@@ -229,7 +229,7 @@ bool DiagramCommand::Do(void)
|
||||
{
|
||||
theShape = (wxShape *)shapeInfo->CreateObject();
|
||||
theShape->AssignNewIds();
|
||||
theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxString("")));
|
||||
theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString));
|
||||
theShape->SetCentreResize(FALSE);
|
||||
theShape->SetPen(wxBLACK_PEN);
|
||||
theShape->SetBrush(wxCYAN_BRUSH);
|
||||
@@ -260,7 +260,7 @@ bool DiagramCommand::Do(void)
|
||||
{
|
||||
theShape = (wxShape *)shapeInfo->CreateObject();
|
||||
theShape->AssignNewIds();
|
||||
theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxString("")));
|
||||
theShape->SetEventHandler(new MyEvtHandler(theShape, theShape, wxEmptyString));
|
||||
theShape->SetPen(wxBLACK_PEN);
|
||||
theShape->SetBrush(wxRED_BRUSH);
|
||||
|
||||
@@ -269,7 +269,7 @@ bool DiagramCommand::Do(void)
|
||||
// Yes, you can have more than 2 control points, in which case
|
||||
// it becomes a multi-segment line.
|
||||
lineShape->MakeLineControlPoints(2);
|
||||
lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_END, 10.0, 0.0, "Normal arrowhead");
|
||||
lineShape->AddArrow(ARROW_ARROW, ARROW_POSITION_END, 10.0, 0.0, _T("Normal arrowhead"));
|
||||
}
|
||||
|
||||
doc->GetDiagram()->AddShape(theShape);
|
||||
@@ -323,7 +323,7 @@ bool DiagramCommand::Do(void)
|
||||
wxClientDC dc(shape->GetCanvas());
|
||||
shape->GetCanvas()->PrepareDC(dc);
|
||||
|
||||
shape->FormatText(dc, (char*) (const char*) myHandler->label);
|
||||
shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label);
|
||||
shape->Draw(dc);
|
||||
|
||||
doc->Modify(TRUE);
|
||||
@@ -408,7 +408,7 @@ bool DiagramCommand::Undo(void)
|
||||
wxClientDC dc(shape->GetCanvas());
|
||||
shape->GetCanvas()->PrepareDC(dc);
|
||||
|
||||
shape->FormatText(dc, (char*) (const char*) myHandler->label);
|
||||
shape->FormatText(dc, /* (char*) (const char*) */ myHandler->label);
|
||||
shape->Draw(dc);
|
||||
|
||||
doc->Modify(TRUE);
|
||||
@@ -428,7 +428,7 @@ void DiagramCommand::RemoveLines(wxShape *shape)
|
||||
while (node)
|
||||
{
|
||||
wxLineShape *line = (wxLineShape *)node->Data();
|
||||
doc->GetCommandProcessor()->Submit(new DiagramCommand("Cut", OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
|
||||
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
|
||||
|
||||
node = shape->GetLines().First();
|
||||
}
|
||||
@@ -438,7 +438,7 @@ void DiagramCommand::RemoveLines(wxShape *shape)
|
||||
* MyEvtHandler: an event handler class for all shapes
|
||||
*/
|
||||
|
||||
void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
|
||||
void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, int WXUNUSED(attachment))
|
||||
{
|
||||
wxClientDC dc(GetShape()->GetCanvas());
|
||||
GetShape()->GetCanvas()->PrepareDC(dc);
|
||||
@@ -488,7 +488,7 @@ void MyEvtHandler::OnLeftClick(double x, double y, int keys, int attachment)
|
||||
* Implement connection of two shapes by right-dragging between them.
|
||||
*/
|
||||
|
||||
void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment)
|
||||
void MyEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int attachment)
|
||||
{
|
||||
// Force attachment to be zero for now. Eventually we can deal with
|
||||
// the actual attachment point, e.g. a rectangle side if attachment mode is on.
|
||||
@@ -506,7 +506,7 @@ void MyEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment
|
||||
GetShape()->GetCanvas()->CaptureMouse();
|
||||
}
|
||||
|
||||
void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int attachment)
|
||||
void MyEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUNUSED(keys), int attachment)
|
||||
{
|
||||
// Force attachment to be zero for now
|
||||
attachment = 0;
|
||||
@@ -522,7 +522,7 @@ void MyEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int atta
|
||||
dc.DrawLine((long) xp, (long) yp, (long) x, (long) y);
|
||||
}
|
||||
|
||||
void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
|
||||
void MyEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int WXUNUSED(attachment))
|
||||
{
|
||||
GetShape()->GetCanvas()->ReleaseMouse();
|
||||
MyCanvas *canvas = (MyCanvas *)GetShape()->GetCanvas();
|
||||
@@ -534,17 +534,17 @@ void MyEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment)
|
||||
if (otherShape && !otherShape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
canvas->view->GetDocument()->GetCommandProcessor()->Submit(
|
||||
new DiagramCommand("wxLineShape", OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape),
|
||||
new DiagramCommand(_T("wxLineShape"), OGLEDIT_ADD_LINE, (DiagramDocument *)canvas->view->GetDocument(), CLASSINFO(wxLineShape),
|
||||
0.0, 0.0, FALSE, NULL, GetShape(), otherShape));
|
||||
}
|
||||
}
|
||||
|
||||
void MyEvtHandler::OnEndSize(double x, double y)
|
||||
void MyEvtHandler::OnEndSize(double WXUNUSED(x), double WXUNUSED(y))
|
||||
{
|
||||
wxClientDC dc(GetShape()->GetCanvas());
|
||||
GetShape()->GetCanvas()->PrepareDC(dc);
|
||||
|
||||
GetShape()->FormatText(dc, (char*) (const char*) label);
|
||||
GetShape()->FormatText(dc, /* (char*) (const char*) */ label);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -557,15 +557,15 @@ bool MyDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
wxDiagram::OnShapeSave(db, shape, expr);
|
||||
MyEvtHandler *handler = (MyEvtHandler *)shape.GetEventHandler();
|
||||
expr.AddAttributeValueString("label", handler->label);
|
||||
expr.AddAttributeValueString(_T("label"), handler->label);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
bool MyDiagram::OnShapeLoad(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
|
||||
{
|
||||
wxDiagram::OnShapeLoad(db, shape, expr);
|
||||
char *label = NULL;
|
||||
expr.AssignAttributeValue("label", &label);
|
||||
wxChar *label = NULL;
|
||||
expr.AssignAttributeValue(_T("label"), &label);
|
||||
MyEvtHandler *handler = new MyEvtHandler(&shape, &shape, wxString(label));
|
||||
shape.SetEventHandler(handler);
|
||||
|
||||
|
Reference in New Issue
Block a user