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
This commit is contained in:
Mattia Barbon
2003-11-09 21:40:34 +00:00
parent 6937991694
commit 8552e6f031
42 changed files with 370 additions and 416 deletions

View File

@@ -156,6 +156,11 @@ public:
const wxString& labelText = wxT(""), bool alignTextRight = FALSE, const wxString& labelText = wxT(""), bool alignTextRight = FALSE,
bool isFlat = TRUE ); bool isFlat = TRUE );
// Unhide method from parent.
virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool)
{ return wxToolBarBase::AddTool(tool); };
// Method from wxToolBarBase (for compatibility), only // Method from wxToolBarBase (for compatibility), only
// the first two arguments are valid. // the first two arguments are valid.
// See the documentation for wxToolBar for details. // See the documentation for wxToolBar for details.
@@ -166,7 +171,12 @@ public:
// Adds a separator. See the documentation for wxToolBar for details. // 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. // Returns tool information for the given tool index.

View File

@@ -145,6 +145,11 @@ public:
// Sets the label and optionally label text. // Sets the label and optionally label text.
virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = wxT("") ); 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. // Sets the text alignment and margins.
virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM, virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM,
int marginX = NB_DEFAULT_MARGIN, int marginX = NB_DEFAULT_MARGIN,

View File

