summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorleo2003-09-18 16:50:52 +0000
committerleo2003-09-18 16:50:52 +0000
commit4bd07328df37f1bc8a16cdd77decf49467b6c4be (patch)
tree31c714fab1ece4cd75a3df66e10821a2a9394caf /common
parent3df8b99fe7e3961006ab4cd4a3bdc33c7c2b7e51 (diff)
Added a progress bar for long operations.
git-svn-id: http://svn.leocad.org/trunk@349 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common')
-rw-r--r--common/project.cpp17
-rwxr-xr-xcommon/system.h3
2 files changed, 20 insertions, 0 deletions
diff --git a/common/project.cpp b/common/project.cpp
index 71f8d32..bc04775 100644
--- a/common/project.cpp
+++ b/common/project.cpp
@@ -715,6 +715,8 @@ bool Project::FileLoad(File* file, bool bUndo, bool bMerge)
file->ReadLong (&m_nScene, 1);
file->ReadLong (&count, 1);
+ SystemStartProgressBar(0, count, 1, "Loading project...");
+
while (count--)
{
if (fv > 0.4f)
@@ -778,7 +780,9 @@ bool Project::FileLoad(File* file, bool bUndo, bool bMerge)
SystemPieceComboAdd(pInfo->m_strDescription);
}
}
+ SytemStepProgressBar();
}
+ SytemEndProgressBar();
if (!bMerge)
{
@@ -2708,15 +2712,28 @@ void Project::RemovePiece(Piece* pPiece)
void Project::CalculateStep()
{
+ int PieceCount = 0;
Piece* pPiece;
Camera* pCamera;
Light* pLight;
for (pPiece = m_pPieces; pPiece; pPiece = pPiece->m_pNext)
+ {
pPiece->UpdatePosition(m_bAnimation ? m_nCurFrame : m_nCurStep, m_bAnimation);
+ PieceCount++;
+ }
+
+ SystemDoWaitCursor(1);
+ SystemStartProgressBar(0, PieceCount, 1, "Updating pieces...");
for (pPiece = m_pPieces; pPiece; pPiece = pPiece->m_pNext)
+ {
pPiece->CalculateConnections(m_pConnections, m_bAnimation ? m_nCurFrame : m_nCurStep, m_bAnimation, false, false);
+ SytemStepProgressBar();
+ }
+
+ SytemEndProgressBar();
+ SystemDoWaitCursor(-1);
for (pCamera = m_pCameras; pCamera; pCamera = pCamera->m_pNext)
pCamera->UpdatePosition(m_bAnimation ? m_nCurFrame : m_nCurStep, m_bAnimation);
diff --git a/common/system.h b/common/system.h
index 0918af7..540c1de 100755
--- a/common/system.h
+++ b/common/system.h
@@ -98,5 +98,8 @@ File* SystemImportClipboard();
void SystemPumpMessages();
long SystemGetTicks();
+void SystemStartProgressBar(int nLower, int nUpper, int nStep, const char* Text);
+void SytemEndProgressBar();
+void SytemStepProgressBar();
#endif // _SYSTEM_H_