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

Class to create toolbars for MainWindow class. More...

#include <CreateToolBars.h>

Inheritance diagram for CreateToolBars:
Inheritance graph
Collaboration diagram for CreateToolBars:
Collaboration graph

Public Member Functions

 CreateToolBars ()
 Single constructor.
void create (MainWindow &mw)
 Create QToolbar toolbars.
void createToolbarBackground (MainWindow &mw)
void createToolbarCoordinateSystem (MainWindow &mw)
void createToolbarDigitize (MainWindow &mw)
void createToolbarSettingsView (MainWindow &mw)

Detailed Description

Class to create toolbars for MainWindow class.

We derive from QObject and use Q_OBJECT so translations work

Definition at line 16 of file CreateToolBars.h.

Constructor & Destructor Documentation

◆ CreateToolBars()

CreateToolBars::CreateToolBars ( )

Single constructor.

Definition at line 29 of file CreateToolBars.cpp.

30{
31}

Member Function Documentation

◆ create()

void CreateToolBars::create ( MainWindow & mw)

Create QToolbar toolbars.

Definition at line 33 of file CreateToolBars.cpp.

34{
35 LOG4CPP_INFO_S ((*mainCat)) << "CreateToolBars::create";
36
41}
log4cpp::Category * mainCat
Definition Logger.cpp:14
void createToolbarSettingsView(MainWindow &mw)
void createToolbarBackground(MainWindow &mw)
void createToolbarDigitize(MainWindow &mw)
void createToolbarCoordinateSystem(MainWindow &mw)
#define LOG4CPP_INFO_S(logger)
Definition convenience.h:18

◆ createToolbarBackground()

void CreateToolBars::createToolbarBackground ( MainWindow & mw)

Definition at line 43 of file CreateToolBars.cpp.

44{
45 // Background toolbar widgets
46 mw.m_cmbBackground = new QComboBox ();
47 mw.m_cmbBackground->setEnabled (false);
48 mw.m_cmbBackground->setStatusTip (tr ("Select background image"));
49 mw.m_cmbBackground->setWhatsThis (tr ("Selected Background\n\n"
50 "Select background image:\n"
51 "1) No background which highlights points\n"
52 "2) Original image which shows everything\n"
53 "3) Filtered image which highlights important details"));
54 mw.m_cmbBackground->addItem (tr ("No background"), QVariant (BACKGROUND_IMAGE_NONE));
55 mw.m_cmbBackground->addItem (tr ("Original image"), QVariant (BACKGROUND_IMAGE_ORIGINAL));
56 mw.m_cmbBackground->addItem (tr ("Filtered image"), QVariant (BACKGROUND_IMAGE_FILTERED));
57 // selectBackgroundOriginal needs currentIndexChanged
58 connect (mw.m_cmbBackground, SIGNAL (currentIndexChanged (int)), &mw, SLOT (slotCmbBackground (int)));
59
60 // Background toolbar
61 mw.m_toolBackground = new QToolBar (tr ("Background"), &mw);
62 mw.m_toolBackground->addWidget (mw.m_cmbBackground);
63 mw.addToolBar (mw.m_toolBackground);
64}
@ BACKGROUND_IMAGE_ORIGINAL
@ BACKGROUND_IMAGE_FILTERED
@ BACKGROUND_IMAGE_NONE

◆ createToolbarCoordinateSystem()

void CreateToolBars::createToolbarCoordinateSystem ( MainWindow & mw)

Definition at line 66 of file CreateToolBars.cpp.

67{
68 // Coordinate system toolbar
69 mw.m_cmbCoordSystem = new QComboBox;
70 mw.m_cmbCoordSystem->setEnabled (false);
71 mw.m_cmbCoordSystem->setStatusTip (tr ("Currently selected coordinate system"));
72 mw.m_cmbCoordSystem->setWhatsThis (tr ("Selected Coordinate System\n\n"
73 "Currently selected coordinate system. This is used to switch between coordinate systems "
74 "in documents with multiple coordinate systems"));
75 connect (mw.m_cmbCoordSystem, SIGNAL (activated (int)), &mw, SLOT (slotCmbCoordSystem (int)));
76
77 mw.m_btnShowAll = new QPushButton(QIcon(":/engauge/img/icon_show_all.png"), "");
78 mw.m_btnShowAll->setEnabled (false);
79 mw.m_btnShowAll->setAcceptDrops(false);
80 mw.m_btnShowAll->setStatusTip (tr ("Show all coordinate systems"));
81 mw.m_btnShowAll->setWhatsThis (tr ("Show All Coordinate Systems\n\n"
82 "When pressed and held, this button shows all digitized points and lines for all coordinate systems."));
83 connect (mw.m_btnShowAll, SIGNAL (pressed ()), &mw, SLOT (slotBtnShowAllPressed ()));
84 connect (mw.m_btnShowAll, SIGNAL (released ()), &mw, SLOT (slotBtnShowAllReleased ()));
85
86 mw.m_btnPrintAll = new QPushButton(QIcon(":/engauge/img/icon_print_all.png"), "");
87 mw.m_btnPrintAll->setEnabled (false);
88 mw.m_btnPrintAll->setAcceptDrops(false);
89 mw.m_btnPrintAll->setStatusTip (tr ("Print all coordinate systems"));
90 mw.m_btnPrintAll->setWhatsThis (tr ("Print All Coordinate Systems\n\n"
91 "When pressed, this button Prints all digitized points and lines for all coordinate systems."));
92 connect (mw.m_btnPrintAll, SIGNAL (pressed ()), &mw, SLOT (slotBtnPrintAll ()));
93
94 mw.m_toolCoordSystem = new QToolBar (tr ("Coordinate System"), &mw);
95 mw.m_toolCoordSystem->addWidget (mw.m_cmbCoordSystem);
96 mw.m_toolCoordSystem->addWidget (mw.m_btnShowAll);
97 mw.m_toolCoordSystem->addWidget (mw.m_btnPrintAll);
98 mw.addToolBar (mw.m_toolCoordSystem);
99}

