canvas->SetView(this);
SetFrame(frame);
- Activate(TRUE);
+ Activate(true);
// Initialize the edit menu Undo and Redo items
doc->GetCommandProcessor()->SetEditMenu(editMenu);
{
case csGRID_STYLE_NONE:
{
- diagramDoc->GetDiagram()->SetSnapToGrid(FALSE);
+ diagramDoc->GetDiagram()->SetSnapToGrid(false);
break;
}
case csGRID_STYLE_INVISIBLE:
{
- diagramDoc->GetDiagram()->SetSnapToGrid(TRUE);
+ diagramDoc->GetDiagram()->SetSnapToGrid(true);
break;
}
case csGRID_STYLE_DOTTED:
}
- return TRUE;
+ return true;
}
csDiagramView::~csDiagramView(void)
bool csDiagramView::OnClose(bool deleteWindow)
{
if (!GetDocument()->Close())
- return FALSE;
+ return false;
csDiagramDocument *diagramDoc = (csDiagramDocument *)GetDocument();
diagramDoc->GetDiagram()->SetCanvas(NULL);
// Remove file menu from those managed by the command history
wxGetApp().GetDocManager()->FileHistoryRemoveMenu(fileMenu);
- Activate(FALSE);
- frame->Show(FALSE);
+ Activate(false);
+ frame->Show(false);
if (deleteWindow)
{
frame->Destroy();
}
- return TRUE;
+ return true;
}
// Adds or removes shape from m_selections
void csDiagramView::OnSelectAll(wxCommandEvent& WXUNUSED(event))
{
- SelectAll(TRUE);
+ SelectAll(true);
}
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();
{
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();
if (selections.GetCount() > 0)
{
wxColourData data;
- data.SetChooseFull(TRUE);
+ data.SetChooseFull(true);
if (selections.GetCount() == 1)
{
wxShape* firstShape = (wxShape*) selections.GetFirst()->GetData();
wxColour col = retData.GetColour();
theBrush = wxTheBrushList->FindOrCreateBrush(col, wxSOLID);
}
- dialog->Close(TRUE);
+ dialog->Close(true);
if (!theBrush)
return;
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();
- theShape->Select(FALSE, &dc);
- SelectShape(theShape, FALSE);
+ theShape->Select(false, &dc);
+ SelectShape(theShape, false);
node = node->GetNext();
}
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();
!eachShape->IsKindOf(CLASSINFO(wxControlPoint)) &&
!eachShape->IsKindOf(CLASSINFO(wxLabelShape)))
{
- eachShape->Select(TRUE, &dc);
- SelectShape(eachShape, TRUE);
+ eachShape->Select(true, &dc);
+ SelectShape(eachShape, true);
}
node = node->GetNext();
}
{
csDiagramCommand* cmd = new csDiagramCommand(stateName, doc);
- wxNode* node = selections.GetFirst();
+ wxObjectList::compatibility_iterator node = selections.GetFirst();
while (node)
{
wxLineShape *theShape = (wxLineShape*) node->GetData();
// Make the arrow toggle button reflect the state of the line
void csDiagramView::ReflectArrowState(wxLineShape* lineShape)
{
- bool haveArrow = FALSE;
- wxNode *node = lineShape->GetArrows().GetFirst();
+ bool haveArrow = false;
+ wxObjectList::compatibility_iterator node = lineShape->GetArrows().GetFirst();
while (node)
{
wxArrowHead *arrow = (wxArrowHead *)node->GetData();
if (ARROW_POSITION_MIDDLE == arrow->GetArrowEnd())
- haveArrow = TRUE;
+ haveArrow = true;
node = node->GetNext();
}
// 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();
if (palette->GetSelection() == PALETTE_ARROW)
{
- GetView()->SelectAll(FALSE);
+ GetView()->SelectAll(false);
wxClientDC dc(this);
PrepareDC(dc);
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();
if (image_x >= min_x && image_x <= max_x &&
image_y >= min_y && image_y <= max_y)
{
- shape->Select(TRUE, &dc);
- GetView()->SelectShape(shape, TRUE);
+ shape->Select(true, &dc);
+ GetView()->SelectShape(shape, true);
}
}
node = node->GetNext();