00001
00002
00003
00004
00005
00006
00007 #include "Logger.h"
00008 #include <qdebug.h>
00009 #include <QGraphicsPixmapItem>
00010 #include <QGraphicsScene>
00011 #include <QGraphicsView>
00012 #include "TutorialButton.h"
00013 #include "TutorialDlg.h"
00014 #include "TutorialStateContext.h"
00015 #include "TutorialStateIntroduction.h"
00016
00017 TutorialStateIntroduction::TutorialStateIntroduction (TutorialStateContext &context) :
00018 TutorialStateAbstractBase (context)
00019 {
00020 }
00021
00022 void TutorialStateIntroduction::begin ()
00023 {
00024 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateIntroduction::begin ()";
00025
00026 m_title = createTitle (tr ("Introduction"));
00027 m_background = createPixmapItem (":/engauge/img/SpreadsheetsForDoc.png",
00028 QPoint (0, 0));
00029 m_text0 = createTextItem (tr ("Engauge Digitizer starts with\n"
00030 "images of graphs and maps."),
00031 QPoint (200, 40));
00032 m_text1 = createTextItem (tr ("You create (or digitize) points along\n"
00033 "the graph and map curves."),
00034 QPoint (240, 180));
00035 m_text2 = createTextItem (tr ("The digitized curve points can be\n"
00036 "exported, as numbers, to other software tools."),
00037 QPoint (210, 330));
00038
00039 QSize backgroundSize = context().tutorialDlg().backgroundSize();
00040
00041 m_next = new TutorialButton (tr ("Next"),
00042 context().tutorialDlg().scene());
00043 m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
00044 backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
00045 connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
00046 }
00047
00048 void TutorialStateIntroduction::end ()
00049 {
00050 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateIntroduction::end ()";
00051
00052 context().tutorialDlg().scene().removeItem (m_title);
00053 context().tutorialDlg().scene().removeItem (m_background);
00054 context().tutorialDlg().scene().removeItem (m_text0);
00055 context().tutorialDlg().scene().removeItem (m_text1);
00056 context().tutorialDlg().scene().removeItem (m_text2);
00057
00058
00059 delete m_title;
00060 delete m_background;
00061 delete m_text0;
00062 delete m_text1;
00063 delete m_text2;
00064 delete m_next;
00065
00066 m_title = 0;
00067 m_background = 0;
00068 m_text0 = 0;
00069 m_text1 = 0;
00070 m_text2 = 0;
00071 m_next = 0;
00072 }
00073
00074 void TutorialStateIntroduction::slotNext ()
00075 {
00076 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateIntroduction::slotNext";
00077
00078 context().requestDelayedStateTransition (TUTORIAL_STATE_AXIS_POINTS);
00079 }