◆ createToolbarDigitize()

void CreateToolBars::createToolbarDigitize ( MainWindow & mw)

Definition at line 101 of file CreateToolBars.cpp.

102{
103 mw.m_cmbCurve = new QComboBox ();
104 mw.m_cmbCurve->setEnabled (false);
105 mw.m_cmbCurve->setMinimumWidth (180);
106 mw.m_cmbCurve->setStatusTip (tr ("Select curve for new points."));
107 mw.m_cmbCurve->setWhatsThis (tr ("Selected Curve Name\n\n"
108 "Select curve for any new points. Every point belongs to one curve.\n\n"
109 "This can be changed while in Curve Point, Point Match, Color Picker or Segment Fill mode."));
110 connect (mw.m_cmbCurve, SIGNAL (activated (int)), &mw, SLOT (slotCmbCurve (int))); // activated() ignores code changes
111
112 mw.m_toolDigitize = new QToolBar (tr ("Drawing"), &mw);
113 mw.m_toolDigitize->addAction (mw.m_actionDigitizeSelect);
114 mw.m_toolDigitize->insertSeparator (mw.m_actionDigitizeAxis);
115 mw.m_toolDigitize->addAction (mw.m_actionDigitizeAxis);
116 mw.m_toolDigitize->addAction (mw.m_actionDigitizeScale);
117 mw.m_toolDigitize->insertSeparator (mw.m_actionDigitizeCurve);
118 mw.m_toolDigitize->addAction (mw.m_actionDigitizeCurve);
119 mw.m_toolDigitize->addAction (mw.m_actionDigitizePointMatch);
120 mw.m_toolDigitize->addAction (mw.m_actionDigitizeColorPicker);
121 mw.m_toolDigitize->addAction (mw.m_actionDigitizeSegment);
122 mw.m_toolDigitize->addAction (mw.m_actionDigitizeGuideline);
123 mw.m_toolDigitize->addWidget (mw.m_cmbCurve);
124 mw.addToolBar (mw.m_toolDigitize);
125}

◆ createToolbarSettingsView()

void CreateToolBars::createToolbarSettingsView ( MainWindow & mw)

Definition at line 127 of file CreateToolBars.cpp.

128{
129 const int VIEW_SIZE = 22;
130
131 mw.m_viewPointStyle = new ViewPointStyle();
132 mw.m_viewPointStyle->setMinimumSize(VIEW_SIZE, VIEW_SIZE);
133 mw.m_viewPointStyle->setMaximumSize(VIEW_SIZE, VIEW_SIZE);
134 mw.m_viewPointStyle->setStatusTip (tr ("Points style for the currently selected curve"));
135 mw.m_viewPointStyle->setWhatsThis (tr ("Points Style\n\n"
136 "Points style for the currently selected curve. The points style is only "
137 "displayed in this toolbar. To change the points style, "
138 "use the Curve Properties dialog."));
139
140 mw.m_viewSegmentFilter = new ViewSegmentFilter();
141 mw.m_viewSegmentFilter->setMinimumSize(VIEW_SIZE, VIEW_SIZE);
142 mw.m_viewSegmentFilter->setMaximumSize(VIEW_SIZE, VIEW_SIZE);
143 mw.m_viewSegmentFilter->setStatusTip (tr ("View of filter for current curve in Segment Fill mode"));
144 mw.m_viewSegmentFilter->setWhatsThis (tr ("Segment Fill Filter\n\n"
145 "View of filter for the current curve in Segment Fill mode. The filter settings are only "
146 "displayed in this toolbar. To changed the filter settings, "
147 "use the Color Picker mode or the Filter Settings dialog."));
148
149 mw.m_toolSettingsViews = new QToolBar (tr ("Views"), &mw);
150 mw.m_toolSettingsViews->addWidget (mw.m_viewPointStyle);
151 mw.m_toolSettingsViews->addWidget (new QLabel (" ")); // A hack, but this works to put some space between the adjacent widgets
152 mw.m_toolSettingsViews->addWidget (mw.m_viewSegmentFilter);
153 mw.addToolBar (mw.m_toolSettingsViews);
154}

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