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 "TutorialStateSegmentFill.h"
00016
00017 TutorialStateSegmentFill::TutorialStateSegmentFill (TutorialStateContext &context) :
00018 TutorialStateAbstractBase (context)
00019 {
00020 }
00021
00022 void TutorialStateSegmentFill::begin ()
00023 {
00024 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::begin ()";
00025
00026 m_title = createTitle (tr ("Segment Fill"));
00027 m_background = createPixmapItem (":/engauge/img/panel_segment_fill.png",
00028 QPoint (0, 30));
00029 m_text0 = createTextItem (tr ("Segment Fill mode places several\n"
00030 "points all along the line segments\n"
00031 "of a curve. Step 1 - Click on the\n"
00032 "Segment Fill button."),
00033 QPoint (300, 40));
00034 m_text1 = createTextItem (tr ("Step 2 - Select the curve the new\n"
00035 "points will belong to."),
00036 QPoint (300, 140));
00037 m_text2 = createTextItem (tr ("Step 3 - Move the cursor over a line\n"
00038 "segment in the desired curve. If a\n"
00039 "green line appears, click on it once\n"
00040 "to generate many points."),
00041 QPoint (300, 220));
00042
00043 QSize backgroundSize = context().tutorialDlg().backgroundSize();
00044
00045 m_previous = new TutorialButton (tr ("Previous"),
00046 context().tutorialDlg().scene());
00047 m_previous->setGeometry (QPoint (buttonMargin (),
00048 backgroundSize.height() - buttonMargin() - m_previous->size().height()));
00049 connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
00050
00051 m_next = new TutorialButton (tr ("Next"),
00052 context().tutorialDlg().scene());
00053 m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
00054 backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
00055 connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
00056 }
00057
00058 void TutorialStateSegmentFill::end ()
00059 {
00060 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::end ()";
00061
00062 context().tutorialDlg().scene().removeItem (m_title);
00063 context().tutorialDlg().scene().removeItem (m_background);
00064 context().tutorialDlg().scene().removeItem (m_text0);
00065 context().tutorialDlg().scene().removeItem (m_text1);
00066 context().tutorialDlg().scene().removeItem (m_text2);
00067
00068
00069 delete m_title;
00070 delete m_background;
00071 delete m_text0;
00072 delete m_text1;
00073 delete m_text2;
00074 delete m_next;
00075 delete m_previous;
00076
00077 m_title = 0;
00078 m_background = 0;
00079 m_text0 = 0;
00080 m_text1 = 0;
00081 m_text2 = 0;
00082 m_next = 0;
00083 m_previous = 0;
00084 }
00085
00086 void TutorialStateSegmentFill::slotNext ()
00087 {
00088 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::slotNext";
00089
00090 context().requestDelayedStateTransition (TUTORIAL_STATE_CHECKLIST_WIZARD_LINES);
00091 }
00092
00093 void TutorialStateSegmentFill::slotPrevious ()
00094 {
00095 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateSegmentFill::slotPrevious";
00096
00097 context().requestDelayedStateTransition (TUTORIAL_STATE_CURVE_TYPE);
00098 }