const wxString& labelText = wxT(""), bool alignTextRight = FALSE,
bool isFlat = TRUE );
+ // Unhide method from parent.
+
+ virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool)
+ { return wxToolBarBase::AddTool(tool); };
+
// Method from wxToolBarBase (for compatibility), only
// the first two arguments are valid.
// See the documentation for wxToolBar for details.
// 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.
// Sets the label and optionally label text.
virtual void SetLabel(const wxBitmap& labelBitmap, const wxString& labelText = wxT("") );
+ // Unhide method from parents.
+
+ virtual void SetLabel(const wxString& label)
+ { wxPanel::SetLabel(label); };
+
// Sets the text alignment and margins.
virtual void SetAlignments( int alignText = NB_ALIGN_TEXT_BOTTOM,
int marginX = NB_DEFAULT_MARGIN,
// 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)
{
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"));
}
{
}
-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)
{
}
}
-void MyFrame::OnTopBottom(wxCommandEvent& event)
+void MyFrame::OnTopBottom(wxCommandEvent& WXUNUSED(event))
{
if (myTree)
{
}
}
-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();
}
}
// Define the repainting behaviour
-void MyCanvas::OnPaint(wxPaintEvent& event)
+void MyCanvas::OnPaint(wxPaintEvent& WXUNUSED(event))
{
wxPaintDC dc(this);
PrepareDC(dc);
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();
}
mImageList( 16,16, FALSE, 2 )
{
+ int i;
+
mpInternalFrm = (wxPanel*)this;
mAboutBox.Create( this, -1, _T("About box in wxWindows style..."),
wxSize( 385,220),
wxDIALOG_MODAL | wxDEFAULT_DIALOG_STYLE | wxTAB_TRAVERSAL );
- int i = 0;
for( i = 0; i != MAX_LAYOUTS; ++i )
mLayouts[i] = NULL;
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;
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 )
{
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:
Destroy();
}
-void MyFrame::OnAbout( wxCommandEvent& event )
+void MyFrame::OnAbout( wxCommandEvent& WXUNUSED(event) )
{
wxFont font;
#ifdef __WXMSW__
}
}
-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);
}
// 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
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"
::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();
//*((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 )
{
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,
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
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,
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
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,
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;
i++;
}
-void MyFrame::OnButt2( wxCommandEvent& event )
+void MyFrame::OnButt2( wxCommandEvent& WXUNUSED(event) )
{
static int i =0;
}
case OGLEDIT_ADD_SHAPE:
{
- wxShape *theShape = NULL;
+ wxShape *theShape;
if (shape)
theShape = shape; // Saved from undoing the shape
else
}
case OGLEDIT_ADD_LINE:
{
- wxShape *theShape = NULL;
+ wxShape *theShape;
if (shape)
theShape = shape; // Saved from undoing the line
else
// 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();
}
}
{
// 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())
redraw = TRUE;
}
}
- node = node->Next();
+ node = node->GetNext();
}
GetShape()->Select(TRUE, &dc);
if (redraw)
//// 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..."));
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();
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.
{
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;
}
// 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();
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;
}
}
- 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);
// 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);
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);
if (m_currentCmd)
{
- if (m_currentCmd->GetStates().Number() == 0)
+ if (m_currentCmd->GetStates().GetCount() == 0)
{
delete m_currentCmd;
}
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"));
}
// 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;
}
}
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
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;
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)"));
}
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();
}
}
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();
}
}
// 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;
}
{
// 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;
}
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);
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),
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();
}
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)
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()->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();
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();
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);
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);
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);
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);
// 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();
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();
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();
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();
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();
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;
}
{
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;
}
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();
}
}
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)
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.
else
cmd->AddState(state);
- node = node->Next();
+ node = node->GetNext();
}
cmd->RemoveLines(); // Schedule any connected lines, not already mentioned,
// to be removed first
{
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);
}
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());
}
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);
}
{
wxList selections;
FindSelectedShapes(selections);
- event.Enable( (selections.Number() > 0) );
+ event.Enable( (selections.GetCount() > 0) );
}
void csDiagramView::OnPointSizeComboSel(wxCommandEvent& event)
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,
cmd->AddState(state);
- node = node->Next();
+ node = node->GetNext();
}
doc->GetCommandProcessor()->Submit(cmd);
}
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)))
eachShape->Select(TRUE, &dc);
SelectShape(eachShape, TRUE);
}
- node = node->Next();
+ node = node->GetNext();
}
}
}
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"));
}
else
{
- if (theShape->GetArrows().Number() > 0)
+ if (theShape->GetArrows().GetCount() > 0)
{
newShape = (wxLineShape*) theShape->CreateNewCopy();
newShape->ClearArrowsAtPosition();
cmd->AddState(state);
}
- node = node->Next();
+ node = node->GetNext();
}
doc->GetCommandProcessor()->Submit(cmd);
}
{
wxList selections;
FindSelectedShapes(selections, CLASSINFO(wxLineShape));
- event.Enable( (selections.Number() > 0) );
+ event.Enable( (selections.GetCount() > 0) );
}
// Make the point size combobox reflect this
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);
// 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();
csCommandState* state = new csCommandState(ID_CS_ALIGN, newShape, shape);
cmd->AddState(state);
}
- node = node->Next();
+ node = node->GetNext();
}
doc->GetCommandProcessor()->Submit(cmd);
}
{
// 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))
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();
csCommandState* state = new csCommandState(ID_CS_NEW_POINT, newShape, shape);
cmd->AddState(state);
}
- node = node->Next();
+ node = node->GetNext();
}
doc->GetCommandProcessor()->Submit(cmd);
}
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();
csCommandState* state = new csCommandState(ID_CS_CUT_POINT, newShape, shape);
cmd->AddState(state);
}
- node = node->Next();
+ node = node->GetNext();
}
doc->GetCommandProcessor()->Submit(cmd);
}
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();
csCommandState* state = new csCommandState(ID_CS_STRAIGHTEN, newShape, shape);
cmd->AddState(state);
}
- node = node->Next();
+ node = node->GetNext();
}
doc->GetCommandProcessor()->Submit(cmd);
}
{
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) );
}
/*
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();
GetView()->SelectShape(shape, TRUE);
}
}
- node = node->Next();
+ node = node->GetNext();
}
}
return FALSE;
wxString value(view->GetValueText()->GetValue());
- bool boolValue = FALSE;
- if (value == wxT("True"))
- boolValue = TRUE;
- else
- boolValue = FALSE;
+ bool boolValue = (value == wxT("True"));
property->GetValue() = (bool)boolValue;
return TRUE;
}
wxChar *s = node->GetData();
if (wxStrcmp(s, currentString) == 0)
{
- wxChar *nextString = NULL;
+ wxChar *nextString;
if (node->GetNext())
nextString = node->GetNext()->GetData();
else
wxItemResource::~wxItemResource()
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxItemResource *item = (wxItemResource *)node->Data();
+ wxItemResource *item = (wxItemResource *)node->GetData();
delete item;
delete node;
- node = m_children.First();
+ node = m_children.GetFirst();
}
}
// See if any resource has this as its child; if so, delete from
// parent's child list.
BeginFind();
- wxNode *node = (wxNode *) NULL;
- node = Next();
+ wxNode *node = Next();
while (node != NULL)
{
- wxItemResource *parent = (wxItemResource *)node->Data();
+ wxItemResource *parent = (wxItemResource *)node->GetData();
if (parent->GetChildren().Member(item))
{
parent->GetChildren().DeleteObject(item);
while (node)
{
wxNode *next = Next();
- wxItemResource *item = (wxItemResource *)node->Data();
+ wxItemResource *item = (wxItemResource *)node->GetData();
delete item;
delete node;
node = next;
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxListBox(parent, id, pos, size,
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxChoice(parent, id, pos, size,
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size,
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size,
bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
{
- wxNode *node = db.First();
+ wxNode *node = db.GetFirst();
while (node)
{
- wxExpr *clause = (wxExpr *)node->Data();
+ wxExpr *clause = (wxExpr *)node->GetData();
wxString functor(clause->Functor());
wxItemResource *item = (wxItemResource *) NULL;
table.DeleteResource(item->GetName());
table.AddResource(item);
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
static bool wxEatWhiteSpace(FILE *fd)
{
- int ch = 0;
+ int ch;
while ((ch = getc(fd)) != EOF)
{
wxItemResource *optResource = (wxItemResource *) NULL;
// Try to find optimum bitmap for this platform/colour depth
- wxNode *node = item->GetChildren().First();
+ wxNode *node = item->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
int platform = (int)child->GetValue2();
int noColours = (int)child->GetValue3();
/*
default:
break;
}
- node = node->Next();
+ node = node->GetNext();
}
// If no matching resource, fail.
if (!optResource)
wxItemResource *optResource = (wxItemResource *) NULL;
// Try to find optimum icon for this platform/colour depth
- wxNode *node = item->GetChildren().First();
+ wxNode *node = item->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
int platform = (int)child->GetValue2();
int noColours = (int)child->GetValue3();
/*
default:
break;
}
- node = node->Next();
+ node = node->GetNext();
}
// If no matching resource, fail.
if (!optResource)
wxMenu *wxResourceCreateMenu(wxItemResource *item)
{
wxMenu *menu = new wxMenu;
- wxNode *node = item->GetChildren().First();
+ wxNode *node = item->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator")))
menu->AppendSeparator();
- else if (child->GetChildren().Number() > 0)
+ else if (child->GetChildren().GetCount() > 0)
{
wxMenu *subMenu = wxResourceCreateMenu(child);
if (subMenu)
{
menu->Append((int)child->GetValue1(), child->GetTitle(), child->GetValue4(), (child->GetValue2() != 0));
}
- node = node->Next();
+ node = node->GetNext();
}
return menu;
}
{
if (!menuBar)
menuBar = new wxMenuBar;
- wxNode *node = menuResource->GetChildren().First();
+ wxNode *node = menuResource->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
wxMenu *menu = wxResourceCreateMenu(child);
if (menu)
menuBar->Append(menu, child->GetTitle());
- node = node->Next();
+ node = node->GetNext();
}
return menuBar;
}
bool wxEatWhiteSpaceString(char *s)
{
- int ch = 0;
+ int ch;
while ((ch = getc_string(s)) != EOF)
{
break;
case '/':
{
- int prev_ch = ch;
ch = getc_string(s);
if (ch == EOF)
{
if (ch == '*')
{
// Eat C comment
- prev_ch = 0;
+ int prev_ch = 0;
while ((ch = getc_string(s)) != EOF)
{
if (ch == '/' && prev_ch == '*')
}
// Now create children
- wxNode *node = resource->GetChildren().First();
+ wxNode *node = resource->GetChildren().GetFirst();
while (node)
{
- wxItemResource *childResource = (wxItemResource *)node->Data();
+ wxItemResource *childResource = (wxItemResource *)node->GetData();
(void) wxCreateItem(thisWindow, childResource, resource, table);
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
if (expr)
{
long functor_key = hash_table->MakeKey(WXSTRINGCAST functor);
- long value_key = 0;
+ long value_key;
if (expr && expr->Type() == wxExprString)
{
value_key = hash_table->MakeKey(WXSTRINGCAST expr->StringValue());
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::
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 ::
// "inverse" bar-visibility of the selected bar
- int newState = 0;
+ int newState;
if ( pBar->mState == wxCBAR_HIDDEN )
{
// some ascii-art, still can't get these *nice* cursors working on wx... :-(
+/*
+// FIXME:: see places where _gHorizCursorImg is used
+
static const char* _gHorizCursorImg[] =
{
"............XX....XX............",
"...............XXX..............",
"................X..............."
};
+*/
// helper inline functions
wxFrameLayout::~wxFrameLayout()
{
+ size_t i;
+
UnhookFromFrame();
if ( mpUpdatesMgr )
// destroy contents of arrays and lists
- size_t i = 0;
for ( i = 0; i != MAX_PANES; ++i )
{
if ( mPanes[i] )
cbDockPane* pPane;
cbRowInfo* pRow;
- bool success = LocateBar( pBar, &pRow, &pPane );
+ #ifdef __WXDEBUG__
+ bool success =
+ #endif
+ LocateBar( pBar, &pRow, &pPane );
wxASSERT( success ); // DBG::
// "inverse" bar-visibility of the selected bar
- int newState = 0;
+ int newState;
if ( pBar->mState == wxCBAR_HIDDEN )
{
int frmWidth, frmHeight;
mpFrame->GetClientSize( &frmWidth, &frmHeight );
- int paneHeight = 0;
int curY = 0;
int curX = 0;
pPane->SetPaneWidth( frmWidth );
pPane->RecalcLayout();
- paneHeight = pPane->GetPaneHeight();
+ int paneHeight = pPane->GetPaneHeight();
rect.x = curX;
rect.y = curY;
cbMotionEvent evt( pos, pToPane );
FirePluginEvent( evt );
}
- else
- {
- int avoidCompilerWarning = 0;
- wxASSERT(avoidCompilerWarning); // DBG::
- }
} // wxFrameLayout::ForwardMouseEvent()
void cbDockPane::PaintRowDecorations( cbRowInfo* pRow, wxDC& dc )
{
- size_t i = 0;
+ size_t i;
// decorations first
for ( i = 0; i != pRow->mBars.Count(); ++i )
void cbDockPane::PaintPane( wxDC& dc )
{
- PaintPaneBackground( dc );
+ size_t i;
- size_t i = 0;
+ PaintPaneBackground( dc );
// first decorations
for ( i = 0; i != mRows.Count(); ++i )
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
void cbDockPane::DoInsertBar( cbBarInfo* pBar, int rowNo )
{
- cbRowInfo* pRow = NULL;
+ cbRowInfo* pRow;
if ( rowNo == -1 || rowNo >= (int)mRows.Count() )
{
bStateCheckDone = TRUE;
size_t j;
- wxDynToolInfo *pInfo = NULL;
+ wxDynToolInfo *pInfo;
wxDynToolInfo *pPrevInfo = NULL;
int nVertSeparators = 0;
if ( mDoToolUpdates )
{
- int o = 0; //glt
- ++o;
-
// TBD::
}
}
pNode = pNode->GetNext();
}
- int avoidCompilerWarning = 0;
- wxASSERT(avoidCompilerWarning); // DBG:: item should be present
-
- return 0;
+ return NULL;
}
wxNode* GarbageCollector::FindReferenceFreeItemNode()
return;
}
- wxCursor* pCurs = NULL;
+ wxCursor* pCurs;
if ( testResult == CB_UPPER_ROW_HANDLE_HITTED ||
testResult == CB_LOWER_ROW_HANDLE_HITTED)
if ( mpPane->IsHorizontal() )
{
- // DBG::
- wxPoint p = event.mPos;
- wxPoint d = mDragOrigin;
-// int dif = event.mPos.x - mDragOrigin.x;
-
// row is dragged up or down;
ShowDraggedRow( pos.y - mDragOrigin.y );
}
else
{
- // DBG::
- wxPoint p = event.mPos;
- wxPoint d = mDragOrigin;
-// int dif = event.mPos.x - mDragOrigin.x;
-
// row is dragged left or right
ShowDraggedRow( pos.x - mDragOrigin.x );
}
void cbRowLayoutPlugin::FitBarsToRange( int from, int till,
cbBarInfo* pTheBar, cbRowInfo* pRow )
{
- cbBarInfo* pFromBar = NULL;
- cbBarInfo* pTillBar = NULL;
+ cbBarInfo* pFromBar;
+ cbBarInfo* pTillBar;
if ( pTheBar->mBounds.x > from )
{
void cbRowLayoutPlugin::ApplyLengthRatios( cbRowInfo* pRow )
{
+ size_t i;
double pcntSum = 0;
// FOR NOW:: all-in-one
- size_t i = 0;
for ( i = 0; i != pRow->mBars.Count(); ++i )
{
if ( !pRow->mBars[i]->IsFixed() )
// FIXME:: Next line not used.
//int newHeight = pTheRow->mRowHeight;
- int freeSpc = 0;
-
if ( forUpperHandle )
{
// calculate available free space from above,
while( pRow )
{
- freeSpc += pRow->mRowHeight - event.mpPane->GetMinimalRowHeight( pRow );
-
pRow = pRow->mpPrev;
}
}
while( pRow )
{
- freeSpc += pRow->mRowHeight - mpPane->GetMinimalRowHeight( pRow );
-
pRow = pRow->mpNext;
}
}
wxChar regionNameBuf[20];
wxChar textNameBuf[20];
- wxExpr *regionExpr = NULL;
+ wxExpr *regionExpr;
wxExpr *textExpr = NULL;
wxSprintf(regionNameBuf, _T("region%d"), regionNo);
wxSprintf(textNameBuf, _T("text%d"), regionNo);
// Return the zero-based position in m_lines of line.
int wxShape::GetLinePosition(wxLineShape* line)
{
- size_t i = 0;
- for (i = 0; i < m_lines.GetCount(); i++)
+ for (size_t i = 0; i < m_lines.GetCount(); i++)
if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line)
return i;
double line_ratio;
double other_ratio;
-// char buf[300];
for (i = 1; i < n; i++)
{
oglCheckLineIntersection(x1, y1, x2, y2, lastx, lasty, xvec[i], yvec[i],
&line_ratio, &other_ratio);
if (line_ratio != 1.0)
isAHit = TRUE;
-// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio);
-// ClipsErrorFunction(buf);
lastx = xvec[i];
lasty = yvec[i];
&line_ratio, &other_ratio);
if (line_ratio != 1.0)
isAHit = TRUE;
-// sprintf(buf, "Line ratio = %.2f, other ratio = %.2f\n", line_ratio, other_ratio);
-// ClipsErrorFunction(buf);
- if (line_ratio < min_ratio)
- min_ratio = line_ratio;
}
-// ClipsErrorFunction("\n");
return isAHit;
}
// Check for division in case line straddles divisions (i.e. is not wholly contained).
if (!nearest_object || !(object->IsKindOf(CLASSINFO(wxDivisionShape)) || WhollyContains(object, nearest_object)))
{
- nearest = dist;
nearest_object = object;
nearest_attachment = temp_attachment;
current = NULL;
haveConstraints = FALSE;
break;
}
- int cType = 0;
- double cXSpacing = 0.0;
- double cYSpacing = 0.0;
wxString cName = wxEmptyString;
- long cId = 0;
wxShape *m_constrainingObject = NULL;
wxList m_constrainedObjects;
wxExpr *constrainingExpr = constraintExpr->Nth(5);
wxExpr *constrainedExpr = constraintExpr->Nth(6);
- cType = (int)typeExpr->IntegerValue();
- cXSpacing = xExpr->RealValue();
- cYSpacing = yExpr->RealValue();
+ int cType = (int)typeExpr->IntegerValue();
+ double cXSpacing = xExpr->RealValue();
+ double cYSpacing = yExpr->RealValue();
cName = nameExpr->StringValue();
- cId = idExpr->IntegerValue();
+ long cId = idExpr->IntegerValue();
wxExpr *objExpr1 = database->HashFind(_T("node_image"), constrainingExpr->IntegerValue());
if (objExpr1 && objExpr1->GetClientData())
double maxX, maxY;
GetBoundingBoxMax(&maxX, &maxY);
- double x, y;
- int direction;
+ double x = 0.0 , y = 0.0;
+ int direction = 0;
/*
if (m_leftSide)
{
};
BEGIN_EVENT_TABLE(OGLPopupDivisionMenu, wxMenu)
- EVT_CUSTOM_RANGE(wxEVT_COMMAND_MENU_SELECTED,
- DIVISION_MENU_SPLIT_HORIZONTALLY,
+ EVT_MENU_RANGE(DIVISION_MENU_SPLIT_HORIZONTALLY,
DIVISION_MENU_EDIT_BOTTOM_EDGE,
OGLPopupDivisionMenu::OnMenu)
END_EVENT_TABLE()
// Left or right.
else
{
- int i = 0;
- bool isLeft = FALSE;
- if (attachment < (n+1))
- {
- i = attachment-1;
- isLeft = FALSE;
- }
- else
- {
- i = (totalNumberAttachments - attachment - 1);
- isLeft = TRUE;
- }
+ bool isLeft = !(attachment < (n+1));
+ int i = (isLeft) ? (totalNumberAttachments - attachment - 1) : (attachment-1);
wxNode *node = GetRegions().Item(i);
if (node)
{
scaleY = 1.0;
else scaleY = h/GetHeight();
- int i = 0;
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
{
if (m_metafiles[i].IsValid())
m_metafiles[i].Scale(scaleX, scaleY);
clause->AddAttributeValue(_T("save_metafile"), (long)m_saveToFile);
if (m_saveToFile)
{
- int i = 0;
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
{
if (m_metafiles[i].IsValid())
m_metafiles[i].WriteAttributes(clause, i);
if (m_saveToFile)
{
- int i = 0;
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
{
m_metafiles[i].ReadAttributes(clause, i);
}
wxDrawnShape& drawnCopy = (wxDrawnShape&) copy;
- int i = 0;
- for (i = 0; i < 4; i++)
+ for (int i = 0; i < 4; i++)
{
m_metafiles[i].Copy(drawnCopy.m_metafiles[i]);
}
double *xpoints = new double[n];
double *ypoints = new double[n];
- int i = 0;
- for (i = 0; i < n; i++)
+ for (int i = 0; i < n; i++)
{
wxRealPoint *point = & (m_points[i]);
xpoints[i] = point->x + xOffset;
}
m_lineControlPoints = new wxList;
- int i = 0;
- for (i = 0; i < n; i++)
+ for (int i = 0; i < n; i++)
{
wxRealPoint *point = new wxRealPoint(-999, -999);
m_lineControlPoints->Append((wxObject*) point);
double positionOnLineX, positionOnLineY;
// Position of start point of line, at the end of which we draw the arrow.
- double startPositionX, startPositionY;
+ double startPositionX = 0.0 , startPositionY = 0.0;
switch (arrow->GetPosition())
{
double y3 = positionOnLineY;
double d = -arrow->GetYOffset(); // Negate so +offset is above line
- double theta = 0.0;
+ double theta;
if (x3 == x1)
theta = (double)(myPi/2.0);
else
return TRUE;
}
+ wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
while (refNode && currNode)
{
- wxArrowHead *currArrow = (wxArrowHead *)currNode->GetData();
refArrow = (wxArrowHead *)refNode->GetData();
// Matching: advance current arrow pointer
wxRealPoint *wxLineShape::GetNextControlPoint(wxShape *nodeObject)
{
int n = m_lineControlPoints->GetCount();
- int nn = 0;
+ int nn;
if (m_to == nodeObject)
{
// Must be END of line, so we want (n - 1)th control point.
static char _buf[1024]; // a temp buffer to use inplace of wxBuffer, which is deprecated.
-static char hexArray[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B',
- 'C', 'D', 'E', 'F' };
-
-static void DecToHex(int dec, char *buf)
-{
- int firstDigit = (int)(dec/16.0);
- int secondDigit = (int)(dec - (firstDigit*16.0));
- buf[0] = hexArray[firstDigit];
- buf[1] = hexArray[secondDigit];
- buf[2] = 0;
-}
-
// 16-bit unsigned integer
static unsigned int getshort(FILE *fp)
{
int testRes = ((unsigned int) c) + (((unsigned int) c1) << 8);
#endif
unsigned long res1 = ((unsigned int) c) + (((unsigned int) c1) << 8);
- int res = 0;
+ int res;
if (res1 > 32767)
res = (int)(res1 - 65536);
else
if (!shape->IsKindOf(CLASSINFO(wxControlPoint)))
{
- wxExpr *expr = NULL;
+ wxExpr *expr;
if (shape->IsKindOf(CLASSINFO(wxLineShape)))
expr = new wxExpr(_T("line"));
else
OnShapeSave(*database, *shape, *expr);
}
- node = node->Next();
+ node = node->GetNext();
}
OnDatabaseSave(*database);
OnHeaderLoad(database, *header);
// Scan through all clauses and register the ids
- wxNode *node = database.First();
+ wxNode *node = database.GetFirst();
while (node)
{
wxExpr *clause = (wxExpr *)node->GetData();
long id = -1;
clause->GetAttributeValue(_T("id"), id);
wxRegisterId(id);
- node = node->Next();
+ node = node->GetNext();
}
ReadNodes(database);
if (shape.IsKindOf(CLASSINFO(wxCompositeShape)))
{
- wxNode *node = shape.GetChildren().First();
+ wxNode *node = shape.GetChildren().GetFirst();
while (node)
{
wxShape *childShape = (wxShape *)node->GetData();
wxExpr *childExpr = new wxExpr(_T("shape"));
OnShapeSave(db, *childShape, *childExpr);
- node = node->Next();
+ node = node->GetNext();
}
}
long current_width = 0;
wxNode *current = text_list->GetFirst();
- int i = 0;
while (current)
{
wxShapeTextLine *line = (wxShapeTextLine *)current->GetData();
if (current_width > max_width)
max_width = current_width;
current = current->GetNext();
- i ++;
}
*actual_height = n*char_height;