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 "TutorialStateColorFilter.h"
00015 #include "TutorialStateContext.h"
00016
00017 TutorialStateColorFilter::TutorialStateColorFilter (TutorialStateContext &context) :
00018 TutorialStateAbstractBase (context)
00019 {
00020 }
00021
00022 void TutorialStateColorFilter::begin ()
00023 {
00024 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateColorFilter::begin ()";
00025
00026 m_title = createTitle (tr ("Color Filter"));
00027 m_background = createPixmapItem (":/engauge/img/panel_color_filter.png",
00028 QPoint (0, 30));
00029 m_text0 = createTextItem (tr ("Each curve has Color Filter settings that\n"
00030 "are applied in Segment Fill mode. For\n"
00031 "black lines the defaults work well, but for\n"
00032 "colored lines the settings can be improved."),
00033 QPoint (260, 30));
00034 m_text1 = createTextItem (tr ("Step 1 - Select the Settings / Color\n"
00035 "Filter menu option."),
00036 QPoint (285, 115));
00037 m_text2 = createTextItem (tr ("Step 2 - Select the curve that will\n"
00038 "be given the new settings."),
00039 QPoint (285, 165));
00040 m_text3 = createTextItem (tr ("Step 3 - Select the mode. Intensity is\n"
00041 "suggested for uncolored lines, and Hue\n"
00042 "is suggested for colored lines."),
00043 QPoint (285, 210));
00044 m_text4 = createTextItem (tr ("Step 4 - Adjust the included range by\n"
00045 "dragging the green handles, until the\n"
00046 "curve is clear in the preview window\n"
00047 "below. The graph shows a histogram\n"
00048 "distribution of the values underneath.\n"
00049 "Click Ok when finished."),
00050 QPoint (285, 280));
00051
00052 QSize backgroundSize = context().tutorialDlg().backgroundSize();
00053
00054 m_back = new TutorialButton (tr ("Back"),
00055 context().tutorialDlg().scene());
00056 m_back->setGeometry (QPoint (backgroundSize.width () / 2 - m_back->size().width () / 2,
00057 backgroundSize.height() - buttonMargin() - m_back->size().height()));
00058 connect (m_back, SIGNAL (signalTriggered ()), this, SLOT (slotBack ()));
00059 }
00060
00061 void TutorialStateColorFilter::end ()
00062 {
00063 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateColorFilter::end ()";
00064
00065 context().tutorialDlg().scene().removeItem (m_title);
00066 context().tutorialDlg().scene().removeItem (m_background);
00067 context().tutorialDlg().scene().removeItem (m_text0);
00068 context().tutorialDlg().scene().removeItem (m_text1);
00069 context().tutorialDlg().scene().removeItem (m_text2);
00070 context().tutorialDlg().scene().removeItem (m_text3);
00071 context().tutorialDlg().scene().removeItem (m_text4);
00072
00073
00074 delete m_title;
00075 delete m_background;
00076 delete m_text0;
00077 delete m_text1;
00078 delete m_text2;
00079 delete m_text3;
00080 delete m_text4;
00081 delete m_back;
00082
00083 m_title = 0;
00084 m_background = 0;
00085 m_text0 = 0;
00086 m_text1 = 0;
00087 m_text2 = 0;
00088 m_text3 = 0;
00089 m_text4 = 0;
00090 m_back = 0;
00091 }
00092
00093 void TutorialStateColorFilter::slotBack ()
00094 {
00095 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateColorFilter::slotBack";
00096
00097 context().requestDelayedStateTransition (TUTORIAL_STATE_CURVE_SELECTION);
00098 }