@@ -97,7 +97,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, cons
// Define the behaviour for the frame closing // Define the behaviour for the frame closing
// - must delete all frames except for the main one. // - must delete all frames except for the main one.
void MyFrame::OnCloseWindow(wxCloseEvent& event) void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
{ {
if (wxGetApp().m_childWindow) if (wxGetApp().m_childWindow)
{ {
@@ -107,32 +107,32 @@ void MyFrame::OnCloseWindow(wxCloseEvent& event)
Destroy(); Destroy();
} }
void MyFrame::OnQuit(wxCommandEvent& event) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{ {
Close(TRUE); Close(TRUE);
} }
void MyFrame::OnDialogList(wxCommandEvent& event) void MyFrame::OnDialogList(wxCommandEvent& WXUNUSED(event))
{ {
wxGetApp().PropertyListTest(TRUE); wxGetApp().PropertyListTest(TRUE);
} }
void MyFrame::OnFrameList(wxCommandEvent& event) void MyFrame::OnFrameList(wxCommandEvent& WXUNUSED(event))
{ {
wxGetApp().PropertyListTest(FALSE); wxGetApp().PropertyListTest(FALSE);
} }
void MyFrame::OnDialogForm(wxCommandEvent& event) void MyFrame::OnDialogForm(wxCommandEvent& WXUNUSED(event))
{ {
wxGetApp().PropertyFormTest(TRUE); wxGetApp().PropertyFormTest(TRUE);
} }
void MyFrame::OnFrameForm(wxCommandEvent& event) void MyFrame::OnFrameForm(wxCommandEvent& WXUNUSED(event))
{ {
wxGetApp().PropertyFormTest(FALSE); 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")); (void)wxMessageBox(_T("Property Classes Demo\nAuthor: Julian Smart"), _T("About Property Classes Test"));
} }

View File

@@ -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); Close(TRUE);
} }
void MyFrame::OnLeftRight(wxCommandEvent& event) void MyFrame::OnLeftRight(wxCommandEvent& WXUNUSED(event))
{ {
if (myTree) if (myTree)
{ {
@@ -170,7 +170,7 @@ void MyFrame::OnLeftRight(wxCommandEvent& event)
} }
} }
void MyFrame::OnTopBottom(wxCommandEvent& event) void MyFrame::OnTopBottom(wxCommandEvent& WXUNUSED(event))
{ {
if (myTree) 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)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(); Destroy();
} }
@@ -205,7 +205,7 @@ MyCanvas::MyCanvas(wxWindow *parent):
} }
// Define the repainting behaviour // Define the repainting behaviour
void MyCanvas::OnPaint(wxPaintEvent& event) void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
{ {
wxPaintDC dc(this); wxPaintDC dc(this);
PrepareDC(dc); PrepareDC(dc);

View File

@@ -96,17 +96,17 @@ BEGIN_EVENT_TABLE( MyFrame, wxFrame )
EVT_MENU( NEW_TEST_EXIT, MyFrame::OnExit ) EVT_MENU( NEW_TEST_EXIT, MyFrame::OnExit )
END_EVENT_TABLE() END_EVENT_TABLE()
void MyFrame::OnLoad( wxCommandEvent& event ) void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
{ {
wxMessageBox(_T("Hey - you found a BIG question-mark !!")); 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 !!")); wxMessageBox(_("Hey - you found another BIG question-mark !!"));
} }
void MyFrame::OnExit( wxCommandEvent& event ) void MyFrame::OnExit( wxCommandEvent& WXUNUSED(event) )
{ {
Destroy(); Destroy();
} }

View File

@@ -166,6 +166,8 @@ MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h
mImageList( 16,16, FALSE, 2 ) mImageList( 16,16, FALSE, 2 )
{ {
int i;
mpInternalFrm = (wxPanel*)this; mpInternalFrm = (wxPanel*)this;
mAboutBox.Create( this, -1, _T("About box in wxWindows style..."), 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), wxSize( 385,220),
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL ); wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
int i = 0;
for( i = 0; i != MAX_LAYOUTS; ++i ) for( i = 0; i != MAX_LAYOUTS; ++i )
mLayouts[i] = NULL; mLayouts[i] = NULL;
@@ -240,17 +241,17 @@ bool MyFrame::OnClose(void)
return TRUE; return TRUE;
} }
void MyFrame::OnLoad( wxCommandEvent& event ) void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
{ {
wxMessageBox(_("Hey - you found a BIG question-mark !!")); 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 !!")); wxMessageBox(_("Hey - you found another BIG question-mark !!"));
} }
void MyFrame::OnAutoSave( wxCommandEvent& event ) void MyFrame::OnAutoSave( wxCommandEvent& WXUNUSED(event) )
{ {
mAutoSave = !mAutoSave; mAutoSave = !mAutoSave;
@@ -260,14 +261,14 @@ void MyFrame::OnAutoSave( wxCommandEvent& event )
SyncMenuBarItems(); SyncMenuBarItems();
} }
void MyFrame::OnRemove( wxCommandEvent& event ) void MyFrame::OnRemove( wxCommandEvent& WXUNUSED(event) )
{ {
RemoveLayout( mActiveLayoutNo ); RemoveLayout( mActiveLayoutNo );
Refresh(); Refresh();
} }
void MyFrame::OnRemoveAll( wxCommandEvent& event ) void MyFrame::OnRemoveAll( wxCommandEvent& WXUNUSED(event) )
{ {
for( int i = 0; i != MAX_LAYOUTS; ++i ) for( int i = 0; i != MAX_LAYOUTS; ++i )
{ {
@@ -287,22 +288,22 @@ void MyFrame::OnRecreate( wxCommandEvent& event )
mLayouts[mActiveLayoutNo]->Activate(); mLayouts[mActiveLayoutNo]->Activate();
} }
void MyFrame::OnFirst( wxCommandEvent& event ) void MyFrame::OnFirst( wxCommandEvent& WXUNUSED(event) )
{ {
ActivateLayout( FIRST_LAYOUT ); ActivateLayout( FIRST_LAYOUT );
} }
void MyFrame::OnSecond( wxCommandEvent& event ) void MyFrame::OnSecond( wxCommandEvent& WXUNUSED(event) )
{ {
ActivateLayout( SECOND_LAYOUT ); ActivateLayout( SECOND_LAYOUT );
} }
void MyFrame::OnThird( wxCommandEvent& event ) void MyFrame::OnThird( wxCommandEvent& WXUNUSED(event) )
{ {
ActivateLayout( THIRD_LAYOUT ); ActivateLayout( THIRD_LAYOUT );
} }
void MyFrame::OnQuit( wxCommandEvent& event ) void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
{ {
// USEFUL TRICK:: avoids flickering of application's frame // USEFUL TRICK:: avoids flickering of application's frame
// when closing NN windows on exit: // when closing NN windows on exit:
@@ -321,7 +322,7 @@ void MyFrame::OnQuit( wxCommandEvent& event )
Destroy(); Destroy();
} }
void MyFrame::OnAbout( wxCommandEvent& event ) void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
{ {
wxFont font; wxFont font;
#ifdef __WXMSW__ #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!") ); 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); mAboutBox.Show(FALSE);
} }
void MyFrame::OnBtnNo( wxCommandEvent& event ) void MyFrame::OnBtnNo( wxCommandEvent& WXUNUSED(event) )
{ {
mAboutBox.Show(FALSE); mAboutBox.Show(FALSE);
} }
void MyFrame::OnBtnEsc( wxCommandEvent& event ) void MyFrame::OnBtnEsc( wxCommandEvent& WXUNUSED(event) )
{ {
mAboutBox.Show(FALSE); mAboutBox.Show(FALSE);
} }
@@ -524,7 +525,7 @@ wxChoice* MyFrame::CreateChoice( const wxString& txt )
// helper // helper
void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent ) void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pParent) )
{ {
cbDimInfo sizes2( 275,38, // when docked horizontally cbDimInfo sizes2( 275,38, // when docked horizontally
45,275, // when docked vertically 45,275, // when docked vertically
@@ -927,14 +928,14 @@ BEGIN_EVENT_TABLE( StartButton95, wxPanel )
EVT_PAINT ( StartButton95::OnPaint ) EVT_PAINT ( StartButton95::OnPaint )
END_EVENT_TABLE() END_EVENT_TABLE()
void StartButton95::OnMouseDown( wxMouseEvent& event ) void StartButton95::OnMouseDown( wxMouseEvent& WXUNUSED(event) )
{ {
m_bPressed = TRUE; m_bPressed = TRUE;
Refresh(); Refresh();
CaptureMouse(); CaptureMouse();
} }
void StartButton95::OnMouseUp( wxMouseEvent& event ) void StartButton95::OnMouseUp( wxMouseEvent& WXUNUSED(event) )
{ {
// "this is not a bug" // "this is not a bug"
@@ -943,8 +944,7 @@ void StartButton95::OnMouseUp( wxMouseEvent& event )
::wxSetCursor( wxCURSOR_WAIT ); ::wxSetCursor( wxCURSOR_WAIT );
wxSleep(1); wxSleep(1);
int i = 0; for( int i = 1; i != 6; ++i )
for( i = 1; i != 6; ++i )
{ {
m_bPressed = (i % 2) != 0; m_bPressed = (i % 2) != 0;
Refresh(); Refresh();
@@ -954,9 +954,9 @@ void StartButton95::OnMouseUp( wxMouseEvent& event )
//*((char*)(i)-3) = 'X'; // Aleks what's the meaning of this??? //*((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 ) if ( m_bPressed )
{ {

View File

@@ -102,7 +102,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
END_EVENT_TABLE() END_EVENT_TABLE()
MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
: wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition, : wxFrame( parent, -1, title, wxDefaultPosition,
wxSize( 700, 500 ), wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
@@ -177,17 +177,17 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
return pCtrl; return pCtrl;
} }
void MyFrame::OnLoad( wxCommandEvent& event ) void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
{ {
wxMessageBox(wxT("Hey - you found a BIG question-mark !!")); 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 !!")); 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 Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction

View File

@@ -103,7 +103,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
END_EVENT_TABLE() END_EVENT_TABLE()
MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
: wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition, : wxFrame( parent, -1, title, wxDefaultPosition,
wxSize( 700, 500 ), wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
@@ -175,17 +175,17 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
return pCtrl; return pCtrl;
} }
void MyFrame::OnLoad( wxCommandEvent& event ) void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
{ {
wxMessageBox(wxT("Hey - you found a BIG question-mark !!")); 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 !!")); 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 Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction

View File

@@ -108,7 +108,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
END_EVENT_TABLE() END_EVENT_TABLE()
MyFrame::MyFrame( wxWindow* parent, const wxChar *title ) MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
: wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition, : wxFrame( parent, -1, title, wxDefaultPosition,
wxSize( 700, 500 ), wxSize( 700, 500 ),
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION, wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
@@ -202,24 +202,24 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
return pCtrl; return pCtrl;
} }
void MyFrame::OnLoad( wxCommandEvent& event ) void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
{ {
wxMessageBox(_("Hey - you found a BIG question-mark !!")); 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 !!")); 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 Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
Close(TRUE); Close(TRUE);
} }
void MyFrame::OnButt( wxCommandEvent& event ) void MyFrame::OnButt( wxCommandEvent& WXUNUSED(event) )
{ {
static int i =0; static int i =0;
@@ -266,7 +266,7 @@ void MyFrame::OnButt( wxCommandEvent& event )
i++; i++;
} }
void MyFrame::OnButt2( wxCommandEvent& event ) void MyFrame::OnButt2( wxCommandEvent& WXUNUSED(event) )
{ {
static int i =0; static int i =0;

View File

@@ -222,7 +222,7 @@ bool DiagramCommand::Do(void)
} }
case OGLEDIT_ADD_SHAPE: case OGLEDIT_ADD_SHAPE:
{ {
wxShape *theShape = NULL; wxShape *theShape;
if (shape) if (shape)
theShape = shape; // Saved from undoing the shape theShape = shape; // Saved from undoing the shape
else else
@@ -253,7 +253,7 @@ bool DiagramCommand::Do(void)
} }
case OGLEDIT_ADD_LINE: case OGLEDIT_ADD_LINE:
{ {
wxShape *theShape = NULL; wxShape *theShape;
if (shape) if (shape)
theShape = shape; // Saved from undoing the line theShape = shape; // Saved from undoing the line
else else
@@ -424,13 +424,13 @@ bool DiagramCommand::Undo(void)
// Remove each individual line connected to a shape by sending a command. // Remove each individual line connected to a shape by sending a command.
void DiagramCommand::RemoveLines(wxShape *shape) void DiagramCommand::RemoveLines(wxShape *shape)
{ {
wxNode *node = shape->GetLines().First(); wxNode *node = shape->GetLines().GetFirst();
while (node) 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)); 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 // Ensure no other shape is selected, to simplify Undo/Redo code
bool redraw = FALSE; bool redraw = FALSE;
wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->Data(); wxShape *eachShape = (wxShape *)node->GetData();
if (eachShape->GetParent() == NULL) if (eachShape->GetParent() == NULL)
{ {
if (eachShape->Selected()) if (eachShape->Selected())
@@ -467,7 +467,7 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
redraw = TRUE; redraw = TRUE;
} }
} }
node = node->Next(); node = node->GetNext();
} }
GetShape()->Select(TRUE, &dc); GetShape()->Select(TRUE, &dc);
if (redraw) if (redraw)

View File

@@ -72,7 +72,6 @@ bool MyApp::OnInit(void)
//// Make a menubar //// Make a menubar
wxMenu *file_menu = new wxMenu; wxMenu *file_menu = new wxMenu;
wxMenu *edit_menu = NULL;
file_menu->Append(wxID_NEW, _T("&New...")); file_menu->Append(wxID_NEW, _T("&New..."));
file_menu->Append(wxID_OPEN, _T("&Open...")); 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_PRINT_SETUP, _T("Print &Setup..."));
file_menu->Append(wxID_PREVIEW, _T("Print Pre&view")); 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_UNDO, _T("&Undo"));
edit_menu->Append(wxID_REDO, _T("&Redo")); edit_menu->Append(wxID_REDO, _T("&Redo"));
edit_menu->AppendSeparator(); edit_menu->AppendSeparator();

View File

@@ -127,16 +127,16 @@ void DiagramView::OnDraw(wxDC *dc)
if (diagram_p->GetShapeList()) if (diagram_p->GetShapeList())
{ {
/* wxCursor *old_cursor = NULL; */ /* 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 while (current) // Loop through the entire list of shapes
{ {
wxShape *object = (wxShape *)current->Data(); wxShape *object = (wxShape *)current->GetData();
if (!object->GetParent()) if (!object->GetParent())
{ {
object->Draw(* dc); // Draw the shape onto our printing dc 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. dc->EndDrawing(); // Allows optimization of drawing code under MS Windows.
@@ -177,16 +177,16 @@ wxShape *DiagramView::FindSelectedShape(void)
{ {
DiagramDocument *doc = (DiagramDocument *)GetDocument(); DiagramDocument *doc = (DiagramDocument *)GetDocument();
wxShape *theShape = NULL; wxShape *theShape = NULL;
wxNode *node = doc->GetDiagram()->GetShapeList()->First(); wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->Data(); wxShape *eachShape = (wxShape *)node->GetData();
if ((eachShape->GetParent() == NULL) && eachShape->Selected()) if ((eachShape->GetParent() == NULL) && eachShape->Selected())
{ {
theShape = eachShape; theShape = eachShape;
node = NULL; node = NULL;
} }
else node = node->Next(); else node = node->GetNext();
} }
return theShape; return theShape;
} }

View File

@@ -70,10 +70,10 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
// First copy all node shapes. // First copy all node shapes.
wxList* shapeList = diagramFrom->GetShapeList(); wxList* shapeList = diagramFrom->GetShapeList();
wxNode* node = shapeList->First(); wxNode* node = shapeList->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape))) if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxShape* newShape = shape->CreateNewCopy(); wxShape* newShape = shape->CreateNewCopy();
@@ -90,13 +90,13 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
OnAddShape(diagramTo, newShape, dc); OnAddShape(diagramTo, newShape, dc);
} }
node = node->Next(); node = node->GetNext();
} }
node = shapeList->First(); node = shapeList->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (((diagramFrom == this) || shape->Selected()) && shape->IsKindOf(CLASSINFO(wxLineShape))) if (((diagramFrom == this) || shape->Selected()) && shape->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxLineShape* lineShape = (wxLineShape*) shape; 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 // Now make sure line ordering is correct
node = shapeList->First(); node = shapeList->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape))) if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxShape* newShape = (wxShape*) mapping.Get((long) shape); 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. // 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. // Then apply the list of new lines to the shape.
wxList newLines; wxList newLines;
wxNode* lineNode = shape->GetLines().First(); wxNode* lineNode = shape->GetLines().GetFirst();
while (lineNode) while (lineNode)
{ {
wxLineShape* lineShape = (wxLineShape*) lineNode->Data(); wxLineShape* lineShape = (wxLineShape*) lineNode->GetData();
if ((diagramFrom == this) || (lineShape->GetTo()->Selected() && lineShape->GetFrom()->Selected())) if ((diagramFrom == this) || (lineShape->GetTo()->Selected() && lineShape->GetFrom()->Selected()))
{ {
wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape); wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape);
@@ -150,13 +150,13 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
newLines.Append(newLineShape); newLines.Append(newLineShape);
} }
lineNode = lineNode->Next(); lineNode = lineNode->GetNext();
} }
if (newLines.Number() > 0) if (newLines.GetCount() > 0)
newShape->ApplyAttachmentOrdering(newLines); newShape->ApplyAttachmentOrdering(newLines);
} }
node = node->Next(); node = node->GetNext();
} }
OnEndCopy(diagramTo); OnEndCopy(diagramTo);
@@ -284,7 +284,7 @@ bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo)
if (m_currentCmd) if (m_currentCmd)
{ {
if (m_currentCmd->GetStates().Number() == 0) if (m_currentCmd->GetStates().GetCount() == 0)
{ {
delete m_currentCmd; delete m_currentCmd;
} }

View File

@@ -100,13 +100,19 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent):
m_generalSettings = new wxPanel; 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.")); wxASSERT_MSG( (success), _T("Could not load general settings panel."));
m_notebook->AddPage(m_generalSettings, _T("General"), TRUE); m_notebook->AddPage(m_generalSettings, _T("General"), TRUE);
m_diagramSettings = new wxPanel; 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.")); wxASSERT_MSG( (success), _T("Could not load diagram settings panel."));
m_notebook->AddPage(m_diagramSettings, _T("Diagram")); m_notebook->AddPage(m_diagramSettings, _T("Diagram"));
@@ -199,10 +205,10 @@ bool csSettingsDialog::TransferDataFromWindow()
} }
// Apply settings to all open diagram documents // Apply settings to all open diagram documents
wxNode* node = wxGetApp().GetDocManager()->GetDocuments().First(); wxNode* node = wxGetApp().GetDocManager()->GetDocuments().GetFirst();
while (node) while (node)
{ {
wxDocument* doc = (wxDocument*) node->Data(); wxDocument* doc = (wxDocument*) node->GetData();
if (doc->IsKindOf(CLASSINFO(csDiagramDocument))) if (doc->IsKindOf(CLASSINFO(csDiagramDocument)))
{ {
csDiagramDocument* diagramDoc = (csDiagramDocument*) doc; csDiagramDocument* diagramDoc = (csDiagramDocument*) doc;
@@ -228,7 +234,7 @@ bool csSettingsDialog::TransferDataFromWindow()
} }
} }
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; 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)); wxPoint(2, 2), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH - 4, SHAPE_PROPERTY_DIALOG_HEIGHT - 4));
m_generalPropertiesDialog = new csGeneralShapePropertiesDialog; 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.")); wxASSERT_MSG( (success), _T("Could not load general properties panel."));
m_notebook->AddPage(m_generalPropertiesDialog, _T("General")); m_notebook->AddPage(m_generalPropertiesDialog, _T("General"));
success = wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName); if (!wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName))
if (!success)
{ {
wxMessageBox(_T("Could not load the attribute dialog for this shape."), _T("Studio"), wxICON_EXCLAMATION); wxMessageBox(_T("Could not load the attribute dialog for this shape."), _T("Studio"), wxICON_EXCLAMATION);
delete m_attributeDialog; delete m_attributeDialog;
@@ -282,8 +290,7 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin
wxString str(attributeDialogName); wxString str(attributeDialogName);
str += _T("1"); str += _T("1");
m_alternativeAttributeDialog = new wxPanel; m_alternativeAttributeDialog = new wxPanel;
success = wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str); if (wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str))
if (success)
{ {
m_notebook->AddPage(m_alternativeAttributeDialog, _T("Attributes (alternative)")); m_notebook->AddPage(m_alternativeAttributeDialog, _T("Attributes (alternative)"));
} }
@@ -358,31 +365,31 @@ void csShapePropertiesDialog::SetDefaults()
if (!m_attributeDialog) if (!m_attributeDialog)
return; return;
wxNode* node = m_attributeDialog->GetChildren().First(); wxWindowListNode* node = m_attributeDialog->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* child = (wxWindow*) node->Data(); wxWindow* child = (wxWindow*) node->GetData();
if (child->IsKindOf(CLASSINFO(wxChoice))) if (child->IsKindOf(CLASSINFO(wxChoice)))
{ {
wxChoice* choice = (wxChoice*) child; wxChoice* choice = (wxChoice*) child;
choice->SetSelection(0); choice->SetSelection(0);
} }
node = node->Next(); node = node->GetNext();
} }
if (!m_alternativeAttributeDialog) if (!m_alternativeAttributeDialog)
return; return;
node = m_alternativeAttributeDialog->GetChildren().First(); node = m_alternativeAttributeDialog->GetChildren().GetFirst();
while (node) while (node)
{ {
wxWindow* child = (wxWindow*) node->Data(); wxWindow* child = (wxWindow*) node->GetData();
if (child->IsKindOf(CLASSINFO(wxChoice))) if (child->IsKindOf(CLASSINFO(wxChoice)))
{ {
wxChoice* choice = (wxChoice*) child; wxChoice* choice = (wxChoice*) child;
choice->SetSelection(0); choice->SetSelection(0);
} }
node = node->Next(); node = node->GetNext();
} }
} }

View File

@@ -120,12 +120,12 @@ csDiagramCommand::csDiagramCommand(const wxString& name, csDiagramDocument *doc,
csDiagramCommand::~csDiagramCommand() csDiagramCommand::~csDiagramCommand()
{ {
wxNode* node = m_states.First(); wxNode* node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->Data(); csCommandState* state = (csCommandState*) node->GetData();
delete state; 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. // Schedule all lines connected to the states to be cut.
void csDiagramCommand::RemoveLines() void csDiagramCommand::RemoveLines()
{ {
wxNode* node = m_states.First(); wxNode* node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->Data(); csCommandState* state = (csCommandState*) node->GetData();
wxShape* shape = state->GetShapeOnCanvas(); wxShape* shape = state->GetShapeOnCanvas();
wxASSERT( (shape != NULL) ); wxASSERT( (shape != NULL) );
wxNode *node1 = shape->GetLines().First(); wxNode *node1 = shape->GetLines().GetFirst();
while (node1) while (node1)
{ {
wxLineShape *line = (wxLineShape *)node1->Data(); wxLineShape *line = (wxLineShape *)node1->GetData();
if (!FindStateByShape(line)) if (!FindStateByShape(line))
{ {
csCommandState* newState = new csCommandState(ID_CS_CUT, NULL, line); csCommandState* newState = new csCommandState(ID_CS_CUT, NULL, line);
InsertState(newState); InsertState(newState);
} }
node1 = node1->Next(); node1 = node1->GetNext();
} }
node = node->Next(); node = node->GetNext();
} }
} }
csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape) csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape)
{ {
wxNode* node = m_states.First(); wxNode* node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->Data(); csCommandState* state = (csCommandState*) node->GetData();
if (shape == state->GetShapeOnCanvas() || shape == state->GetSavedState()) if (shape == state->GetShapeOnCanvas() || shape == state->GetSavedState())
return state; return state;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
bool csDiagramCommand::Do() bool csDiagramCommand::Do()
{ {
wxNode* node = m_states.First(); wxNode* node = m_states.GetFirst();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->Data(); csCommandState* state = (csCommandState*) node->GetData();
if (!state->Do()) if (!state->Do())
return FALSE; return FALSE;
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -200,13 +200,13 @@ bool csDiagramCommand::Undo()
{ {
// Undo in reverse order, so e.g. shapes get added // Undo in reverse order, so e.g. shapes get added
// back before the lines do. // back before the lines do.
wxNode* node = m_states.Last(); wxNode* node = m_states.GetLast();
while (node) while (node)
{ {
csCommandState* state = (csCommandState*) node->Data(); csCommandState* state = (csCommandState*) node->GetData();
if (!state->Undo()) if (!state->Undo())
return FALSE; return FALSE;
node = node->Previous(); node = node->GetPrevious();
} }
return TRUE; return TRUE;
} }
@@ -457,7 +457,7 @@ bool csCommandState::Do()
m_shapeOnCanvas->Show(TRUE); m_shapeOnCanvas->Show(TRUE);
// Recursively redraw links if we have a composite. // 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->DrawLinks(dc, -1, TRUE);
m_shapeOnCanvas->GetEventHandler()->OnEndSize(width, height); m_shapeOnCanvas->GetEventHandler()->OnEndSize(width, height);

View File

@@ -31,7 +31,7 @@ BEGIN_EVENT_TABLE(csProjectTreeCtrl, wxTreeCtrl)
END_EVENT_TABLE() END_EVENT_TABLE()
// Define my frame constructor // 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): long style):
wxTreeCtrl(parent, id, pos, size, style), wxTreeCtrl(parent, id, pos, size, style),

View File

@@ -199,7 +199,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
double xp, yp; double xp, yp;
GetShape()->GetAttachmentPositionEdge(attachment, &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(); GetShape()->GetCanvas()->CaptureMouse();
} }
@@ -213,7 +213,7 @@ void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUN
dc.SetPen(dottedPen); dc.SetPen(dottedPen);
double xp, yp; double xp, yp;
GetShape()->GetAttachmentPositionEdge(attachment, &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) 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); GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
// Draw bounding box for other selected shapes // Draw bounding box for other selected shapes
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape())) if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape()))
{ {
shape->GetBoundingBoxMax(&w, &h); shape->GetBoundingBoxMax(&w, &h);
shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, 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); GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
// Draw bounding box for other selected shapes // Draw bounding box for other selected shapes
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape())) if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape()))
{ {
shape->GetBoundingBoxMax(&w, &h); shape->GetBoundingBoxMax(&w, &h);
shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, w, h); shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, w, h);
} }
node = node->Next(); node = node->GetNext();
} }
GetShape()->GetCanvas()->CaptureMouse(); 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())); new csCommandState(ID_CS_MOVE, newShape, GetShape()));
// Move line points // Move line points
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
// Only move the line point(s) if both ends move too // Only move the line point(s) if both ends move too
if (shape->IsKindOf(CLASSINFO(wxLineShape)) && if (shape->IsKindOf(CLASSINFO(wxLineShape)) &&
((wxLineShape*)shape)->GetTo()->Selected() && ((wxLineShape*)shape)->GetFrom()->Selected()) ((wxLineShape*)shape)->GetTo()->Selected() && ((wxLineShape*)shape)->GetFrom()->Selected())
{ {
wxLineShape* lineShape = (wxLineShape*) shape; wxLineShape* lineShape = (wxLineShape*) shape;
if (lineShape->GetLineControlPoints()->Number() > 2) if (lineShape->GetLineControlPoints()->GetCount() > 2)
{ {
wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy(); wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy();
wxNode *node1 = newLineShape->GetLineControlPoints()->First(); wxNode *node1 = newLineShape->GetLineControlPoints()->GetFirst();
while (node1) while (node1)
{ {
wxRealPoint *point = (wxRealPoint *)node1->Data(); wxRealPoint *point = (wxRealPoint *)node1->GetData();
point->x += offsetX; point->x += offsetX;
point->y += offsetY; point->y += offsetY;
node1 = node1->Next(); node1 = node1->GetNext();
} }
cmd->AddState(new csCommandState(ID_CS_MOVE_LINE_POINT, newLineShape, lineShape)); cmd->AddState(new csCommandState(ID_CS_MOVE_LINE_POINT, newLineShape, lineShape));
lineShape->Erase(dc); lineShape->Erase(dc);
} }
} }
node = node->Next(); node = node->GetNext();
} }
// Add other selected node shapes, if any // Add other selected node shapes, if any
node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First(); node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape())) if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape()))
{ {
wxShape* newShape2 = shape->CreateNewCopy(); wxShape* newShape2 = shape->CreateNewCopy();
@@ -454,7 +454,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment)
newShape2->SetY(shape->GetY() + offsetY); newShape2->SetY(shape->GetY() + offsetY);
cmd->AddState(new csCommandState(ID_CS_MOVE, newShape2, shape)); cmd->AddState(new csCommandState(ID_CS_MOVE, newShape2, shape));
} }
node = node->Next(); node = node->GetNext();
} }
canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd); canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd);
@@ -736,7 +736,7 @@ csThinRectangleShape::csThinRectangleShape()
double w = csSTANDARD_SHAPE_WIDTH/2; double w = csSTANDARD_SHAPE_WIDTH/2;
double h = csSTANDARD_SHAPE_WIDTH; 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(); CalculateSize();
SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetAttachmentMode(ATTACHMENT_MODE_BRANCHING);
@@ -755,7 +755,7 @@ csWideRectangleShape::csWideRectangleShape()
double w = csSTANDARD_SHAPE_WIDTH; double w = csSTANDARD_SHAPE_WIDTH;
double h = w/2.0; 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(); CalculateSize();
SetAttachmentMode(ATTACHMENT_MODE_BRANCHING); SetAttachmentMode(ATTACHMENT_MODE_BRANCHING);
@@ -778,9 +778,9 @@ csTriangleShape::csTriangleShape()
wxPoint* points = new wxPoint[3]; wxPoint* points = new wxPoint[3];
points[0] = wxPoint( 0 , - h / 2 ); points[0] = wxPoint( 0 , (int)(- h / 2) );
points[1] = wxPoint( w / 2 , h / 2 ); points[1] = wxPoint( (int)(w / 2) , (int)(h / 2) );
points[2] = wxPoint( -w / 2, h / 2 ); points[2] = wxPoint( (int)(-w / 2), (int)(h / 2) );
DrawPolygon(3, points, oglMETAFLAGS_OUTLINE); DrawPolygon(3, points, oglMETAFLAGS_OUTLINE);
@@ -834,14 +834,14 @@ csSemiCircleShape::csSemiCircleShape()
// bounding box, since we can't calculate the bounding box for // bounding box, since we can't calculate the bounding box for
// an arbitrary arc (not implemented) // 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); SetDrawnPen(wxBLACK_PEN);
wxBrush* brush = wxTheBrushList->FindOrCreateBrush(wxColour(220, 220, 220), wxSOLID); wxBrush* brush = wxTheBrushList->FindOrCreateBrush(wxColour(220, 220, 220), wxSOLID);
SetDrawnBrush(brush); SetDrawnBrush(brush);
DrawEllipticArc(wxRect(-w/2, -h/2, w, 2*h), 0.0, 180.0); DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(2*h)), 0.0, 180.0);
DrawLine(wxPoint(-w/2, h/2), wxPoint(w/2, h/2)); DrawLine(wxPoint((int)(-w/2), (int)(h/2)), wxPoint((int)(w/2), (int)(h/2)));
CalculateSize(); CalculateSize();
@@ -855,13 +855,13 @@ csSemiCircleShape::csSemiCircleShape()
SetDrawnPen(wxTRANSPARENT_PEN); SetDrawnPen(wxTRANSPARENT_PEN);
SetDrawnBrush(wxTRANSPARENT_BRUSH); 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); SetDrawnPen(wxBLACK_PEN);
SetDrawnBrush(brush); SetDrawnBrush(brush);
DrawEllipticArc(wxRect(-w/2 - w, -h/2, 2*w, h), 270.0, 90.0); DrawEllipticArc(wxRect((int)(-w/2 - w), (int)(-h/2), (int)(2*w), (int)(h)), 270.0, 90.0);
DrawLine(wxPoint(-w/2, -h/2), wxPoint(-w/2, h/2)); DrawLine(wxPoint((int)(-w/2), (int)(-h/2)), wxPoint((int)(-w/2), (int)(h/2)));
CalculateSize(); CalculateSize();
@@ -875,13 +875,13 @@ csSemiCircleShape::csSemiCircleShape()
SetDrawnPen(wxTRANSPARENT_PEN); SetDrawnPen(wxTRANSPARENT_PEN);
SetDrawnBrush(wxTRANSPARENT_BRUSH); 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); SetDrawnPen(wxBLACK_PEN);
SetDrawnBrush(brush); SetDrawnBrush(brush);
DrawEllipticArc(wxRect(-w/2, -h/2 - h, w, 2*h), 180.0, 0.0); DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2 - h), (int)(w), (int)(2*h)), 180.0, 0.0);
DrawLine(wxPoint(-w/2, -h/2), wxPoint(w/2, -h/2)); DrawLine(wxPoint((int)(-w/2), (int)(-h/2)), wxPoint((int)(w/2), (int)(-h/2)));
CalculateSize(); CalculateSize();
@@ -895,13 +895,13 @@ csSemiCircleShape::csSemiCircleShape()
SetDrawnPen(wxTRANSPARENT_PEN); SetDrawnPen(wxTRANSPARENT_PEN);
SetDrawnBrush(wxTRANSPARENT_BRUSH); 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); SetDrawnPen(wxBLACK_PEN);
SetDrawnBrush(brush); SetDrawnBrush(brush);
DrawEllipticArc(wxRect(-w/2, -h/2, 2*w, h), 90.0, 270.0); DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2), (int)(2*w), (int)(h)), 90.0, 270.0);
DrawLine(wxPoint(w/2, -h/2), wxPoint(w/2, h/2)); DrawLine(wxPoint((int)(w/2),(int)(-h/2)), wxPoint((int)(w/2), (int)(h/2)));
CalculateSize(); CalculateSize();

View File

@@ -244,9 +244,7 @@ wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu**
fileMenu->AppendSeparator(); fileMenu->AppendSeparator();
fileMenu->Append(wxID_EXIT, _T("E&xit")); fileMenu->Append(wxID_EXIT, _T("E&xit"));
wxMenu *editMenu = NULL; wxMenu* editMenu = new wxMenu;
editMenu = new wxMenu;
editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z")); editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z"));
editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y")); editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y"));
editMenu->AppendSeparator(); editMenu->AppendSeparator();

View File

@@ -74,41 +74,41 @@ void csSymbolDatabase::AddSymbol(csSymbol* symbol)
void csSymbolDatabase::ClearSymbols() void csSymbolDatabase::ClearSymbols()
{ {
wxNode* node = m_symbols.First(); wxNode* node = m_symbols.GetFirst();
while (node) while (node)
{ {
csSymbol* symbol = (csSymbol*) node->Data(); csSymbol* symbol = (csSymbol*) node->GetData();
delete symbol; delete symbol;
node = node->Next(); node = node->GetNext();
} }
m_symbols.Clear(); m_symbols.Clear();
} }
csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const
{ {
wxNode* node = m_symbols.First(); wxNode* node = m_symbols.GetFirst();
while (node) while (node)
{ {
csSymbol* symbol = (csSymbol*) node->Data(); csSymbol* symbol = (csSymbol*) node->GetData();
if (symbol->GetName() == name) if (symbol->GetName() == name)
return symbol; return symbol;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }
csSymbol* csSymbolDatabase::FindSymbol(int toolId) const csSymbol* csSymbolDatabase::FindSymbol(int toolId) const
{ {
wxNode* node = m_symbols.First(); wxNode* node = m_symbols.GetFirst();
while (node) while (node)
{ {
csSymbol* symbol = (csSymbol*) node->Data(); csSymbol* symbol = (csSymbol*) node->GetData();
if (symbol->GetToolId() == toolId) if (symbol->GetToolId() == toolId)
return symbol; return symbol;
node = node->Next(); node = node->GetNext();
} }
return NULL; return NULL;
} }

View File

@@ -199,16 +199,16 @@ wxShape *csDiagramView::FindFirstSelectedShape(void)
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxShape *theShape = NULL; wxShape *theShape = NULL;
wxNode *node = doc->GetDiagram()->GetShapeList()->First(); wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->Data(); wxShape *eachShape = (wxShape *)node->GetData();
if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected()) if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected())
{ {
theShape = eachShape; theShape = eachShape;
node = NULL; node = NULL;
} }
else node = node->Next(); else node = node->GetNext();
} }
return theShape; return theShape;
} }
@@ -216,15 +216,15 @@ wxShape *csDiagramView::FindFirstSelectedShape(void)
void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind) void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind)
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxNode *node = doc->GetDiagram()->GetShapeList()->First(); wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) 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)))) if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected() && ((toFind == NULL) || (eachShape->IsKindOf(toFind))))
{ {
selections.Append(eachShape); selections.Append(eachShape);
} }
node = node->Next(); node = node->GetNext();
} }
} }
@@ -296,17 +296,17 @@ void csDiagramView::OnDuplicate(wxCommandEvent& WXUNUSED(event))
void csDiagramView::OnCutUpdate(wxUpdateUIEvent& event) void csDiagramView::OnCutUpdate(wxUpdateUIEvent& event)
{ {
event.Enable( (m_selections.Number() > 0) ); event.Enable( (m_selections.GetCount() > 0) );
} }
void csDiagramView::OnClearUpdate(wxUpdateUIEvent& event) void csDiagramView::OnClearUpdate(wxUpdateUIEvent& event)
{ {
event.Enable( (m_selections.Number() > 0) ); event.Enable( (m_selections.GetCount() > 0) );
} }
void csDiagramView::OnCopyUpdate(wxUpdateUIEvent& event) void csDiagramView::OnCopyUpdate(wxUpdateUIEvent& event)
{ {
event.Enable( (m_selections.Number() > 0) ); event.Enable( (m_selections.GetCount() > 0) );
} }
void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event) void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
@@ -320,21 +320,21 @@ void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
void csDiagramView::OnDuplicateUpdate(wxUpdateUIEvent& event) void csDiagramView::OnDuplicateUpdate(wxUpdateUIEvent& event)
{ {
event.Enable( (m_selections.Number() > 0) ); event.Enable( (m_selections.GetCount() > 0) );
} }
void csDiagramView::DoCut(wxList& shapes) void csDiagramView::DoCut(wxList& shapes)
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
if (shapes.Number() > 0) if (shapes.GetCount() > 0)
{ {
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
wxNode* node = shapes.First(); wxNode* node = shapes.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->Data(); wxShape *theShape = (wxShape*) node->GetData();
csCommandState* state = new csCommandState(ID_CS_CUT, NULL, theShape); csCommandState* state = new csCommandState(ID_CS_CUT, NULL, theShape);
// Insert lines at the front, so they are cut first. // Insert lines at the front, so they are cut first.
@@ -345,7 +345,7 @@ void csDiagramView::DoCut(wxList& shapes)
else else
cmd->AddState(state); cmd->AddState(state);
node = node->Next(); node = node->GetNext();
} }
cmd->RemoveLines(); // Schedule any connected lines, not already mentioned, cmd->RemoveLines(); // Schedule any connected lines, not already mentioned,
// to be removed first // to be removed first
@@ -359,21 +359,21 @@ void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxSt
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
if (shapes.Number() > 0) if (shapes.GetCount() > 0)
{ {
csDiagramCommand* command = new csDiagramCommand(op, doc); csDiagramCommand* command = new csDiagramCommand(op, doc);
wxNode* node = shapes.First(); wxNode* node = shapes.GetFirst();
wxNode* node1 = oldShapes.First(); wxNode* node1 = oldShapes.GetFirst();
while (node && node1) while (node && node1)
{ {
wxShape *theShape = (wxShape*) node->Data(); wxShape *theShape = (wxShape*) node->GetData();
wxShape *oldShape = (wxShape*) node1->Data(); wxShape *oldShape = (wxShape*) node1->GetData();
csCommandState* state = new csCommandState(cmd, theShape, oldShape); csCommandState* state = new csCommandState(cmd, theShape, oldShape);
command->AddState(state); command->AddState(state);
node = node->Next(); node = node->GetNext();
node1 = node1->Next(); node1 = node1->GetNext();
} }
doc->GetCommandProcessor()->Submit(command); doc->GetCommandProcessor()->Submit(command);
} }
@@ -386,13 +386,13 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
wxList selections; wxList selections;
FindSelectedShapes(selections); FindSelectedShapes(selections);
if (selections.Number() > 0) if (selections.GetCount() > 0)
{ {
wxColourData data; wxColourData data;
data.SetChooseFull(TRUE); 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()); data.SetColour(firstShape->GetBrush()->GetColour());
} }
@@ -410,17 +410,17 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc);
wxNode* node = selections.First(); wxNode* node = selections.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->Data(); wxShape *theShape = (wxShape*) node->GetData();
wxShape* newShape = theShape->CreateNewCopy(); wxShape* newShape = theShape->CreateNewCopy();
newShape->SetBrush(theBrush); newShape->SetBrush(theBrush);
csCommandState* state = new csCommandState(ID_CS_CHANGE_BACKGROUND_COLOUR, newShape, theShape); csCommandState* state = new csCommandState(ID_CS_CHANGE_BACKGROUND_COLOUR, newShape, theShape);
cmd->AddState(state); cmd->AddState(state);
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -437,7 +437,7 @@ void csDiagramView::OnEditPropertiesUpdate(wxUpdateUIEvent& event)
{ {
wxList selections; wxList selections;
FindSelectedShapes(selections); FindSelectedShapes(selections);
event.Enable( (selections.Number() > 0) ); event.Enable( (selections.GetCount() > 0) );
} }
void csDiagramView::OnPointSizeComboSel(wxCommandEvent& event) void csDiagramView::OnPointSizeComboSel(wxCommandEvent& event)
@@ -475,14 +475,14 @@ void csDiagramView::ApplyPointSize(int pointSize)
wxList selections; wxList selections;
FindSelectedShapes(selections); FindSelectedShapes(selections);
if (selections.Number() > 0) if (selections.GetCount() > 0)
{ {
csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc);
wxNode* node = selections.First(); wxNode* node = selections.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->Data(); wxShape *theShape = (wxShape*) node->GetData();
wxShape *newShape = theShape->CreateNewCopy(); wxShape *newShape = theShape->CreateNewCopy();
wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize, wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize,
@@ -498,7 +498,7 @@ void csDiagramView::ApplyPointSize(int pointSize)
cmd->AddState(state); cmd->AddState(state);
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -531,23 +531,23 @@ void csDiagramView::SelectAll(bool select)
wxList selections; wxList selections;
FindSelectedShapes(selections); FindSelectedShapes(selections);
wxNode* node = selections.First(); wxNode* node = selections.GetFirst();
while (node) while (node)
{ {
wxShape *theShape = (wxShape*) node->Data(); wxShape *theShape = (wxShape*) node->GetData();
theShape->Select(FALSE, &dc); theShape->Select(FALSE, &dc);
SelectShape(theShape, FALSE); SelectShape(theShape, FALSE);
node = node->Next(); node = node->GetNext();
} }
} }
else else
{ {
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
wxNode *node = doc->GetDiagram()->GetShapeList()->First(); wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *eachShape = (wxShape *)node->Data(); wxShape *eachShape = (wxShape *)node->GetData();
if (eachShape->GetParent() == NULL && if (eachShape->GetParent() == NULL &&
!eachShape->IsKindOf(CLASSINFO(wxControlPoint)) && !eachShape->IsKindOf(CLASSINFO(wxControlPoint)) &&
!eachShape->IsKindOf(CLASSINFO(wxLabelShape))) !eachShape->IsKindOf(CLASSINFO(wxLabelShape)))
@@ -555,7 +555,7 @@ void csDiagramView::SelectAll(bool select)
eachShape->Select(TRUE, &dc); eachShape->Select(TRUE, &dc);
SelectShape(eachShape, TRUE); SelectShape(eachShape, TRUE);
} }
node = node->Next(); node = node->GetNext();
} }
} }
} }
@@ -575,20 +575,20 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event))
wxList selections; wxList selections;
FindSelectedShapes(selections, CLASSINFO(wxLineShape)); FindSelectedShapes(selections, CLASSINFO(wxLineShape));
if (selections.Number() > 0) if (selections.GetCount() > 0)
{ {
csDiagramCommand* cmd = new csDiagramCommand(stateName, doc); csDiagramCommand* cmd = new csDiagramCommand(stateName, doc);
wxNode* node = selections.First(); wxNode* node = selections.GetFirst();
while (node) while (node)
{ {
wxLineShape *theShape = (wxLineShape*) node->Data(); wxLineShape *theShape = (wxLineShape*) node->GetData();
wxLineShape *newShape = NULL; wxLineShape *newShape = NULL;
if (state) if (state)
{ {
// Add arrow // Add arrow
if (theShape->GetArrows().Number() == 0) if (theShape->GetArrows().GetCount() == 0)
{ {
newShape = (wxLineShape*) theShape->CreateNewCopy(); newShape = (wxLineShape*) theShape->CreateNewCopy();
newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead")); 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 else
{ {
if (theShape->GetArrows().Number() > 0) if (theShape->GetArrows().GetCount() > 0)
{ {
newShape = (wxLineShape*) theShape->CreateNewCopy(); newShape = (wxLineShape*) theShape->CreateNewCopy();
newShape->ClearArrowsAtPosition(); newShape->ClearArrowsAtPosition();
@@ -610,7 +610,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event))
cmd->AddState(state); cmd->AddState(state);
} }
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -620,7 +620,7 @@ void csDiagramView::OnToggleArrowToolUpdate(wxUpdateUIEvent& event)
{ {
wxList selections; wxList selections;
FindSelectedShapes(selections, CLASSINFO(wxLineShape)); FindSelectedShapes(selections, CLASSINFO(wxLineShape));
event.Enable( (selections.Number() > 0) ); event.Enable( (selections.GetCount() > 0) );
} }
// Make the point size combobox reflect this // Make the point size combobox reflect this
@@ -634,13 +634,13 @@ void csDiagramView::ReflectPointSize(int pointSize)
void csDiagramView::ReflectArrowState(wxLineShape* lineShape) void csDiagramView::ReflectArrowState(wxLineShape* lineShape)
{ {
bool haveArrow = FALSE; bool haveArrow = FALSE;
wxNode *node = lineShape->GetArrows().First(); wxNode *node = lineShape->GetArrows().GetFirst();
while (node) while (node)
{ {
wxArrowHead *arrow = (wxArrowHead *)node->Data(); wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (ARROW_POSITION_MIDDLE == arrow->GetArrowEnd()) if (ARROW_POSITION_MIDDLE == arrow->GetArrowEnd())
haveArrow = TRUE; haveArrow = TRUE;
node = node->Next(); node = node->GetNext();
} }
wxGetApp().GetDiagramToolBar()->ToggleTool(DIAGRAM_TOOLBAR_LINE_ARROW, haveArrow); 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 // Make a copy of the selections, keeping only those shapes
// that are top-level non-line shapes. // that are top-level non-line shapes.
wxList selections; wxList selections;
wxNode* node = GetSelectionList().First(); wxNode* node = GetSelectionList().GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if ((shape->GetParent() == NULL) && (!shape->IsKindOf(CLASSINFO(wxLineShape)))) if ((shape->GetParent() == NULL) && (!shape->IsKindOf(CLASSINFO(wxLineShape))))
{ {
selections.Append(shape); selections.Append(shape);
} }
node = node->Next(); node = node->GetNext();
} }
if (selections.Number() == 0) if (selections.GetCount() == 0)
return; return;
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("Align"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Align"), doc);
node = selections.First(); node = selections.GetFirst();
wxShape* firstShape = (wxShape*) node->Data(); wxShape* firstShape = (wxShape*) node->GetData();
double x = firstShape->GetX(); double x = firstShape->GetX();
double y = firstShape->GetY(); double y = firstShape->GetY();
double width, height; double width, height;
firstShape->GetBoundingBoxMax(&width, &height); firstShape->GetBoundingBoxMax(&width, &height);
node = selections.First(); node = selections.GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape != firstShape) if (shape != firstShape)
{ {
/* double x1 = */ shape->GetX(); /* double x1 = */ shape->GetX();
@@ -734,7 +734,7 @@ void csDiagramView::OnAlign(wxCommandEvent& event)
csCommandState* state = new csCommandState(ID_CS_ALIGN, newShape, shape); csCommandState* state = new csCommandState(ID_CS_ALIGN, newShape, shape);
cmd->AddState(state); cmd->AddState(state);
} }
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -743,7 +743,7 @@ void csDiagramView::OnAlignUpdate(wxUpdateUIEvent& event)
{ {
// This is an approximation, since there may be lines // This is an approximation, since there may be lines
// amongst the selections. // amongst the selections.
event.Enable( (m_selections.Number() > 1) ) ; event.Enable( (m_selections.GetCount() > 1) ) ;
} }
void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event)) void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
@@ -751,10 +751,10 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc);
wxNode* node = m_selections.First(); wxNode* node = m_selections.GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->IsKindOf(CLASSINFO(wxLineShape))) if (shape->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxShape* newShape = shape->CreateNewCopy(); wxShape* newShape = shape->CreateNewCopy();
@@ -762,7 +762,7 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
csCommandState* state = new csCommandState(ID_CS_NEW_POINT, newShape, shape); csCommandState* state = new csCommandState(ID_CS_NEW_POINT, newShape, shape);
cmd->AddState(state); cmd->AddState(state);
} }
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -772,10 +772,10 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event))
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc);
wxNode* node = m_selections.First(); wxNode* node = m_selections.GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->IsKindOf(CLASSINFO(wxLineShape))) if (shape->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxShape* newShape = shape->CreateNewCopy(); wxShape* newShape = shape->CreateNewCopy();
@@ -783,7 +783,7 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event))
csCommandState* state = new csCommandState(ID_CS_CUT_POINT, newShape, shape); csCommandState* state = new csCommandState(ID_CS_CUT_POINT, newShape, shape);
cmd->AddState(state); cmd->AddState(state);
} }
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -793,10 +793,10 @@ void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event))
csDiagramDocument *doc = (csDiagramDocument *)GetDocument(); csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc); csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc);
wxNode* node = m_selections.First(); wxNode* node = m_selections.GetFirst();
while (node) while (node)
{ {
wxShape* shape = (wxShape*) node->Data(); wxShape* shape = (wxShape*) node->GetData();
if (shape->IsKindOf(CLASSINFO(wxLineShape))) if (shape->IsKindOf(CLASSINFO(wxLineShape)))
{ {
wxShape* newShape = shape->CreateNewCopy(); wxShape* newShape = shape->CreateNewCopy();
@@ -804,7 +804,7 @@ void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event))
csCommandState* state = new csCommandState(ID_CS_STRAIGHTEN, newShape, shape); csCommandState* state = new csCommandState(ID_CS_STRAIGHTEN, newShape, shape);
cmd->AddState(state); cmd->AddState(state);
} }
node = node->Next(); node = node->GetNext();
} }
doc->GetCommandProcessor()->Submit(cmd); doc->GetCommandProcessor()->Submit(cmd);
} }
@@ -813,21 +813,21 @@ void csDiagramView::OnNewLinePointUpdate(wxUpdateUIEvent& event)
{ {
wxList selections; wxList selections;
FindSelectedShapes(selections, CLASSINFO(wxLineShape)); FindSelectedShapes(selections, CLASSINFO(wxLineShape));
event.Enable( (selections.Number() > 0) ); event.Enable( (selections.GetCount() > 0) );
} }
void csDiagramView::OnCutLinePointUpdate(wxUpdateUIEvent& event) void csDiagramView::OnCutLinePointUpdate(wxUpdateUIEvent& event)
{ {
wxList selections; wxList selections;
FindSelectedShapes(selections, CLASSINFO(wxLineShape)); FindSelectedShapes(selections, CLASSINFO(wxLineShape));
event.Enable( (selections.Number() > 0) ); event.Enable( (selections.GetCount() > 0) );
} }
void csDiagramView::OnStraightenLinesUpdate(wxUpdateUIEvent& event) void csDiagramView::OnStraightenLinesUpdate(wxUpdateUIEvent& event)
{ {
wxList selections; wxList selections;
FindSelectedShapes(selections, CLASSINFO(wxLineShape)); 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); min_y = wxMin(y, sg_initialY);
max_y = wxMax(y, sg_initialY); max_y = wxMax(y, sg_initialY);
wxNode *node = GetDiagram()->GetShapeList()->First(); wxNode *node = GetDiagram()->GetShapeList()->GetFirst();
while (node) while (node)
{ {
wxShape *shape = (wxShape *)node->Data(); wxShape *shape = (wxShape *)node->GetData();
if (shape->GetParent() == NULL && !shape->IsKindOf(CLASSINFO(wxControlPoint))) if (shape->GetParent() == NULL && !shape->IsKindOf(CLASSINFO(wxControlPoint)))
{ {
float image_x = shape->GetX(); float image_x = shape->GetX();
@@ -1014,7 +1014,7 @@ void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys))
GetView()->SelectShape(shape, TRUE); GetView()->SelectShape(shape, TRUE);
} }
} }
node = node->Next(); node = node->GetNext();
} }
} }

