From 3f6d43ec7b4e70fabf78338672b4d46901af58e8 Mon Sep 17 00:00:00 2001 From: Vladislav Khorev Date: Tue, 18 Jun 2013 20:52:07 +0000 Subject: [PATCH] upd --- AnimationBuilder/Animation.cpp | 5 +++++ AnimationBuilder/Animation.h | 1 + AnimationBuilder/AnimationBuilder.pro | 4 ++-- AnimationBuilder/mainwindow.cpp | 17 +++++++++++++++++ AnimationBuilder/mainwindow.h | 2 ++ AnimationBuilder/mainwindow.ui | 14 ++++++++++++++ 6 files changed, 41 insertions(+), 2 deletions(-) diff --git a/AnimationBuilder/Animation.cpp b/AnimationBuilder/Animation.cpp index 496c56c..58b2564 100644 --- a/AnimationBuilder/Animation.cpp +++ b/AnimationBuilder/Animation.cpp @@ -159,5 +159,10 @@ void TAnimation::LoadFrame() } +void TAnimation::Clear() +{ + FrameList.clear(); +} + diff --git a/AnimationBuilder/Animation.h b/AnimationBuilder/Animation.h index 191bd0b..9943bb0 100644 --- a/AnimationBuilder/Animation.h +++ b/AnimationBuilder/Animation.h @@ -97,6 +97,7 @@ public: void FillSheet(boost::shared_ptr sheetPixmap, std::vector& frameDataArr); + void Clear(); public slots: void LoadFrame(); diff --git a/AnimationBuilder/AnimationBuilder.pro b/AnimationBuilder/AnimationBuilder.pro index 280d12c..74d49ff 100644 --- a/AnimationBuilder/AnimationBuilder.pro +++ b/AnimationBuilder/AnimationBuilder.pro @@ -17,7 +17,7 @@ SOURCES += main.cpp\ HEADERS += mainwindow.h \ Animation.h -INCLUDEPATH += $$(LibsPath)/boost_1_47_0 -DEPENDPATH += $$(LibsPath)/boost_1_47_0 +INCLUDEPATH += $$(LibsPath)/boost_1_52_0 +DEPENDPATH += $$(LibsPath)/boost_1_52_0 FORMS += mainwindow.ui diff --git a/AnimationBuilder/mainwindow.cpp b/AnimationBuilder/mainwindow.cpp index 171ac44..e89907c 100644 --- a/AnimationBuilder/mainwindow.cpp +++ b/AnimationBuilder/mainwindow.cpp @@ -59,6 +59,8 @@ void MainWindow::SetAnimation(TAnimation* animation) QObject::connect(ui->SaveSheetButton, SIGNAL(pressed()), this, SLOT(SaveSheet())); QObject::connect(ui->SaveAnimParamsButton, SIGNAL(pressed()), this, SLOT(SaveAnimationParams())); QObject::connect(ui->AnimateCheckBox, SIGNAL(stateChanged(int)), this, SLOT(AnimateCheckBoxStateChanged(int))); + QObject::connect(ui->ClearButton, SIGNAL(pressed()), this, SLOT(Clear())); + QObject::connect(&AnimTimer, SIGNAL(timeout()), this, SLOT(TimerTimeout())); @@ -292,3 +294,18 @@ void MainWindow::LoadFrame(const std::string& text) ui->FrameList->addItem(QString(text.c_str())); } + +void MainWindow::Clear() +{ + AnimTimer.stop(); + + //ui->FrameImage->pixmap()->fill(); + + ui->AnimateCheckBox->setChecked(false); + + ui->OutputXmlFile->clear(); + + ui->FrameList->clear(); + + Animation->Clear(); +} diff --git a/AnimationBuilder/mainwindow.h b/AnimationBuilder/mainwindow.h index 9a8298b..7c3b324 100644 --- a/AnimationBuilder/mainwindow.h +++ b/AnimationBuilder/mainwindow.h @@ -44,6 +44,8 @@ public slots: void AnimateCheckBoxStateChanged(int state); void TimerTimeout(); + void Clear(); + private: Ui::MainWindow *ui; diff --git a/AnimationBuilder/mainwindow.ui b/AnimationBuilder/mainwindow.ui index b7ea69b..07819e9 100644 --- a/AnimationBuilder/mainwindow.ui +++ b/AnimationBuilder/mainwindow.ui @@ -342,6 +342,19 @@ Animate + + + + 140 + 30 + 75 + 23 + + + + Clear + + frame_2 LoadFrameButton frame @@ -363,6 +376,7 @@ SaveSheetButton SaveAnimParamsButton AnimateCheckBox + ClearButton