- switch (m_cmd)
- {
- case DOODLE_CUT:
- {
- // Paste the segment
- if (m_segment)
- {
- m_doc->GetDoodleSegments().Append(m_segment);
- m_doc->Modify(true);
- m_doc->UpdateAllViews();
- m_segment = NULL;
- }
- m_doc->Modify(true);
- m_doc->UpdateAllViews();
- break;
- }
- case DOODLE_ADD:
- {
- // Cut the last segment
- if (m_doc->GetDoodleSegments().GetCount() > 0)
- {
- wxList::compatibility_iterator node = m_doc->GetDoodleSegments().GetLast();
- DoodleSegment* seg = (DoodleSegment*)node->GetData();
- delete seg;
- m_doc->GetDoodleSegments().Erase(node);
-
- m_doc->Modify(true);
- m_doc->UpdateAllViews();
- }
- }
- }
- return true;