wxShape *csDiagramView::FindFirstSelectedShape(void)
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
- wxShape *theShape = NULL;
- wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *eachShape = (wxShape *)node->GetData();
if ((eachShape->GetParent() == NULL) && !eachShape->IsKindOf(CLASSINFO(wxLabelShape)) && eachShape->Selected())
{
- theShape = eachShape;
- node = NULL;
+ return eachShape;
}
else node = node->GetNext();
}
- return theShape;
+ return NULL;
}
void csDiagramView::FindSelectedShapes(wxList& selections, wxClassInfo* toFind)
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
- wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *eachShape = (wxShape *)node->GetData();
void csDiagramView::OnPasteUpdate(wxUpdateUIEvent& event)
{
- /* csDiagramDocument *doc = */ (csDiagramDocument *)GetDocument();
-
int n = wxGetApp().GetDiagramClipboard().GetCount();
event.Enable( (n > 0) );
{
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut"), doc);
- wxNode* node = shapes.GetFirst();
+ wxObjectList::compatibility_iterator node = shapes.GetFirst();
while (node)
{
wxShape *theShape = (wxShape*) node->GetData();
{
csDiagramCommand* command = new csDiagramCommand(op, doc);
- wxNode* node = shapes.GetFirst();
- wxNode* node1 = oldShapes.GetFirst();
+ wxObjectList::compatibility_iterator node = shapes.GetFirst();
+ wxObjectList::compatibility_iterator node1 = oldShapes.GetFirst();
while (node && node1)
{
wxShape *theShape = (wxShape*) node->GetData();
csDiagramCommand* cmd = new csDiagramCommand(_T("Change colour"), doc);
- wxNode* node = selections.GetFirst();
+ wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node)
{
wxShape *theShape = (wxShape*) node->GetData();
{
csDiagramCommand* cmd = new csDiagramCommand(_T("Point size"), doc);
- wxNode* node = selections.GetFirst();
+ wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node)
{
wxShape *theShape = (wxShape*) node->GetData();
wxList selections;
FindSelectedShapes(selections);
- wxNode* node = selections.GetFirst();
+ wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node)
{
wxShape *theShape = (wxShape*) node->GetData();
else
{
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
- wxNode *node = doc->GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = doc->GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *eachShape = (wxShape *)node->GetData();
{
csDiagramCommand* cmd = new csDiagramCommand(stateName, doc);
- wxNode* node = selections.GetFirst();
+ wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node)
{
wxLineShape *theShape = (wxLineShape*) node->GetData();
void csDiagramView::ReflectArrowState(wxLineShape* lineShape)
{
bool haveArrow = false;
- wxNode *node = lineShape->GetArrows().GetFirst();
+ wxObjectList::compatibility_iterator node = lineShape->GetArrows().GetFirst();
while (node)
{
wxArrowHead *arrow = (wxArrowHead *)node->GetData();
// Make a copy of the selections, keeping only those shapes
// that are top-level non-line shapes.
wxList selections;
- wxNode* node = GetSelectionList().GetFirst();
+ wxObjectList::compatibility_iterator node = GetSelectionList().GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("New line point"), doc);
- wxNode* node = m_selections.GetFirst();
+ wxObjectList::compatibility_iterator node = m_selections.GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("Cut line point"), doc);
- wxNode* node = m_selections.GetFirst();
+ wxObjectList::compatibility_iterator node = m_selections.GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
csDiagramDocument *doc = (csDiagramDocument *)GetDocument();
csDiagramCommand* cmd = new csDiagramCommand(_T("Straighten lines"), doc);
- wxNode* node = m_selections.GetFirst();
+ wxObjectList::compatibility_iterator node = m_selections.GetFirst();
while (node)
{
wxShape* shape = (wxShape*) node->GetData();
void csCanvas::DrawOutline(wxDC& dc, double x1, double y1, double x2, double y2)
{
- wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
+ wxPen dottedPen(*wxBLACK, 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush(* wxTRANSPARENT_BRUSH);
if (palette->GetSelection() == PALETTE_TEXT_TOOL)
{
+ wxString newLabel;
+
+#if wxUSE_WX_RESOURCES
// Ask for a label and create a new free-floating text region
csLabelEditingDialog* dialog = new csLabelEditingDialog(GetParent());
return;
}
- wxString newLabel = dialog->GetShapeLabel();
+ newLabel = dialog->GetShapeLabel();
dialog->Destroy();
+#endif // wxUSE_WX_RESOURCES
wxShape* shape = new csTextBoxShape;
shape->AssignNewIds();
min_y = wxMin(y, sg_initialY);
max_y = wxMax(y, sg_initialY);
- wxNode *node = GetDiagram()->GetShapeList()->GetFirst();
+ wxObjectList::compatibility_iterator node = GetDiagram()->GetShapeList()->GetFirst();
while (node)
{
wxShape *shape = (wxShape *)node->GetData();