From 8552e6f031ded8ae61b4a5b489fbf06962365da7 Mon Sep 17 00:00:00 2001 From: Mattia Barbon Date: Sun, 9 Nov 2003 21:40:34 +0000 Subject: [PATCH] Warning fixes and deprecated method elimination from ABX. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@24494 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/fl/dyntbar.h | 12 +- contrib/include/wx/fl/newbmpbtn.h | 5 + .../samples/deprecated/proplist/proplist.cpp | 14 +- .../samples/deprecated/treelay/treelay.cpp | 12 +- contrib/samples/fl/fl_demo1.cpp | 6 +- contrib/samples/fl/fl_demo2.cpp | 44 +++--- contrib/samples/fl/fl_sample1.cpp | 8 +- contrib/samples/fl/fl_sample2.cpp | 8 +- contrib/samples/fl/fl_sample3.cpp | 12 +- contrib/samples/ogl/ogledit/doc.cpp | 16 +- contrib/samples/ogl/ogledit/ogledit.cpp | 3 +- contrib/samples/ogl/ogledit/view.cpp | 12 +- contrib/samples/ogl/studio/csprint.cpp | 28 ++-- contrib/samples/ogl/studio/dialogs.cpp | 39 +++-- contrib/samples/ogl/studio/doc.cpp | 38 ++--- contrib/samples/ogl/studio/project.cpp | 2 +- contrib/samples/ogl/studio/shapes.cpp | 70 ++++----- contrib/samples/ogl/studio/studio.cpp | 4 +- contrib/samples/ogl/studio/symbols.cpp | 18 +-- contrib/samples/ogl/studio/view.cpp | 146 +++++++++--------- contrib/src/deprecated/proplist.cpp | 8 +- contrib/src/deprecated/resource.cpp | 98 ++++++------ contrib/src/deprecated/wxexpr.cpp | 2 +- contrib/src/fl/bardragpl.cpp | 10 +- contrib/src/fl/cbcustom.cpp | 2 +- contrib/src/fl/controlbar.cpp | 34 ++-- contrib/src/fl/dyntbar.cpp | 2 +- contrib/src/fl/frmview.cpp | 3 - contrib/src/fl/garbagec.cpp | 5 +- contrib/src/fl/panedrawpl.cpp | 2 +- contrib/src/fl/rowdragpl.cpp | 10 -- contrib/src/fl/rowlayoutpl.cpp | 12 +- contrib/src/ogl/basic.cpp | 5 +- contrib/src/ogl/basic2.cpp | 8 - contrib/src/ogl/canvas.cpp | 1 - contrib/src/ogl/composit.cpp | 19 +-- contrib/src/ogl/divided.cpp | 14 +- contrib/src/ogl/drawn.cpp | 15 +- contrib/src/ogl/lines.cpp | 11 +- contrib/src/ogl/mfutils.cpp | 14 +- contrib/src/ogl/ogldiag.cpp | 12 +- contrib/src/ogl/oglmisc.cpp | 2 - 42 files changed, 370 insertions(+), 416 deletions(-) diff --git a/contrib/include/wx/fl/dyntbar.h b/contrib/include/wx/fl/dyntbar.h index 1a37a728c2..bf593b9e94 100644 --- a/contrib/include/wx/fl/dyntbar.h +++ b/contrib/include/wx/fl/dyntbar.h @@ -156,6 +156,11 @@ public: const wxString& labelText = wxT(""), bool alignTextRight = FALSE, bool isFlat = TRUE ); + // Unhide method from parent. + + virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool) + { return wxToolBarBase::AddTool(tool); }; + // Method from wxToolBarBase (for compatibility), only // the first two arguments are valid. // See the documentation for wxToolBar for details. @@ -166,7 +171,12 @@ public: // Adds a separator. See the documentation for wxToolBar for details. - virtual void AddSeparator( wxWindow* pSepartorWnd = NULL ); + virtual void AddSeparator( wxWindow* pSepartorWnd ); +FIXXXXXME + // Unhide method from parent. + + virtual wxToolBarToolBase *AddSeparator() + { return wxToolBarBase::AddSeparator(); }; // Returns tool information for the given tool index. diff --git a/contrib/include/wx/fl/newbmpbtn.h b/contrib/include/wx/fl/newbmpbtn.h index 49a0001810..1421594b41 100644 --- a/contrib/include/wx/fl/newbmpbtn.h +++ b/contrib/include/wx/fl/newbmpbtn.h @@ -145,6 +145,11 @@ public: // Sets the label and optionally label text. virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = wxT("") ); + // Unhide method from parents. + + virtual void SetLabel(const wxString& label) + { wxPanel::SetLabel(label); }; + // Sets the text alignment and margins. virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM, int marginX = NB_DEFAULT_MARGIN, diff --git a/contrib/samples/deprecated/proplist/proplist.cpp b/contrib/samples/deprecated/proplist/proplist.cpp index bb962d52db..dccdaf3266 100644 --- a/contrib/samples/deprecated/proplist/proplist.cpp +++ b/contrib/samples/deprecated/proplist/proplist.cpp @@ -97,7 +97,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, cons // Define the behaviour for the frame closing // - must delete all frames except for the main one. -void MyFrame::OnCloseWindow(wxCloseEvent& event) +void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { if (wxGetApp().m_childWindow) { @@ -107,32 +107,32 @@ void MyFrame::OnCloseWindow(wxCloseEvent& event) Destroy(); } -void MyFrame::OnQuit(wxCommandEvent& event) +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } -void MyFrame::OnDialogList(wxCommandEvent& event) +void MyFrame::OnDialogList(wxCommandEvent& WXUNUSED(event)) { wxGetApp().PropertyListTest(TRUE); } -void MyFrame::OnFrameList(wxCommandEvent& event) +void MyFrame::OnFrameList(wxCommandEvent& WXUNUSED(event)) { wxGetApp().PropertyListTest(FALSE); } -void MyFrame::OnDialogForm(wxCommandEvent& event) +void MyFrame::OnDialogForm(wxCommandEvent& WXUNUSED(event)) { wxGetApp().PropertyFormTest(TRUE); } -void MyFrame::OnFrameForm(wxCommandEvent& event) +void MyFrame::OnFrameForm(wxCommandEvent& WXUNUSED(event)) { wxGetApp().PropertyFormTest(FALSE); } -void MyFrame::OnAbout(wxCommandEvent& event) +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { (void)wxMessageBox(_T("Property Classes Demo\nAuthor: Julian Smart"), _T("About Property Classes Test")); } diff --git a/contrib/samples/deprecated/treelay/treelay.cpp b/contrib/samples/deprecated/treelay/treelay.cpp index 43d9c9832c..ba469e45ca 100644 --- a/contrib/samples/deprecated/treelay/treelay.cpp +++ b/contrib/samples/deprecated/treelay/treelay.cpp @@ -152,12 +152,12 @@ MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, co { } -void MyFrame::OnQuit(wxCommandEvent& event) +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { Close(TRUE); } -void MyFrame::OnLeftRight(wxCommandEvent& event) +void MyFrame::OnLeftRight(wxCommandEvent& WXUNUSED(event)) { if (myTree) { @@ -170,7 +170,7 @@ void MyFrame::OnLeftRight(wxCommandEvent& event) } } -void MyFrame::OnTopBottom(wxCommandEvent& event) +void MyFrame::OnTopBottom(wxCommandEvent& WXUNUSED(event)) { if (myTree) { @@ -183,12 +183,12 @@ void MyFrame::OnTopBottom(wxCommandEvent& event) } } -void MyFrame::OnAbout(wxCommandEvent& event) +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) { (void)wxMessageBox(_T("wxWindows tree library demo Vsn 2.0\nAuthor: Julian Smart (c) 1998"), _T("About tree test")); } -void MyFrame::OnCloseWindow(wxCloseEvent& event) +void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { Destroy(); } @@ -205,7 +205,7 @@ MyCanvas::MyCanvas(wxWindow *parent): } // Define the repainting behaviour -void MyCanvas::OnPaint(wxPaintEvent& event) +void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event)) { wxPaintDC dc(this); PrepareDC(dc); diff --git a/contrib/samples/fl/fl_demo1.cpp b/contrib/samples/fl/fl_demo1.cpp index ca6272f57a..0146cf2b05 100644 --- a/contrib/samples/fl/fl_demo1.cpp +++ b/contrib/samples/fl/fl_demo1.cpp @@ -96,17 +96,17 @@ BEGIN_EVENT_TABLE( MyFrame, wxFrame ) EVT_MENU( NEW_TEST_EXIT, MyFrame::OnExit ) END_EVENT_TABLE() -void MyFrame::OnLoad( wxCommandEvent& event ) +void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_T("Hey - you found a BIG question-mark !!")); } -void MyFrame::OnSave( wxCommandEvent& event ) +void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_("Hey - you found another BIG question-mark !!")); } -void MyFrame::OnExit( wxCommandEvent& event ) +void MyFrame::OnExit( wxCommandEvent& WXUNUSED(event) ) { Destroy(); } diff --git a/contrib/samples/fl/fl_demo2.cpp b/contrib/samples/fl/fl_demo2.cpp index 05ceeecb0c..804b1bef14 100644 --- a/contrib/samples/fl/fl_demo2.cpp +++ b/contrib/samples/fl/fl_demo2.cpp @@ -166,6 +166,8 @@ MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h mImageList( 16,16, FALSE, 2 ) { + int i; + mpInternalFrm = (wxPanel*)this; mAboutBox.Create( this, -1, _T("About box in wxWindows style..."), @@ -173,7 +175,6 @@ MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h wxSize( 385,220), wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL ); - int i = 0; for( i = 0; i != MAX_LAYOUTS; ++i ) mLayouts[i] = NULL; @@ -240,17 +241,17 @@ bool MyFrame::OnClose(void) return TRUE; } -void MyFrame::OnLoad( wxCommandEvent& event ) +void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_("Hey - you found a BIG question-mark !!")); } -void MyFrame::OnStore( wxCommandEvent& event ) +void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_("Hey - you found another BIG question-mark !!")); } -void MyFrame::OnAutoSave( wxCommandEvent& event ) +void MyFrame::OnAutoSave( wxCommandEvent& WXUNUSED(event) ) { mAutoSave = !mAutoSave; @@ -260,14 +261,14 @@ void MyFrame::OnAutoSave( wxCommandEvent& event ) SyncMenuBarItems(); } -void MyFrame::OnRemove( wxCommandEvent& event ) +void MyFrame::OnRemove( wxCommandEvent& WXUNUSED(event) ) { RemoveLayout( mActiveLayoutNo ); Refresh(); } -void MyFrame::OnRemoveAll( wxCommandEvent& event ) +void MyFrame::OnRemoveAll( wxCommandEvent& WXUNUSED(event) ) { for( int i = 0; i != MAX_LAYOUTS; ++i ) { @@ -287,22 +288,22 @@ void MyFrame::OnRecreate( wxCommandEvent& event ) mLayouts[mActiveLayoutNo]->Activate(); } -void MyFrame::OnFirst( wxCommandEvent& event ) +void MyFrame::OnFirst( wxCommandEvent& WXUNUSED(event) ) { ActivateLayout( FIRST_LAYOUT ); } -void MyFrame::OnSecond( wxCommandEvent& event ) +void MyFrame::OnSecond( wxCommandEvent& WXUNUSED(event) ) { ActivateLayout( SECOND_LAYOUT ); } -void MyFrame::OnThird( wxCommandEvent& event ) +void MyFrame::OnThird( wxCommandEvent& WXUNUSED(event) ) { ActivateLayout( THIRD_LAYOUT ); } -void MyFrame::OnQuit( wxCommandEvent& event ) +void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) ) { // USEFUL TRICK:: avoids flickering of application's frame // when closing NN windows on exit: @@ -321,7 +322,7 @@ void MyFrame::OnQuit( wxCommandEvent& event ) Destroy(); } -void MyFrame::OnAbout( wxCommandEvent& event ) +void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) ) { wxFont font; #ifdef __WXMSW__ @@ -397,22 +398,22 @@ void MyFrame::OnChar( wxKeyEvent& event ) } } -void MyFrame::OnSayItsOk( wxCommandEvent& event ) +void MyFrame::OnSayItsOk( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_("It's OK :-)\n\n now click on the border around the button\n and try dragging it!") ); } -void MyFrame::OnBtnYes( wxCommandEvent& event ) +void MyFrame::OnBtnYes( wxCommandEvent& WXUNUSED(event) ) { mAboutBox.Show(FALSE); } -void MyFrame::OnBtnNo( wxCommandEvent& event ) +void MyFrame::OnBtnNo( wxCommandEvent& WXUNUSED(event) ) { mAboutBox.Show(FALSE); } -void MyFrame::OnBtnEsc( wxCommandEvent& event ) +void MyFrame::OnBtnEsc( wxCommandEvent& WXUNUSED(event) ) { mAboutBox.Show(FALSE); } @@ -524,7 +525,7 @@ wxChoice* MyFrame::CreateChoice( const wxString& txt ) // helper -void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent ) +void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pParent) ) { cbDimInfo sizes2( 275,38, // when docked horizontally 45,275, // when docked vertically @@ -927,14 +928,14 @@ BEGIN_EVENT_TABLE( StartButton95, wxPanel ) EVT_PAINT ( StartButton95::OnPaint ) END_EVENT_TABLE() -void StartButton95::OnMouseDown( wxMouseEvent& event ) +void StartButton95::OnMouseDown( wxMouseEvent& WXUNUSED(event) ) { m_bPressed = TRUE; Refresh(); CaptureMouse(); } -void StartButton95::OnMouseUp( wxMouseEvent& event ) +void StartButton95::OnMouseUp( wxMouseEvent& WXUNUSED(event) ) { // "this is not a bug" @@ -943,8 +944,7 @@ void StartButton95::OnMouseUp( wxMouseEvent& event ) ::wxSetCursor( wxCURSOR_WAIT ); wxSleep(1); - int i = 0; - for( i = 1; i != 6; ++i ) + for( int i = 1; i != 6; ++i ) { m_bPressed = (i % 2) != 0; Refresh(); @@ -954,9 +954,9 @@ void StartButton95::OnMouseUp( wxMouseEvent& event ) //*((char*)(i)-3) = 'X'; // Aleks what's the meaning of this??? } -void StartButton95::OnPaint( wxPaintEvent& event ) +void StartButton95::OnPaint( wxPaintEvent& WXUNUSED(event) ) { - wxBitmap* pBmp = 0; + wxBitmap* pBmp; if ( m_bPressed ) { diff --git a/contrib/samples/fl/fl_sample1.cpp b/contrib/samples/fl/fl_sample1.cpp index bcc0e8c8c1..d873fe3328 100644 --- a/contrib/samples/fl/fl_sample1.cpp +++ b/contrib/samples/fl/fl_sample1.cpp @@ -102,7 +102,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) - : wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition, + : wxFrame( parent, -1, title, wxDefaultPosition, wxSize( 700, 500 ), wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, @@ -177,17 +177,17 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value ) return pCtrl; } -void MyFrame::OnLoad( wxCommandEvent& event ) +void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(wxT("Hey - you found a BIG question-mark !!")); } -void MyFrame::OnStore( wxCommandEvent& event ) +void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(wxT("Hey - you found another BIG question-mark !!")); } -void MyFrame::OnQuit( wxCommandEvent& event ) +void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) ) { Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction diff --git a/contrib/samples/fl/fl_sample2.cpp b/contrib/samples/fl/fl_sample2.cpp index 47f293e9f6..dd389f7002 100644 --- a/contrib/samples/fl/fl_sample2.cpp +++ b/contrib/samples/fl/fl_sample2.cpp @@ -103,7 +103,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) - : wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition, + : wxFrame( parent, -1, title, wxDefaultPosition, wxSize( 700, 500 ), wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, @@ -175,17 +175,17 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value ) return pCtrl; } -void MyFrame::OnLoad( wxCommandEvent& event ) +void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(wxT("Hey - you found a BIG question-mark !!")); } -void MyFrame::OnStore( wxCommandEvent& event ) +void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(wxT("Hey - you found another BIG question-mark !!")); } -void MyFrame::OnQuit( wxCommandEvent& event ) +void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) ) { Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction diff --git a/contrib/samples/fl/fl_sample3.cpp b/contrib/samples/fl/fl_sample3.cpp index 0eed34096e..2e42b69ba1 100644 --- a/contrib/samples/fl/fl_sample3.cpp +++ b/contrib/samples/fl/fl_sample3.cpp @@ -108,7 +108,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame) END_EVENT_TABLE() MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) - : wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition, + : wxFrame( parent, -1, title, wxDefaultPosition, wxSize( 700, 500 ), wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, @@ -202,24 +202,24 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value ) return pCtrl; } -void MyFrame::OnLoad( wxCommandEvent& event ) +void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_("Hey - you found a BIG question-mark !!")); } -void MyFrame::OnStore( wxCommandEvent& event ) +void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) ) { wxMessageBox(_("Hey - you found another BIG question-mark !!")); } -void MyFrame::OnQuit( wxCommandEvent& event ) +void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) ) { Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction Close(TRUE); } -void MyFrame::OnButt( wxCommandEvent& event ) +void MyFrame::OnButt( wxCommandEvent& WXUNUSED(event) ) { static int i =0; @@ -266,7 +266,7 @@ void MyFrame::OnButt( wxCommandEvent& event ) i++; } -void MyFrame::OnButt2( wxCommandEvent& event ) +void MyFrame::OnButt2( wxCommandEvent& WXUNUSED(event) ) { static int i =0; diff --git a/contrib/samples/ogl/ogledit/doc.cpp b/contrib/samples/ogl/ogledit/doc.cpp index ecda6e4917..88a17da9ec 100644 --- a/contrib/samples/ogl/ogledit/doc.cpp +++ b/contrib/samples/ogl/ogledit/doc.cpp @@ -222,7 +222,7 @@ bool DiagramCommand::Do(void) } case OGLEDIT_ADD_SHAPE: { - wxShape *theShape = NULL; + wxShape *theShape; if (shape) theShape = shape; // Saved from undoing the shape else @@ -253,7 +253,7 @@ bool DiagramCommand::Do(void) } case OGLEDIT_ADD_LINE: { - wxShape *theShape = NULL; + wxShape *theShape; if (shape) theShape = shape; // Saved from undoing the line else @@ -424,13 +424,13 @@ bool DiagramCommand::Undo(void) // Remove each individual line connected to a shape by sending a command. void DiagramCommand::RemoveLines(wxShape *shape) { - wxNode *node = shape->GetLines().First(); + wxNode *node = shape->GetLines().GetFirst(); while (node) { - wxLineShape *line = (wxLineShape *)node->Data(); + wxLineShape *line = (wxLineShape *)node->GetData(); doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line)); - node = shape->GetLines().First(); + node = shape->GetLines().GetFirst(); } } @@ -455,10 +455,10 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, { // Ensure no other shape is selected, to simplify Undo/Redo code bool redraw = FALSE; - wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); + wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape *eachShape = (wxShape *)node->Data(); + wxShape *eachShape = (wxShape *)node->GetData(); if (eachShape->GetParent() == NULL) { if (eachShape->Selected()) @@ -467,7 +467,7 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys, redraw = TRUE; } } - node = node->Next(); + node = node->GetNext(); } GetShape()->Select(TRUE, &dc); if (redraw) diff --git a/contrib/samples/ogl/ogledit/ogledit.cpp b/contrib/samples/ogl/ogledit/ogledit.cpp index 13e3770ee9..44226b4ac0 100644 --- a/contrib/samples/ogl/ogledit/ogledit.cpp +++ b/contrib/samples/ogl/ogledit/ogledit.cpp @@ -72,7 +72,6 @@ bool MyApp::OnInit(void) //// Make a menubar wxMenu *file_menu = new wxMenu; - wxMenu *edit_menu = NULL; file_menu->Append(wxID_NEW, _T("&New...")); file_menu->Append(wxID_OPEN, _T("&Open...")); @@ -85,7 +84,7 @@ bool MyApp::OnInit(void) file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup...")); file_menu->Append(wxID_PREVIEW, _T("Print Pre&view")); - edit_menu = new wxMenu; + wxMenu *edit_menu = new wxMenu; edit_menu->Append(wxID_UNDO, _T("&Undo")); edit_menu->Append(wxID_REDO, _T("&Redo")); edit_menu->AppendSeparator(); diff --git a/contrib/samples/ogl/ogledit/view.cpp b/contrib/samples/ogl/ogledit/view.cpp index 3800e31106..74f8f357fe 100644 --- a/contrib/samples/ogl/ogledit/view.cpp +++ b/contrib/samples/ogl/ogledit/view.cpp @@ -127,16 +127,16 @@ void DiagramView::OnDraw(wxDC *dc) if (diagram_p->GetShapeList()) { /* wxCursor *old_cursor = NULL; */ - wxNode *current = diagram_p->GetShapeList()->First(); + wxNode *current = diagram_p->GetShapeList()->GetFirst(); while (current) // Loop through the entire list of shapes { - wxShape *object = (wxShape *)current->Data(); + wxShape *object = (wxShape *)current->GetData(); if (!object->GetParent()) { object->Draw(* dc); // Draw the shape onto our printing dc } - current = current->Next(); // Procede to the next shape in the list + current = current->GetNext(); // Procede to the next shape in the list } } dc->EndDrawing(); // Allows optimization of drawing code under MS Windows. @@ -177,16 +177,16 @@ wxShape *DiagramView::FindSelectedShape(void) { DiagramDocument *doc = (DiagramDocument *)GetDocument(); wxShape *theShape = NULL; - wxNode *node = doc->GetDiagram()->GetShapeList()->First(); + wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape *eachShape = (wxShape *)node->Data(); + wxShape *eachShape = (wxShape *)node->GetData(); if ((eachShape->GetParent() == NULL) && eachShape->Selected()) { theShape = eachShape; node = NULL; } - else node = node->Next(); + else node = node->GetNext(); } return theShape; } diff --git a/contrib/samples/ogl/studio/csprint.cpp b/contrib/samples/ogl/studio/csprint.cpp index 28134aa425..4d17b59ab7 100644 --- a/contrib/samples/ogl/studio/csprint.cpp +++ b/contrib/samples/ogl/studio/csprint.cpp @@ -70,10 +70,10 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo // First copy all node shapes. wxList* shapeList = diagramFrom->GetShapeList(); - wxNode* node = shapeList->First(); + wxNode* node = shapeList->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape))) { wxShape* newShape = shape->CreateNewCopy(); @@ -90,13 +90,13 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo OnAddShape(diagramTo, newShape, dc); } - node = node->Next(); + node = node->GetNext(); } - node = shapeList->First(); + node = shapeList->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (((diagramFrom == this) || shape->Selected()) && shape->IsKindOf(CLASSINFO(wxLineShape))) { wxLineShape* lineShape = (wxLineShape*) shape; @@ -122,14 +122,14 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo } } - node = node->Next(); + node = node->GetNext(); } // Now make sure line ordering is correct - node = shapeList->First(); + node = shapeList->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape))) { wxShape* newShape = (wxShape*) mapping.Get((long) shape); @@ -137,10 +137,10 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo // Make a list of all the new lines, in the same order as the old lines. // Then apply the list of new lines to the shape. wxList newLines; - wxNode* lineNode = shape->GetLines().First(); + wxNode* lineNode = shape->GetLines().GetFirst(); while (lineNode) { - wxLineShape* lineShape = (wxLineShape*) lineNode->Data(); + wxLineShape* lineShape = (wxLineShape*) lineNode->GetData(); if ((diagramFrom == this) || (lineShape->GetTo()->Selected() && lineShape->GetFrom()->Selected())) { wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape); @@ -150,13 +150,13 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo newLines.Append(newLineShape); } - lineNode = lineNode->Next(); + lineNode = lineNode->GetNext(); } - if (newLines.Number() > 0) + if (newLines.GetCount() > 0) newShape->ApplyAttachmentOrdering(newLines); } - node = node->Next(); + node = node->GetNext(); } OnEndCopy(diagramTo); @@ -284,7 +284,7 @@ bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo) if (m_currentCmd) { - if (m_currentCmd->GetStates().Number() == 0) + if (m_currentCmd->GetStates().GetCount() == 0) { delete m_currentCmd; } diff --git a/contrib/samples/ogl/studio/dialogs.cpp b/contrib/samples/ogl/studio/dialogs.cpp index 6136b5863d..753bdf1022 100644 --- a/contrib/samples/ogl/studio/dialogs.cpp +++ b/contrib/samples/ogl/studio/dialogs.cpp @@ -100,13 +100,19 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent): m_generalSettings = new wxPanel; - bool success = wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog")); + #ifdef __WXDEBUG__ + bool success = + #endif + 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, _T("diagram_settings_dialog")); + #ifdef __WXDEBUG__ + success = + #endif + 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")); @@ -199,10 +205,10 @@ bool csSettingsDialog::TransferDataFromWindow() } // Apply settings to all open diagram documents - wxNode* node = wxGetApp().GetDocManager()->GetDocuments().First(); + wxNode* node = wxGetApp().GetDocManager()->GetDocuments().GetFirst(); while (node) { - wxDocument* doc = (wxDocument*) node->Data(); + wxDocument* doc = (wxDocument*) node->GetData(); if (doc->IsKindOf(CLASSINFO(csDiagramDocument))) { csDiagramDocument* diagramDoc = (csDiagramDocument*) doc; @@ -228,7 +234,7 @@ bool csSettingsDialog::TransferDataFromWindow() } } } - node = node->Next(); + node = node->GetNext(); } return TRUE; @@ -262,12 +268,14 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin wxPoint(2, 2), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH - 4, SHAPE_PROPERTY_DIALOG_HEIGHT - 4)); m_generalPropertiesDialog = new csGeneralShapePropertiesDialog; - bool success = wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog")); + #ifdef __WXDEBUG__ + bool success = + #endif + 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) + if (!wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName)) { wxMessageBox(_T("Could not load the attribute dialog for this shape."), _T("Studio"), wxICON_EXCLAMATION); delete m_attributeDialog; @@ -282,8 +290,7 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin wxString str(attributeDialogName); str += _T("1"); m_alternativeAttributeDialog = new wxPanel; - success = wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str); - if (success) + if (wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str)) { m_notebook->AddPage(m_alternativeAttributeDialog, _T("Attributes (alternative)")); } @@ -358,31 +365,31 @@ void csShapePropertiesDialog::SetDefaults() if (!m_attributeDialog) return; - wxNode* node = m_attributeDialog->GetChildren().First(); + wxWindowListNode* node = m_attributeDialog->GetChildren().GetFirst(); while (node) { - wxWindow* child = (wxWindow*) node->Data(); + wxWindow* child = (wxWindow*) node->GetData(); if (child->IsKindOf(CLASSINFO(wxChoice))) { wxChoice* choice = (wxChoice*) child; choice->SetSelection(0); } - node = node->Next(); + node = node->GetNext(); } if (!m_alternativeAttributeDialog) return; - node = m_alternativeAttributeDialog->GetChildren().First(); + node = m_alternativeAttributeDialog->GetChildren().GetFirst(); while (node) { - wxWindow* child = (wxWindow*) node->Data(); + wxWindow* child = (wxWindow*) node->GetData(); if (child->IsKindOf(CLASSINFO(wxChoice))) { wxChoice* choice = (wxChoice*) child; choice->SetSelection(0); } - node = node->Next(); + node = node->GetNext(); } } diff --git a/contrib/samples/ogl/studio/doc.cpp b/contrib/samples/ogl/studio/doc.cpp index ea8e698b86..a9f21169d4 100644 --- a/contrib/samples/ogl/studio/doc.cpp +++ b/contrib/samples/ogl/studio/doc.cpp @@ -120,12 +120,12 @@ csDiagramCommand::csDiagramCommand(const wxString& name, csDiagramDocument *doc, csDiagramCommand::~csDiagramCommand() { - wxNode* node = m_states.First(); + wxNode* node = m_states.GetFirst(); while (node) { - csCommandState* state = (csCommandState*) node->Data(); + csCommandState* state = (csCommandState*) node->GetData(); delete state; - node = node->Next(); + node = node->GetNext(); } } @@ -147,51 +147,51 @@ void csDiagramCommand::InsertState(csCommandState* state) // Schedule all lines connected to the states to be cut. void csDiagramCommand::RemoveLines() { - wxNode* node = m_states.First(); + wxNode* node = m_states.GetFirst(); while (node) { - csCommandState* state = (csCommandState*) node->Data(); + csCommandState* state = (csCommandState*) node->GetData(); wxShape* shape = state->GetShapeOnCanvas(); wxASSERT( (shape != NULL) ); - wxNode *node1 = shape->GetLines().First(); + wxNode *node1 = shape->GetLines().GetFirst(); while (node1) { - wxLineShape *line = (wxLineShape *)node1->Data(); + wxLineShape *line = (wxLineShape *)node1->GetData(); if (!FindStateByShape(line)) { csCommandState* newState = new csCommandState(ID_CS_CUT, NULL, line); InsertState(newState); } - node1 = node1->Next(); + node1 = node1->GetNext(); } - node = node->Next(); + node = node->GetNext(); } } csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape) { - wxNode* node = m_states.First(); + wxNode* node = m_states.GetFirst(); while (node) { - csCommandState* state = (csCommandState*) node->Data(); + csCommandState* state = (csCommandState*) node->GetData(); if (shape == state->GetShapeOnCanvas() || shape == state->GetSavedState()) return state; - node = node->Next(); + node = node->GetNext(); } return NULL; } bool csDiagramCommand::Do() { - wxNode* node = m_states.First(); + wxNode* node = m_states.GetFirst(); while (node) { - csCommandState* state = (csCommandState*) node->Data(); + csCommandState* state = (csCommandState*) node->GetData(); if (!state->Do()) return FALSE; - node = node->Next(); + node = node->GetNext(); } return TRUE; } @@ -200,13 +200,13 @@ bool csDiagramCommand::Undo() { // Undo in reverse order, so e.g. shapes get added // back before the lines do. - wxNode* node = m_states.Last(); + wxNode* node = m_states.GetLast(); while (node) { - csCommandState* state = (csCommandState*) node->Data(); + csCommandState* state = (csCommandState*) node->GetData(); if (!state->Undo()) return FALSE; - node = node->Previous(); + node = node->GetPrevious(); } return TRUE; } @@ -457,7 +457,7 @@ bool csCommandState::Do() m_shapeOnCanvas->Show(TRUE); // Recursively redraw links if we have a composite. - if (m_shapeOnCanvas->GetChildren().Number() > 0) + if (m_shapeOnCanvas->GetChildren().GetCount() > 0) m_shapeOnCanvas->DrawLinks(dc, -1, TRUE); m_shapeOnCanvas->GetEventHandler()->OnEndSize(width, height); diff --git a/contrib/samples/ogl/studio/project.cpp b/contrib/samples/ogl/studio/project.cpp index 8d6e0efd69..982e239393 100644 --- a/contrib/samples/ogl/studio/project.cpp +++ b/contrib/samples/ogl/studio/project.cpp @@ -31,7 +31,7 @@ BEGIN_EVENT_TABLE(csProjectTreeCtrl, wxTreeCtrl) END_EVENT_TABLE() // Define my frame constructor -csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, +csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size, long style): wxTreeCtrl(parent, id, pos, size, style), diff --git a/contrib/samples/ogl/studio/shapes.cpp b/contrib/samples/ogl/studio/shapes.cpp index 3e421feeb4..272b887ba2 100644 --- a/contrib/samples/ogl/studio/shapes.cpp +++ b/contrib/samples/ogl/studio/shapes.cpp @@ -199,7 +199,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int dc.SetPen(dottedPen); double xp, yp; GetShape()->GetAttachmentPositionEdge(attachment, &xp, &yp); - dc.DrawLine(xp, yp, x, y); + dc.DrawLine((wxCoord)xp, (wxCoord)yp, (wxCoord)x, (wxCoord)y); GetShape()->GetCanvas()->CaptureMouse(); } @@ -213,7 +213,7 @@ void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUN dc.SetPen(dottedPen); double xp, yp; GetShape()->GetAttachmentPositionEdge(attachment, &xp, &yp); - dc.DrawLine(xp, yp, x, y); + dc.DrawLine((wxCoord)xp, (wxCoord)yp, (wxCoord)x, (wxCoord)y); } void csEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int attachment) @@ -299,16 +299,16 @@ void csEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attac GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); // Draw bounding box for other selected shapes - wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); + wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape())) { shape->GetBoundingBoxMax(&w, &h); shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, w, h); } - node = node->Next(); + node = node->GetNext(); } } @@ -358,16 +358,16 @@ void csEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment) GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); // Draw bounding box for other selected shapes - wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); + wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape())) { shape->GetBoundingBoxMax(&w, &h); shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, w, h); } - node = node->Next(); + node = node->GetNext(); } GetShape()->GetCanvas()->CaptureMouse(); @@ -413,40 +413,40 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment) new csCommandState(ID_CS_MOVE, newShape, GetShape())); // Move line points - wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); + wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); // Only move the line point(s) if both ends move too if (shape->IsKindOf(CLASSINFO(wxLineShape)) && ((wxLineShape*)shape)->GetTo()->Selected() && ((wxLineShape*)shape)->GetFrom()->Selected()) { wxLineShape* lineShape = (wxLineShape*) shape; - if (lineShape->GetLineControlPoints()->Number() > 2) + if (lineShape->GetLineControlPoints()->GetCount() > 2) { wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy(); - wxNode *node1 = newLineShape->GetLineControlPoints()->First(); + wxNode *node1 = newLineShape->GetLineControlPoints()->GetFirst(); while (node1) { - wxRealPoint *point = (wxRealPoint *)node1->Data(); + wxRealPoint *point = (wxRealPoint *)node1->GetData(); point->x += offsetX; point->y += offsetY; - node1 = node1->Next(); + node1 = node1->GetNext(); } cmd->AddState(new csCommandState(ID_CS_MOVE_LINE_POINT, newLineShape, lineShape)); lineShape->Erase(dc); } } - node = node->Next(); + node = node->GetNext(); } // Add other selected node shapes, if any - node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); + node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape())) { wxShape* newShape2 = shape->CreateNewCopy(); @@ -454,7 +454,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment) newShape2->SetY(shape->GetY() + offsetY); cmd->AddState(new csCommandState(ID_CS_MOVE, newShape2, shape)); } - node = node->Next(); + node = node->GetNext(); } canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd); @@ -736,7 +736,7 @@ csThinRectangleShape::csThinRectangleShape() double w = csSTANDARD_SHAPE_WIDTH/2; double h = csSTANDARD_SHAPE_WIDTH; - DrawRectangle(wxRect(- w/2, - h/2, w, h)); + DrawRectangle(wxRect((int)(- w/2), (int)(- h/2), (int)(w), (int)(h))); CalculateSize(); SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); @@ -755,7 +755,7 @@ csWideRectangleShape::csWideRectangleShape() double w = csSTANDARD_SHAPE_WIDTH; double h = w/2.0; - DrawRoundedRectangle(wxRect(- w/2, - h/2, w, h), -0.3); + DrawRoundedRectangle(wxRect((int)(- w/2), (int)(- h/2), (int)(w), (int)(h)), -0.3); CalculateSize(); SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); @@ -778,9 +778,9 @@ csTriangleShape::csTriangleShape() wxPoint* points = new wxPoint[3]; - points[0] = wxPoint( 0 , - h / 2 ); - points[1] = wxPoint( w / 2 , h / 2 ); - points[2] = wxPoint( -w / 2, h / 2 ); + points[0] = wxPoint( 0 , (int)(- h / 2) ); + points[1] = wxPoint( (int)(w / 2) , (int)(h / 2) ); + points[2] = wxPoint( (int)(-w / 2), (int)(h / 2) ); DrawPolygon(3, points, oglMETAFLAGS_OUTLINE); @@ -834,14 +834,14 @@ csSemiCircleShape::csSemiCircleShape() // bounding box, since we can't calculate the bounding box for // an arbitrary arc (not implemented) - DrawRectangle(wxRect(-w/2.0, -h/2.0, w, h)); + DrawRectangle(wxRect((int)(-w/2.0), (int)(-h/2.0), (int)(w), (int)(h))); SetDrawnPen(wxBLACK_PEN); wxBrush* brush = wxTheBrushList->FindOrCreateBrush(wxColour(220, 220, 220), wxSOLID); SetDrawnBrush(brush); - DrawEllipticArc(wxRect(-w/2, -h/2, w, 2*h), 0.0, 180.0); - DrawLine(wxPoint(-w/2, h/2), wxPoint(w/2, h/2)); + DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(2*h)), 0.0, 180.0); + DrawLine(wxPoint((int)(-w/2), (int)(h/2)), wxPoint((int)(w/2), (int)(h/2))); CalculateSize(); @@ -855,13 +855,13 @@ csSemiCircleShape::csSemiCircleShape() SetDrawnPen(wxTRANSPARENT_PEN); SetDrawnBrush(wxTRANSPARENT_BRUSH); - DrawRectangle(wxRect(-w/2, -h/2, w, h)); + DrawRectangle(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(h))); SetDrawnPen(wxBLACK_PEN); SetDrawnBrush(brush); - DrawEllipticArc(wxRect(-w/2 - w, -h/2, 2*w, h), 270.0, 90.0); - DrawLine(wxPoint(-w/2, -h/2), wxPoint(-w/2, h/2)); + DrawEllipticArc(wxRect((int)(-w/2 - w), (int)(-h/2), (int)(2*w), (int)(h)), 270.0, 90.0); + DrawLine(wxPoint((int)(-w/2), (int)(-h/2)), wxPoint((int)(-w/2), (int)(h/2))); CalculateSize(); @@ -875,13 +875,13 @@ csSemiCircleShape::csSemiCircleShape() SetDrawnPen(wxTRANSPARENT_PEN); SetDrawnBrush(wxTRANSPARENT_BRUSH); - DrawRectangle(wxRect(-w/2, -h/2, w, h)); + DrawRectangle(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(h))); SetDrawnPen(wxBLACK_PEN); SetDrawnBrush(brush); - DrawEllipticArc(wxRect(-w/2, -h/2 - h, w, 2*h), 180.0, 0.0); - DrawLine(wxPoint(-w/2, -h/2), wxPoint(w/2, -h/2)); + DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2 - h), (int)(w), (int)(2*h)), 180.0, 0.0); + DrawLine(wxPoint((int)(-w/2), (int)(-h/2)), wxPoint((int)(w/2), (int)(-h/2))); CalculateSize(); @@ -895,13 +895,13 @@ csSemiCircleShape::csSemiCircleShape() SetDrawnPen(wxTRANSPARENT_PEN); SetDrawnBrush(wxTRANSPARENT_BRUSH); - DrawRectangle(wxRect(-w/2, -h/2, w, h)); + DrawRectangle(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(h))); SetDrawnPen(wxBLACK_PEN); SetDrawnBrush(brush); - DrawEllipticArc(wxRect(-w/2, -h/2, 2*w, h), 90.0, 270.0); - DrawLine(wxPoint(w/2, -h/2), wxPoint(w/2, h/2)); + DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2), (int)(2*w), (int)(h)), 90.0, 270.0); + DrawLine(wxPoint((int)(w/2),(int)(-h/2)), wxPoint((int)(w/2), (int)(h/2))); CalculateSize(); diff --git a/contrib/samples/ogl/studio/studio.cpp b/contrib/samples/ogl/studio/studio.cpp index ce7ca8b609..7940916eb5 100644 --- a/contrib/samples/ogl/studio/studio.cpp +++ b/contrib/samples/ogl/studio/studio.cpp @@ -244,9 +244,7 @@ wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu** fileMenu->AppendSeparator(); fileMenu->Append(wxID_EXIT, _T("E&xit")); - wxMenu *editMenu = NULL; - - editMenu = new wxMenu; + wxMenu* editMenu = new wxMenu; editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z")); editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y")); editMenu->AppendSeparator(); diff --git a/contrib/samples/ogl/studio/symbols.cpp b/contrib/samples/ogl/studio/symbols.cpp index 8bc2778ef0..362b0799ea 100644 --- a/contrib/samples/ogl/studio/symbols.cpp +++ b/contrib/samples/ogl/studio/symbols.cpp @@ -74,41 +74,41 @@ void csSymbolDatabase::AddSymbol(csSymbol* symbol) void csSymbolDatabase::ClearSymbols() { - wxNode* node = m_symbols.First(); + wxNode* node = m_symbols.GetFirst(); while (node) { - csSymbol* symbol = (csSymbol*) node->Data(); + csSymbol* symbol = (csSymbol*) node->GetData(); delete symbol; - node = node->Next(); + node = node->GetNext(); } m_symbols.Clear(); } csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const { - wxNode* node = m_symbols.First(); + wxNode* node = m_symbols.GetFirst(); while (node) { - csSymbol* symbol = (csSymbol*) node->Data(); + csSymbol* symbol = (csSymbol*) node->GetData(); if (symbol->GetName() == name) return symbol; - node = node->Next(); + node = node->GetNext(); } return NULL; } csSymbol* csSymbolDatabase::FindSymbol(int toolId) const { - wxNode* node = m_symbols.First(); + wxNode* node = m_symbols.GetFirst(); while (node) { - csSymbol* symbol = (csSymbol*) node->Data(); + csSymbol* symbol = (csSymbol*) node->GetData(); if (symbol->GetToolId() == toolId) return symbol; - node = node->Next(); + node = node->GetNext(); } return NULL; } diff --git a/contrib/samples/ogl/studio/view.cpp b/contrib/samples/ogl/studio/view.cpp index c00189d947..4b894fd48f 100644 --- a/contrib/samples/ogl/studio/view.cpp +++ b/contrib/samples/ogl/studio/view.cpp @@ -199,16 +199,16 @@ wxShape *csDiagramView::FindFirstSelectedShape(void) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); wxShape *theShape = NULL; - wxNode *node = doc->GetDiagram()->GetShapeList()->First(); + wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape *eachShape = (wxShape *)node->Data(); + wxShape *eachShape = (wxShape *)node->GetData(); if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected()) { theShape = eachShape; node = NULL; } - else node = node->Next(); + else node = node->GetNext(); } return theShape; } @@ -216,15 +216,15 @@ wxShape *csDiagramView::FindFirstSelectedShape(void) void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - wxNode *node = doc->GetDiagram()->GetShapeList()->First(); + wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape *eachShape = (wxShape *)node->Data(); + wxShape *eachShape = (wxShape *)node->GetData(); if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected() && ((toFind == NULL) || (eachShape->IsKindOf(toFind)))) { selections.Append(eachShape); } - node = node->Next(); + node = node->GetNext(); } } @@ -296,17 +296,17 @@ void csDiagramView::OnDuplicate(wxCommandEvent& WXUNUSED(event)) void csDiagramView::OnCutUpdate(wxUpdateUIEvent& event) { - event.Enable( (m_selections.Number() > 0) ); + event.Enable( (m_selections.GetCount() > 0) ); } void csDiagramView::OnClearUpdate(wxUpdateUIEvent& event) { - event.Enable( (m_selections.Number() > 0) ); + event.Enable( (m_selections.GetCount() > 0) ); } void csDiagramView::OnCopyUpdate(wxUpdateUIEvent& event) { - event.Enable( (m_selections.Number() > 0) ); + event.Enable( (m_selections.GetCount() > 0) ); } void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event) @@ -320,21 +320,21 @@ void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event) void csDiagramView::OnDuplicateUpdate(wxUpdateUIEvent& event) { - event.Enable( (m_selections.Number() > 0) ); + event.Enable( (m_selections.GetCount() > 0) ); } void csDiagramView::DoCut(wxList& shapes) { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - if (shapes.Number() > 0) + if (shapes.GetCount() > 0) { csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc); - wxNode* node = shapes.First(); + wxNode* node = shapes.GetFirst(); while (node) { - wxShape *theShape = (wxShape*) node->Data(); + wxShape *theShape = (wxShape*) node->GetData(); csCommandState* state = new csCommandState(ID_CS_CUT, NULL, theShape); // Insert lines at the front, so they are cut first. @@ -345,7 +345,7 @@ void csDiagramView::DoCut(wxList& shapes) else cmd->AddState(state); - node = node->Next(); + node = node->GetNext(); } cmd->RemoveLines(); // Schedule any connected lines, not already mentioned, // to be removed first @@ -359,21 +359,21 @@ void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxSt { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - if (shapes.Number() > 0) + if (shapes.GetCount() > 0) { csDiagramCommand* command = new csDiagramCommand(op, doc); - wxNode* node = shapes.First(); - wxNode* node1 = oldShapes.First(); + wxNode* node = shapes.GetFirst(); + wxNode* node1 = oldShapes.GetFirst(); while (node && node1) { - wxShape *theShape = (wxShape*) node->Data(); - wxShape *oldShape = (wxShape*) node1->Data(); + wxShape *theShape = (wxShape*) node->GetData(); + wxShape *oldShape = (wxShape*) node1->GetData(); csCommandState* state = new csCommandState(cmd, theShape, oldShape); command->AddState(state); - node = node->Next(); - node1 = node1->Next(); + node = node->GetNext(); + node1 = node1->GetNext(); } doc->GetCommandProcessor()->Submit(command); } @@ -386,13 +386,13 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) wxList selections; FindSelectedShapes(selections); - if (selections.Number() > 0) + if (selections.GetCount() > 0) { wxColourData data; data.SetChooseFull(TRUE); - if (selections.Number() == 1) + if (selections.GetCount() == 1) { - wxShape* firstShape = (wxShape*) selections.First()->Data(); + wxShape* firstShape = (wxShape*) selections.GetFirst()->GetData(); data.SetColour(firstShape->GetBrush()->GetColour()); } @@ -410,17 +410,17 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event)) csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc); - wxNode* node = selections.First(); + wxNode* node = selections.GetFirst(); while (node) { - wxShape *theShape = (wxShape*) node->Data(); + wxShape *theShape = (wxShape*) node->GetData(); wxShape* newShape = theShape->CreateNewCopy(); newShape->SetBrush(theBrush); csCommandState* state = new csCommandState(ID_CS_CHANGE_BACKGROUND_COLOUR, newShape, theShape); cmd->AddState(state); - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -437,7 +437,7 @@ void csDiagramView::OnEditPropertiesUpdate(wxUpdateUIEvent& event) { wxList selections; FindSelectedShapes(selections); - event.Enable( (selections.Number() > 0) ); + event.Enable( (selections.GetCount() > 0) ); } void csDiagramView::OnPointSizeComboSel(wxCommandEvent& event) @@ -475,14 +475,14 @@ void csDiagramView::ApplyPointSize(int pointSize) wxList selections; FindSelectedShapes(selections); - if (selections.Number() > 0) + if (selections.GetCount() > 0) { csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc); - wxNode* node = selections.First(); + wxNode* node = selections.GetFirst(); while (node) { - wxShape *theShape = (wxShape*) node->Data(); + wxShape *theShape = (wxShape*) node->GetData(); wxShape *newShape = theShape->CreateNewCopy(); wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize, @@ -498,7 +498,7 @@ void csDiagramView::ApplyPointSize(int pointSize) cmd->AddState(state); - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -531,23 +531,23 @@ void csDiagramView::SelectAll(bool select) wxList selections; FindSelectedShapes(selections); - wxNode* node = selections.First(); + wxNode* node = selections.GetFirst(); while (node) { - wxShape *theShape = (wxShape*) node->Data(); + wxShape *theShape = (wxShape*) node->GetData(); theShape->Select(FALSE, &dc); SelectShape(theShape, FALSE); - node = node->Next(); + node = node->GetNext(); } } else { csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); - wxNode *node = doc->GetDiagram()->GetShapeList()->First(); + wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape *eachShape = (wxShape *)node->Data(); + wxShape *eachShape = (wxShape *)node->GetData(); if (eachShape->GetParent() == NULL && !eachShape->IsKindOf(CLASSINFO(wxControlPoint)) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape))) @@ -555,7 +555,7 @@ void csDiagramView::SelectAll(bool select) eachShape->Select(TRUE, &dc); SelectShape(eachShape, TRUE); } - node = node->Next(); + node = node->GetNext(); } } } @@ -575,20 +575,20 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event)) wxList selections; FindSelectedShapes(selections, CLASSINFO(wxLineShape)); - if (selections.Number() > 0) + if (selections.GetCount() > 0) { csDiagramCommand* cmd = new csDiagramCommand(stateName, doc); - wxNode* node = selections.First(); + wxNode* node = selections.GetFirst(); while (node) { - wxLineShape *theShape = (wxLineShape*) node->Data(); + wxLineShape *theShape = (wxLineShape*) node->GetData(); wxLineShape *newShape = NULL; if (state) { // Add arrow - if (theShape->GetArrows().Number() == 0) + if (theShape->GetArrows().GetCount() == 0) { newShape = (wxLineShape*) theShape->CreateNewCopy(); newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead")); @@ -596,7 +596,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event)) } else { - if (theShape->GetArrows().Number() > 0) + if (theShape->GetArrows().GetCount() > 0) { newShape = (wxLineShape*) theShape->CreateNewCopy(); newShape->ClearArrowsAtPosition(); @@ -610,7 +610,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event)) cmd->AddState(state); } - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -620,7 +620,7 @@ void csDiagramView::OnToggleArrowToolUpdate(wxUpdateUIEvent& event) { wxList selections; FindSelectedShapes(selections, CLASSINFO(wxLineShape)); - event.Enable( (selections.Number() > 0) ); + event.Enable( (selections.GetCount() > 0) ); } // Make the point size combobox reflect this @@ -634,13 +634,13 @@ void csDiagramView::ReflectPointSize(int pointSize) void csDiagramView::ReflectArrowState(wxLineShape* lineShape) { bool haveArrow = FALSE; - wxNode *node = lineShape->GetArrows().First(); + wxNode *node = lineShape->GetArrows().GetFirst(); while (node) { - wxArrowHead *arrow = (wxArrowHead *)node->Data(); + wxArrowHead *arrow = (wxArrowHead *)node->GetData(); if (ARROW_POSITION_MIDDLE == arrow->GetArrowEnd()) haveArrow = TRUE; - node = node->Next(); + node = node->GetNext(); } wxGetApp().GetDiagramToolBar()->ToggleTool(DIAGRAM_TOOLBAR_LINE_ARROW, haveArrow); @@ -651,35 +651,35 @@ void csDiagramView::OnAlign(wxCommandEvent& event) // Make a copy of the selections, keeping only those shapes // that are top-level non-line shapes. wxList selections; - wxNode* node = GetSelectionList().First(); + wxNode* node = GetSelectionList().GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if ((shape->GetParent() == NULL) && (!shape->IsKindOf(CLASSINFO(wxLineShape)))) { selections.Append(shape); } - node = node->Next(); + node = node->GetNext(); } - if (selections.Number() == 0) + if (selections.GetCount() == 0) return; csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramCommand* cmd = new csDiagramCommand(_T("Align"), doc); - node = selections.First(); - wxShape* firstShape = (wxShape*) node->Data(); + node = selections.GetFirst(); + wxShape* firstShape = (wxShape*) node->GetData(); double x = firstShape->GetX(); double y = firstShape->GetY(); double width, height; firstShape->GetBoundingBoxMax(&width, &height); - node = selections.First(); + node = selections.GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape != firstShape) { /* double x1 = */ shape->GetX(); @@ -734,7 +734,7 @@ void csDiagramView::OnAlign(wxCommandEvent& event) csCommandState* state = new csCommandState(ID_CS_ALIGN, newShape, shape); cmd->AddState(state); } - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -743,7 +743,7 @@ void csDiagramView::OnAlignUpdate(wxUpdateUIEvent& event) { // This is an approximation, since there may be lines // amongst the selections. - event.Enable( (m_selections.Number() > 1) ) ; + event.Enable( (m_selections.GetCount() > 1) ) ; } void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event)) @@ -751,10 +751,10 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event)) csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc); - wxNode* node = m_selections.First(); + wxNode* node = m_selections.GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->IsKindOf(CLASSINFO(wxLineShape))) { wxShape* newShape = shape->CreateNewCopy(); @@ -762,7 +762,7 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event)) csCommandState* state = new csCommandState(ID_CS_NEW_POINT, newShape, shape); cmd->AddState(state); } - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -772,10 +772,10 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event)) csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc); - wxNode* node = m_selections.First(); + wxNode* node = m_selections.GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->IsKindOf(CLASSINFO(wxLineShape))) { wxShape* newShape = shape->CreateNewCopy(); @@ -783,7 +783,7 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event)) csCommandState* state = new csCommandState(ID_CS_CUT_POINT, newShape, shape); cmd->AddState(state); } - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -793,10 +793,10 @@ void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event)) csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc); - wxNode* node = m_selections.First(); + wxNode* node = m_selections.GetFirst(); while (node) { - wxShape* shape = (wxShape*) node->Data(); + wxShape* shape = (wxShape*) node->GetData(); if (shape->IsKindOf(CLASSINFO(wxLineShape))) { wxShape* newShape = shape->CreateNewCopy(); @@ -804,7 +804,7 @@ void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event)) csCommandState* state = new csCommandState(ID_CS_STRAIGHTEN, newShape, shape); cmd->AddState(state); } - node = node->Next(); + node = node->GetNext(); } doc->GetCommandProcessor()->Submit(cmd); } @@ -813,21 +813,21 @@ void csDiagramView::OnNewLinePointUpdate(wxUpdateUIEvent& event) { wxList selections; FindSelectedShapes(selections, CLASSINFO(wxLineShape)); - event.Enable( (selections.Number() > 0) ); + event.Enable( (selections.GetCount() > 0) ); } void csDiagramView::OnCutLinePointUpdate(wxUpdateUIEvent& event) { wxList selections; FindSelectedShapes(selections, CLASSINFO(wxLineShape)); - event.Enable( (selections.Number() > 0) ); + event.Enable( (selections.GetCount() > 0) ); } void csDiagramView::OnStraightenLinesUpdate(wxUpdateUIEvent& event) { wxList selections; FindSelectedShapes(selections, CLASSINFO(wxLineShape)); - event.Enable( (selections.Number() > 0) ); + event.Enable( (selections.GetCount() > 0) ); } /* @@ -999,10 +999,10 @@ void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys)) min_y = wxMin(y, sg_initialY); max_y = wxMax(y, sg_initialY); - wxNode *node = GetDiagram()->GetShapeList()->First(); + wxNode *node = GetDiagram()->GetShapeList()->GetFirst(); while (node) { - wxShape *shape = (wxShape *)node->Data(); + wxShape *shape = (wxShape *)node->GetData(); if (shape->GetParent() == NULL && !shape->IsKindOf(CLASSINFO(wxControlPoint))) { float image_x = shape->GetX(); @@ -1014,7 +1014,7 @@ void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys)) GetView()->SelectShape(shape, TRUE); } } - node = node->Next(); + node = node->GetNext(); } } diff --git a/contrib/src/deprecated/proplist.cpp b/contrib/src/deprecated/proplist.cpp index 2962502234..58cf7d29d8 100644 --- a/contrib/src/deprecated/proplist.cpp +++ b/contrib/src/deprecated/proplist.cpp @@ -1031,11 +1031,7 @@ bool wxBoolListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi return FALSE; wxString value(view->GetValueText()->GetValue()); - bool boolValue = FALSE; - if (value == wxT("True")) - boolValue = TRUE; - else - boolValue = FALSE; + bool boolValue = (value == wxT("True")); property->GetValue() = (bool)boolValue; return TRUE; } @@ -1258,7 +1254,7 @@ bool wxStringListValidator::OnDoubleClick( wxProperty *property, wxChar *s = node->GetData(); if (wxStrcmp(s, currentString) == 0) { - wxChar *nextString = NULL; + wxChar *nextString; if (node->GetNext()) nextString = node->GetNext()->GetData(); else diff --git a/contrib/src/deprecated/resource.cpp b/contrib/src/deprecated/resource.cpp index 4c148bb008..3d0188a9ec 100644 --- a/contrib/src/deprecated/resource.cpp +++ b/contrib/src/deprecated/resource.cpp @@ -164,13 +164,13 @@ wxItemResource::wxItemResource() wxItemResource::~wxItemResource() { - wxNode *node = m_children.First(); + wxNode *node = m_children.GetFirst(); while (node) { - wxItemResource *item = (wxItemResource *)node->Data(); + wxItemResource *item = (wxItemResource *)node->GetData(); delete item; delete node; - node = m_children.First(); + node = m_children.GetFirst(); } } @@ -215,11 +215,10 @@ bool wxResourceTable::DeleteResource(const wxString& name) // See if any resource has this as its child; if so, delete from // parent's child list. BeginFind(); - wxNode *node = (wxNode *) NULL; - node = Next(); + wxNode *node = Next(); while (node != NULL) { - wxItemResource *parent = (wxItemResource *)node->Data(); + wxItemResource *parent = (wxItemResource *)node->GetData(); if (parent->GetChildren().Member(item)) { parent->GetChildren().DeleteObject(item); @@ -314,7 +313,7 @@ void wxResourceTable::ClearTable() while (node) { wxNode *next = Next(); - wxItemResource *item = (wxItemResource *)node->Data(); + wxItemResource *item = (wxItemResource *)node->GetData(); delete item; delete node; node = next; @@ -464,17 +463,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; int noStrings = 0; - if (stringList.Number() > 0) + if (stringList.GetCount() > 0) { - noStrings = stringList.Number(); + noStrings = stringList.GetCount(); strings = new wxString[noStrings]; - wxNode *node = stringList.First(); + wxStringListNode *node = stringList.GetFirst(); int i = 0; while (node) { - strings[i] = (wxChar *)node->Data(); + strings[i] = (wxChar *)node->GetData(); i ++; - node = node->Next(); + node = node->GetNext(); } } control = new wxListBox(parent, id, pos, size, @@ -488,17 +487,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; int noStrings = 0; - if (stringList.Number() > 0) + if (stringList.GetCount() > 0) { - noStrings = stringList.Number(); + noStrings = stringList.GetCount(); strings = new wxString[noStrings]; - wxNode *node = stringList.First(); + wxStringListNode *node = stringList.GetFirst(); int i = 0; while (node) { - strings[i] = (wxChar *)node->Data(); + strings[i] = (wxChar *)node->GetData(); i ++; - node = node->Next(); + node = node->GetNext(); } } control = new wxChoice(parent, id, pos, size, @@ -513,17 +512,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; int noStrings = 0; - if (stringList.Number() > 0) + if (stringList.GetCount() > 0) { - noStrings = stringList.Number(); + noStrings = stringList.GetCount(); strings = new wxString[noStrings]; - wxNode *node = stringList.First(); + wxStringListNode *node = stringList.GetFirst(); int i = 0; while (node) { - strings[i] = (wxChar *)node->Data(); + strings[i] = (wxChar *)node->GetData(); i ++; - node = node->Next(); + node = node->GetNext(); } } control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size, @@ -538,17 +537,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c wxStringList& stringList = childResource->GetStringValues(); wxString *strings = (wxString *) NULL; int noStrings = 0; - if (stringList.Number() > 0) + if (stringList.GetCount() > 0) { - noStrings = stringList.Number(); + noStrings = stringList.GetCount(); strings = new wxString[noStrings]; - wxNode *node = stringList.First(); + wxStringListNode *node = stringList.GetFirst(); int i = 0; while (node) { - strings[i] = (wxChar *)node->Data(); + strings[i] = (wxChar *)node->GetData(); i ++; - node = node->Next(); + node = node->GetNext(); } } control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size, @@ -587,10 +586,10 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) { - wxNode *node = db.First(); + wxNode *node = db.GetFirst(); while (node) { - wxExpr *clause = (wxExpr *)node->Data(); + wxExpr *clause = (wxExpr *)node->GetData(); wxString functor(clause->Functor()); wxItemResource *item = (wxItemResource *) NULL; @@ -616,7 +615,7 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db) table.DeleteResource(item->GetName()); table.AddResource(item); } - node = node->Next(); + node = node->GetNext(); } return TRUE; } @@ -1543,7 +1542,7 @@ bool wxReallocateResourceBuffer() static bool wxEatWhiteSpace(FILE *fd) { - int ch = 0; + int ch; while ((ch = getc(fd)) != EOF) { @@ -2391,10 +2390,10 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table wxItemResource *optResource = (wxItemResource *) NULL; // Try to find optimum bitmap for this platform/colour depth - wxNode *node = item->GetChildren().First(); + wxNode *node = item->GetChildren().GetFirst(); while (node) { - wxItemResource *child = (wxItemResource *)node->Data(); + wxItemResource *child = (wxItemResource *)node->GetData(); int platform = (int)child->GetValue2(); int noColours = (int)child->GetValue3(); /* @@ -2465,7 +2464,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table default: break; } - node = node->Next(); + node = node->GetNext(); } // If no matching resource, fail. if (!optResource) @@ -2545,10 +2544,10 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) wxItemResource *optResource = (wxItemResource *) NULL; // Try to find optimum icon for this platform/colour depth - wxNode *node = item->GetChildren().First(); + wxNode *node = item->GetChildren().GetFirst(); while (node) { - wxItemResource *child = (wxItemResource *)node->Data(); + wxItemResource *child = (wxItemResource *)node->GetData(); int platform = (int)child->GetValue2(); int noColours = (int)child->GetValue3(); /* @@ -2619,7 +2618,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) default: break; } - node = node->Next(); + node = node->GetNext(); } // If no matching resource, fail. if (!optResource) @@ -2686,13 +2685,13 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table) wxMenu *wxResourceCreateMenu(wxItemResource *item) { wxMenu *menu = new wxMenu; - wxNode *node = item->GetChildren().First(); + wxNode *node = item->GetChildren().GetFirst(); while (node) { - wxItemResource *child = (wxItemResource *)node->Data(); + wxItemResource *child = (wxItemResource *)node->GetData(); if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator"))) menu->AppendSeparator(); - else if (child->GetChildren().Number() > 0) + else if (child->GetChildren().GetCount() > 0) { wxMenu *subMenu = wxResourceCreateMenu(child); if (subMenu) @@ -2702,7 +2701,7 @@ wxMenu *wxResourceCreateMenu(wxItemResource *item) { menu->Append((int)child->GetValue1(), child->GetTitle(), child->GetValue4(), (child->GetValue2() != 0)); } - node = node->Next(); + node = node->GetNext(); } return menu; } @@ -2717,14 +2716,14 @@ wxMenuBar *wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *ta { if (!menuBar) menuBar = new wxMenuBar; - wxNode *node = menuResource->GetChildren().First(); + wxNode *node = menuResource->GetChildren().GetFirst(); while (node) { - wxItemResource *child = (wxItemResource *)node->Data(); + wxItemResource *child = (wxItemResource *)node->GetData(); wxMenu *menu = wxResourceCreateMenu(child); if (menu) menuBar->Append(menu, child->GetTitle()); - node = node->Next(); + node = node->GetNext(); } return menuBar; } @@ -2876,7 +2875,7 @@ static int ungetc_string() bool wxEatWhiteSpaceString(char *s) { - int ch = 0; + int ch; while ((ch = getc_string(s)) != EOF) { @@ -2889,7 +2888,6 @@ bool wxEatWhiteSpaceString(char *s) break; case '/': { - int prev_ch = ch; ch = getc_string(s); if (ch == EOF) { @@ -2900,7 +2898,7 @@ bool wxEatWhiteSpaceString(char *s) if (ch == '*') { // Eat C comment - prev_ch = 0; + int prev_ch = 0; while ((ch = getc_string(s)) != EOF) { if (ch == '/' && prev_ch == '*') @@ -3251,14 +3249,14 @@ bool wxLoadFromResource(wxWindow* thisWindow, wxWindow *parent, const wxString& } // Now create children - wxNode *node = resource->GetChildren().First(); + wxNode *node = resource->GetChildren().GetFirst(); while (node) { - wxItemResource *childResource = (wxItemResource *)node->Data(); + wxItemResource *childResource = (wxItemResource *)node->GetData(); (void) wxCreateItem(thisWindow, childResource, resource, table); - node = node->Next(); + node = node->GetNext(); } return TRUE; } diff --git a/contrib/src/deprecated/wxexpr.cpp b/contrib/src/deprecated/wxexpr.cpp index f8450343cb..24ce21acc3 100644 --- a/contrib/src/deprecated/wxexpr.cpp +++ b/contrib/src/deprecated/wxexpr.cpp @@ -1020,7 +1020,7 @@ void wxExprDatabase::Append(wxExpr *clause) if (expr) { long functor_key = hash_table->MakeKey(WXSTRINGCAST functor); - long value_key = 0; + long value_key; if (expr && expr->Type() == wxExprString) { value_key = hash_table->MakeKey(WXSTRINGCAST expr->StringValue()); diff --git a/contrib/src/fl/bardragpl.cpp b/contrib/src/fl/bardragpl.cpp index a1ef597f87..c3f75adb6c 100644 --- a/contrib/src/fl/bardragpl.cpp +++ b/contrib/src/fl/bardragpl.cpp @@ -465,7 +465,10 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient ) if ( mpSrcPane->mProps.mExactDockPredictionOn && mpCurPane ) { - bool success = mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE ); + #ifdef __WXDEBUG__ + bool success = + #endif + mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE ); wxASSERT( success ); // DBG:: @@ -519,7 +522,10 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient ) mpDraggedBar->mUMgrData.SetDirty( TRUE ); - bool success = mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE ); + #ifdef __WXDEBUG__ + bool success = + #endif + mpLayout->RedockBar( mpDraggedBar, mHintRect, mpCurPane, FALSE ); wxASSERT( success ); // DBG :: diff --git a/contrib/src/fl/cbcustom.cpp b/contrib/src/fl/cbcustom.cpp index 1fca0c0b23..8dbf3430e0 100644 --- a/contrib/src/fl/cbcustom.cpp +++ b/contrib/src/fl/cbcustom.cpp @@ -167,7 +167,7 @@ void cbSimpleCustomizationPlugin::OnMenuItemSelected( wxCommandEvent& event ) // "inverse" bar-visibility of the selected bar - int newState = 0; + int newState; if ( pBar->mState == wxCBAR_HIDDEN ) { diff --git a/contrib/src/fl/controlbar.cpp b/contrib/src/fl/controlbar.cpp index 780f9960f8..aaf5c6decf 100644 --- a/contrib/src/fl/controlbar.cpp +++ b/contrib/src/fl/controlbar.cpp @@ -87,6 +87,9 @@ // some ascii-art, still can't get these *nice* cursors working on wx... :-( +/* +// FIXME:: see places where _gHorizCursorImg is used + static const char* _gHorizCursorImg[] = { "............XX....XX............", @@ -126,6 +129,7 @@ static const char* _gVertCursorImg[] = "...............XXX..............", "................X..............." }; +*/ // helper inline functions @@ -446,6 +450,8 @@ void wxFrameLayout::ShowFloatedWindows( bool show ) wxFrameLayout::~wxFrameLayout() { + size_t i; + UnhookFromFrame(); if ( mpUpdatesMgr ) @@ -474,7 +480,6 @@ wxFrameLayout::~wxFrameLayout() // destroy contents of arrays and lists - size_t i = 0; for ( i = 0; i != MAX_PANES; ++i ) { if ( mPanes[i] ) @@ -691,7 +696,10 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow ) cbDockPane* pPane; cbRowInfo* pRow; - bool success = LocateBar( pBar, &pRow, &pPane ); + #ifdef __WXDEBUG__ + bool success = + #endif + LocateBar( pBar, &pRow, &pPane ); wxASSERT( success ); // DBG:: @@ -773,7 +781,7 @@ void wxFrameLayout::InverseVisibility( cbBarInfo* pBar ) // "inverse" bar-visibility of the selected bar - int newState = 0; + int newState; if ( pBar->mState == wxCBAR_HIDDEN ) { @@ -1012,7 +1020,6 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow ) int frmWidth, frmHeight; mpFrame->GetClientSize( &frmWidth, &frmHeight ); - int paneHeight = 0; int curY = 0; int curX = 0; @@ -1028,7 +1035,7 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow ) pPane->SetPaneWidth( frmWidth ); pPane->RecalcLayout(); - paneHeight = pPane->GetPaneHeight(); + int paneHeight = pPane->GetPaneHeight(); rect.x = curX; rect.y = curY; @@ -1362,11 +1369,6 @@ void wxFrameLayout::ForwardMouseEvent( wxMouseEvent& event, cbMotionEvent evt( pos, pToPane ); FirePluginEvent( evt ); } - else - { - int avoidCompilerWarning = 0; - wxASSERT(avoidCompilerWarning); // DBG:: - } } // wxFrameLayout::ForwardMouseEvent() @@ -2235,7 +2237,7 @@ void cbDockPane::PaintRowBackground ( cbRowInfo* pRow, wxDC& dc ) void cbDockPane::PaintRowDecorations( cbRowInfo* pRow, wxDC& dc ) { - size_t i = 0; + size_t i; // decorations first for ( i = 0; i != pRow->mBars.Count(); ++i ) @@ -2271,9 +2273,9 @@ void cbDockPane::PaintPaneDecorations( wxDC& dc ) void cbDockPane::PaintPane( wxDC& dc ) { - PaintPaneBackground( dc ); + size_t i; - size_t i = 0; + PaintPaneBackground( dc ); // first decorations for ( i = 0; i != mRows.Count(); ++i ) @@ -2625,9 +2627,9 @@ bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar ) void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow ) { - int totalWidth = 0; + size_t i; - size_t i = 0; + int totalWidth = 0; // calc current-maximal-total-length of all maximized bars @@ -2781,7 +2783,7 @@ void cbDockPane::InitLinksForRows() void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo ) { - cbRowInfo* pRow = NULL; + cbRowInfo* pRow; if ( rowNo == -1 || rowNo >= (int)mRows.Count() ) { diff --git a/contrib/src/fl/dyntbar.cpp b/contrib/src/fl/dyntbar.cpp index 8e9697b75b..c30ce0668b 100644 --- a/contrib/src/fl/dyntbar.cpp +++ b/contrib/src/fl/dyntbar.cpp @@ -374,7 +374,7 @@ void wxDynamicToolBar::SizeToolWindows() bStateCheckDone = TRUE; size_t j; - wxDynToolInfo *pInfo = NULL; + wxDynToolInfo *pInfo; wxDynToolInfo *pPrevInfo = NULL; int nVertSeparators = 0; diff --git a/contrib/src/fl/frmview.cpp b/contrib/src/fl/frmview.cpp index 19d65e5efd..f06c94e6db 100644 --- a/contrib/src/fl/frmview.cpp +++ b/contrib/src/fl/frmview.cpp @@ -41,9 +41,6 @@ void wxFrameView::OnIdle( wxIdleEvent& event) if ( mDoToolUpdates ) { - int o = 0; //glt - ++o; - // TBD:: } } diff --git a/contrib/src/fl/garbagec.cpp b/contrib/src/fl/garbagec.cpp index 7f690b27f5..e0f95d02f5 100644 --- a/contrib/src/fl/garbagec.cpp +++ b/contrib/src/fl/garbagec.cpp @@ -69,10 +69,7 @@ wxNode* GarbageCollector::FindItemNode( void* pForObj ) pNode = pNode->GetNext(); } - int avoidCompilerWarning = 0; - wxASSERT(avoidCompilerWarning); // DBG:: item should be present - - return 0; + return NULL; } wxNode* GarbageCollector::FindReferenceFreeItemNode() diff --git a/contrib/src/fl/panedrawpl.cpp b/contrib/src/fl/panedrawpl.cpp index 9967106470..2568ca27f2 100644 --- a/contrib/src/fl/panedrawpl.cpp +++ b/contrib/src/fl/panedrawpl.cpp @@ -294,7 +294,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event ) return; } - wxCursor* pCurs = NULL; + wxCursor* pCurs; if ( testResult == CB_UPPER_ROW_HANDLE_HITTED || testResult == CB_LOWER_ROW_HANDLE_HITTED) diff --git a/contrib/src/fl/rowdragpl.cpp b/contrib/src/fl/rowdragpl.cpp index 56b569b093..21bd0e653a 100644 --- a/contrib/src/fl/rowdragpl.cpp +++ b/contrib/src/fl/rowdragpl.cpp @@ -226,21 +226,11 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event ) if ( mpPane->IsHorizontal() ) { - // DBG:: - wxPoint p = event.mPos; - wxPoint d = mDragOrigin; -// int dif = event.mPos.x - mDragOrigin.x; - // row is dragged up or down; ShowDraggedRow( pos.y - mDragOrigin.y ); } else { - // DBG:: - wxPoint p = event.mPos; - wxPoint d = mDragOrigin; -// int dif = event.mPos.x - mDragOrigin.x; - // row is dragged left or right ShowDraggedRow( pos.x - mDragOrigin.x ); } diff --git a/contrib/src/fl/rowlayoutpl.cpp b/contrib/src/fl/rowlayoutpl.cpp index 84bdc7e111..e500194447 100644 --- a/contrib/src/fl/rowlayoutpl.cpp +++ b/contrib/src/fl/rowlayoutpl.cpp @@ -219,8 +219,8 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* WXUNUSED(pRow), cbBar void cbRowLayoutPlugin::FitBarsToRange( int from, int till, cbBarInfo* pTheBar, cbRowInfo* pRow ) { - cbBarInfo* pFromBar = NULL; - cbBarInfo* pTillBar = NULL; + cbBarInfo* pFromBar; + cbBarInfo* pTillBar; if ( pTheBar->mBounds.x > from ) { @@ -400,11 +400,11 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow ) void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow ) { + size_t i; double pcntSum = 0; // FOR NOW:: all-in-one - size_t i = 0; for ( i = 0; i != pRow->mBars.Count(); ++i ) { if ( !pRow->mBars[i]->IsFixed() ) @@ -1109,8 +1109,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event ) // FIXME:: Next line not used. //int newHeight = pTheRow->mRowHeight; - int freeSpc = 0; - if ( forUpperHandle ) { // calculate available free space from above, @@ -1120,8 +1118,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event ) while( pRow ) { - freeSpc += pRow->mRowHeight - event.mpPane->GetMinimalRowHeight( pRow ); - pRow = pRow->mpPrev; } } @@ -1134,8 +1130,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event ) while( pRow ) { - freeSpc += pRow->mRowHeight - mpPane->GetMinimalRowHeight( pRow ); - pRow = pRow->mpNext; } } diff --git a/contrib/src/ogl/basic.cpp b/contrib/src/ogl/basic.cpp index 95f6993b8b..3a7abc3fa1 100644 --- a/contrib/src/ogl/basic.cpp +++ b/contrib/src/ogl/basic.cpp @@ -2064,7 +2064,7 @@ void wxShape::ReadRegions(wxExpr *clause) wxChar regionNameBuf[20]; wxChar textNameBuf[20]; - wxExpr *regionExpr = NULL; + wxExpr *regionExpr; wxExpr *textExpr = NULL; wxSprintf(regionNameBuf, _T("region%d"), regionNo); wxSprintf(textNameBuf, _T("text%d"), regionNo); @@ -2896,8 +2896,7 @@ wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPo // Return the zero-based position in m_lines of line. int wxShape::GetLinePosition(wxLineShape* line) { - size_t i = 0; - for (i = 0; i < m_lines.GetCount(); i++) + for (size_t i = 0; i < m_lines.GetCount(); i++) if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line) return i; diff --git a/contrib/src/ogl/basic2.cpp b/contrib/src/ogl/basic2.cpp index 39093dd57e..b79a6c7545 100644 --- a/contrib/src/ogl/basic2.cpp +++ b/contrib/src/ogl/basic2.cpp @@ -203,15 +203,12 @@ bool PolylineHitTest(double n, double xvec[], double yvec[], double line_ratio; double other_ratio; -// char buf[300]; for (i = 1; i < n; i++) { oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i], &line_ratio, &other_ratio); if (line_ratio != 1.0) isAHit = TRUE; -// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio); -// ClipsErrorFunction(buf); lastx = xvec[i]; lasty = yvec[i]; @@ -226,13 +223,8 @@ bool PolylineHitTest(double n, double xvec[], double yvec[], &line_ratio, &other_ratio); if (line_ratio != 1.0) isAHit = TRUE; -// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio); -// ClipsErrorFunction(buf); - if (line_ratio < min_ratio) - min_ratio = line_ratio; } -// ClipsErrorFunction("\n"); return isAHit; } diff --git a/contrib/src/ogl/canvas.cpp b/contrib/src/ogl/canvas.cpp index d4ba237e52..6c3bb4d561 100644 --- a/contrib/src/ogl/canvas.cpp +++ b/contrib/src/ogl/canvas.cpp @@ -449,7 +449,6 @@ wxShape *wxShapeCanvas::FindShape(double x, double y, int *attachment, wxClassIn // Check for division in case line straddles divisions (i.e. is not wholly contained). if (!nearest_object || !(object->IsKindOf(CLASSINFO(wxDivisionShape)) || WhollyContains(object, nearest_object))) { - nearest = dist; nearest_object = object; nearest_attachment = temp_attachment; current = NULL; diff --git a/contrib/src/ogl/composit.cpp b/contrib/src/ogl/composit.cpp index 724c10d6db..05eeefd2a3 100644 --- a/contrib/src/ogl/composit.cpp +++ b/contrib/src/ogl/composit.cpp @@ -693,11 +693,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) haveConstraints = FALSE; break; } - int cType = 0; - double cXSpacing = 0.0; - double cYSpacing = 0.0; wxString cName = wxEmptyString; - long cId = 0; wxShape *m_constrainingObject = NULL; wxList m_constrainedObjects; @@ -712,11 +708,11 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database) wxExpr *constrainingExpr = constraintExpr->Nth(5); wxExpr *constrainedExpr = constraintExpr->Nth(6); - cType = (int)typeExpr->IntegerValue(); - cXSpacing = xExpr->RealValue(); - cYSpacing = yExpr->RealValue(); + int cType = (int)typeExpr->IntegerValue(); + double cXSpacing = xExpr->RealValue(); + double cYSpacing = yExpr->RealValue(); cName = nameExpr->StringValue(); - cId = idExpr->IntegerValue(); + long cId = idExpr->IntegerValue(); wxExpr *objExpr1 = database->HashFind(_T("node_image"), constrainingExpr->IntegerValue()); if (objExpr1 && objExpr1->GetClientData()) @@ -1180,8 +1176,8 @@ void wxDivisionShape::MakeMandatoryControlPoints() double maxX, maxY; GetBoundingBoxMax(&maxX, &maxY); - double x, y; - int direction; + double x = 0.0 , y = 0.0; + int direction = 0; /* if (m_leftSide) { @@ -1585,8 +1581,7 @@ public: }; BEGIN_EVENT_TABLE(OGLPopupDivisionMenu, wxMenu) - EVT_CUSTOM_RANGE(wxEVT_COMMAND_MENU_SELECTED, - DIVISION_MENU_SPLIT_HORIZONTALLY, + EVT_MENU_RANGE(DIVISION_MENU_SPLIT_HORIZONTALLY, DIVISION_MENU_EDIT_BOTTOM_EDGE, OGLPopupDivisionMenu::OnMenu) END_EVENT_TABLE() diff --git a/contrib/src/ogl/divided.cpp b/contrib/src/ogl/divided.cpp index 92448da749..41e62564d3 100644 --- a/contrib/src/ogl/divided.cpp +++ b/contrib/src/ogl/divided.cpp @@ -243,18 +243,8 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y, // Left or right. else { - int i = 0; - bool isLeft = FALSE; - if (attachment < (n+1)) - { - i = attachment-1; - isLeft = FALSE; - } - else - { - i = (totalNumberAttachments - attachment - 1); - isLeft = TRUE; - } + bool isLeft = !(attachment < (n+1)); + int i = (isLeft) ? (totalNumberAttachments - attachment - 1) : (attachment-1); wxNode *node = GetRegions().Item(i); if (node) { diff --git a/contrib/src/ogl/drawn.cpp b/contrib/src/ogl/drawn.cpp index 15b1863a49..20bea6a216 100644 --- a/contrib/src/ogl/drawn.cpp +++ b/contrib/src/ogl/drawn.cpp @@ -89,8 +89,7 @@ void wxDrawnShape::SetSize(double w, double h, bool WXUNUSED(recursive)) scaleY = 1.0; else scaleY = h/GetHeight(); - int i = 0; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { if (m_metafiles[i].IsValid()) m_metafiles[i].Scale(scaleX, scaleY); @@ -242,8 +241,7 @@ void wxDrawnShape::WriteAttributes(wxExpr *clause) clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile); if (m_saveToFile) { - int i = 0; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { if (m_metafiles[i].IsValid()) m_metafiles[i].WriteAttributes(clause, i); @@ -262,8 +260,7 @@ void wxDrawnShape::ReadAttributes(wxExpr *clause) if (m_saveToFile) { - int i = 0; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { m_metafiles[i].ReadAttributes(clause, i); } @@ -280,8 +277,7 @@ void wxDrawnShape::Copy(wxShape& copy) wxDrawnShape& drawnCopy = (wxDrawnShape&) copy; - int i = 0; - for (i = 0; i < 4; i++) + for (int i = 0; i < 4; i++) { m_metafiles[i].Copy(drawnCopy.m_metafiles[i]); } @@ -1261,8 +1257,7 @@ bool wxOpPolyDraw::GetPerimeterPoint(double x1, double y1, double *xpoints = new double[n]; double *ypoints = new double[n]; - int i = 0; - for (i = 0; i < n; i++) + for (int i = 0; i < n; i++) { wxRealPoint *point = & (m_points[i]); xpoints[i] = point->x + xOffset; diff --git a/contrib/src/ogl/lines.cpp b/contrib/src/ogl/lines.cpp index 850c19434b..c3a378c13e 100644 --- a/contrib/src/ogl/lines.cpp +++ b/contrib/src/ogl/lines.cpp @@ -115,8 +115,7 @@ void wxLineShape::MakeLineControlPoints(int n) } m_lineControlPoints = new wxList; - int i = 0; - for (i = 0; i < n; i++) + for (int i = 0; i < n; i++) { wxRealPoint *point = new wxRealPoint(-999, -999); m_lineControlPoints->Append((wxObject*) point); @@ -598,7 +597,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p double positionOnLineX, positionOnLineY; // Position of start point of line, at the end of which we draw the arrow. - double startPositionX, startPositionY; + double startPositionX = 0.0 , startPositionY = 0.0; switch (arrow->GetPosition()) { @@ -691,7 +690,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p double y3 = positionOnLineY; double d = -arrow->GetYOffset(); // Negate so +offset is above line - double theta = 0.0; + double theta; if (x3 == x1) theta = (double)(myPi/2.0); else @@ -2036,9 +2035,9 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int return TRUE; } + wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData(); while (refNode && currNode) { - wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData(); refArrow = (wxArrowHead *)refNode->GetData(); // Matching: advance current arrow pointer @@ -2318,7 +2317,7 @@ int wxLineShape::GetAlignmentType(bool isEnd) wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject) { int n = m_lineControlPoints->GetCount(); - int nn = 0; + int nn; if (m_to == nodeObject) { // Must be END of line, so we want (n - 1)th control point. diff --git a/contrib/src/ogl/mfutils.cpp b/contrib/src/ogl/mfutils.cpp index 17111d481e..1fc7848fcb 100644 --- a/contrib/src/ogl/mfutils.cpp +++ b/contrib/src/ogl/mfutils.cpp @@ -33,18 +33,6 @@ static char _buf[1024]; // a temp buffer to use inplace of wxBuffer, which is deprecated. -static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', - 'C', 'D', 'E', 'F' }; - -static void DecToHex(int dec, char *buf) -{ - int firstDigit = (int)(dec/16.0); - int secondDigit = (int)(dec - (firstDigit*16.0)); - buf[0] = hexArray[firstDigit]; - buf[1] = hexArray[secondDigit]; - buf[2] = 0; -} - // 16-bit unsigned integer static unsigned int getshort(FILE *fp) { @@ -64,7 +52,7 @@ static int getsignedshort(FILE *fp) int testRes = ((unsigned int) c) + (((unsigned int) c1) << 8); #endif unsigned long res1 = ((unsigned int) c) + (((unsigned int) c1) << 8); - int res = 0; + int res; if (res1 > 32767) res = (int)(res1 - 65536); else diff --git a/contrib/src/ogl/ogldiag.cpp b/contrib/src/ogl/ogldiag.cpp index 1f7be29092..b4edc56ff3 100644 --- a/contrib/src/ogl/ogldiag.cpp +++ b/contrib/src/ogl/ogldiag.cpp @@ -231,7 +231,7 @@ bool wxDiagram::SaveFile(const wxString& filename) if (!shape->IsKindOf(CLASSINFO(wxControlPoint))) { - wxExpr *expr = NULL; + wxExpr *expr; if (shape->IsKindOf(CLASSINFO(wxLineShape))) expr = new wxExpr(_T("line")); else @@ -239,7 +239,7 @@ bool wxDiagram::SaveFile(const wxString& filename) OnShapeSave(*database, *shape, *expr); } - node = node->Next(); + node = node->GetNext(); } OnDatabaseSave(*database); @@ -308,14 +308,14 @@ bool wxDiagram::LoadFile(const wxString& filename) OnHeaderLoad(database, *header); // Scan through all clauses and register the ids - wxNode *node = database.First(); + wxNode *node = database.GetFirst(); while (node) { wxExpr *clause = (wxExpr *)node->GetData(); long id = -1; clause->GetAttributeValue(_T("id"), id); wxRegisterId(id); - node = node->Next(); + node = node->GetNext(); } ReadNodes(database); @@ -534,13 +534,13 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr) if (shape.IsKindOf(CLASSINFO(wxCompositeShape))) { - wxNode *node = shape.GetChildren().First(); + wxNode *node = shape.GetChildren().GetFirst(); while (node) { wxShape *childShape = (wxShape *)node->GetData(); wxExpr *childExpr = new wxExpr(_T("shape")); OnShapeSave(db, *childShape, *childExpr); - node = node->Next(); + node = node->GetNext(); } } diff --git a/contrib/src/ogl/oglmisc.cpp b/contrib/src/ogl/oglmisc.cpp index 0b0d9b83a2..b0fdf825f7 100644 --- a/contrib/src/ogl/oglmisc.cpp +++ b/contrib/src/ogl/oglmisc.cpp @@ -360,7 +360,6 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, long current_width = 0; wxNode *current = text_list->GetFirst(); - int i = 0; while (current) { wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); @@ -369,7 +368,6 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list, if (current_width > max_width) max_width = current_width; current = current->GetNext(); - i ++; } *actual_height = n*char_height; -- 2.45.2