Engauge Digitizer  2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Slots | Public Member Functions | List of all members
TutorialStateCurveType Class Reference

Curve type state/panel lets user select the curve type (lines or points) More...

#include <TutorialStateCurveType.h>

Inheritance diagram for TutorialStateCurveType:
Inheritance graph
Collaboration diagram for TutorialStateCurveType:
Collaboration graph

Public Slots

void slotNextCurves ()
 Slot called when next button for curves is triggered. More...
 
void slotNextLines ()
 Slot called when next button for lines is triggered. More...
 
void slotPrevious ()
 Slot called to return to previous panel. More...
 

Public Member Functions

 TutorialStateCurveType (TutorialStateContext &context)
 Single constructor. More...
 
virtual void begin ()
 Transition into this state. More...
 
virtual void end ()
 Transition out of this state. More...
 
- Public Member Functions inherited from TutorialStateAbstractBase
 TutorialStateAbstractBase (TutorialStateContext &context)
 Single constructor. More...
 
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. More...
 
TutorialStateContextcontext ()
 Context class for the tutorial state machine. More...
 
QGraphicsPixmapItem * createPixmapItem (const QString &resource, const QPoint &pos)
 Factory method for pixmap items. More...
 
QGraphicsTextItem * createTextItem (const QString &text, const QPoint &pos)
 Factory method for text items. More...
 
QGraphicsTextItem * createTitle (const QString &text)
 Factory method for title items. More...
 

Detailed Description

Curve type state/panel lets user select the curve type (lines or points)

Definition at line 18 of file TutorialStateCurveType.h.

Constructor & Destructor Documentation

TutorialStateCurveType::TutorialStateCurveType ( TutorialStateContext context)

Single constructor.

Definition at line 18 of file TutorialStateCurveType.cpp.

18  :
19  TutorialStateAbstractBase (context),
20  m_title (nullptr),
21  m_background (nullptr),
22  m_text0 (nullptr),
23  m_text1 (nullptr),
24  m_text2 (nullptr),
25  m_previous (nullptr),
26  m_nextLines (nullptr),
27  m_nextPoints (nullptr)
28 {
29  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::TutorialStateCurveType";
30 }
One state manages one panel of the tutorial.
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14

Member Function Documentation

void TutorialStateCurveType::begin ( )
virtual

Transition into this state.

Implements TutorialStateAbstractBase.

Definition at line 32 of file TutorialStateCurveType.cpp.

33 {
34  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::begin ()";
35 
36  context().tutorialDlg().scene().clear ();
37 
38  m_title = createTitle (tr ("Curve Type"));
39  m_background = createPixmapItem (":/engauge/img/panel_lines_points.png",
40  QPoint (0, 0));
41  m_text0 = createTextItem (tr ("The next steps depend on how the curves\n"
42  "are drawn, in terms of lines and points."),
43  QPoint (240, 40));
44  m_text1 = createTextItem (tr ("If the curves are drawn\n"
45  "with lines (with or without\n"
46  "points) then click on\n"
47  "Next (Lines)."),
48  QPoint (265, 110));
49  m_text2 = createTextItem (tr ("If the curves are drawn\n"
50  "without lines and only\n"
51  "with points, then click on\n"
52  "Next (Points)."),
53  QPoint (265, 270));
54 
55  QSize backgroundSize = context().tutorialDlg().backgroundSize();
56 
57  m_previous = new TutorialButton (tr ("Previous"),
58  context().tutorialDlg().scene());
59  m_previous->setGeometry (QPoint (buttonMargin (),
60  backgroundSize.height () - buttonMargin() - m_previous->size().height()));
61  connect (m_previous, SIGNAL (signalTriggered ()), this, SLOT (slotPrevious ()));
62 
63  m_nextLines = new TutorialButton (tr ("Next (Lines)"),
64  context().tutorialDlg().scene());
65  m_nextLines->setGeometry (QPoint (qFloor (backgroundSize.width () - buttonMargin () - m_nextLines->size ().width ()),
66  qFloor (backgroundSize.height () / 3.0 - m_nextLines->size ().height () / 2.0)));
67  connect (m_nextLines, SIGNAL (signalTriggered ()), this, SLOT (slotNextCurves ()));
68 
69  m_nextPoints = new TutorialButton (tr ("Next (Points)"),
70  context().tutorialDlg().scene());
71  m_nextPoints->setGeometry (QPoint (qFloor (backgroundSize.width () - buttonMargin () - m_nextPoints->size ().width ()),
72  qFloor (backgroundSize.height () * 2.0 / 3.0 - m_nextPoints->size ().height () / 2.0)));
73  connect (m_nextPoints, SIGNAL (signalTriggered ()), this, SLOT (slotNextLines ()));
74 }
void setGeometry(const QPoint &pos)
Set the position. This is called after creation so screen extent is available for positioning calcula...
Show a button with text for clicking ion. The button is implemented using layering of two graphics it...
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
int buttonMargin() const
Buttons are placed up against bottom side, and left or right side, separated by this margin...
QGraphicsScene & scene()
Single scene the covers the entire tutorial dialog.
Definition: TutorialDlg.cpp:76
void slotNextCurves()
Slot called when next button for curves is triggered.
TutorialStateContext & context()
Context class for the tutorial state machine.
void slotNextLines()
Slot called when next button for lines is triggered.
QGraphicsTextItem * createTextItem(const QString &text, const QPoint &pos)
Factory method for text items.
QSize backgroundSize() const
Make geometry available for layout.
Definition: TutorialDlg.cpp:44
QGraphicsTextItem * createTitle(const QString &text)
Factory method for title items.
void slotPrevious()
Slot called to return to previous panel.
QGraphicsPixmapItem * createPixmapItem(const QString &resource, const QPoint &pos)
Factory method for pixmap items.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
QSize size() const
Size of this button.
TutorialDlg & tutorialDlg()
Access to tutorial dialogs and its scene.
void TutorialStateCurveType::end ( )
virtual

Transition out of this state.

Implements TutorialStateAbstractBase.

Definition at line 76 of file TutorialStateCurveType.cpp.

77 {
78  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::end ()";
79 
80  // It is not safe to remove and deallocate items here since an active TutorialButton
81  // may be on the stack. So we clear the scene as the first step in the next begin()
82 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void TutorialStateCurveType::slotNextCurves ( )
slot

Slot called when next button for curves is triggered.

Definition at line 84 of file TutorialStateCurveType.cpp.

85 {
86  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::slotNextCurves";
87 
89 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TutorialStateContext & context()
Context class for the tutorial state machine.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
void TutorialStateCurveType::slotNextLines ( )
slot

Slot called when next button for lines is triggered.

Definition at line 91 of file TutorialStateCurveType.cpp.

92 {
93  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::slotNextLines";
94 
96 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TutorialStateContext & context()
Context class for the tutorial state machine.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.
void TutorialStateCurveType::slotPrevious ( )
slot

Slot called to return to previous panel.

Definition at line 98 of file TutorialStateCurveType.cpp.

99 {
100  LOG4CPP_INFO_S ((*mainCat)) << "TutorialStateCurveType::slotNextCurves";
101 
103 }
#define LOG4CPP_INFO_S(logger)
Definition: convenience.h:18
TutorialStateContext & context()
Context class for the tutorial state machine.
log4cpp::Category * mainCat
Definition: Logger.cpp:14
void requestDelayedStateTransition(TutorialState tutorialState)
Request a transition to the specified state from the current state.

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