View File

@@ -1031,11 +1031,7 @@ bool wxBoolListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListVi
return FALSE; return FALSE;
wxString value(view->GetValueText()->GetValue()); wxString value(view->GetValueText()->GetValue());
bool boolValue = FALSE; bool boolValue = (value == wxT("True"));
if (value == wxT("True"))
boolValue = TRUE;
else
boolValue = FALSE;
property->GetValue() = (bool)boolValue; property->GetValue() = (bool)boolValue;
return TRUE; return TRUE;
} }
@@ -1258,7 +1254,7 @@ bool wxStringListValidator::OnDoubleClick( wxProperty *property,
wxChar *s = node->GetData(); wxChar *s = node->GetData();
if (wxStrcmp(s, currentString) == 0) if (wxStrcmp(s, currentString) == 0)
{ {
wxChar *nextString = NULL; wxChar *nextString;
if (node->GetNext()) if (node->GetNext())
nextString = node->GetNext()->GetData(); nextString = node->GetNext()->GetData();
else else

View File

@@ -164,13 +164,13 @@ wxItemResource::wxItemResource()
wxItemResource::~wxItemResource() wxItemResource::~wxItemResource()
{ {
wxNode *node = m_children.First(); wxNode *node = m_children.GetFirst();
while (node) while (node)
{ {
wxItemResource *item = (wxItemResource *)node->Data(); wxItemResource *item = (wxItemResource *)node->GetData();
delete item; delete item;
delete node; 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 // See if any resource has this as its child; if so, delete from
// parent's child list. // parent's child list.
BeginFind(); BeginFind();
wxNode *node = (wxNode *) NULL; wxNode *node = Next();
node = Next();
while (node != NULL) while (node != NULL)
{ {
wxItemResource *parent = (wxItemResource *)node->Data(); wxItemResource *parent = (wxItemResource *)node->GetData();
if (parent->GetChildren().Member(item)) if (parent->GetChildren().Member(item))
{ {
parent->GetChildren().DeleteObject(item); parent->GetChildren().DeleteObject(item);
@@ -314,7 +313,7 @@ void wxResourceTable::ClearTable()
while (node) while (node)
{ {
wxNode *next = Next(); wxNode *next = Next();
wxItemResource *item = (wxItemResource *)node->Data(); wxItemResource *item = (wxItemResource *)node->GetData();
delete item; delete item;
delete node; delete node;
node = next; node = next;
@@ -464,17 +463,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
wxStringList& stringList = childResource->GetStringValues(); wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL; wxString *strings = (wxString *) NULL;
int noStrings = 0; int noStrings = 0;
if (stringList.Number() > 0) if (stringList.GetCount() > 0)
{ {
noStrings = stringList.Number(); noStrings = stringList.GetCount();
strings = new wxString[noStrings]; strings = new wxString[noStrings];
wxNode *node = stringList.First(); wxStringListNode *node = stringList.GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
strings[i] = (wxChar *)node->Data(); strings[i] = (wxChar *)node->GetData();
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
} }
control = new wxListBox(parent, id, pos, size, control = new wxListBox(parent, id, pos, size,
@@ -488,17 +487,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
wxStringList& stringList = childResource->GetStringValues(); wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL; wxString *strings = (wxString *) NULL;
int noStrings = 0; int noStrings = 0;
if (stringList.Number() > 0) if (stringList.GetCount() > 0)
{ {
noStrings = stringList.Number(); noStrings = stringList.GetCount();
strings = new wxString[noStrings]; strings = new wxString[noStrings];
wxNode *node = stringList.First(); wxStringListNode *node = stringList.GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
strings[i] = (wxChar *)node->Data(); strings[i] = (wxChar *)node->GetData();
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
} }
control = new wxChoice(parent, id, pos, size, control = new wxChoice(parent, id, pos, size,
@@ -513,17 +512,17 @@ wxControl *wxResourceTable::CreateItem(wxWindow *parent, const wxItemResource* c
wxStringList& stringList = childResource->GetStringValues(); wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL; wxString *strings = (wxString *) NULL;
int noStrings = 0; int noStrings = 0;
if (stringList.Number() > 0) if (stringList.GetCount() > 0)
{ {
noStrings = stringList.Number(); noStrings = stringList.GetCount();
strings = new wxString[noStrings]; strings = new wxString[noStrings];
wxNode *node = stringList.First(); wxStringListNode *node = stringList.GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
strings[i] = (wxChar *)node->Data(); strings[i] = (wxChar *)node->GetData();
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
} }
control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size, 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(); wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL; wxString *strings = (wxString *) NULL;
int noStrings = 0; int noStrings = 0;
if (stringList.Number() > 0) if (stringList.GetCount() > 0)
{ {
noStrings = stringList.Number(); noStrings = stringList.GetCount();
strings = new wxString[noStrings]; strings = new wxString[noStrings];
wxNode *node = stringList.First(); wxStringListNode *node = stringList.GetFirst();
int i = 0; int i = 0;
while (node) while (node)
{ {
strings[i] = (wxChar *)node->Data(); strings[i] = (wxChar *)node->GetData();
i ++; i ++;
node = node->Next(); node = node->GetNext();
} }
} }
control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size, 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) bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
{ {
wxNode *node = db.First(); wxNode *node = db.GetFirst();
while (node) while (node)
{ {
wxExpr *clause = (wxExpr *)node->Data(); wxExpr *clause = (wxExpr *)node->GetData();
wxString functor(clause->Functor()); wxString functor(clause->Functor());
wxItemResource *item = (wxItemResource *) NULL; wxItemResource *item = (wxItemResource *) NULL;
@@ -616,7 +615,7 @@ bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
table.DeleteResource(item->GetName()); table.DeleteResource(item->GetName());
table.AddResource(item); table.AddResource(item);
} }
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }
@@ -1543,7 +1542,7 @@ bool wxReallocateResourceBuffer()
static bool wxEatWhiteSpace(FILE *fd) static bool wxEatWhiteSpace(FILE *fd)
{ {
int ch = 0; int ch;
while ((ch = getc(fd)) != EOF) while ((ch = getc(fd)) != EOF)
{ {
@@ -2391,10 +2390,10 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
wxItemResource *optResource = (wxItemResource *) NULL; wxItemResource *optResource = (wxItemResource *) NULL;
// Try to find optimum bitmap for this platform/colour depth // Try to find optimum bitmap for this platform/colour depth
wxNode *node = item->GetChildren().First(); wxNode *node = item->GetChildren().GetFirst();
while (node) while (node)
{ {
wxItemResource *child = (wxItemResource *)node->Data(); wxItemResource *child = (wxItemResource *)node->GetData();
int platform = (int)child->GetValue2(); int platform = (int)child->GetValue2();
int noColours = (int)child->GetValue3(); int noColours = (int)child->GetValue3();
/* /*
@@ -2465,7 +2464,7 @@ wxBitmap wxResourceCreateBitmap(const wxString& resource, wxResourceTable *table
default: default:
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
// If no matching resource, fail. // If no matching resource, fail.
if (!optResource) if (!optResource)
@@ -2545,10 +2544,10 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
wxItemResource *optResource = (wxItemResource *) NULL; wxItemResource *optResource = (wxItemResource *) NULL;
// Try to find optimum icon for this platform/colour depth // Try to find optimum icon for this platform/colour depth
wxNode *node = item->GetChildren().First(); wxNode *node = item->GetChildren().GetFirst();
while (node) while (node)
{ {
wxItemResource *child = (wxItemResource *)node->Data(); wxItemResource *child = (wxItemResource *)node->GetData();
int platform = (int)child->GetValue2(); int platform = (int)child->GetValue2();
int noColours = (int)child->GetValue3(); int noColours = (int)child->GetValue3();
/* /*
@@ -2619,7 +2618,7 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
default: default:
break; break;
} }
node = node->Next(); node = node->GetNext();
} }
// If no matching resource, fail. // If no matching resource, fail.
if (!optResource) if (!optResource)
@@ -2686,13 +2685,13 @@ wxIcon wxResourceCreateIcon(const wxString& resource, wxResourceTable *table)
wxMenu *wxResourceCreateMenu(wxItemResource *item) wxMenu *wxResourceCreateMenu(wxItemResource *item)
{ {
wxMenu *menu = new wxMenu; wxMenu *menu = new wxMenu;
wxNode *node = item->GetChildren().First(); wxNode *node = item->GetChildren().GetFirst();
while (node) while (node)
{ {
wxItemResource *child = (wxItemResource *)node->Data(); wxItemResource *child = (wxItemResource *)node->GetData();
if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator"))) if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator")))
menu->AppendSeparator(); menu->AppendSeparator();
else if (child->GetChildren().Number() > 0) else if (child->GetChildren().GetCount() > 0)
{ {
wxMenu *subMenu = wxResourceCreateMenu(child); wxMenu *subMenu = wxResourceCreateMenu(child);
if (subMenu) if (subMenu)
@@ -2702,7 +2701,7 @@ wxMenu *wxResourceCreateMenu(wxItemResource *item)
{ {
menu->Append((int)child->GetValue1(), child->GetTitle(), child->GetValue4(), (child->GetValue2() != 0)); menu->Append((int)child->GetValue1(), child->GetTitle(), child->GetValue4(), (child->GetValue2() != 0));
} }
node = node->Next(); node = node->GetNext();
} }
return menu; return menu;
} }
@@ -2717,14 +2716,14 @@ wxMenuBar *wxResourceCreateMenuBar(const wxString& resource, wxResourceTable *ta
{ {
if (!menuBar) if (!menuBar)
menuBar = new wxMenuBar; menuBar = new wxMenuBar;
wxNode *node = menuResource->GetChildren().First(); wxNode *node = menuResource->GetChildren().GetFirst();
while (node) while (node)
{ {
wxItemResource *child = (wxItemResource *)node->Data(); wxItemResource *child = (wxItemResource *)node->GetData();
wxMenu *menu = wxResourceCreateMenu(child); wxMenu *menu = wxResourceCreateMenu(child);
if (menu) if (menu)
menuBar->Append(menu, child->GetTitle()); menuBar->Append(menu, child->GetTitle());
node = node->Next(); node = node->GetNext();
} }
return menuBar; return menuBar;
} }
@@ -2876,7 +2875,7 @@ static int ungetc_string()
bool wxEatWhiteSpaceString(char *s) bool wxEatWhiteSpaceString(char *s)
{ {
int ch = 0; int ch;
while ((ch = getc_string(s)) != EOF) while ((ch = getc_string(s)) != EOF)
{ {
@@ -2889,7 +2888,6 @@ bool wxEatWhiteSpaceString(char *s)
break; break;
case '/': case '/':
{ {
int prev_ch = ch;
ch = getc_string(s); ch = getc_string(s);
if (ch == EOF) if (ch == EOF)
{ {
@@ -2900,7 +2898,7 @@ bool wxEatWhiteSpaceString(char *s)
if (ch == '*') if (ch == '*')
{ {
// Eat C comment // Eat C comment
prev_ch = 0; int prev_ch = 0;
while ((ch = getc_string(s)) != EOF) while ((ch = getc_string(s)) != EOF)
{ {
if (ch == '/' && prev_ch == '*') if (ch == '/' && prev_ch == '*')
@@ -3251,14 +3249,14 @@ bool wxLoadFromResource(wxWindow* thisWindow, wxWindow *parent, const wxString&
} }
// Now create children // Now create children
wxNode *node = resource->GetChildren().First(); wxNode *node = resource->GetChildren().GetFirst();
while (node) while (node)
{ {
wxItemResource *childResource = (wxItemResource *)node->Data(); wxItemResource *childResource = (wxItemResource *)node->GetData();
(void) wxCreateItem(thisWindow, childResource, resource, table); (void) wxCreateItem(thisWindow, childResource, resource, table);
node = node->Next(); node = node->GetNext();
} }
return TRUE; return TRUE;
} }

View File

@@ -1020,7 +1020,7 @@ void wxExprDatabase::Append(wxExpr *clause)
if (expr) if (expr)
{ {
long functor_key = hash_table->MakeKey(WXSTRINGCAST functor); long functor_key = hash_table->MakeKey(WXSTRINGCAST functor);
long value_key = 0; long value_key;
if (expr && expr->Type() == wxExprString) if (expr && expr->Type() == wxExprString)
{ {
value_key = hash_table->MakeKey(WXSTRINGCAST expr->StringValue()); value_key = hash_table->MakeKey(WXSTRINGCAST expr->StringValue());

View File

@@ -465,7 +465,10 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
if ( mpSrcPane->mProps.mExactDockPredictionOn && mpCurPane ) 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:: wxASSERT( success ); // DBG::
@@ -519,7 +522,10 @@ void cbBarDragPlugin::ShowHint( bool prevWasInClient )
mpDraggedBar->mUMgrData.SetDirty( TRUE ); 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 :: wxASSERT( success ); // DBG ::

View File

@@ -167,7 +167,7 @@ void cbSimpleCustomizationPlugin::OnMenuItemSelected( wxCommandEvent& event )
// "inverse" bar-visibility of the selected bar // "inverse" bar-visibility of the selected bar
int newState = 0; int newState;
if ( pBar->mState == wxCBAR_HIDDEN ) if ( pBar->mState == wxCBAR_HIDDEN )
{ {

View File

@@ -87,6 +87,9 @@
// some ascii-art, still can't get these *nice* cursors working on wx... :-( // some ascii-art, still can't get these *nice* cursors working on wx... :-(
/*
// FIXME:: see places where _gHorizCursorImg is used
static const char* _gHorizCursorImg[] = static const char* _gHorizCursorImg[] =
{ {
"............XX....XX............", "............XX....XX............",
@@ -126,6 +129,7 @@ static const char* _gVertCursorImg[] =
"...............XXX..............", "...............XXX..............",
"................X..............." "................X..............."
}; };
*/
// helper inline functions // helper inline functions
@@ -446,6 +450,8 @@ void wxFrameLayout::ShowFloatedWindows( bool show )
wxFrameLayout::~wxFrameLayout() wxFrameLayout::~wxFrameLayout()
{ {
size_t i;
UnhookFromFrame(); UnhookFromFrame();
if ( mpUpdatesMgr ) if ( mpUpdatesMgr )
@@ -474,7 +480,6 @@ wxFrameLayout::~wxFrameLayout()
// destroy contents of arrays and lists // destroy contents of arrays and lists
size_t i = 0;
for ( i = 0; i != MAX_PANES; ++i ) for ( i = 0; i != MAX_PANES; ++i )
{ {
if ( mPanes[i] ) if ( mPanes[i] )
@@ -691,7 +696,10 @@ void wxFrameLayout::SetBarState( cbBarInfo* pBar, int newState, bool updateNow )
cbDockPane* pPane; cbDockPane* pPane;
cbRowInfo* pRow; cbRowInfo* pRow;
bool success = LocateBar( pBar, &pRow, &pPane ); #ifdef __WXDEBUG__
bool success =
#endif
LocateBar( pBar, &pRow, &pPane );
wxASSERT( success ); // DBG:: wxASSERT( success ); // DBG::
@@ -773,7 +781,7 @@ void wxFrameLayout::InverseVisibility( cbBarInfo* pBar )
// "inverse" bar-visibility of the selected bar // "inverse" bar-visibility of the selected bar
int newState = 0; int newState;
if ( pBar->mState == wxCBAR_HIDDEN ) if ( pBar->mState == wxCBAR_HIDDEN )
{ {
@@ -1012,7 +1020,6 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
int frmWidth, frmHeight; int frmWidth, frmHeight;
mpFrame->GetClientSize( &frmWidth, &frmHeight ); mpFrame->GetClientSize( &frmWidth, &frmHeight );
int paneHeight = 0;
int curY = 0; int curY = 0;
int curX = 0; int curX = 0;
@@ -1028,7 +1035,7 @@ void wxFrameLayout::RecalcLayout( bool repositionBarsNow )
pPane->SetPaneWidth( frmWidth ); pPane->SetPaneWidth( frmWidth );
pPane->RecalcLayout(); pPane->RecalcLayout();
paneHeight = pPane->GetPaneHeight(); int paneHeight = pPane->GetPaneHeight();
rect.x = curX; rect.x = curX;
rect.y = curY; rect.y = curY;
@@ -1362,11 +1369,6 @@ void wxFrameLayout::ForwardMouseEvent( wxMouseEvent& event,
cbMotionEvent evt( pos, pToPane ); cbMotionEvent evt( pos, pToPane );
FirePluginEvent( evt ); FirePluginEvent( evt );
} }
else
{
int avoidCompilerWarning = 0;
wxASSERT(avoidCompilerWarning); // DBG::
}
} // wxFrameLayout::ForwardMouseEvent() } // wxFrameLayout::ForwardMouseEvent()
@@ -2235,7 +2237,7 @@ void cbDockPane::PaintRowBackground ( cbRowInfo* pRow, wxDC& dc )
void cbDockPane::PaintRowDecorations( cbRowInfo* pRow, wxDC& dc ) void cbDockPane::PaintRowDecorations( cbRowInfo* pRow, wxDC& dc )
{ {
size_t i = 0; size_t i;
// decorations first // decorations first
for ( i = 0; i != pRow->mBars.Count(); ++i ) for ( i = 0; i != pRow->mBars.Count(); ++i )
@@ -2271,9 +2273,9 @@ void cbDockPane::PaintPaneDecorations( wxDC& dc )
void cbDockPane::PaintPane( wxDC& dc ) void cbDockPane::PaintPane( wxDC& dc )
{ {
PaintPaneBackground( dc ); size_t i;
size_t i = 0; PaintPaneBackground( dc );
// first decorations // first decorations
for ( i = 0; i != mRows.Count(); ++i ) for ( i = 0; i != mRows.Count(); ++i )
@@ -2625,9 +2627,9 @@ bool cbDockPane::HasNotFixedBarsRight( cbBarInfo* pBar )
void cbDockPane::CalcLengthRatios( cbRowInfo* pInRow ) 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 // calc current-maximal-total-length of all maximized bars
@@ -2781,7 +2783,7 @@ void cbDockPane::InitLinksForRows()
void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo ) void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo )
{ {
cbRowInfo* pRow = NULL; cbRowInfo* pRow;
if ( rowNo == -1 || rowNo >= (int)mRows.Count() ) if ( rowNo == -1 || rowNo >= (int)mRows.Count() )
{ {

View File

@@ -374,7 +374,7 @@ void wxDynamicToolBar::SizeToolWindows()
bStateCheckDone = TRUE; bStateCheckDone = TRUE;
size_t j; size_t j;
wxDynToolInfo *pInfo = NULL; wxDynToolInfo *pInfo;
wxDynToolInfo *pPrevInfo = NULL; wxDynToolInfo *pPrevInfo = NULL;
int nVertSeparators = 0; int nVertSeparators = 0;

View File

@@ -41,9 +41,6 @@ void wxFrameView::OnIdle( wxIdleEvent& event)
if ( mDoToolUpdates ) if ( mDoToolUpdates )
{ {
int o = 0; //glt
++o;
// TBD:: // TBD::
} }
} }

View File

@@ -69,10 +69,7 @@ wxNode* GarbageCollector::FindItemNode( void* pForObj )
pNode = pNode->GetNext(); pNode = pNode->GetNext();
} }
int avoidCompilerWarning = 0; return NULL;
wxASSERT(avoidCompilerWarning); // DBG:: item should be present
return 0;
} }
wxNode* GarbageCollector::FindReferenceFreeItemNode() wxNode* GarbageCollector::FindReferenceFreeItemNode()

View File

@@ -294,7 +294,7 @@ void cbPaneDrawPlugin::OnMouseMove( cbMotionEvent& event )
return; return;
} }
wxCursor* pCurs = NULL; wxCursor* pCurs;
if ( testResult == CB_UPPER_ROW_HANDLE_HITTED || if ( testResult == CB_UPPER_ROW_HANDLE_HITTED ||
testResult == CB_LOWER_ROW_HANDLE_HITTED) testResult == CB_LOWER_ROW_HANDLE_HITTED)

View File

@@ -226,21 +226,11 @@ void cbRowDragPlugin::OnMouseMove( cbMotionEvent& event )
if ( mpPane->IsHorizontal() ) if ( mpPane->IsHorizontal() )
{ {
// DBG::
wxPoint p = event.mPos;
wxPoint d = mDragOrigin;
// int dif = event.mPos.x - mDragOrigin.x;
// row is dragged up or down; // row is dragged up or down;
ShowDraggedRow( pos.y - mDragOrigin.y ); ShowDraggedRow( pos.y - mDragOrigin.y );
} }
else else
{ {
// DBG::
wxPoint p = event.mPos;
wxPoint d = mDragOrigin;
// int dif = event.mPos.x - mDragOrigin.x;
// row is dragged left or right // row is dragged left or right
ShowDraggedRow( pos.x - mDragOrigin.x ); ShowDraggedRow( pos.x - mDragOrigin.x );
} }

View File

@@ -219,8 +219,8 @@ void cbRowLayoutPlugin::AdjustLengthOfInserted( cbRowInfo* WXUNUSED(pRow), cbBar
void cbRowLayoutPlugin::FitBarsToRange( int from, int till, void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
cbBarInfo* pTheBar, cbRowInfo* pRow ) cbBarInfo* pTheBar, cbRowInfo* pRow )
{ {
cbBarInfo* pFromBar = NULL; cbBarInfo* pFromBar;
cbBarInfo* pTillBar = NULL; cbBarInfo* pTillBar;
if ( pTheBar->mBounds.x > from ) if ( pTheBar->mBounds.x > from )
{ {
@@ -400,11 +400,11 @@ void cbRowLayoutPlugin::RecalcLengthRatios( cbRowInfo* pRow )
void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow ) void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
{ {
size_t i;
double pcntSum = 0; double pcntSum = 0;
// FOR NOW:: all-in-one // FOR NOW:: all-in-one
size_t i = 0;
for ( i = 0; i != pRow->mBars.Count(); ++i ) for ( i = 0; i != pRow->mBars.Count(); ++i )
{ {
if ( !pRow->mBars[i]->IsFixed() ) if ( !pRow->mBars[i]->IsFixed() )
@@ -1109,8 +1109,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
// FIXME:: Next line not used. // FIXME:: Next line not used.
//int newHeight = pTheRow->mRowHeight; //int newHeight = pTheRow->mRowHeight;
int freeSpc = 0;
if ( forUpperHandle ) if ( forUpperHandle )
{ {
// calculate available free space from above, // calculate available free space from above,
@@ -1120,8 +1118,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
while( pRow ) while( pRow )
{ {
freeSpc += pRow->mRowHeight - event.mpPane->GetMinimalRowHeight( pRow );
pRow = pRow->mpPrev; pRow = pRow->mpPrev;
} }
} }
@@ -1134,8 +1130,6 @@ void cbRowLayoutPlugin::OnResizeRow( cbResizeRowEvent& event )
while( pRow ) while( pRow )
{ {
freeSpc += pRow->mRowHeight - mpPane->GetMinimalRowHeight( pRow );
pRow = pRow->mpNext; pRow = pRow->mpNext;
} }
} }

View File

@@ -2064,7 +2064,7 @@ void wxShape::ReadRegions(wxExpr *clause)
wxChar regionNameBuf[20]; wxChar regionNameBuf[20];
wxChar textNameBuf[20]; wxChar textNameBuf[20];
wxExpr *regionExpr = NULL; wxExpr *regionExpr;
wxExpr *textExpr = NULL; wxExpr *textExpr = NULL;
wxSprintf(regionNameBuf, _T("region%d"), regionNo); wxSprintf(regionNameBuf, _T("region%d"), regionNo);
wxSprintf(textNameBuf, _T("text%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. // Return the zero-based position in m_lines of line.
int wxShape::GetLinePosition(wxLineShape* line) int wxShape::GetLinePosition(wxLineShape* line)
{ {
size_t i = 0; for (size_t i = 0; i < m_lines.GetCount(); i++)
for (i = 0; i < m_lines.GetCount(); i++)
if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line) if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line)
return i; return i;

View File

@@ -203,15 +203,12 @@ bool PolylineHitTest(double n, double xvec[], double yvec[],
double line_ratio; double line_ratio;
double other_ratio; double other_ratio;
// char buf[300];
for (i = 1; i < n; i++) for (i = 1; i < n; i++)
{ {
oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i], oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i],
&line_ratio, &other_ratio); &line_ratio, &other_ratio);
if (line_ratio != 1.0) if (line_ratio != 1.0)
isAHit = TRUE; isAHit = TRUE;
// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio);
// ClipsErrorFunction(buf);
lastx = xvec[i]; lastx = xvec[i];
lasty = yvec[i]; lasty = yvec[i];
@@ -226,13 +223,8 @@ bool PolylineHitTest(double n, double xvec[], double yvec[],
&line_ratio, &other_ratio); &line_ratio, &other_ratio);
if (line_ratio != 1.0) if (line_ratio != 1.0)
isAHit = TRUE; 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; return isAHit;
} }

View File

@@ -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). // 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))) if (!nearest_object || !(object->IsKindOf(CLASSINFO(wxDivisionShape)) || WhollyContains(object, nearest_object)))
{ {
nearest = dist;
nearest_object = object; nearest_object = object;
nearest_attachment = temp_attachment; nearest_attachment = temp_attachment;
current = NULL; current = NULL;

View File

@@ -693,11 +693,7 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
haveConstraints = FALSE; haveConstraints = FALSE;
break; break;
} }
int cType = 0;
double cXSpacing = 0.0;
double cYSpacing = 0.0;
wxString cName = wxEmptyString; wxString cName = wxEmptyString;
long cId = 0;
wxShape *m_constrainingObject = NULL; wxShape *m_constrainingObject = NULL;
wxList m_constrainedObjects; wxList m_constrainedObjects;
@@ -712,11 +708,11 @@ void wxCompositeShape::ReadConstraints(wxExpr *clause, wxExprDatabase *database)
wxExpr *constrainingExpr = constraintExpr->Nth(5); wxExpr *constrainingExpr = constraintExpr->Nth(5);
wxExpr *constrainedExpr = constraintExpr->Nth(6); wxExpr *constrainedExpr = constraintExpr->Nth(6);
cType = (int)typeExpr->IntegerValue(); int cType = (int)typeExpr->IntegerValue();
cXSpacing = xExpr->RealValue(); double cXSpacing = xExpr->RealValue();
cYSpacing = yExpr->RealValue(); double cYSpacing = yExpr->RealValue();
cName = nameExpr->StringValue(); cName = nameExpr->StringValue();
cId = idExpr->IntegerValue(); long cId = idExpr->IntegerValue();
wxExpr *objExpr1 = database->HashFind(_T("node_image"), constrainingExpr->IntegerValue()); wxExpr *objExpr1 = database->HashFind(_T("node_image"), constrainingExpr->IntegerValue());
if (objExpr1 && objExpr1->GetClientData()) if (objExpr1 && objExpr1->GetClientData())
@@ -1180,8 +1176,8 @@ void wxDivisionShape::MakeMandatoryControlPoints()
double maxX, maxY; double maxX, maxY;
GetBoundingBoxMax(&maxX, &maxY); GetBoundingBoxMax(&maxX, &maxY);
double x, y; double x = 0.0 , y = 0.0;
int direction; int direction = 0;
/* /*
if (m_leftSide) if (m_leftSide)
{ {
@@ -1585,8 +1581,7 @@ public:
}; };
BEGIN_EVENT_TABLE(OGLPopupDivisionMenu, wxMenu) BEGIN_EVENT_TABLE(OGLPopupDivisionMenu, wxMenu)
EVT_CUSTOM_RANGE(wxEVT_COMMAND_MENU_SELECTED, EVT_MENU_RANGE(DIVISION_MENU_SPLIT_HORIZONTALLY,
DIVISION_MENU_SPLIT_HORIZONTALLY,
DIVISION_MENU_EDIT_BOTTOM_EDGE, DIVISION_MENU_EDIT_BOTTOM_EDGE,
OGLPopupDivisionMenu::OnMenu) OGLPopupDivisionMenu::OnMenu)
END_EVENT_TABLE() END_EVENT_TABLE()

View File

@@ -243,18 +243,8 @@ bool wxDividedShape::GetAttachmentPosition(int attachment, double *x, double *y,
// Left or right. // Left or right.
else else
{ {
int i = 0; bool isLeft = !(attachment < (n+1));
bool isLeft = FALSE; int i = (isLeft) ? (totalNumberAttachments - attachment - 1) : (attachment-1);
if (attachment < (n+1))
{
i = attachment-1;
isLeft = FALSE;
}
else
{
i = (totalNumberAttachments - attachment - 1);
isLeft = TRUE;
}
wxNode *node = GetRegions().Item(i); wxNode *node = GetRegions().Item(i);
if (node) if (node)
{ {

View File

@@ -89,8 +89,7 @@ void wxDrawnShape::SetSize(double w, double h, bool WXUNUSED(recursive))
scaleY = 1.0; scaleY = 1.0;
else scaleY = h/GetHeight(); else scaleY = h/GetHeight();
int i = 0; for (int i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
{ {
if (m_metafiles[i].IsValid()) if (m_metafiles[i].IsValid())
m_metafiles[i].Scale(scaleX, scaleY); m_metafiles[i].Scale(scaleX, scaleY);
@@ -242,8 +241,7 @@ void wxDrawnShape::WriteAttributes(wxExpr *clause)
clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile); clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile);
if (m_saveToFile) if (m_saveToFile)
{ {
int i = 0; for (int i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
{ {
if (m_metafiles[i].IsValid()) if (m_metafiles[i].IsValid())
m_metafiles[i].WriteAttributes(clause, i); m_metafiles[i].WriteAttributes(clause, i);
@@ -262,8 +260,7 @@ void wxDrawnShape::ReadAttributes(wxExpr *clause)
if (m_saveToFile) if (m_saveToFile)
{ {
int i = 0; for (int i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
{ {
m_metafiles[i].ReadAttributes(clause, i); m_metafiles[i].ReadAttributes(clause, i);
} }
@@ -280,8 +277,7 @@ void wxDrawnShape::Copy(wxShape& copy)
wxDrawnShape& drawnCopy = (wxDrawnShape&) copy; wxDrawnShape& drawnCopy = (wxDrawnShape&) copy;
int i = 0; for (int i = 0; i < 4; i++)
for (i = 0; i < 4; i++)
{ {
m_metafiles[i].Copy(drawnCopy.m_metafiles[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 *xpoints = new double[n];
double *ypoints = new double[n]; double *ypoints = new double[n];
int i = 0; for (int i = 0; i < n; i++)
for (i = 0; i < n; i++)
{ {
wxRealPoint *point = & (m_points[i]); wxRealPoint *point = & (m_points[i]);
xpoints[i] = point->x + xOffset; xpoints[i] = point->x + xOffset;

View File

@@ -115,8 +115,7 @@ void wxLineShape::MakeLineControlPoints(int n)
} }
m_lineControlPoints = new wxList; m_lineControlPoints = new wxList;
int i = 0; for (int i = 0; i < n; i++)
for (i = 0; i < n; i++)
{ {
wxRealPoint *point = new wxRealPoint(-999, -999); wxRealPoint *point = new wxRealPoint(-999, -999);
m_lineControlPoints->Append((wxObject*) point); m_lineControlPoints->Append((wxObject*) point);
@@ -598,7 +597,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
double positionOnLineX, positionOnLineY; double positionOnLineX, positionOnLineY;
// Position of start point of line, at the end of which we draw the arrow. // 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()) switch (arrow->GetPosition())
{ {
@@ -691,7 +690,7 @@ void wxLineShape::DrawArrow(wxDC& dc, wxArrowHead *arrow, double xOffset, bool p
double y3 = positionOnLineY; double y3 = positionOnLineY;
double d = -arrow->GetYOffset(); // Negate so +offset is above line double d = -arrow->GetYOffset(); // Negate so +offset is above line
double theta = 0.0; double theta;
if (x3 == x1) if (x3 == x1)
theta = (double)(myPi/2.0); theta = (double)(myPi/2.0);
else else
@@ -2036,9 +2035,9 @@ bool wxLineShape::AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int
return TRUE; return TRUE;
} }
wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
while (refNode && currNode) while (refNode && currNode)
{ {
wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
refArrow = (wxArrowHead *)refNode->GetData(); refArrow = (wxArrowHead *)refNode->GetData();
// Matching: advance current arrow pointer // Matching: advance current arrow pointer
@@ -2318,7 +2317,7 @@ int wxLineShape::GetAlignmentType(bool isEnd)
wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject) wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
{ {
int n = m_lineControlPoints->GetCount(); int n = m_lineControlPoints->GetCount();
int nn = 0; int nn;
if (m_to == nodeObject) if (m_to == nodeObject)
{ {
// Must be END of line, so we want (n - 1)th control point. // Must be END of line, so we want (n - 1)th control point.

View File

@@ -33,18 +33,6 @@
static char _buf[1024]; // a temp buffer to use inplace of wxBuffer, which is deprecated. 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 // 16-bit unsigned integer
static unsigned int getshort(FILE *fp) static unsigned int getshort(FILE *fp)
{ {
@@ -64,7 +52,7 @@ static int getsignedshort(FILE *fp)
int testRes = ((unsigned int) c) + (((unsigned int) c1) << 8); int testRes = ((unsigned int) c) + (((unsigned int) c1) << 8);
#endif #endif
unsigned long res1 = ((unsigned int) c) + (((unsigned int) c1) << 8); unsigned long res1 = ((unsigned int) c) + (((unsigned int) c1) << 8);
int res = 0; int res;
if (res1 > 32767) if (res1 > 32767)
res = (int)(res1 - 65536); res = (int)(res1 - 65536);
else else

View File

@@ -231,7 +231,7 @@ bool wxDiagram::SaveFile(const wxString& filename)
if (!shape->IsKindOf(CLASSINFO(wxControlPoint))) if (!shape->IsKindOf(CLASSINFO(wxControlPoint)))
{ {
wxExpr *expr = NULL; wxExpr *expr;
if (shape->IsKindOf(CLASSINFO(wxLineShape))) if (shape->IsKindOf(CLASSINFO(wxLineShape)))
expr = new wxExpr(_T("line")); expr = new wxExpr(_T("line"));
else else
@@ -239,7 +239,7 @@ bool wxDiagram::SaveFile(const wxString& filename)
OnShapeSave(*database, *shape, *expr); OnShapeSave(*database, *shape, *expr);
} }
node = node->Next(); node = node->GetNext();
} }
OnDatabaseSave(*database); OnDatabaseSave(*database);
@@ -308,14 +308,14 @@ bool wxDiagram::LoadFile(const wxString& filename)
OnHeaderLoad(database, *header); OnHeaderLoad(database, *header);
// Scan through all clauses and register the ids // Scan through all clauses and register the ids
wxNode *node = database.First(); wxNode *node = database.GetFirst();
while (node) while (node)
{ {
wxExpr *clause = (wxExpr *)node->GetData(); wxExpr *clause = (wxExpr *)node->GetData();
long id = -1; long id = -1;
clause->GetAttributeValue(_T("id"), id); clause->GetAttributeValue(_T("id"), id);
wxRegisterId(id); wxRegisterId(id);
node = node->Next(); node = node->GetNext();
} }
ReadNodes(database); ReadNodes(database);
@@ -534,13 +534,13 @@ bool wxDiagram::OnShapeSave(wxExprDatabase& db, wxShape& shape, wxExpr& expr)
if (shape.IsKindOf(CLASSINFO(wxCompositeShape))) if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
{ {
wxNode *node = shape.GetChildren().First(); wxNode *node = shape.GetChildren().GetFirst();
while (node) while (node)
{ {
wxShape *childShape = (wxShape *)node->GetData(); wxShape *childShape = (wxShape *)node->GetData();
wxExpr *childExpr = new wxExpr(_T("shape")); wxExpr *childExpr = new wxExpr(_T("shape"));
OnShapeSave(db, *childShape, *childExpr); OnShapeSave(db, *childShape, *childExpr);
node = node->Next(); node = node->GetNext();
} }
} }

View File

@@ -360,7 +360,6 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
long current_width = 0; long current_width = 0;
wxNode *current = text_list->GetFirst(); wxNode *current = text_list->GetFirst();
int i = 0;
while (current) while (current)
{ {
wxShapeTextLine *line = (wxShapeTextLine *)current->GetData(); wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
@@ -369,7 +368,6 @@ void oglGetCentredTextExtent(wxDC& dc, wxList *text_list,
if (current_width > max_width) if (current_width > max_width)
max_width = current_width; max_width = current_width;
current = current->GetNext(); current = current->GetNext();
i ++;
} }
*actual_height = n*char_height; *actual_height = n*char_height;