X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2910dac85f655c9beae54b3d5c723237eda3e6f6..2356708db31b737c6eae53c2316b642aa5a2e68d:/utils/ogl/src/ogldiag.cpp diff --git a/utils/ogl/src/ogldiag.cpp b/utils/ogl/src/ogldiag.cpp index 12d08924a8..b447f545ed 100644 --- a/utils/ogl/src/ogldiag.cpp +++ b/utils/ogl/src/ogldiag.cpp @@ -24,9 +24,7 @@ #include #endif -#ifdef PROLOGIO #include -#endif #if wxUSE_IOSTREAMH #include @@ -95,7 +93,7 @@ void wxDiagram::Redraw(wxDC& dc) if (m_shapeList) { if (GetCanvas()) - GetCanvas()->SetCursor(wxHOURGLASS_CURSOR); + GetCanvas()->SetCursor(* wxHOURGLASS_CURSOR); wxNode *current = m_shapeList->First(); while (current) @@ -107,7 +105,7 @@ void wxDiagram::Redraw(wxDC& dc) current = current->Next(); } if (GetCanvas()) - GetCanvas()->SetCursor(wxSTANDARD_CURSOR); + GetCanvas()->SetCursor(* wxSTANDARD_CURSOR); } } @@ -193,20 +191,20 @@ void wxDiagram::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2 wxPoint points[5]; - points[0].x = x1; - points[0].y = y1; + points[0].x = (int) x1; + points[0].y = (int) y1; - points[1].x = x2; - points[1].y = y1; + points[1].x = (int) x2; + points[1].y = (int) y1; - points[2].x = x2; - points[2].y = y2; + points[2].x = (int) x2; + points[2].y = (int) y2; - points[3].x = x1; - points[3].y = y2; + points[3].x = (int) x1; + points[3].y = (int) y2; - points[4].x = x1; - points[4].y = y1; + points[4].x = (int) x1; + points[4].y = (int) y1; dc.DrawLines(5, points); } @@ -227,20 +225,20 @@ void wxDiagram::RecentreAll(wxDC& dc) bool wxDiagram::SaveFile(const wxString& filename) { wxBeginBusyCursor(); - + wxExprDatabase *database = new wxExprDatabase; // First write the diagram type wxExpr *header = new wxExpr("diagram"); OnHeaderSave(*database, *header); - + database->Append(header); - + wxNode *node = m_shapeList->First(); while (node) { wxShape *shape = (wxShape *)node->Data(); - + if (!shape->IsKindOf(CLASSINFO(wxControlPoint))) { wxExpr *expr = NULL; @@ -254,19 +252,19 @@ bool wxDiagram::SaveFile(const wxString& filename) node = node->Next(); } OnDatabaseSave(*database); - + char tempFile[400]; wxGetTempFileName("diag", tempFile); - ofstream stream(tempFile); - if (stream.bad()) + FILE* file = fopen(tempFile, "w"); + if (! file) { wxEndBusyCursor(); delete database; return FALSE; } - - database->Write(stream); - stream.close(); + + database->Write(file); + fclose(file); delete database; /* @@ -303,14 +301,14 @@ bool wxDiagram::SaveFile(const wxString& filename) bool wxDiagram::LoadFile(const wxString& filename) { wxBeginBusyCursor(); - + wxExprDatabase database(wxExprInteger, "id"); if (!database.Read(filename)) { wxEndBusyCursor(); return FALSE; } - + DeleteAllShapes(); database.BeginFind(); @@ -333,7 +331,7 @@ bool wxDiagram::LoadFile(const wxString& filename) ReadNodes(database); ReadContainerGeometry(database); ReadLines(database); - + OnDatabaseLoad(database); wxEndBusyCursor(); @@ -358,7 +356,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) { wxShape *shape = (wxShape *)classInfo->CreateObject(); OnShapeLoad(database, *shape, *clause); - + shape->SetCanvas(GetCanvas()); shape->Show(TRUE); @@ -380,7 +378,7 @@ void wxDiagram::ReadNodes(wxExprDatabase& database) } if (type) delete[] type; - + clause = database.FindClauseByFunctor("shape"); } return;