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 "TutorialStateAxisPoints.h"
00015 #include "TutorialStateContext.h"
00016
00017 TutorialStateAxisPoints::TutorialStateAxisPoints (TutorialStateContext &context) :
00018 TutorialStateAbstractBase (context)
00019 {
00020 }
00021
00022 void TutorialStateAxisPoints::begin ()
00023 {
00024 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::begin ()";
00025
00026 m_title = createTitle (tr ("Axis Points"));
00027 m_background = createPixmapItem (":/engauge/img/panel_axis_points.png",
00028 QPoint (0, 30));
00029 m_text0 = createTextItem (tr ("Axis points are first defined to\n"
00030 "define the coordinates. Step 1 -\n"
00031 "Click on the Axis Points button"),
00032 QPoint (320, 60));
00033 m_text1 = createTextItem (tr ("Step 2 - Click on an axis or grid\n"
00034 "line with known coordinates. An axis\n"
00035 "point appears, with a dialog window\n"
00036 "for entering the axis point's\n"
00037 "coordinates"),
00038 QPoint (300, 210));
00039 m_text2 = createTextItem (tr ("Step 3 - Enter the two coordinates\n"
00040 "of the axis point and then click Ok.\n"
00041 "Repeat steps 2 and 3 twice more\n"
00042 "until three axis points are created"),
00043 QPoint (280, 320));
00044
00045 QSize backgroundSize = context().tutorialDlg().backgroundSize();
00046
00047 m_previous = new TutorialButton (tr ("Previous"),
00048 context().tutorialDlg().scene());
00049 m_previous->setGeometry (QPoint (buttonMargin (),
00050 backgroundSize.height() - buttonMargin() - m_previous->size().height()));
00051 connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
00052
00053 m_next = new TutorialButton (tr ("Next"),
00054 context().tutorialDlg().scene());
00055 m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
00056 backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
00057 connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
00058 }
00059
00060 void TutorialStateAxisPoints::end ()
00061 {
00062 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::end ()";
00063
00064 context().tutorialDlg().scene().removeItem (m_title);
00065 context().tutorialDlg().scene().removeItem (m_background);
00066 context().tutorialDlg().scene().removeItem (m_text0);
00067 context().tutorialDlg().scene().removeItem (m_text1);
00068 context().tutorialDlg().scene().removeItem (m_text2);
00069
00070
00071 delete m_title;
00072 delete m_background;
00073 delete m_text0;
00074 delete m_text1;
00075 delete m_text2;
00076 delete m_next;
00077 delete m_previous;
00078
00079 m_title = 0;
00080 m_background = 0;
00081 m_text0 = 0;
00082 m_text1 = 0;
00083 m_text2 = 0;
00084 m_next = 0;
00085 m_previous = 0;
00086 }
00087
00088 void TutorialStateAxisPoints::slotNext ()
00089 {
00090 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::slotNextCurves";
00091
00092 context().requestDelayedStateTransition (TUTORIAL_STATE_CURVE_SELECTION);
00093 }
00094
00095 void TutorialStateAxisPoints::slotPrevious ()
00096 {
00097 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::slotPrevious";
00098
00099 context().requestDelayedStateTransition (TUTORIAL_STATE_INTRODUCTION);
00100 }