Engauge Digitizer  2
DlgEditScale.h
1 /******************************************************************************************************
2  * (C) 2017 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3  * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4  * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5  ******************************************************************************************************/
6 
7 #ifndef DLG_EDIT_SCALE_H
8 #define DLG_EDIT_SCALE_H
9 
10 #include <QDialog>
11 #include <QLineEdit>
12 #include <QPushButton>
13 
17 class MainWindow;
18 class MainWindowModel;
19 class QVBoxLayout;
20 
22 class DlgEditScale : public QDialog
23 {
24  Q_OBJECT;
25 
26 public:
28  DlgEditScale (MainWindow &mainWindow,
29  const DocumentModelCoords &modelCoords,
30  const DocumentModelGeneral &modelGeneral,
31  const MainWindowModel &modelMainWindow,
32  const double *scaleLength = 0);
33  ~DlgEditScale ();
34 
36  double scaleLength () const;
37 
38 private slots:
39  void slotTextChanged (const QString &);
40 
41 private:
42  void createHint (QVBoxLayout *layoutOuter);
43  void createOkCancel (QVBoxLayout *layoutOuter);
44  void createScaleLength (QVBoxLayout *layoutOuter);
45  void initializeScaleLength (const double *scaleLength);
46  void updateControls ();
47 
48  QLineEdit *m_editScaleLength;
49  DlgValidatorAbstract *m_validatorScaleLength;
50  QPushButton *m_btnOk;
51  QPushButton *m_btnCancel;
52 
53  const DocumentModelCoords &m_modelCoords;
54  const DocumentModelGeneral &m_modelGeneral;
55  const MainWindowModel &m_modelMainWindow;
56 };
57 
58 #endif // DLG_EDIT_SCALE_H
Model for DlgSettingsGeneral and CmdSettingsGeneral.
Dialog box for editing the information of the map scale.
Definition: DlgEditScale.h:22
Abstract validator for all numeric formats.
Model for DlgSettingsMainWindow.
Model for DlgSettingsCoords and CmdSettingsCoords.
double scaleLength() const
Return the scale bar length specified by the user. Only applies if dialog was accepted.
DlgEditScale(MainWindow &mainWindow, const DocumentModelCoords &modelCoords, const DocumentModelGeneral &modelGeneral, const MainWindowModel &modelMainWindow, const double *scaleLength=0)
Single constructor.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Definition: MainWindow.h:89