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;
29 const int MINIMUM_HEIGHT = 480;
33 "DlgSettingsGridDisplay",
37 m_modelGridDisplayBefore (0),
38 m_modelGridDisplayAfter (0)
40 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::DlgSettingsGridDisplay";
46 DlgSettingsGridDisplay::~DlgSettingsGridDisplay()
48 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::~DlgSettingsGridDisplay";
51 void DlgSettingsGridDisplay::createDisplayCommon (QGridLayout *layout,
int &row)
53 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createDisplayCommon";
55 QWidget *widgetCommon =
new QWidget;
56 layout->addWidget (widgetCommon, row++, 2, 1, 2);
58 QGridLayout *layoutCommon =
new QGridLayout;
59 widgetCommon->setLayout (layoutCommon);
62 QLabel *labelColor =
new QLabel (tr (
"Color:"));
63 layoutCommon->addWidget (labelColor, rowCommon, 1);
65 m_cmbColor =
new QComboBox;
66 m_cmbColor->setWhatsThis (tr (
"Select a color for the lines"));
68 connect (m_cmbColor, SIGNAL (activated (
const QString &)),
this, SLOT (slotColor (
const QString &)));
69 layoutCommon->addWidget (m_cmbColor, rowCommon++, 2);
72 layoutCommon->setColumnStretch (0, 1);
73 layoutCommon->setColumnStretch (1, 0);
74 layoutCommon->setColumnStretch (2, 0);
75 layoutCommon->setColumnStretch (3, 1);
78 void DlgSettingsGridDisplay::createDisplayGridLinesX (QGridLayout *layout,
int &row)
80 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createDisplayGridLinesX";
82 m_groupX =
new QGroupBox;
83 layout->addWidget (m_groupX, row, 2);
85 QGridLayout *layoutGroup =
new QGridLayout;
86 m_groupX->setLayout (layoutGroup);
88 QLabel *labelDisable =
new QLabel (tr (
"Disable:"));
89 layoutGroup->addWidget (labelDisable, 0, 0);
91 m_cmbDisableX =
new QComboBox;
92 m_cmbDisableX->setWhatsThis (tr (
"Disabled value.\n\n" 93 "The X grid lines are specified using only three values at a time. For flexibility, four values " 94 "are offered so you must chose which value is disabled. Once disabled, that value is simply " 95 "updated as the other values change"));
96 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
97 QVariant (GRID_COORD_DISABLE_COUNT));
98 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
99 QVariant (GRID_COORD_DISABLE_START));
100 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
101 QVariant (GRID_COORD_DISABLE_STEP));
102 m_cmbDisableX->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
103 QVariant (GRID_COORD_DISABLE_STOP));
104 connect (m_cmbDisableX, SIGNAL (activated (
const QString &)),
this, SLOT (slotDisableX (
const QString &)));
105 layoutGroup->addWidget (m_cmbDisableX, 0, 1);
107 QLabel *labelCount =
new QLabel (tr (
"Count:"));
108 layoutGroup->addWidget (labelCount, 1, 0);
110 m_editCountX =
new QLineEdit;
111 m_editCountX->setWhatsThis (tr (
"Number of X grid lines.\n\n" 112 "The number of X grid lines must be entered as an integer greater than zero"));
113 m_validatorCountX =
new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
114 m_editCountX->setValidator (m_validatorCountX);
115 connect (m_editCountX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotCountX (
const QString &)));
116 layoutGroup->addWidget (m_editCountX, 1, 1);
118 QLabel *labelStart =
new QLabel (tr (
"Start:"));
119 layoutGroup->addWidget (labelStart, 2, 0);
121 m_editStartX =
new QLineEdit;
122 m_editStartX->setWhatsThis (tr (
"Value of the first X grid line.\n\n" 123 "The start value cannot be greater than the stop value"));
124 m_validatorStartX =
new QDoubleValidator;
125 m_editStartX->setValidator (m_validatorStartX);
126 connect (m_editStartX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStartX (
const QString &)));
127 layoutGroup->addWidget (m_editStartX, 2, 1);
129 QLabel *labelStep =
new QLabel (tr (
"Step:"));
130 layoutGroup->addWidget (labelStep, 3, 0);
132 m_editStepX =
new QLineEdit;
133 m_editStepX->setWhatsThis (tr (
"Difference in value between two successive X grid lines.\n\n" 134 "The step value must be greater than zero"));
135 m_validatorStepX =
new QDoubleValidator;
136 m_editStepX->setValidator (m_validatorStepX);
137 connect (m_editStepX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStepX (
const QString &)));
138 layoutGroup->addWidget (m_editStepX, 3, 1);
140 QLabel *labelStop =
new QLabel (tr (
"Stop:"));
141 layoutGroup->addWidget (labelStop, 4, 0);
143 m_editStopX =
new QLineEdit;
144 m_editStopX->setWhatsThis (tr (
"Value of the last X grid line.\n\n" 145 "The stop value cannot be less than the start value"));
146 m_validatorStopX =
new QDoubleValidator;
147 m_editStopX->setValidator (m_validatorStopX);
148 connect (m_editStopX, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStopX (
const QString &)));
149 layoutGroup->addWidget (m_editStopX, 4, 1);
152 void DlgSettingsGridDisplay::createDisplayGridLinesY (QGridLayout *layout,
int &row)
154 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createDisplayGridLinesY";
156 m_groupY =
new QGroupBox;
157 layout->addWidget (m_groupY, row++, 3);
159 QGridLayout *layoutGroup =
new QGridLayout;
160 m_groupY->setLayout (layoutGroup);
162 QLabel *labelDisable =
new QLabel (tr (
"Disable:"));
163 layoutGroup->addWidget (labelDisable, 0, 0);
165 m_cmbDisableY =
new QComboBox;
166 m_cmbDisableY->setWhatsThis (tr (
"Disabled value.\n\n" 167 "The Y grid lines are specified using only three values at a time. For flexibility, four values " 168 "are offered so you must chose which value is disabled. Once disabled, that value is simply " 169 "updated as the other values change"));
170 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_COUNT),
171 QVariant (GRID_COORD_DISABLE_COUNT));
172 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_START),
173 QVariant (GRID_COORD_DISABLE_START));
174 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STEP),
175 QVariant (GRID_COORD_DISABLE_STEP));
176 m_cmbDisableY->addItem(gridCoordDisableToString (GRID_COORD_DISABLE_STOP),
177 QVariant (GRID_COORD_DISABLE_STOP));
178 connect (m_cmbDisableY, SIGNAL (activated (
const QString &)),
this, SLOT (slotDisableY (
const QString &)));
179 layoutGroup->addWidget (m_cmbDisableY, 0, 1);
181 QLabel *labelCount =
new QLabel (tr (
"Count:"));
182 layoutGroup->addWidget (labelCount, 1, 0);
184 m_editCountY =
new QLineEdit;
185 m_editCountY->setWhatsThis (tr (
"Number of Y grid lines.\n\n" 186 "The number of Y grid lines must be entered as an integer greater than zero"));
187 m_validatorCountY =
new QDoubleValidator (COUNT_MIN, COUNT_MAX, COUNT_DECIMALS);
188 m_editCountY->setValidator (m_validatorCountY);
189 connect (m_editCountY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotCountY (
const QString &)));
190 layoutGroup->addWidget (m_editCountY, 1, 1);
192 QLabel *labelStart =
new QLabel (tr (
"Start:"));
193 layoutGroup->addWidget (labelStart, 2, 0);
195 m_editStartY =
new QLineEdit;
196 m_editStartY->setWhatsThis (tr (
"Value of the first Y grid line.\n\n" 197 "The start value cannot be greater than the stop value"));
198 m_validatorStartY =
new QDoubleValidator;
199 m_editStartY->setValidator (m_validatorStartY);
200 connect (m_editStartY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStartY (
const QString &)));
201 layoutGroup->addWidget (m_editStartY, 2, 1);
203 QLabel *labelStep =
new QLabel (tr (
"Step:"));
204 layoutGroup->addWidget (labelStep, 3, 0);
206 m_editStepY =
new QLineEdit;
207 m_editStepY->setWhatsThis (tr (
"Difference in value between two successive Y grid lines.\n\n" 208 "The step value must be greater than zero"));
209 m_validatorStepY =
new QDoubleValidator;
210 m_editStepY->setValidator (m_validatorStepY);
211 connect (m_editStepY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStepY (
const QString &)));
212 layoutGroup->addWidget (m_editStepY, 3, 1);
214 QLabel *labelStop =
new QLabel (tr (
"Stop:"));
215 layoutGroup->addWidget (labelStop, 4, 0);
217 m_editStopY =
new QLineEdit;
218 m_editStopY->setWhatsThis (tr (
"Value of the last Y grid line.\n\n" 219 "The stop value cannot be less than the start value"));
220 m_validatorStopY =
new QDoubleValidator;
221 m_editStopY->setValidator (m_validatorStopY);
222 connect (m_editStopY, SIGNAL (textEdited (
const QString &)),
this, SLOT (slotStopY (
const QString &)));
223 layoutGroup->addWidget (m_editStopY, 4, 1);
230 void DlgSettingsGridDisplay::createPreview (QGridLayout *layout,
int &row)
232 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createPreview";
234 QLabel *labelPreview =
new QLabel (tr (
"Preview"));
235 layout->addWidget (labelPreview, row++, 0, 1, 5);
237 m_scenePreview =
new QGraphicsScene (
this);
239 ViewPreview::VIEW_ASPECT_RATIO_VARIABLE,
241 m_viewPreview->setWhatsThis (tr (
"Preview window that shows how current settings affect grid display"));
242 m_viewPreview->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
243 m_viewPreview->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
245 layout->addWidget (m_viewPreview, row++, 0, 1, 5);
250 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::createSubPanel";
252 const int COLUMN_CHECKBOX_WIDTH = 60;
254 QWidget *subPanel =
new QWidget ();
255 QGridLayout *layout =
new QGridLayout (subPanel);
256 subPanel->setLayout (layout);
258 layout->setColumnStretch(0, 1);
259 layout->setColumnStretch(1, 0);
260 layout->setColumnMinimumWidth(1, COLUMN_CHECKBOX_WIDTH);
261 layout->setColumnStretch(2, 0);
262 layout->setColumnStretch(3, 0);
263 layout->setColumnStretch(4, 1);
266 createDisplayGridLinesX (layout, row);
267 createDisplayGridLinesY (layout, row);
268 createDisplayCommon (layout, row);
269 createPreview (layout, row);
276 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::handleOk";
279 m_modelGridDisplayAfter->
setStable (
true);
283 *m_modelGridDisplayBefore,
284 *m_modelGridDisplayAfter);
292 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::load";
297 if (m_modelGridDisplayBefore != 0) {
298 delete m_modelGridDisplayBefore;
300 if (m_modelGridDisplayAfter != 0) {
301 delete m_modelGridDisplayAfter;
305 QString titleX = tr (
"X Grid Lines");
307 titleX = QString (QChar (0x98, 0x03)) + QString (
" %1").arg (tr (
"Grid Lines"));
309 m_groupX->setTitle (titleX);
311 QString titleY = tr (
"Y Grid Lines");
313 titleY = QString (tr (
"Radius Grid Lines"));
315 m_groupY->setTitle (titleY);
322 int indexDisableX = m_cmbDisableX->findData (QVariant (m_modelGridDisplayAfter->
disableX()));
323 m_cmbDisableX->setCurrentIndex (indexDisableX);
325 m_editCountX->setText(QString::number(m_modelGridDisplayAfter->
countX()));
326 m_editStartX->setText(QString::number(m_modelGridDisplayAfter->
startX()));
327 m_editStepX->setText(QString::number(m_modelGridDisplayAfter->
stepX()));
328 m_editStopX->setText(QString::number(m_modelGridDisplayAfter->
stopX()));
330 int indexDisableY = m_cmbDisableY->findData (QVariant (m_modelGridDisplayAfter->
disableY()));
331 m_cmbDisableY->setCurrentIndex (indexDisableY);
333 m_editCountY->setText(QString::number(m_modelGridDisplayAfter->
countY()));
334 m_editStartY->setText(QString::number(m_modelGridDisplayAfter->
startY()));
335 m_editStepY->setText(QString::number(m_modelGridDisplayAfter->
stepY()));
336 m_editStopY->setText(QString::number(m_modelGridDisplayAfter->
stopY()));
338 int indexColor = m_cmbColor->findData(QVariant(m_modelGridDisplayAfter->
paletteColor()));
339 ENGAUGE_ASSERT (indexColor >= 0);
340 m_cmbColor->setCurrentIndex(indexColor);
352 setMinimumHeight (MINIMUM_HEIGHT);
356 void DlgSettingsGridDisplay::slotColor (QString
const &)
358 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotColor";
360 m_modelGridDisplayAfter->
setPaletteColor((ColorPalette) m_cmbColor->currentData().toInt());
365 void DlgSettingsGridDisplay::slotCountX(
const QString &count)
367 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotCountX";
369 m_modelGridDisplayAfter->
setCountX(count.toInt());
370 updateDisplayedVariableX ();
375 void DlgSettingsGridDisplay::slotCountY(
const QString &count)
377 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotCountY";
379 m_modelGridDisplayAfter->
setCountY(count.toInt());
380 updateDisplayedVariableY ();
385 void DlgSettingsGridDisplay::slotDisableX(
const QString &)
387 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotDisableX";
389 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
390 m_modelGridDisplayAfter->
setDisableX(gridCoordDisable);
391 updateDisplayedVariableX ();
396 void DlgSettingsGridDisplay::slotDisableY(
const QString &)
398 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotDisableY";
400 GridCoordDisable gridCoordDisable = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
401 m_modelGridDisplayAfter->
setDisableY(gridCoordDisable);
402 updateDisplayedVariableY ();
407 void DlgSettingsGridDisplay::slotStartX(
const QString &startX)
409 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStartX";
411 m_modelGridDisplayAfter->
setStartX(startX.toDouble());
412 updateDisplayedVariableX ();
417 void DlgSettingsGridDisplay::slotStartY(
const QString &startY)
419 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStartY";
421 m_modelGridDisplayAfter->
setStartY(startY.toDouble());
422 updateDisplayedVariableY ();
427 void DlgSettingsGridDisplay::slotStepX(
const QString &stepX)
429 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStepX";
431 m_modelGridDisplayAfter->
setStepX(stepX.toDouble());
432 updateDisplayedVariableX ();
437 void DlgSettingsGridDisplay::slotStepY(
const QString &stepY)
439 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStepY";
441 m_modelGridDisplayAfter->
setStepY(stepY.toDouble());
442 updateDisplayedVariableY ();
447 void DlgSettingsGridDisplay::slotStopX(
const QString &stopX)
449 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStopX";
451 m_modelGridDisplayAfter->
setStopX(stopX.toDouble());
452 updateDisplayedVariableX ();
457 void DlgSettingsGridDisplay::slotStopY(
const QString &stopY)
459 LOG4CPP_INFO_S ((*mainCat)) <<
"DlgSettingsGridDisplay::slotStopY";
461 m_modelGridDisplayAfter->
setStopY(stopY.toDouble());
462 updateDisplayedVariableY ();
467 bool DlgSettingsGridDisplay::textItemsAreValid ()
const 469 QString textCountX = m_editCountX->text();
470 QString textCountY = m_editCountY->text();
471 QString textStartX = m_editStartX->text();
472 QString textStartY = m_editStartY->text();
473 QString textStepX = m_editStepX->text();
474 QString textStepY = m_editStepY->text();
475 QString textStopX = m_editStopX->text();
476 QString textStopY = m_editStopY->text();
482 return (!textCountX.isEmpty() &&
483 !textCountY.isEmpty() &&
484 !textStartX.isEmpty() &&
485 !textStartY.isEmpty() &&
486 !textStepX.isEmpty() &&
487 !textStepY.isEmpty() &&
488 !textStopX.isEmpty() &&
489 !textStopY.isEmpty() &&
490 m_validatorCountX->validate(textCountX, pos) == QValidator::Acceptable &&
491 m_validatorCountY->validate(textCountY, pos) == QValidator::Acceptable &&
492 m_validatorStartX->validate(textStartX, pos) == QValidator::Acceptable &&
493 m_validatorStartY->validate(textStartY, pos) == QValidator::Acceptable &&
494 m_validatorStepX->validate(textStepX, pos) == QValidator::Acceptable &&
495 m_validatorStepY->validate(textStepY, pos) == QValidator::Acceptable &&
496 m_validatorStopX->validate(textStopX, pos) == QValidator::Acceptable &&
497 m_validatorStopY->validate(textStopY, pos) == QValidator::Acceptable);
500 void DlgSettingsGridDisplay::updateControls ()
502 GridCoordDisable disableX = (GridCoordDisable) m_cmbDisableX->currentData().toInt();
503 m_editCountX->setEnabled (disableX != GRID_COORD_DISABLE_COUNT);
504 m_editStartX->setEnabled (disableX != GRID_COORD_DISABLE_START);
505 m_editStepX->setEnabled (disableX != GRID_COORD_DISABLE_STEP);
506 m_editStopX->setEnabled (disableX != GRID_COORD_DISABLE_STOP);
508 GridCoordDisable disableY = (GridCoordDisable) m_cmbDisableY->currentData().toInt();
509 m_editCountY->setEnabled (disableY != GRID_COORD_DISABLE_COUNT);
510 m_editStartY->setEnabled (disableY != GRID_COORD_DISABLE_START);
511 m_editStepY->setEnabled (disableY != GRID_COORD_DISABLE_STEP);
512 m_editStopY->setEnabled (disableY != GRID_COORD_DISABLE_STOP);
517 void DlgSettingsGridDisplay::updateDisplayedVariableX ()
523 switch (m_modelGridDisplayAfter->
disableX()) {
524 case GRID_COORD_DISABLE_COUNT:
525 m_editCountX->setText (QString::number (initializer.
computeCount (linearAxis,
526 m_modelGridDisplayAfter->
startX (),
527 m_modelGridDisplayAfter->
stopX (),
528 m_modelGridDisplayAfter->
stepX ())));
531 case GRID_COORD_DISABLE_START:
532 m_editStartX->setText (QString::number (initializer.
computeStart (linearAxis,
533 m_modelGridDisplayAfter->
stopX (),
534 m_modelGridDisplayAfter->
stepX (),
535 m_modelGridDisplayAfter->
countX ())));
538 case GRID_COORD_DISABLE_STEP:
539 m_editStepX->setText (QString::number (initializer.
computeStep (linearAxis,
540 m_modelGridDisplayAfter->
startX (),
541 m_modelGridDisplayAfter->
stopX (),
542 m_modelGridDisplayAfter->
countX ())));
545 case GRID_COORD_DISABLE_STOP:
546 m_editStopX->setText (QString::number (initializer.
computeStop (linearAxis,
547 m_modelGridDisplayAfter->
startX (),
548 m_modelGridDisplayAfter->
stepX (),
549 m_modelGridDisplayAfter->
countX ())));
553 LOG4CPP_ERROR_S ((*mainCat)) <<
"DlgSettingsGridDisplay::updateDisplayedVariableX";
558 void DlgSettingsGridDisplay::updateDisplayedVariableY ()
564 switch (m_modelGridDisplayAfter->
disableY()) {
565 case GRID_COORD_DISABLE_COUNT:
566 m_editCountY->setText (QString::number (initializer.
computeCount (linearAxis,
567 m_modelGridDisplayAfter->
startY (),
568 m_modelGridDisplayAfter->
stopY (),
569 m_modelGridDisplayAfter->
stepY ())));
572 case GRID_COORD_DISABLE_START:
573 m_editStartY->setText (QString::number (initializer.
computeStart (linearAxis,
574 m_modelGridDisplayAfter->
stopY (),
575 m_modelGridDisplayAfter->
stepY (),
576 m_modelGridDisplayAfter->
countY ())));
579 case GRID_COORD_DISABLE_STEP:
580 m_editStepY->setText (QString::number (initializer.
computeStep (linearAxis,
581 m_modelGridDisplayAfter->
startY (),
582 m_modelGridDisplayAfter->
stopY (),
583 m_modelGridDisplayAfter->
countY ())));
586 case GRID_COORD_DISABLE_STOP:
587 m_editStopY->setText (QString::number (initializer.
computeStop (linearAxis,
588 m_modelGridDisplayAfter->
startY (),
589 m_modelGridDisplayAfter->
stepY (),
590 m_modelGridDisplayAfter->
countY ())));
594 LOG4CPP_ERROR_S ((*mainCat)) <<
"DlgSettingsGridDisplay::updateDisplayedVariableY";
599 void DlgSettingsGridDisplay::updatePreview ()
601 m_gridLines.
clear ();
603 if (textItemsAreValid ()) {
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.
void createGridLinesForEvenlySpacedGrid(const DocumentModelGridDisplay &modelGridDisplay, const Document &document, const MainWindowModel &modelMainWindow, const Transformation &transformation, GridLines &gridLines)
Create a rectangular (cartesian) or annular (polar) grid of evenly spaced grid lines.
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.
void finishPanel(QWidget *subPanel, int minimumWidth=MINIMUM_DIALOG_WIDTH, int minimumHeightOrZero=0)
Add Ok and Cancel buttons to subpanel to get the whole dialog.
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 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.
virtual void setSmallDialogs(bool smallDialogs)
If false then dialogs have a minimum size so all controls are visible.
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.