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:
@@ -97,7 +97,7 @@ MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, cons
|
||||
|
||||
// Define the behaviour for the frame closing
|
||||
// - must delete all frames except for the main one.
|
||||
void MyFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
if (wxGetApp().m_childWindow)
|
||||
{
|
||||
@@ -107,32 +107,32 @@ void MyFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& event)
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnDialogList(wxCommandEvent& event)
|
||||
void MyFrame::OnDialogList(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxGetApp().PropertyListTest(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnFrameList(wxCommandEvent& event)
|
||||
void MyFrame::OnFrameList(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxGetApp().PropertyListTest(FALSE);
|
||||
}
|
||||
|
||||
void MyFrame::OnDialogForm(wxCommandEvent& event)
|
||||
void MyFrame::OnDialogForm(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxGetApp().PropertyFormTest(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnFrameForm(wxCommandEvent& event)
|
||||
void MyFrame::OnFrameForm(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxGetApp().PropertyFormTest(FALSE);
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& event)
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(void)wxMessageBox(_T("Property Classes Demo\nAuthor: Julian Smart"), _T("About Property Classes Test"));
|
||||
}
|
||||
|
@@ -152,12 +152,12 @@ MyFrame::MyFrame(wxWindow *parent, const wxString& title, const wxPoint& pos, co
|
||||
{
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit(wxCommandEvent& event)
|
||||
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnLeftRight(wxCommandEvent& event)
|
||||
void MyFrame::OnLeftRight(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (myTree)
|
||||
{
|
||||
@@ -170,7 +170,7 @@ void MyFrame::OnLeftRight(wxCommandEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::OnTopBottom(wxCommandEvent& event)
|
||||
void MyFrame::OnTopBottom(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
if (myTree)
|
||||
{
|
||||
@@ -183,12 +183,12 @@ void MyFrame::OnTopBottom(wxCommandEvent& event)
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout(wxCommandEvent& event)
|
||||
void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
(void)wxMessageBox(_T("wxWindows tree library demo Vsn 2.0\nAuthor: Julian Smart (c) 1998"), _T("About tree test"));
|
||||
}
|
||||
|
||||
void MyFrame::OnCloseWindow(wxCloseEvent& event)
|
||||
void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event))
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
@@ -205,7 +205,7 @@ MyCanvas::MyCanvas(wxWindow *parent):
|
||||
}
|
||||
|
||||
// Define the repainting behaviour
|
||||
void MyCanvas::OnPaint(wxPaintEvent& event)
|
||||
void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
|
||||
{
|
||||
wxPaintDC dc(this);
|
||||
PrepareDC(dc);
|
||||
|
@@ -96,17 +96,17 @@ BEGIN_EVENT_TABLE( MyFrame, wxFrame )
|
||||
EVT_MENU( NEW_TEST_EXIT, MyFrame::OnExit )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void MyFrame::OnLoad( wxCommandEvent& event )
|
||||
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_T("Hey - you found a BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnSave( wxCommandEvent& event )
|
||||
void MyFrame::OnSave( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_("Hey - you found another BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnExit( wxCommandEvent& event )
|
||||
void MyFrame::OnExit( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
Destroy();
|
||||
}
|
||||
|
@@ -166,6 +166,8 @@ MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h
|
||||
|
||||
mImageList( 16,16, FALSE, 2 )
|
||||
{
|
||||
int i;
|
||||
|
||||
mpInternalFrm = (wxPanel*)this;
|
||||
|
||||
mAboutBox.Create( this, -1, _T("About box in wxWindows style..."),
|
||||
@@ -173,7 +175,6 @@ MyFrame::MyFrame(wxFrame *frame, const wxChar *title, int x, int y, int w, int h
|
||||
wxSize( 385,220),
|
||||
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
|
||||
|
||||
int i = 0;
|
||||
for( i = 0; i != MAX_LAYOUTS; ++i )
|
||||
mLayouts[i] = NULL;
|
||||
|
||||
@@ -240,17 +241,17 @@ bool MyFrame::OnClose(void)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void MyFrame::OnLoad( wxCommandEvent& event )
|
||||
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_("Hey - you found a BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnStore( wxCommandEvent& event )
|
||||
void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_("Hey - you found another BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnAutoSave( wxCommandEvent& event )
|
||||
void MyFrame::OnAutoSave( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAutoSave = !mAutoSave;
|
||||
|
||||
@@ -260,14 +261,14 @@ void MyFrame::OnAutoSave( wxCommandEvent& event )
|
||||
SyncMenuBarItems();
|
||||
}
|
||||
|
||||
void MyFrame::OnRemove( wxCommandEvent& event )
|
||||
void MyFrame::OnRemove( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
RemoveLayout( mActiveLayoutNo );
|
||||
|
||||
Refresh();
|
||||
}
|
||||
|
||||
void MyFrame::OnRemoveAll( wxCommandEvent& event )
|
||||
void MyFrame::OnRemoveAll( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
for( int i = 0; i != MAX_LAYOUTS; ++i )
|
||||
{
|
||||
@@ -287,22 +288,22 @@ void MyFrame::OnRecreate( wxCommandEvent& event )
|
||||
mLayouts[mActiveLayoutNo]->Activate();
|
||||
}
|
||||
|
||||
void MyFrame::OnFirst( wxCommandEvent& event )
|
||||
void MyFrame::OnFirst( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
ActivateLayout( FIRST_LAYOUT );
|
||||
}
|
||||
|
||||
void MyFrame::OnSecond( wxCommandEvent& event )
|
||||
void MyFrame::OnSecond( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
ActivateLayout( SECOND_LAYOUT );
|
||||
}
|
||||
|
||||
void MyFrame::OnThird( wxCommandEvent& event )
|
||||
void MyFrame::OnThird( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
ActivateLayout( THIRD_LAYOUT );
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit( wxCommandEvent& event )
|
||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
// USEFUL TRICK:: avoids flickering of application's frame
|
||||
// when closing NN windows on exit:
|
||||
@@ -321,7 +322,7 @@ void MyFrame::OnQuit( wxCommandEvent& event )
|
||||
Destroy();
|
||||
}
|
||||
|
||||
void MyFrame::OnAbout( wxCommandEvent& event )
|
||||
void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxFont font;
|
||||
#ifdef __WXMSW__
|
||||
@@ -397,22 +398,22 @@ void MyFrame::OnChar( wxKeyEvent& event )
|
||||
}
|
||||
}
|
||||
|
||||
void MyFrame::OnSayItsOk( wxCommandEvent& event )
|
||||
void MyFrame::OnSayItsOk( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_("It's OK :-)\n\n now click on the border around the button\n and try dragging it!") );
|
||||
}
|
||||
|
||||
void MyFrame::OnBtnYes( wxCommandEvent& event )
|
||||
void MyFrame::OnBtnYes( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAboutBox.Show(FALSE);
|
||||
}
|
||||
|
||||
void MyFrame::OnBtnNo( wxCommandEvent& event )
|
||||
void MyFrame::OnBtnNo( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAboutBox.Show(FALSE);
|
||||
}
|
||||
|
||||
void MyFrame::OnBtnEsc( wxCommandEvent& event )
|
||||
void MyFrame::OnBtnEsc( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
mAboutBox.Show(FALSE);
|
||||
}
|
||||
@@ -524,7 +525,7 @@ wxChoice* MyFrame::CreateChoice( const wxString& txt )
|
||||
|
||||
// helper
|
||||
|
||||
void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* pParent )
|
||||
void MyFrame::AddSearchToolbars( wxFrameLayout& layout, wxWindow* WXUNUSED(pParent) )
|
||||
{
|
||||
cbDimInfo sizes2( 275,38, // when docked horizontally
|
||||
45,275, // when docked vertically
|
||||
@@ -927,14 +928,14 @@ BEGIN_EVENT_TABLE( StartButton95, wxPanel )
|
||||
EVT_PAINT ( StartButton95::OnPaint )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
void StartButton95::OnMouseDown( wxMouseEvent& event )
|
||||
void StartButton95::OnMouseDown( wxMouseEvent& WXUNUSED(event) )
|
||||
{
|
||||
m_bPressed = TRUE;
|
||||
Refresh();
|
||||
CaptureMouse();
|
||||
}
|
||||
|
||||
void StartButton95::OnMouseUp( wxMouseEvent& event )
|
||||
void StartButton95::OnMouseUp( wxMouseEvent& WXUNUSED(event) )
|
||||
{
|
||||
// "this is not a bug"
|
||||
|
||||
@@ -943,8 +944,7 @@ void StartButton95::OnMouseUp( wxMouseEvent& event )
|
||||
::wxSetCursor( wxCURSOR_WAIT );
|
||||
wxSleep(1);
|
||||
|
||||
int i = 0;
|
||||
for( i = 1; i != 6; ++i )
|
||||
for( int i = 1; i != 6; ++i )
|
||||
{
|
||||
m_bPressed = (i % 2) != 0;
|
||||
Refresh();
|
||||
@@ -954,9 +954,9 @@ void StartButton95::OnMouseUp( wxMouseEvent& event )
|
||||
//*((char*)(i)-3) = 'X'; // Aleks what's the meaning of this???
|
||||
}
|
||||
|
||||
void StartButton95::OnPaint( wxPaintEvent& event )
|
||||
void StartButton95::OnPaint( wxPaintEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxBitmap* pBmp = 0;
|
||||
wxBitmap* pBmp;
|
||||
|
||||
if ( m_bPressed )
|
||||
{
|
||||
|
@@ -102,7 +102,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||
: wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition,
|
||||
: wxFrame( parent, -1, title, wxDefaultPosition,
|
||||
wxSize( 700, 500 ),
|
||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||
@@ -177,17 +177,17 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||
return pCtrl;
|
||||
}
|
||||
|
||||
void MyFrame::OnLoad( wxCommandEvent& event )
|
||||
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(wxT("Hey - you found a BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnStore( wxCommandEvent& event )
|
||||
void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(wxT("Hey - you found another BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit( wxCommandEvent& event )
|
||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
|
||||
|
||||
|
@@ -103,7 +103,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||
: wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition,
|
||||
: wxFrame( parent, -1, title, wxDefaultPosition,
|
||||
wxSize( 700, 500 ),
|
||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||
@@ -175,17 +175,17 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||
return pCtrl;
|
||||
}
|
||||
|
||||
void MyFrame::OnLoad( wxCommandEvent& event )
|
||||
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(wxT("Hey - you found a BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnStore( wxCommandEvent& event )
|
||||
void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(wxT("Hey - you found another BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit( wxCommandEvent& event )
|
||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
|
||||
|
||||
|
@@ -108,7 +108,7 @@ BEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
MyFrame::MyFrame( wxWindow* parent, const wxChar *title )
|
||||
: wxFrame( parent, -1, _("NewTest-II"), wxDefaultPosition,
|
||||
: wxFrame( parent, -1, title, wxDefaultPosition,
|
||||
wxSize( 700, 500 ),
|
||||
wxCLIP_CHILDREN | wxMINIMIZE_BOX | wxMAXIMIZE_BOX |
|
||||
wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION,
|
||||
@@ -202,24 +202,24 @@ wxTextCtrl* MyFrame::CreateTextCtrl( const wxString& value )
|
||||
return pCtrl;
|
||||
}
|
||||
|
||||
void MyFrame::OnLoad( wxCommandEvent& event )
|
||||
void MyFrame::OnLoad( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_("Hey - you found a BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnStore( wxCommandEvent& event )
|
||||
void MyFrame::OnStore( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
wxMessageBox(_("Hey - you found another BIG question-mark !!"));
|
||||
}
|
||||
|
||||
void MyFrame::OnQuit( wxCommandEvent& event )
|
||||
void MyFrame::OnQuit( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
Show( FALSE ); // TRICK:: hide it, to avoid flickered destruction
|
||||
|
||||
Close(TRUE);
|
||||
}
|
||||
|
||||
void MyFrame::OnButt( wxCommandEvent& event )
|
||||
void MyFrame::OnButt( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
static int i =0;
|
||||
|
||||
@@ -266,7 +266,7 @@ void MyFrame::OnButt( wxCommandEvent& event )
|
||||
i++;
|
||||
}
|
||||
|
||||
void MyFrame::OnButt2( wxCommandEvent& event )
|
||||
void MyFrame::OnButt2( wxCommandEvent& WXUNUSED(event) )
|
||||
{
|
||||
static int i =0;
|
||||
|
||||
|
@@ -222,7 +222,7 @@ bool DiagramCommand::Do(void)
|
||||
}
|
||||
case OGLEDIT_ADD_SHAPE:
|
||||
{
|
||||
wxShape *theShape = NULL;
|
||||
wxShape *theShape;
|
||||
if (shape)
|
||||
theShape = shape; // Saved from undoing the shape
|
||||
else
|
||||
@@ -253,7 +253,7 @@ bool DiagramCommand::Do(void)
|
||||
}
|
||||
case OGLEDIT_ADD_LINE:
|
||||
{
|
||||
wxShape *theShape = NULL;
|
||||
wxShape *theShape;
|
||||
if (shape)
|
||||
theShape = shape; // Saved from undoing the line
|
||||
else
|
||||
@@ -424,13 +424,13 @@ bool DiagramCommand::Undo(void)
|
||||
// Remove each individual line connected to a shape by sending a command.
|
||||
void DiagramCommand::RemoveLines(wxShape *shape)
|
||||
{
|
||||
wxNode *node = shape->GetLines().First();
|
||||
wxNode *node = shape->GetLines().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxLineShape *line = (wxLineShape *)node->Data();
|
||||
wxLineShape *line = (wxLineShape *)node->GetData();
|
||||
doc->GetCommandProcessor()->Submit(new DiagramCommand(_T("Cut"), OGLEDIT_CUT, doc, NULL, 0.0, 0.0, line->Selected(), line));
|
||||
|
||||
node = shape->GetLines().First();
|
||||
node = shape->GetLines().GetFirst();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -455,10 +455,10 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
|
||||
{
|
||||
// Ensure no other shape is selected, to simplify Undo/Redo code
|
||||
bool redraw = FALSE;
|
||||
wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
|
||||
wxNode *node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *eachShape = (wxShape *)node->Data();
|
||||
wxShape *eachShape = (wxShape *)node->GetData();
|
||||
if (eachShape->GetParent() == NULL)
|
||||
{
|
||||
if (eachShape->Selected())
|
||||
@@ -467,7 +467,7 @@ void MyEvtHandler::OnLeftClick(double WXUNUSED(x), double WXUNUSED(y), int keys,
|
||||
redraw = TRUE;
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
GetShape()->Select(TRUE, &dc);
|
||||
if (redraw)
|
||||
|
@@ -72,7 +72,6 @@ bool MyApp::OnInit(void)
|
||||
|
||||
//// Make a menubar
|
||||
wxMenu *file_menu = new wxMenu;
|
||||
wxMenu *edit_menu = NULL;
|
||||
|
||||
file_menu->Append(wxID_NEW, _T("&New..."));
|
||||
file_menu->Append(wxID_OPEN, _T("&Open..."));
|
||||
@@ -85,7 +84,7 @@ bool MyApp::OnInit(void)
|
||||
file_menu->Append(wxID_PRINT_SETUP, _T("Print &Setup..."));
|
||||
file_menu->Append(wxID_PREVIEW, _T("Print Pre&view"));
|
||||
|
||||
edit_menu = new wxMenu;
|
||||
wxMenu *edit_menu = new wxMenu;
|
||||
edit_menu->Append(wxID_UNDO, _T("&Undo"));
|
||||
edit_menu->Append(wxID_REDO, _T("&Redo"));
|
||||
edit_menu->AppendSeparator();
|
||||
|
@@ -127,16 +127,16 @@ void DiagramView::OnDraw(wxDC *dc)
|
||||
if (diagram_p->GetShapeList())
|
||||
{
|
||||
/* wxCursor *old_cursor = NULL; */
|
||||
wxNode *current = diagram_p->GetShapeList()->First();
|
||||
wxNode *current = diagram_p->GetShapeList()->GetFirst();
|
||||
|
||||
while (current) // Loop through the entire list of shapes
|
||||
{
|
||||
wxShape *object = (wxShape *)current->Data();
|
||||
wxShape *object = (wxShape *)current->GetData();
|
||||
if (!object->GetParent())
|
||||
{
|
||||
object->Draw(* dc); // Draw the shape onto our printing dc
|
||||
}
|
||||
current = current->Next(); // Procede to the next shape in the list
|
||||
current = current->GetNext(); // Procede to the next shape in the list
|
||||
}
|
||||
}
|
||||
dc->EndDrawing(); // Allows optimization of drawing code under MS Windows.
|
||||
@@ -177,16 +177,16 @@ wxShape *DiagramView::FindSelectedShape(void)
|
||||
{
|
||||
DiagramDocument *doc = (DiagramDocument *)GetDocument();
|
||||
wxShape *theShape = NULL;
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->First();
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *eachShape = (wxShape *)node->Data();
|
||||
wxShape *eachShape = (wxShape *)node->GetData();
|
||||
if ((eachShape->GetParent() == NULL) && eachShape->Selected())
|
||||
{
|
||||
theShape = eachShape;
|
||||
node = NULL;
|
||||
}
|
||||
else node = node->Next();
|
||||
else node = node->GetNext();
|
||||
}
|
||||
return theShape;
|
||||
}
|
||||
|
@@ -70,10 +70,10 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
|
||||
// First copy all node shapes.
|
||||
wxList* shapeList = diagramFrom->GetShapeList();
|
||||
wxNode* node = shapeList->First();
|
||||
wxNode* node = shapeList->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
wxShape* newShape = shape->CreateNewCopy();
|
||||
@@ -90,13 +90,13 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
OnAddShape(diagramTo, newShape, dc);
|
||||
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
node = shapeList->First();
|
||||
node = shapeList->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (((diagramFrom == this) || shape->Selected()) && shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
wxLineShape* lineShape = (wxLineShape*) shape;
|
||||
@@ -122,14 +122,14 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
// Now make sure line ordering is correct
|
||||
node = shapeList->First();
|
||||
node = shapeList->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (((diagramFrom == this) || shape->Selected()) && !shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
wxShape* newShape = (wxShape*) mapping.Get((long) shape);
|
||||
@@ -137,10 +137,10 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
// Make a list of all the new lines, in the same order as the old lines.
|
||||
// Then apply the list of new lines to the shape.
|
||||
wxList newLines;
|
||||
wxNode* lineNode = shape->GetLines().First();
|
||||
wxNode* lineNode = shape->GetLines().GetFirst();
|
||||
while (lineNode)
|
||||
{
|
||||
wxLineShape* lineShape = (wxLineShape*) lineNode->Data();
|
||||
wxLineShape* lineShape = (wxLineShape*) lineNode->GetData();
|
||||
if ((diagramFrom == this) || (lineShape->GetTo()->Selected() && lineShape->GetFrom()->Selected()))
|
||||
{
|
||||
wxLineShape* newLineShape = (wxLineShape*) mapping.Get((long) lineShape);
|
||||
@@ -150,13 +150,13 @@ bool wxDiagramClipboard::DoCopy(wxDiagram* diagramFrom, wxDiagram* diagramTo, bo
|
||||
newLines.Append(newLineShape);
|
||||
}
|
||||
|
||||
lineNode = lineNode->Next();
|
||||
lineNode = lineNode->GetNext();
|
||||
}
|
||||
|
||||
if (newLines.Number() > 0)
|
||||
if (newLines.GetCount() > 0)
|
||||
newShape->ApplyAttachmentOrdering(newLines);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
OnEndCopy(diagramTo);
|
||||
@@ -284,7 +284,7 @@ bool csDiagramClipboard::OnEndCopy(wxDiagram* diagramTo)
|
||||
|
||||
if (m_currentCmd)
|
||||
{
|
||||
if (m_currentCmd->GetStates().Number() == 0)
|
||||
if (m_currentCmd->GetStates().GetCount() == 0)
|
||||
{
|
||||
delete m_currentCmd;
|
||||
}
|
||||
|
@@ -100,13 +100,19 @@ csSettingsDialog::csSettingsDialog(wxWindow* parent):
|
||||
|
||||
m_generalSettings = new wxPanel;
|
||||
|
||||
bool success = wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog"));
|
||||
#ifdef __WXDEBUG__
|
||||
bool success =
|
||||
#endif
|
||||
wxLoadFromResource(m_generalSettings, m_notebook, _T("general_settings_dialog"));
|
||||
wxASSERT_MSG( (success), _T("Could not load general settings panel."));
|
||||
m_notebook->AddPage(m_generalSettings, _T("General"), TRUE);
|
||||
|
||||
m_diagramSettings = new wxPanel;
|
||||
|
||||
success = wxLoadFromResource(m_diagramSettings, m_notebook, _T("diagram_settings_dialog"));
|
||||
#ifdef __WXDEBUG__
|
||||
success =
|
||||
#endif
|
||||
wxLoadFromResource(m_diagramSettings, m_notebook, _T("diagram_settings_dialog"));
|
||||
wxASSERT_MSG( (success), _T("Could not load diagram settings panel."));
|
||||
m_notebook->AddPage(m_diagramSettings, _T("Diagram"));
|
||||
|
||||
@@ -199,10 +205,10 @@ bool csSettingsDialog::TransferDataFromWindow()
|
||||
}
|
||||
|
||||
// Apply settings to all open diagram documents
|
||||
wxNode* node = wxGetApp().GetDocManager()->GetDocuments().First();
|
||||
wxNode* node = wxGetApp().GetDocManager()->GetDocuments().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxDocument* doc = (wxDocument*) node->Data();
|
||||
wxDocument* doc = (wxDocument*) node->GetData();
|
||||
if (doc->IsKindOf(CLASSINFO(csDiagramDocument)))
|
||||
{
|
||||
csDiagramDocument* diagramDoc = (csDiagramDocument*) doc;
|
||||
@@ -228,7 +234,7 @@ bool csSettingsDialog::TransferDataFromWindow()
|
||||
}
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
@@ -262,12 +268,14 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin
|
||||
wxPoint(2, 2), wxSize(SHAPE_PROPERTY_DIALOG_WIDTH - 4, SHAPE_PROPERTY_DIALOG_HEIGHT - 4));
|
||||
|
||||
m_generalPropertiesDialog = new csGeneralShapePropertiesDialog;
|
||||
bool success = wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog"));
|
||||
#ifdef __WXDEBUG__
|
||||
bool success =
|
||||
#endif
|
||||
wxLoadFromResource(m_generalPropertiesDialog, m_notebook, _T("general_shape_properties_dialog"));
|
||||
wxASSERT_MSG( (success), _T("Could not load general properties panel."));
|
||||
m_notebook->AddPage(m_generalPropertiesDialog, _T("General"));
|
||||
|
||||
success = wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName);
|
||||
if (!success)
|
||||
if (!wxLoadFromResource(m_attributeDialog, m_notebook, attributeDialogName))
|
||||
{
|
||||
wxMessageBox(_T("Could not load the attribute dialog for this shape."), _T("Studio"), wxICON_EXCLAMATION);
|
||||
delete m_attributeDialog;
|
||||
@@ -282,8 +290,7 @@ csShapePropertiesDialog::csShapePropertiesDialog(wxWindow* parent, const wxStrin
|
||||
wxString str(attributeDialogName);
|
||||
str += _T("1");
|
||||
m_alternativeAttributeDialog = new wxPanel;
|
||||
success = wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str);
|
||||
if (success)
|
||||
if (wxLoadFromResource(m_alternativeAttributeDialog, m_notebook, str))
|
||||
{
|
||||
m_notebook->AddPage(m_alternativeAttributeDialog, _T("Attributes (alternative)"));
|
||||
}
|
||||
@@ -358,31 +365,31 @@ void csShapePropertiesDialog::SetDefaults()
|
||||
if (!m_attributeDialog)
|
||||
return;
|
||||
|
||||
wxNode* node = m_attributeDialog->GetChildren().First();
|
||||
wxWindowListNode* node = m_attributeDialog->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* child = (wxWindow*) node->Data();
|
||||
wxWindow* child = (wxWindow*) node->GetData();
|
||||
if (child->IsKindOf(CLASSINFO(wxChoice)))
|
||||
{
|
||||
wxChoice* choice = (wxChoice*) child;
|
||||
choice->SetSelection(0);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
if (!m_alternativeAttributeDialog)
|
||||
return;
|
||||
|
||||
node = m_alternativeAttributeDialog->GetChildren().First();
|
||||
node = m_alternativeAttributeDialog->GetChildren().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxWindow* child = (wxWindow*) node->Data();
|
||||
wxWindow* child = (wxWindow*) node->GetData();
|
||||
if (child->IsKindOf(CLASSINFO(wxChoice)))
|
||||
{
|
||||
wxChoice* choice = (wxChoice*) child;
|
||||
choice->SetSelection(0);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -120,12 +120,12 @@ csDiagramCommand::csDiagramCommand(const wxString& name, csDiagramDocument *doc,
|
||||
|
||||
csDiagramCommand::~csDiagramCommand()
|
||||
{
|
||||
wxNode* node = m_states.First();
|
||||
wxNode* node = m_states.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csCommandState* state = (csCommandState*) node->Data();
|
||||
csCommandState* state = (csCommandState*) node->GetData();
|
||||
delete state;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,51 +147,51 @@ void csDiagramCommand::InsertState(csCommandState* state)
|
||||
// Schedule all lines connected to the states to be cut.
|
||||
void csDiagramCommand::RemoveLines()
|
||||
{
|
||||
wxNode* node = m_states.First();
|
||||
wxNode* node = m_states.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csCommandState* state = (csCommandState*) node->Data();
|
||||
csCommandState* state = (csCommandState*) node->GetData();
|
||||
wxShape* shape = state->GetShapeOnCanvas();
|
||||
wxASSERT( (shape != NULL) );
|
||||
|
||||
wxNode *node1 = shape->GetLines().First();
|
||||
wxNode *node1 = shape->GetLines().GetFirst();
|
||||
while (node1)
|
||||
{
|
||||
wxLineShape *line = (wxLineShape *)node1->Data();
|
||||
wxLineShape *line = (wxLineShape *)node1->GetData();
|
||||
if (!FindStateByShape(line))
|
||||
{
|
||||
csCommandState* newState = new csCommandState(ID_CS_CUT, NULL, line);
|
||||
InsertState(newState);
|
||||
}
|
||||
|
||||
node1 = node1->Next();
|
||||
node1 = node1->GetNext();
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
csCommandState* csDiagramCommand::FindStateByShape(wxShape* shape)
|
||||
{
|
||||
wxNode* node = m_states.First();
|
||||
wxNode* node = m_states.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csCommandState* state = (csCommandState*) node->Data();
|
||||
csCommandState* state = (csCommandState*) node->GetData();
|
||||
if (shape == state->GetShapeOnCanvas() || shape == state->GetSavedState())
|
||||
return state;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
bool csDiagramCommand::Do()
|
||||
{
|
||||
wxNode* node = m_states.First();
|
||||
wxNode* node = m_states.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csCommandState* state = (csCommandState*) node->Data();
|
||||
csCommandState* state = (csCommandState*) node->GetData();
|
||||
if (!state->Do())
|
||||
return FALSE;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -200,13 +200,13 @@ bool csDiagramCommand::Undo()
|
||||
{
|
||||
// Undo in reverse order, so e.g. shapes get added
|
||||
// back before the lines do.
|
||||
wxNode* node = m_states.Last();
|
||||
wxNode* node = m_states.GetLast();
|
||||
while (node)
|
||||
{
|
||||
csCommandState* state = (csCommandState*) node->Data();
|
||||
csCommandState* state = (csCommandState*) node->GetData();
|
||||
if (!state->Undo())
|
||||
return FALSE;
|
||||
node = node->Previous();
|
||||
node = node->GetPrevious();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
@@ -457,7 +457,7 @@ bool csCommandState::Do()
|
||||
m_shapeOnCanvas->Show(TRUE);
|
||||
|
||||
// Recursively redraw links if we have a composite.
|
||||
if (m_shapeOnCanvas->GetChildren().Number() > 0)
|
||||
if (m_shapeOnCanvas->GetChildren().GetCount() > 0)
|
||||
m_shapeOnCanvas->DrawLinks(dc, -1, TRUE);
|
||||
|
||||
m_shapeOnCanvas->GetEventHandler()->OnEndSize(width, height);
|
||||
|
@@ -31,7 +31,7 @@ BEGIN_EVENT_TABLE(csProjectTreeCtrl, wxTreeCtrl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
// Define my frame constructor
|
||||
csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
csProjectTreeCtrl::csProjectTreeCtrl(wxWindow *parent, const wxWindowID id, const wxPoint& pos, const wxSize& size,
|
||||
long style):
|
||||
|
||||
wxTreeCtrl(parent, id, pos, size, style),
|
||||
|
@@ -199,7 +199,7 @@ void csEvtHandler::OnBeginDragRight(double x, double y, int WXUNUSED(keys), int
|
||||
dc.SetPen(dottedPen);
|
||||
double xp, yp;
|
||||
GetShape()->GetAttachmentPositionEdge(attachment, &xp, &yp);
|
||||
dc.DrawLine(xp, yp, x, y);
|
||||
dc.DrawLine((wxCoord)xp, (wxCoord)yp, (wxCoord)x, (wxCoord)y);
|
||||
GetShape()->GetCanvas()->CaptureMouse();
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ void csEvtHandler::OnDragRight(bool WXUNUSED(draw), double x, double y, int WXUN
|
||||
dc.SetPen(dottedPen);
|
||||
double xp, yp;
|
||||
GetShape()->GetAttachmentPositionEdge(attachment, &xp, &yp);
|
||||
dc.DrawLine(xp, yp, x, y);
|
||||
dc.DrawLine((wxCoord)xp, (wxCoord)yp, (wxCoord)x, (wxCoord)y);
|
||||
}
|
||||
|
||||
void csEvtHandler::OnEndDragRight(double x, double y, int WXUNUSED(keys), int attachment)
|
||||
@@ -299,16 +299,16 @@ void csEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attac
|
||||
GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
|
||||
|
||||
// Draw bounding box for other selected shapes
|
||||
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
|
||||
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape()))
|
||||
{
|
||||
shape->GetBoundingBoxMax(&w, &h);
|
||||
shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, w, h);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -358,16 +358,16 @@ void csEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment)
|
||||
GetShape()->GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h);
|
||||
|
||||
// Draw bounding box for other selected shapes
|
||||
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
|
||||
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape()))
|
||||
{
|
||||
shape->GetBoundingBoxMax(&w, &h);
|
||||
shape->OnDrawOutline(dc, shape->GetX() + offsetX, shape->GetY() + offsetY, w, h);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
GetShape()->GetCanvas()->CaptureMouse();
|
||||
@@ -413,40 +413,40 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment)
|
||||
new csCommandState(ID_CS_MOVE, newShape, GetShape()));
|
||||
|
||||
// Move line points
|
||||
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
|
||||
wxNode* node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
// Only move the line point(s) if both ends move too
|
||||
if (shape->IsKindOf(CLASSINFO(wxLineShape)) &&
|
||||
((wxLineShape*)shape)->GetTo()->Selected() && ((wxLineShape*)shape)->GetFrom()->Selected())
|
||||
{
|
||||
wxLineShape* lineShape = (wxLineShape*) shape;
|
||||
|
||||
if (lineShape->GetLineControlPoints()->Number() > 2)
|
||||
if (lineShape->GetLineControlPoints()->GetCount() > 2)
|
||||
{
|
||||
wxLineShape* newLineShape = (wxLineShape*) lineShape->CreateNewCopy();
|
||||
|
||||
wxNode *node1 = newLineShape->GetLineControlPoints()->First();
|
||||
wxNode *node1 = newLineShape->GetLineControlPoints()->GetFirst();
|
||||
while (node1)
|
||||
{
|
||||
wxRealPoint *point = (wxRealPoint *)node1->Data();
|
||||
wxRealPoint *point = (wxRealPoint *)node1->GetData();
|
||||
point->x += offsetX;
|
||||
point->y += offsetY;
|
||||
node1 = node1->Next();
|
||||
node1 = node1->GetNext();
|
||||
}
|
||||
cmd->AddState(new csCommandState(ID_CS_MOVE_LINE_POINT, newLineShape, lineShape));
|
||||
lineShape->Erase(dc);
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
// Add other selected node shapes, if any
|
||||
node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->First();
|
||||
node = GetShape()->GetCanvas()->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape->Selected() && !shape->IsKindOf(CLASSINFO(wxLineShape)) && (shape != GetShape()))
|
||||
{
|
||||
wxShape* newShape2 = shape->CreateNewCopy();
|
||||
@@ -454,7 +454,7 @@ void csEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment)
|
||||
newShape2->SetY(shape->GetY() + offsetY);
|
||||
cmd->AddState(new csCommandState(ID_CS_MOVE, newShape2, shape));
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
canvas->GetView()->GetDocument()->GetCommandProcessor()->Submit(cmd);
|
||||
@@ -736,7 +736,7 @@ csThinRectangleShape::csThinRectangleShape()
|
||||
double w = csSTANDARD_SHAPE_WIDTH/2;
|
||||
double h = csSTANDARD_SHAPE_WIDTH;
|
||||
|
||||
DrawRectangle(wxRect(- w/2, - h/2, w, h));
|
||||
DrawRectangle(wxRect((int)(- w/2), (int)(- h/2), (int)(w), (int)(h)));
|
||||
CalculateSize();
|
||||
|
||||
SetAttachmentMode(ATTACHMENT_MODE_BRANCHING);
|
||||
@@ -755,7 +755,7 @@ csWideRectangleShape::csWideRectangleShape()
|
||||
double w = csSTANDARD_SHAPE_WIDTH;
|
||||
double h = w/2.0;
|
||||
|
||||
DrawRoundedRectangle(wxRect(- w/2, - h/2, w, h), -0.3);
|
||||
DrawRoundedRectangle(wxRect((int)(- w/2), (int)(- h/2), (int)(w), (int)(h)), -0.3);
|
||||
CalculateSize();
|
||||
|
||||
SetAttachmentMode(ATTACHMENT_MODE_BRANCHING);
|
||||
@@ -778,9 +778,9 @@ csTriangleShape::csTriangleShape()
|
||||
wxPoint* points = new wxPoint[3];
|
||||
|
||||
|
||||
points[0] = wxPoint( 0 , - h / 2 );
|
||||
points[1] = wxPoint( w / 2 , h / 2 );
|
||||
points[2] = wxPoint( -w / 2, h / 2 );
|
||||
points[0] = wxPoint( 0 , (int)(- h / 2) );
|
||||
points[1] = wxPoint( (int)(w / 2) , (int)(h / 2) );
|
||||
points[2] = wxPoint( (int)(-w / 2), (int)(h / 2) );
|
||||
|
||||
DrawPolygon(3, points, oglMETAFLAGS_OUTLINE);
|
||||
|
||||
@@ -834,14 +834,14 @@ csSemiCircleShape::csSemiCircleShape()
|
||||
// bounding box, since we can't calculate the bounding box for
|
||||
// an arbitrary arc (not implemented)
|
||||
|
||||
DrawRectangle(wxRect(-w/2.0, -h/2.0, w, h));
|
||||
DrawRectangle(wxRect((int)(-w/2.0), (int)(-h/2.0), (int)(w), (int)(h)));
|
||||
|
||||
SetDrawnPen(wxBLACK_PEN);
|
||||
wxBrush* brush = wxTheBrushList->FindOrCreateBrush(wxColour(220, 220, 220), wxSOLID);
|
||||
SetDrawnBrush(brush);
|
||||
|
||||
DrawEllipticArc(wxRect(-w/2, -h/2, w, 2*h), 0.0, 180.0);
|
||||
DrawLine(wxPoint(-w/2, h/2), wxPoint(w/2, h/2));
|
||||
DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(2*h)), 0.0, 180.0);
|
||||
DrawLine(wxPoint((int)(-w/2), (int)(h/2)), wxPoint((int)(w/2), (int)(h/2)));
|
||||
|
||||
CalculateSize();
|
||||
|
||||
@@ -855,13 +855,13 @@ csSemiCircleShape::csSemiCircleShape()
|
||||
SetDrawnPen(wxTRANSPARENT_PEN);
|
||||
SetDrawnBrush(wxTRANSPARENT_BRUSH);
|
||||
|
||||
DrawRectangle(wxRect(-w/2, -h/2, w, h));
|
||||
DrawRectangle(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(h)));
|
||||
|
||||
SetDrawnPen(wxBLACK_PEN);
|
||||
SetDrawnBrush(brush);
|
||||
|
||||
DrawEllipticArc(wxRect(-w/2 - w, -h/2, 2*w, h), 270.0, 90.0);
|
||||
DrawLine(wxPoint(-w/2, -h/2), wxPoint(-w/2, h/2));
|
||||
DrawEllipticArc(wxRect((int)(-w/2 - w), (int)(-h/2), (int)(2*w), (int)(h)), 270.0, 90.0);
|
||||
DrawLine(wxPoint((int)(-w/2), (int)(-h/2)), wxPoint((int)(-w/2), (int)(h/2)));
|
||||
|
||||
CalculateSize();
|
||||
|
||||
@@ -875,13 +875,13 @@ csSemiCircleShape::csSemiCircleShape()
|
||||
SetDrawnPen(wxTRANSPARENT_PEN);
|
||||
SetDrawnBrush(wxTRANSPARENT_BRUSH);
|
||||
|
||||
DrawRectangle(wxRect(-w/2, -h/2, w, h));
|
||||
DrawRectangle(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(h)));
|
||||
|
||||
SetDrawnPen(wxBLACK_PEN);
|
||||
SetDrawnBrush(brush);
|
||||
|
||||
DrawEllipticArc(wxRect(-w/2, -h/2 - h, w, 2*h), 180.0, 0.0);
|
||||
DrawLine(wxPoint(-w/2, -h/2), wxPoint(w/2, -h/2));
|
||||
DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2 - h), (int)(w), (int)(2*h)), 180.0, 0.0);
|
||||
DrawLine(wxPoint((int)(-w/2), (int)(-h/2)), wxPoint((int)(w/2), (int)(-h/2)));
|
||||
|
||||
CalculateSize();
|
||||
|
||||
@@ -895,13 +895,13 @@ csSemiCircleShape::csSemiCircleShape()
|
||||
SetDrawnPen(wxTRANSPARENT_PEN);
|
||||
SetDrawnBrush(wxTRANSPARENT_BRUSH);
|
||||
|
||||
DrawRectangle(wxRect(-w/2, -h/2, w, h));
|
||||
DrawRectangle(wxRect((int)(-w/2), (int)(-h/2), (int)(w), (int)(h)));
|
||||
|
||||
SetDrawnPen(wxBLACK_PEN);
|
||||
SetDrawnBrush(brush);
|
||||
|
||||
DrawEllipticArc(wxRect(-w/2, -h/2, 2*w, h), 90.0, 270.0);
|
||||
DrawLine(wxPoint(w/2, -h/2), wxPoint(w/2, h/2));
|
||||
DrawEllipticArc(wxRect((int)(-w/2), (int)(-h/2), (int)(2*w), (int)(h)), 90.0, 270.0);
|
||||
DrawLine(wxPoint((int)(w/2),(int)(-h/2)), wxPoint((int)(w/2), (int)(h/2)));
|
||||
|
||||
CalculateSize();
|
||||
|
||||
|
@@ -244,9 +244,7 @@ wxMDIChildFrame *csApp::CreateChildFrame(wxDocument *doc, wxView *view, wxMenu**
|
||||
fileMenu->AppendSeparator();
|
||||
fileMenu->Append(wxID_EXIT, _T("E&xit"));
|
||||
|
||||
wxMenu *editMenu = NULL;
|
||||
|
||||
editMenu = new wxMenu;
|
||||
wxMenu* editMenu = new wxMenu;
|
||||
editMenu->Append(wxID_UNDO, _T("&Undo\tCtrl+Z"));
|
||||
editMenu->Append(wxID_REDO, _T("&Redo\tCtrl+Y"));
|
||||
editMenu->AppendSeparator();
|
||||
|
@@ -74,41 +74,41 @@ void csSymbolDatabase::AddSymbol(csSymbol* symbol)
|
||||
|
||||
void csSymbolDatabase::ClearSymbols()
|
||||
{
|
||||
wxNode* node = m_symbols.First();
|
||||
wxNode* node = m_symbols.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csSymbol* symbol = (csSymbol*) node->Data();
|
||||
csSymbol* symbol = (csSymbol*) node->GetData();
|
||||
delete symbol;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
m_symbols.Clear();
|
||||
}
|
||||
|
||||
csSymbol* csSymbolDatabase::FindSymbol(const wxString& name) const
|
||||
{
|
||||
wxNode* node = m_symbols.First();
|
||||
wxNode* node = m_symbols.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csSymbol* symbol = (csSymbol*) node->Data();
|
||||
csSymbol* symbol = (csSymbol*) node->GetData();
|
||||
if (symbol->GetName() == name)
|
||||
return symbol;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
csSymbol* csSymbolDatabase::FindSymbol(int toolId) const
|
||||
{
|
||||
wxNode* node = m_symbols.First();
|
||||
wxNode* node = m_symbols.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
csSymbol* symbol = (csSymbol*) node->Data();
|
||||
csSymbol* symbol = (csSymbol*) node->GetData();
|
||||
if (symbol->GetToolId() == toolId)
|
||||
return symbol;
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
@@ -199,16 +199,16 @@ wxShape *csDiagramView::FindFirstSelectedShape(void)
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
wxShape *theShape = NULL;
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->First();
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *eachShape = (wxShape *)node->Data();
|
||||
wxShape *eachShape = (wxShape *)node->GetData();
|
||||
if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected())
|
||||
{
|
||||
theShape = eachShape;
|
||||
node = NULL;
|
||||
}
|
||||
else node = node->Next();
|
||||
else node = node->GetNext();
|
||||
}
|
||||
return theShape;
|
||||
}
|
||||
@@ -216,15 +216,15 @@ wxShape *csDiagramView::FindFirstSelectedShape(void)
|
||||
void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind)
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->First();
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *eachShape = (wxShape *)node->Data();
|
||||
wxShape *eachShape = (wxShape *)node->GetData();
|
||||
if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected() && ((toFind == NULL) || (eachShape->IsKindOf(toFind))))
|
||||
{
|
||||
selections.Append(eachShape);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -296,17 +296,17 @@ void csDiagramView::OnDuplicate(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
void csDiagramView::OnCutUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable( (m_selections.Number() > 0) );
|
||||
event.Enable( (m_selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::OnClearUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable( (m_selections.Number() > 0) );
|
||||
event.Enable( (m_selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::OnCopyUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable( (m_selections.Number() > 0) );
|
||||
event.Enable( (m_selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
|
||||
@@ -320,21 +320,21 @@ void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
|
||||
|
||||
void csDiagramView::OnDuplicateUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
event.Enable( (m_selections.Number() > 0) );
|
||||
event.Enable( (m_selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::DoCut(wxList& shapes)
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
if (shapes.Number() > 0)
|
||||
if (shapes.GetCount() > 0)
|
||||
{
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
|
||||
|
||||
wxNode* node = shapes.First();
|
||||
wxNode* node = shapes.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *theShape = (wxShape*) node->Data();
|
||||
wxShape *theShape = (wxShape*) node->GetData();
|
||||
csCommandState* state = new csCommandState(ID_CS_CUT, NULL, theShape);
|
||||
|
||||
// Insert lines at the front, so they are cut first.
|
||||
@@ -345,7 +345,7 @@ void csDiagramView::DoCut(wxList& shapes)
|
||||
else
|
||||
cmd->AddState(state);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
cmd->RemoveLines(); // Schedule any connected lines, not already mentioned,
|
||||
// to be removed first
|
||||
@@ -359,21 +359,21 @@ void csDiagramView::DoCmd(wxList& shapes, wxList& oldShapes, int cmd, const wxSt
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
|
||||
if (shapes.Number() > 0)
|
||||
if (shapes.GetCount() > 0)
|
||||
{
|
||||
csDiagramCommand* command = new csDiagramCommand(op, doc);
|
||||
|
||||
wxNode* node = shapes.First();
|
||||
wxNode* node1 = oldShapes.First();
|
||||
wxNode* node = shapes.GetFirst();
|
||||
wxNode* node1 = oldShapes.GetFirst();
|
||||
while (node && node1)
|
||||
{
|
||||
wxShape *theShape = (wxShape*) node->Data();
|
||||
wxShape *oldShape = (wxShape*) node1->Data();
|
||||
wxShape *theShape = (wxShape*) node->GetData();
|
||||
wxShape *oldShape = (wxShape*) node1->GetData();
|
||||
csCommandState* state = new csCommandState(cmd, theShape, oldShape);
|
||||
command->AddState(state);
|
||||
|
||||
node = node->Next();
|
||||
node1 = node1->Next();
|
||||
node = node->GetNext();
|
||||
node1 = node1->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(command);
|
||||
}
|
||||
@@ -386,13 +386,13 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections);
|
||||
|
||||
if (selections.Number() > 0)
|
||||
if (selections.GetCount() > 0)
|
||||
{
|
||||
wxColourData data;
|
||||
data.SetChooseFull(TRUE);
|
||||
if (selections.Number() == 1)
|
||||
if (selections.GetCount() == 1)
|
||||
{
|
||||
wxShape* firstShape = (wxShape*) selections.First()->Data();
|
||||
wxShape* firstShape = (wxShape*) selections.GetFirst()->GetData();
|
||||
data.SetColour(firstShape->GetBrush()->GetColour());
|
||||
}
|
||||
|
||||
@@ -410,17 +410,17 @@ void csDiagramView::OnChangeBackgroundColour(wxCommandEvent& WXUNUSED(event))
|
||||
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc);
|
||||
|
||||
wxNode* node = selections.First();
|
||||
wxNode* node = selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *theShape = (wxShape*) node->Data();
|
||||
wxShape *theShape = (wxShape*) node->GetData();
|
||||
wxShape* newShape = theShape->CreateNewCopy();
|
||||
newShape->SetBrush(theBrush);
|
||||
|
||||
csCommandState* state = new csCommandState(ID_CS_CHANGE_BACKGROUND_COLOUR, newShape, theShape);
|
||||
cmd->AddState(state);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -437,7 +437,7 @@ void csDiagramView::OnEditPropertiesUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections);
|
||||
event.Enable( (selections.Number() > 0) );
|
||||
event.Enable( (selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::OnPointSizeComboSel(wxCommandEvent& event)
|
||||
@@ -475,14 +475,14 @@ void csDiagramView::ApplyPointSize(int pointSize)
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections);
|
||||
|
||||
if (selections.Number() > 0)
|
||||
if (selections.GetCount() > 0)
|
||||
{
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc);
|
||||
|
||||
wxNode* node = selections.First();
|
||||
wxNode* node = selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *theShape = (wxShape*) node->Data();
|
||||
wxShape *theShape = (wxShape*) node->GetData();
|
||||
wxShape *newShape = theShape->CreateNewCopy();
|
||||
|
||||
wxFont* newFont = wxTheFontList->FindOrCreateFont(pointSize,
|
||||
@@ -498,7 +498,7 @@ void csDiagramView::ApplyPointSize(int pointSize)
|
||||
|
||||
cmd->AddState(state);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -531,23 +531,23 @@ void csDiagramView::SelectAll(bool select)
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections);
|
||||
|
||||
wxNode* node = selections.First();
|
||||
wxNode* node = selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *theShape = (wxShape*) node->Data();
|
||||
wxShape *theShape = (wxShape*) node->GetData();
|
||||
theShape->Select(FALSE, &dc);
|
||||
SelectShape(theShape, FALSE);
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->First();
|
||||
wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *eachShape = (wxShape *)node->Data();
|
||||
wxShape *eachShape = (wxShape *)node->GetData();
|
||||
if (eachShape->GetParent() == NULL &&
|
||||
!eachShape->IsKindOf(CLASSINFO(wxControlPoint)) &&
|
||||
!eachShape->IsKindOf(CLASSINFO(wxLabelShape)))
|
||||
@@ -555,7 +555,7 @@ void csDiagramView::SelectAll(bool select)
|
||||
eachShape->Select(TRUE, &dc);
|
||||
SelectShape(eachShape, TRUE);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -575,20 +575,20 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event))
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
|
||||
|
||||
if (selections.Number() > 0)
|
||||
if (selections.GetCount() > 0)
|
||||
{
|
||||
csDiagramCommand* cmd = new csDiagramCommand(stateName, doc);
|
||||
|
||||
wxNode* node = selections.First();
|
||||
wxNode* node = selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxLineShape *theShape = (wxLineShape*) node->Data();
|
||||
wxLineShape *theShape = (wxLineShape*) node->GetData();
|
||||
wxLineShape *newShape = NULL;
|
||||
|
||||
if (state)
|
||||
{
|
||||
// Add arrow
|
||||
if (theShape->GetArrows().Number() == 0)
|
||||
if (theShape->GetArrows().GetCount() == 0)
|
||||
{
|
||||
newShape = (wxLineShape*) theShape->CreateNewCopy();
|
||||
newShape->AddArrow(ARROW_ARROW, ARROW_POSITION_MIDDLE, 10.0, 0.0, _T("Normal arrowhead"));
|
||||
@@ -596,7 +596,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
else
|
||||
{
|
||||
if (theShape->GetArrows().Number() > 0)
|
||||
if (theShape->GetArrows().GetCount() > 0)
|
||||
{
|
||||
newShape = (wxLineShape*) theShape->CreateNewCopy();
|
||||
newShape->ClearArrowsAtPosition();
|
||||
@@ -610,7 +610,7 @@ void csDiagramView::OnToggleArrowTool(wxCommandEvent& WXUNUSED(event))
|
||||
cmd->AddState(state);
|
||||
}
|
||||
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -620,7 +620,7 @@ void csDiagramView::OnToggleArrowToolUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
|
||||
event.Enable( (selections.Number() > 0) );
|
||||
event.Enable( (selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
// Make the point size combobox reflect this
|
||||
@@ -634,13 +634,13 @@ void csDiagramView::ReflectPointSize(int pointSize)
|
||||
void csDiagramView::ReflectArrowState(wxLineShape* lineShape)
|
||||
{
|
||||
bool haveArrow = FALSE;
|
||||
wxNode *node = lineShape->GetArrows().First();
|
||||
wxNode *node = lineShape->GetArrows().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxArrowHead *arrow = (wxArrowHead *)node->Data();
|
||||
wxArrowHead *arrow = (wxArrowHead *)node->GetData();
|
||||
if (ARROW_POSITION_MIDDLE == arrow->GetArrowEnd())
|
||||
haveArrow = TRUE;
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
wxGetApp().GetDiagramToolBar()->ToggleTool(DIAGRAM_TOOLBAR_LINE_ARROW, haveArrow);
|
||||
@@ -651,35 +651,35 @@ void csDiagramView::OnAlign(wxCommandEvent& event)
|
||||
// Make a copy of the selections, keeping only those shapes
|
||||
// that are top-level non-line shapes.
|
||||
wxList selections;
|
||||
wxNode* node = GetSelectionList().First();
|
||||
wxNode* node = GetSelectionList().GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if ((shape->GetParent() == NULL) && (!shape->IsKindOf(CLASSINFO(wxLineShape))))
|
||||
{
|
||||
selections.Append(shape);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
|
||||
if (selections.Number() == 0)
|
||||
if (selections.GetCount() == 0)
|
||||
return;
|
||||
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Align"), doc);
|
||||
|
||||
node = selections.First();
|
||||
wxShape* firstShape = (wxShape*) node->Data();
|
||||
node = selections.GetFirst();
|
||||
wxShape* firstShape = (wxShape*) node->GetData();
|
||||
|
||||
double x = firstShape->GetX();
|
||||
double y = firstShape->GetY();
|
||||
double width, height;
|
||||
firstShape->GetBoundingBoxMax(&width, &height);
|
||||
|
||||
node = selections.First();
|
||||
node = selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape != firstShape)
|
||||
{
|
||||
/* double x1 = */ shape->GetX();
|
||||
@@ -734,7 +734,7 @@ void csDiagramView::OnAlign(wxCommandEvent& event)
|
||||
csCommandState* state = new csCommandState(ID_CS_ALIGN, newShape, shape);
|
||||
cmd->AddState(state);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -743,7 +743,7 @@ void csDiagramView::OnAlignUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
// This is an approximation, since there may be lines
|
||||
// amongst the selections.
|
||||
event.Enable( (m_selections.Number() > 1) ) ;
|
||||
event.Enable( (m_selections.GetCount() > 1) ) ;
|
||||
}
|
||||
|
||||
void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
@@ -751,10 +751,10 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc);
|
||||
|
||||
wxNode* node = m_selections.First();
|
||||
wxNode* node = m_selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
wxShape* newShape = shape->CreateNewCopy();
|
||||
@@ -762,7 +762,7 @@ void csDiagramView::OnNewLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
csCommandState* state = new csCommandState(ID_CS_NEW_POINT, newShape, shape);
|
||||
cmd->AddState(state);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -772,10 +772,10 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc);
|
||||
|
||||
wxNode* node = m_selections.First();
|
||||
wxNode* node = m_selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
wxShape* newShape = shape->CreateNewCopy();
|
||||
@@ -783,7 +783,7 @@ void csDiagramView::OnCutLinePoint(wxCommandEvent& WXUNUSED(event))
|
||||
csCommandState* state = new csCommandState(ID_CS_CUT_POINT, newShape, shape);
|
||||
cmd->AddState(state);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -793,10 +793,10 @@ void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event))
|
||||
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
|
||||
csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc);
|
||||
|
||||
wxNode* node = m_selections.First();
|
||||
wxNode* node = m_selections.GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape* shape = (wxShape*) node->Data();
|
||||
wxShape* shape = (wxShape*) node->GetData();
|
||||
if (shape->IsKindOf(CLASSINFO(wxLineShape)))
|
||||
{
|
||||
wxShape* newShape = shape->CreateNewCopy();
|
||||
@@ -804,7 +804,7 @@ void csDiagramView::OnStraightenLines(wxCommandEvent& WXUNUSED(event))
|
||||
csCommandState* state = new csCommandState(ID_CS_STRAIGHTEN, newShape, shape);
|
||||
cmd->AddState(state);
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
doc->GetCommandProcessor()->Submit(cmd);
|
||||
}
|
||||
@@ -813,21 +813,21 @@ void csDiagramView::OnNewLinePointUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
|
||||
event.Enable( (selections.Number() > 0) );
|
||||
event.Enable( (selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::OnCutLinePointUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
|
||||
event.Enable( (selections.Number() > 0) );
|
||||
event.Enable( (selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
void csDiagramView::OnStraightenLinesUpdate(wxUpdateUIEvent& event)
|
||||
{
|
||||
wxList selections;
|
||||
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
|
||||
event.Enable( (selections.Number() > 0) );
|
||||
event.Enable( (selections.GetCount() > 0) );
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -999,10 +999,10 @@ void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys))
|
||||
min_y = wxMin(y, sg_initialY);
|
||||
max_y = wxMax(y, sg_initialY);
|
||||
|
||||
wxNode *node = GetDiagram()->GetShapeList()->First();
|
||||
wxNode *node = GetDiagram()->GetShapeList()->GetFirst();
|
||||
while (node)
|
||||
{
|
||||
wxShape *shape = (wxShape *)node->Data();
|
||||
wxShape *shape = (wxShape *)node->GetData();
|
||||
if (shape->GetParent() == NULL && !shape->IsKindOf(CLASSINFO(wxControlPoint)))
|
||||
{
|
||||
float image_x = shape->GetX();
|
||||
@@ -1014,7 +1014,7 @@ void csCanvas::OnEndDragLeft(double x, double y, int WXUNUSED(keys))
|
||||
GetView()->SelectShape(shape, TRUE);
|
||||
}
|
||||
}
|
||||
node = node->Next();
|
||||
node = node->GetNext();
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user