From 0b2a355e9425c3e1b2a2ef1ea7229f407072682c Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 30 Dec 2000 13:51:06 +0000 Subject: Added Step Insert and Step Delete commands git-svn-id: http://svn.leocad.org/trunk@196 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/project.cpp | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- common/typedefs.h | 2 ++ 2 files changed, 68 insertions(+), 2 deletions(-) (limited to 'common') diff --git a/common/project.cpp b/common/project.cpp index f159dac..29ec323 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -5183,6 +5183,9 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam) { redraw = true; pPiece->SetFrameShow(t+1); + + if (pPiece->IsSelected () && t == m_nCurFrame) + pPiece->Select (false, false, false); } } else @@ -5190,8 +5193,11 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam) unsigned char t = pPiece->GetStepShow(); if (t < 255) { - redraw = true; - pPiece->SetStepShow(t+1); + redraw = true; + pPiece->SetStepShow(t+1); + + if (pPiece->IsSelected () && t == m_nCurStep) + pPiece->Select (false, false, false); } } } @@ -5201,6 +5207,7 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam) SetModifiedFlag(true); CheckPoint("Modifying"); SystemRedrawView(); + UpdateSelection (); } } break; @@ -5516,6 +5523,63 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam) SystemUpdateTime(m_bAnimation, m_nCurStep, 255); } break; + case LC_VIEW_STEP_INSERT: + { + bool redraw = false; + + if (m_bAnimation) + break; + + for (Piece* pPiece = m_pPieces; pPiece; pPiece = pPiece->m_pNext) + { + unsigned char t = pPiece->GetStepShow(); + + if (t >= m_nCurStep && t < 255) + { + redraw = true; + pPiece->SetStepShow (t+1); + + if (pPiece->IsSelected () && t == m_nCurStep) + pPiece->Select (false, false, false); + } + } + + if (redraw) + { + SetModifiedFlag (true); + CheckPoint ("Adding Step"); + SystemRedrawView (); + UpdateSelection (); + } + } break; + + case LC_VIEW_STEP_DELETE: + { + bool redraw = false; + + if (m_bAnimation) + break; + + for (Piece* pPiece = m_pPieces; pPiece; pPiece = pPiece->m_pNext) + { + unsigned char t = pPiece->GetStepShow(); + + if (t >= m_nCurStep && t > 1) + { + redraw = true; + pPiece->SetStepShow (t-1); + } + } + + if (redraw) + { + SetModifiedFlag (true); + CheckPoint ("Removing Step"); + SystemRedrawView (); + UpdateSelection (); + } + } break; + case LC_VIEW_STOP: { m_bStopRender = true; diff --git a/common/typedefs.h b/common/typedefs.h index 502ba49..96772ed 100644 --- a/common/typedefs.h +++ b/common/typedefs.h @@ -69,6 +69,8 @@ typedef enum { LC_VIEW_STEP_LAST, LC_VIEW_STEP_CHOOSE, LC_VIEW_STEP_SET, + LC_VIEW_STEP_INSERT, + LC_VIEW_STEP_DELETE, LC_VIEW_STOP, LC_VIEW_PLAY, LC_VIEW_CAMERA_MENU, -- cgit v1.2.3