Engauge Digitizer 2
Loading...
Searching...
No Matches
TutorialStateAxisPoints Class Reference

Axis points panel discusses axis point digitization. More...

#include <TutorialStateAxisPoints.h>

Inheritance diagram for TutorialStateAxisPoints:
Inheritance graph
Collaboration diagram for TutorialStateAxisPoints:
Collaboration graph

Public Slots

void slotNext ()
 Slot called when next button is triggered.
void slotPrevious ()
 Slot called to return to previous panel.

Public Member Functions

 TutorialStateAxisPoints (TutorialStateContext &context)
 Single constructor.
virtual void begin ()
 Transition into this state.
virtual void end ()
 Transition out of this state.
Public Member Functions inherited from TutorialStateAbstractBase
 TutorialStateAbstractBase (TutorialStateContext &context)
 Single constructor.
virtual ~TutorialStateAbstractBase ()

Additional Inherited Members

Protected Member Functions inherited from TutorialStateAbstractBase
int buttonMargin () const
 Buttons are placed up against bottom side, and left or right side, separated by this margin.
TutorialStateContextcontext ()
 Context class for the tutorial state machine.
QGraphicsPixmapItem * createPixmapItem (const QString &resource, const QPoint &pos)
 Factory method for pixmap items.
QGraphicsTextItem * createTextItem (const QString &text, const QPoint &pos)
 Factory method for text items.
QGraphicsTextItem * createTitle (const QString &text)
 Factory method for title items.

Detailed Description

Axis points panel discusses axis point digitization.

Definition at line 18 of file TutorialStateAxisPoints.h.

Constructor & Destructor Documentation

◆ TutorialStateAxisPoints()

TutorialStateAxisPoints::TutorialStateAxisPoints ( TutorialStateContext & context)

Single constructor.

Definition at line 17 of file TutorialStateAxisPoints.cpp.

17 :
19 m_title (nullptr),
20 m_background (nullptr),
21 m_text0 (nullptr),
22 m_text1 (nullptr),
23 m_text2 (nullptr),
24 m_previous (nullptr),
25 m_next (nullptr)
26{
27}
TutorialStateAbstractBase(TutorialStateContext &context)
Single constructor.
TutorialStateContext & context()
Context class for the tutorial state machine.

Member Function Documentation

◆ begin()

void TutorialStateAxisPoints::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 29 of file TutorialStateAxisPoints.cpp.

30{
31 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::begin ()";
32
33 context().tutorialDlg().scene().clear ();
34
35 m_title = createTitle (tr ("Axis Points"));
36 m_background = createPixmapItem (":/engauge/img/panel_axis_points.png",
37 QPoint (0, 30));
38 m_text0 = createTextItem (tr ("Axis points are first defined to\n"
39 "define the coordinates. Step 1 -\n"
40 "Click on the Axis Points button"),
41 QPoint (320, 60));
42 m_text1 = createTextItem (tr ("Step 2 - Click on an axis or grid\n"
43 "line with known coordinates. An axis\n"
44 "point appears, with a dialog window\n"
45 "for entering the axis point\n"
46 "coordinates"),
47 QPoint (300, 210));
48 m_text2 = createTextItem (tr ("Step 3 - Enter the two coordinates\n"
49 "of the axis point and then click Ok.\n"
50 "Repeat steps 2 and 3 twice more\n"
51 "until three axis points are created"),
52 QPoint (280, 320));
53
54 QSize backgroundSize = context().tutorialDlg().backgroundSize();
55
56 m_previous = new TutorialButton (tr ("Previous"),
57 context().tutorialDlg().scene());
58 m_previous->setGeometry (QPoint (buttonMargin (),
59 backgroundSize.height() - buttonMargin() - m_previous->size().height()));
60 connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
61
62 m_next = new TutorialButton (tr ("Next"),
63 context().tutorialDlg().scene());
64 m_next->setGeometry (QPoint (backgroundSize.width () - buttonMargin () - m_next->size ().width (),
65 backgroundSize.height () - buttonMargin () - m_next->size ().height ()));
66 connect (m_next, SIGNAL (signalTriggered ()), this, SLOT (slotNext ()));
67}
log4cpp::Category * mainCat
Definition Logger.cpp:14
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
QSize backgroundSize() const
Make geometry available for layout.
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin.
void slotNext()
Slot called when next button is triggered.
void slotPrevious()
Slot called to return to previous panel.
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ end()

void TutorialStateAxisPoints::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 69 of file TutorialStateAxisPoints.cpp.

70{
71 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::end ()";
72
73 // It is not safe to remove and deallocate items here since an active TutorialButton
74 // may be on the stack. So we clear the scene as the first step in the next begin()
75}

◆ slotNext

void TutorialStateAxisPoints::slotNext ( )
slot

Slot called when next button is triggered.

Definition at line 77 of file TutorialStateAxisPoints.cpp.

78{
79 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::slotNextCurves";
80
82}
@ TUTORIAL_STATE_CURVE_SELECTION
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.

◆ slotPrevious

void TutorialStateAxisPoints::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 84 of file TutorialStateAxisPoints.cpp.

85{
86 LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateAxisPoints::slotPrevious";
87
89}
@ TUTORIAL_STATE_INTRODUCTION

The documentation for this class was generated from the following files: