7 #include "CmdMediator.h"
8 #include "CmdSettingsGridDisplay.h"
9 #include "DlgSettingsGridDisplay.h"
10 #include "EngaugeAssert.h"
11 #include "GridInitializer.h"
12 #include "GridLineFactory.h"
14 #include "MainWindow.h"
17 #include <QDoubleValidator>
18 #include <QGraphicsScene>
19 #include <QGridLayout>
21 #include <QHBoxLayout>
24 #include "ViewPreview.h"
26 const int COUNT_MIN = 1;
27 const int COUNT_MAX = 100;
28 const int COUNT_DECIMALS = 0;
32 "DlgSettingsGridDisplay",
36 m_modelGridDisplayBefore (0),
37 m_modelGridDisplayAfter (0)
39 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::DlgSettingsGridDisplay";
45 DlgSettingsGridDisplay::~DlgSettingsGridDisplay()
47 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::~DlgSettingsGridDisplay";
50 void DlgSettingsGridDisplay::createDisplayCommon (QGridLayout *layout,
int &row)
52 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createDisplayCommon";
54 QWidget *widgetCommon =
new QWidget;
55 layout->addWidget (widgetCommon, row++, 2, 1, 2);
57 QGridLayout *layoutCommon =
new QGridLayout;
58 widgetCommon->setLayout (layoutCommon);
61 QLabel *labelColor =
new QLabel (tr (
"Color:"));
62 layoutCommon->addWidget (labelColor, rowCommon, 1);
64 m_cmbColor =
new QComboBox;
65 m_cmbColor->setWhatsThis (tr (
"Select a color for the lines"));
67 connect (m_cmbColor, SIGNAL (activated (
const QString &)),
this, SLOT (slotColor (
const QString &)));
68 layoutCommon->addWidget (m_cmbColor, rowCommon++, 2);
71 layoutCommon->setColumnStretch (0, 1);
72 layoutCommon->setColumnStretch (1, 0);
73 layoutCommon->setColumnStretch (2, 0);
74 layoutCommon->setColumnStretch (3, 1);
77 void DlgSettingsGridDisplay::createDisplayGridLinesX (QGridLayout *layout,
int &row)
79 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createDisplayGridLinesX";
81 m_groupX =
new QGroupBox;
82 layout->addWidget (m_groupX, row, 2);
84 QGridLayout *layoutGroup =
new QGridLayout;
85 m_groupX->setLayout (layoutGroup);
87 QLabel *labelDisable =
new QLabel (tr (
"Disable:"));
88 layoutGroup->addWidget (labelDisable, 0, 0);
90 m_cmbDisableX =
new QComboBox;
91 m_cmbDisableX->setWhatsThis (tr (
"Disabled value.\n\n"
92 "The X grid lines are specified using only three values at a time. For flexibility, four values "
93 "are offered so you must chose which value is disabled. Once disabled, that value is simply "
94 "updated as the other values change"));
95 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
96 QVariant (GRID_COORD_DISABLE_COUNT));
97 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
98 QVariant (GRID_COORD_DISABLE_START));
99 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
100 QVariant (GRID_COORD_DISABLE_STEP));
101 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
102 QVariant (GRID_COORD_DISABLE_STOP));
103 connect (m_cmbDisableX, SIGNAL (activated (
const QString &)),
this, SLOT (slotDisableX (
const QString &)));
104 layoutGroup->addWidget (m_cmbDisableX, 0, 1);
106 QLabel *labelCount =
new QLabel (tr (
"Count:"));
107 layoutGroup->addWidget (labelCount, 1, 0);
109 m_editCountX =
new QLineEdit;
110 m_editCountX->setWhatsThis (tr (
"Number of X grid lines.\n\n"
111 "The number of X grid lines must be entered as an integer greater than zero"));
112 m_validatorCountX =
new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
113 m_editCountX->setValidator (m_validatorCountX);
114 connect (m_editCountX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotCountX (
const QString &)));
115 layoutGroup->addWidget (m_editCountX, 1, 1);
117 QLabel *labelStart =
new QLabel (tr (
"Start:"));
118 layoutGroup->addWidget (labelStart, 2, 0);
120 m_editStartX =
new QLineEdit;
121 m_editStartX->setWhatsThis (tr (
"Value of the first X grid line.\n\n"
122 "The start value cannot be greater than the stop value"));
123 m_validatorStartX =
new QDoubleValidator;
124 m_editStartX->setValidator (m_validatorStartX);
125 connect (m_editStartX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStartX (
const QString &)));
126 layoutGroup->addWidget (m_editStartX, 2, 1);
128 QLabel *labelStep =
new QLabel (tr (
"Step:"));
129 layoutGroup->addWidget (labelStep, 3, 0);
131 m_editStepX =
new QLineEdit;
132 m_editStepX->setWhatsThis (tr (
"Difference in value between two successive X grid lines.\n\n"
133 "The step value must be greater than zero"));
134 m_validatorStepX =
new QDoubleValidator;
135 m_editStepX->setValidator (m_validatorStepX);
136 connect (m_editStepX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStepX (
const QString &)));
137 layoutGroup->addWidget (m_editStepX, 3, 1);
139 QLabel *labelStop =
new QLabel (tr (
"Stop:"));
140 layoutGroup->addWidget (labelStop, 4, 0);
142 m_editStopX =
new QLineEdit;
143 m_editStopX->setWhatsThis (tr (
"Value of the last X grid line.\n\n"
144 "The stop value cannot be less than the start value"));
145 m_validatorStopX =
new QDoubleValidator;
146 m_editStopX->setValidator (m_validatorStopX);
147 connect (m_editStopX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStopX (
const QString &)));
148 layoutGroup->addWidget (m_editStopX, 4, 1);
151 void DlgSettingsGridDisplay::createDisplayGridLinesY (QGridLayout *layout,
int &row)
153 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createDisplayGridLinesY";
155 m_groupY =
new QGroupBox;
156 layout->addWidget (m_groupY, row++, 3);
158 QGridLayout *layoutGroup =
new QGridLayout;
159 m_groupY->setLayout (layoutGroup);
161 QLabel *labelDisable =
new QLabel (tr (
"Disable:"));
162 layoutGroup->addWidget (labelDisable, 0, 0);
164 m_cmbDisableY =
new QComboBox;
165 m_cmbDisableY->setWhatsThis (tr (
"Disabled value.\n\n"
166 "The Y grid lines are specified using only three values at a time. For flexibility, four values "
167 "are offered so you must chose which value is disabled. Once disabled, that value is simply "
168 "updated as the other values change"));
169 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
170 QVariant (GRID_COORD_DISABLE_COUNT));
171 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
172 QVariant (GRID_COORD_DISABLE_START));
173 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
174 QVariant (GRID_COORD_DISABLE_STEP));
175 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
176 QVariant (GRID_COORD_DISABLE_STOP));
177 connect (m_cmbDisableY, SIGNAL (activated (
const QString &)),
this, SLOT (slotDisableY (
const QString &)));
178 layoutGroup->addWidget (m_cmbDisableY, 0, 1);
180 QLabel *labelCount =
new QLabel (tr (
"Count:"));
181 layoutGroup->addWidget (labelCount, 1, 0);
183 m_editCountY =
new QLineEdit;
184 m_editCountY->setWhatsThis (tr (
"Number of Y grid lines.\n\n"
185 "The number of Y grid lines must be entered as an integer greater than zero"));
186 m_validatorCountY =
new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
187 m_editCountY->setValidator (m_validatorCountY);
188 connect (m_editCountY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotCountY (
const QString &)));
189 layoutGroup->addWidget (m_editCountY, 1, 1);
191 QLabel *labelStart =
new QLabel (tr (
"Start:"));
192 layoutGroup->addWidget (labelStart, 2, 0);
194 m_editStartY =
new QLineEdit;
195 m_editStartY->setWhatsThis (tr (
"Value of the first Y grid line.\n\n"
196 "The start value cannot be greater than the stop value"));
197 m_validatorStartY =
new QDoubleValidator;
198 m_editStartY->setValidator (m_validatorStartY);
199 connect (m_editStartY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStartY (
const QString &)));
200 layoutGroup->addWidget (m_editStartY, 2, 1);
202 QLabel *labelStep =
new QLabel (tr (
"Step:"));
203 layoutGroup->addWidget (labelStep, 3, 0);
205 m_editStepY =
new QLineEdit;
206 m_editStepY->setWhatsThis (tr (
"Difference in value between two successive Y grid lines.\n\n"
207 "The step value must be greater than zero"));
208 m_validatorStepY =
new QDoubleValidator;
209 m_editStepY->setValidator (m_validatorStepY);
210 connect (m_editStepY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStepY (
const QString &)));
211 layoutGroup->addWidget (m_editStepY, 3, 1);
213 QLabel *labelStop =
new QLabel (tr (
"Stop:"));
214 layoutGroup->addWidget (labelStop, 4, 0);
216 m_editStopY =
new QLineEdit;
217 m_editStopY->setWhatsThis (tr (
"Value of the last Y grid line.\n\n"
218 "The stop value cannot be less than the start value"));
219 m_validatorStopY =
new QDoubleValidator;
220 m_editStopY->setValidator (m_validatorStopY);
221 connect (m_editStopY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStopY (
const QString &)));
222 layoutGroup->addWidget (m_editStopY, 4, 1);
229 void DlgSettingsGridDisplay::createPreview (QGridLayout *layout,
int &row)
231 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createPreview";
233 QLabel *labelPreview =
new QLabel (tr (
"Preview"));
234 layout->addWidget (labelPreview, row++, 0, 1, 5);
236 m_scenePreview =
new QGraphicsScene (
this);
238 ViewPreview::VIEW_ASPECT_RATIO_VARIABLE,
240 m_viewPreview->setWhatsThis (tr (
"Preview window that shows how current settings affect grid display"));
241 m_viewPreview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
242 m_viewPreview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
244 layout->addWidget (m_viewPreview, row++, 0, 1, 5);
249 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createSubPanel";
251 const int COLUMN_CHECKBOX_WIDTH = 60;
253 QWidget *subPanel =
new QWidget ();
254 QGridLayout *layout =
new QGridLayout (subPanel);
255 subPanel->setLayout (layout);
257 layout->setColumnStretch(0, 1);
258 layout->setColumnStretch(1, 0);
259 layout->setColumnMinimumWidth(1, COLUMN_CHECKBOX_WIDTH);
260 layout->setColumnStretch(2, 0);
261 layout->setColumnStretch(3, 0);
262 layout->setColumnStretch(4, 1);
265 createDisplayGridLinesX (layout, row);
266 createDisplayGridLinesY (layout, row);
267 createDisplayCommon (layout, row);
268 createPreview (layout, row);
275 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::handleOk";
278 m_modelGridDisplayAfter->
setStable (
true);
282 *m_modelGridDisplayBefore,
283 *m_modelGridDisplayAfter);
291 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::load";
296 if (m_modelGridDisplayBefore != 0) {
297 delete m_modelGridDisplayBefore;
299 if (m_modelGridDisplayAfter != 0) {
300 delete m_modelGridDisplayAfter;
304 QString titleX = tr (
"X Grid Lines");
306 titleX = QString (QChar (0x98, 0x03)) + QString (
" %1").arg (tr (
"Grid Lines"));
308 m_groupX->setTitle (titleX);
310 QString titleY = tr (
"Y Grid Lines");
312 titleY = QString (tr (
"Radius Grid Lines"));
314 m_groupY->setTitle (titleY);
321 int indexDisableX = m_cmbDisableX->findData (QVariant (m_modelGridDisplayAfter->
disableX()));
322 m_cmbDisableX->setCurrentIndex (indexDisableX);
324 m_editCountX->setText(QString::number(m_modelGridDisplayAfter->
countX()));
325 m_editStartX->setText(QString::number(m_modelGridDisplayAfter->
startX()));
326 m_editStepX->setText(QString::number(m_modelGridDisplayAfter->
stepX()));
327 m_editStopX->setText(QString::number(m_modelGridDisplayAfter->
stopX()));
329 int indexDisableY = m_cmbDisableY->findData (QVariant (m_modelGridDisplayAfter->
disableY()));
330 m_cmbDisableY->setCurrentIndex (indexDisableY);
332 m_editCountY->setText(QString::number(m_modelGridDisplayAfter->
countY()));
333 m_editStartY->setText(QString::number(m_modelGridDisplayAfter->
startY()));
334 m_editStepY->setText(QString::number(m_modelGridDisplayAfter->
stepY()));
335 m_editStopY->setText(QString::number(m_modelGridDisplayAfter->
stopY()));
337 int indexColor = m_cmbColor->findData(QVariant(m_modelGridDisplayAfter->
paletteColor()));
338 ENGAUGE_ASSERT (indexColor >= 0);
339 m_cmbColor->setCurrentIndex(indexColor);
348 void DlgSettingsGridDisplay::slotColor (QString
const &)
350 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotColor";
352 m_modelGridDisplayAfter->
setPaletteColor((ColorPalette) m_cmbColor->currentData().toInt());
357 void DlgSettingsGridDisplay::slotCountX(
const QString &count)
359 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotCountX";
361 m_modelGridDisplayAfter->
setCountX(count.toInt());
362 updateDisplayedVariableX ();
367 void DlgSettingsGridDisplay::slotCountY(
const QString &count)
369 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotCountY";
371 m_modelGridDisplayAfter->
setCountY(count.toInt());
372 updateDisplayedVariableY ();
377 void DlgSettingsGridDisplay::slotDisableX(
const QString &)
379 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotDisableX";
381 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
382 m_modelGridDisplayAfter->
setDisableX(gridCoordDisable);
383 updateDisplayedVariableX ();
388 void DlgSettingsGridDisplay::slotDisableY(
const QString &)
390 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotDisableY";
392 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
393 m_modelGridDisplayAfter->
setDisableY(gridCoordDisable);
394 updateDisplayedVariableY ();
399 void DlgSettingsGridDisplay::slotStartX(
const QString &startX)
401 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStartX";
403 m_modelGridDisplayAfter->
setStartX(startX.toDouble());
404 updateDisplayedVariableX ();
409 void DlgSettingsGridDisplay::slotStartY(
const QString &startY)
411 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStartY";
413 m_modelGridDisplayAfter->
setStartY(startY.toDouble());
414 updateDisplayedVariableY ();
419 void DlgSettingsGridDisplay::slotStepX(
const QString &stepX)
421 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStepX";
423 m_modelGridDisplayAfter->
setStepX(stepX.toDouble());
424 updateDisplayedVariableX ();
429 void DlgSettingsGridDisplay::slotStepY(
const QString &stepY)
431 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStepY";
433 m_modelGridDisplayAfter->
setStepY(stepY.toDouble());
434 updateDisplayedVariableY ();
439 void DlgSettingsGridDisplay::slotStopX(
const QString &stopX)
441 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStopX";
443 m_modelGridDisplayAfter->
setStopX(stopX.toDouble());
444 updateDisplayedVariableX ();
449 void DlgSettingsGridDisplay::slotStopY(
const QString &stopY)
451 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStopY";
453 m_modelGridDisplayAfter->
setStopY(stopY.toDouble());
454 updateDisplayedVariableY ();
459 bool DlgSettingsGridDisplay::textItemsAreValid ()
const
461 QString textCountX = m_editCountX->text();
462 QString textCountY = m_editCountY->text();
463 QString textStartX = m_editStartX->text();
464 QString textStartY = m_editStartY->text();
465 QString textStepX = m_editStepX->text();
466 QString textStepY = m_editStepY->text();
467 QString textStopX = m_editStopX->text();
468 QString textStopY = m_editStopY->text();
474 return (!textCountX.isEmpty() &&
475 !textCountY.isEmpty() &&
476 !textStartX.isEmpty() &&
477 !textStartY.isEmpty() &&
478 !textStepX.isEmpty() &&
479 !textStepY.isEmpty() &&
480 !textStopX.isEmpty() &&
481 !textStopY.isEmpty() &&
482 m_validatorCountX->validate(textCountX, pos) == QValidator::Acceptable &&
483 m_validatorCountY->validate(textCountY, pos) == QValidator::Acceptable &&
484 m_validatorStartX->validate(textStartX, pos) == QValidator::Acceptable &&
485 m_validatorStartY->validate(textStartY, pos) == QValidator::Acceptable &&
486 m_validatorStepX->validate(textStepX, pos) == QValidator::Acceptable &&
487 m_validatorStepY->validate(textStepY, pos) == QValidator::Acceptable &&
488 m_validatorStopX->validate(textStopX, pos) == QValidator::Acceptable &&
489 m_validatorStopY->validate(textStopY, pos) == QValidator::Acceptable);
492 void DlgSettingsGridDisplay::updateControls ()
494 GridCoordDisable disableX = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
495 m_editCountX->setEnabled (disableX != GRID_COORD_DISABLE_COUNT);
496 m_editStartX->setEnabled (disableX != GRID_COORD_DISABLE_START);
497 m_editStepX->setEnabled (disableX != GRID_COORD_DISABLE_STEP);
498 m_editStopX->setEnabled (disableX != GRID_COORD_DISABLE_STOP);
500 GridCoordDisable disableY = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
501 m_editCountY->setEnabled (disableY != GRID_COORD_DISABLE_COUNT);
502 m_editStartY->setEnabled (disableY != GRID_COORD_DISABLE_START);
503 m_editStepY->setEnabled (disableY != GRID_COORD_DISABLE_STEP);
504 m_editStopY->setEnabled (disableY != GRID_COORD_DISABLE_STOP);
509 void DlgSettingsGridDisplay::updateDisplayedVariableX ()
515 switch (m_modelGridDisplayAfter->
disableX()) {
516 case GRID_COORD_DISABLE_COUNT:
517 m_editCountX->setText (QString::number (initializer.
computeCount (linearAxis,
518 m_modelGridDisplayAfter->
startX (),
519 m_modelGridDisplayAfter->
stopX (),
520 m_modelGridDisplayAfter->
stepX ())));
523 case GRID_COORD_DISABLE_START:
524 m_editStartX->setText (QString::number (initializer.
computeStart (linearAxis,
525 m_modelGridDisplayAfter->
stopX (),
526 m_modelGridDisplayAfter->
stepX (),
527 m_modelGridDisplayAfter->
countX ())));
530 case GRID_COORD_DISABLE_STEP:
531 m_editStepX->setText (QString::number (initializer.
computeStep (linearAxis,
532 m_modelGridDisplayAfter->
startX (),
533 m_modelGridDisplayAfter->
stopX (),
534 m_modelGridDisplayAfter->
countX ())));
537 case GRID_COORD_DISABLE_STOP:
538 m_editStopX->setText (QString::number (initializer.
computeStop (linearAxis,
539 m_modelGridDisplayAfter->
startX (),
540 m_modelGridDisplayAfter->
stepX (),
541 m_modelGridDisplayAfter->
countX ())));
545 LOG4CPP_ERROR_S ((*mainCat)) <<
"DlgSettingsGridDisplay::updateDisplayedVariableX";
550 void DlgSettingsGridDisplay::updateDisplayedVariableY ()
556 switch (m_modelGridDisplayAfter->
disableY()) {
557 case GRID_COORD_DISABLE_COUNT:
558 m_editCountY->setText (QString::number (initializer.
computeCount (linearAxis,
559 m_modelGridDisplayAfter->
startY (),
560 m_modelGridDisplayAfter->
stopY (),
561 m_modelGridDisplayAfter->
stepY ())));
564 case GRID_COORD_DISABLE_START:
565 m_editStartY->setText (QString::number (initializer.
computeStart (linearAxis,
566 m_modelGridDisplayAfter->
stopY (),
567 m_modelGridDisplayAfter->
stepY (),
568 m_modelGridDisplayAfter->
countY ())));
571 case GRID_COORD_DISABLE_STEP:
572 m_editStepY->setText (QString::number (initializer.
computeStep (linearAxis,
573 m_modelGridDisplayAfter->
startY (),
574 m_modelGridDisplayAfter->
stopY (),
575 m_modelGridDisplayAfter->
countY ())));
578 case GRID_COORD_DISABLE_STOP:
579 m_editStopY->setText (QString::number (initializer.
computeStop (linearAxis,
580 m_modelGridDisplayAfter->
startY (),
581 m_modelGridDisplayAfter->
stepY (),
582 m_modelGridDisplayAfter->
countY ())));
586 LOG4CPP_ERROR_S ((*mainCat)) <<
"DlgSettingsGridDisplay::updateDisplayedVariableY";
591 void DlgSettingsGridDisplay::updatePreview ()
593 m_gridLines.
clear ();
595 if (textItemsAreValid ()) {
601 factory.createGridLinesForEvenlySpacedGrid (*m_modelGridDisplayAfter,
double stopX() const
Get method for x grid line upper bound (inclusive).
Factory class for generating the points, composed of QGraphicsItem objects, along a GridLine...
GridCoordDisable disableX() const
Get method for x grid line disabled variable.
int computeCount(bool linearAxis, double start, double stop, double step) const
Compute axis scale count from the other axis parameters.
double stepX() const
Get method for x grid line increment.
void setStartX(double startX)
Set method for x grid line lower bound (inclusive).
Model for DlgSettingsGridDisplay and CmdSettingsGridDisplay.
void clear()
Deallocate and remove all grid lines.
void setCountY(unsigned int countY)
Set method for y grid line count.
void setStepX(double stepX)
Set method for x grid line increment.
virtual void load(CmdMediator &cmdMediator)
Load settings from Document.
virtual void createOptionalSaveDefault(QHBoxLayout *layout)
Let subclass define an optional Save As Default button.
Command for DlgSettingsGridDisplay.
void setCmdMediator(CmdMediator &cmdMediator)
Store CmdMediator for easy access by the leaf class.
CoordScale coordScaleYRadius() const
Get method for linear/log scale on y/radius.
DocumentModelCoords modelCoords() const
Get method for DocumentModelCoords.
double computeStart(bool linearAxis, double stop, double step, int count) const
Compute axis scale start from the other axis parameters.
QPixmap pixmap() const
Return the image that is being digitized.
double startX() const
Get method for x grid line lower bound (inclusive).
void setStepY(double yStep)
Set method for y grid line increment.
DlgSettingsGridDisplay(MainWindow &mainWindow)
Single constructor.
void setStable(bool stable)
Set method for stable flag.
Class that modifies QGraphicsView to automatically expand/shrink the view to fit the window...
CoordScale coordScaleXTheta() const
Get method for linear/log scale on x/theta.
void setStopX(double stopX)
Set method for x grid line upper bound (inclusive).
void populateColorComboWithoutTransparent(QComboBox &combo)
Add colors in color palette to combobox, without transparent entry at end.
virtual QWidget * createSubPanel()
Create dialog-specific panel to which base class will add Ok and Cancel buttons.
This class initializes the count, start, step and stop parameters for one coordinate (either x/theta ...
virtual void handleOk()
Process slotOk.
CoordsType coordsType() const
Get method for coordinates type.
void setDisableX(GridCoordDisable disableX)
Set method for x grid line disabled variable.
void setStopY(double yStop)
Set method for y grid line upper bound (inclusive).
double computeStop(bool linearAxis, double start, double step, int count) const
Compute axis scale stop from the other axis parameters.
ColorPalette paletteColor() const
Get method for color.
void setDisableY(GridCoordDisable disableY)
Set method for y grid line disabled variable.
double stopY() const
Get method for y grid line upper bound (inclusive).
double startY() const
Get method for y grid line lower bound (inclusive).
void finishPanel(QWidget *subPanel)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
void setCountX(unsigned int countX)
Set method for x grid line count.
void setStartY(double yStart)
Set method for y grid line lower bound (inclusive).
static int MINIMUM_PREVIEW_HEIGHT
Dialog layout constant that guarantees preview has sufficent room.
double stepY() const
Get method for y grid line increment.
void enableOk(bool enable)
Let leaf subclass control the Ok button.
Abstract base class for all Settings dialogs.
double computeStep(bool linearAxis, double start, double stop, int count) const
Compute axis scale step from the other axis parameters.
GridCoordDisable disableY() const
Get method for y grid line disabled variable.
MainWindow & mainWindow()
Get method for MainWindow.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
void setPaletteColor(ColorPalette paletteColor)
Set method for color.
CmdMediator & cmdMediator()
Provide access to Document information wrapped inside CmdMediator.
unsigned int countX() const
Get method for x grid line count.
unsigned int countY() const
Get method for y grid line count.