@@ -29,19 +29,33 @@ USE_ENCODING_AUTODETECTION
2929
3030
3131QtCoordinatesDialog::QtCoordinatesDialog (
32- QWidget* parent, const UTF8String& title,
33- const UTF8String& xLabel,
34- const UTF8String& yLabel,
35- const UTF8String& zLabel,
36- double x, double y, double z,
37- bool checkboxesEnabled,
38- bool xEnabled, bool yEnabled, bool zEnabled,
32+ QWidget* parent, const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
33+ double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
3934 const string& helpURL, const string& helpTag)
4035 : QDialog (parent, QtConfiguration::modalDialogWFlags),
41- _xTextField (0 ), _yTextField (0 ), _zTextField (0 ),
42- _modifyXCheckBox (0 ), _modifyYCheckBox (0 ), _modifyZCheckBox (0 ),
43- _closurePanel (0 )
44- {
36+ _xTextField (0 ), _yTextField (0 ), _zTextField (0 ), _modifyXCheckBox (0 ), _modifyYCheckBox (0 ), _modifyZCheckBox (0 ), _closurePanel (0 )
37+ {
38+ createGui (title, xLabel, yLabel, zLabel, x, y, z, 1 ., -1 ., 1 ., -1 ., 1 ., -1 ., checkboxesEnabled, xEnabled, yEnabled, zEnabled, helpURL, helpTag); // v 6.3.0
39+ } // QtCoordinatesDialog::QtCoordinatesDialog
40+
41+
42+ QtCoordinatesDialog::QtCoordinatesDialog ( // v 6.3.0
43+ QWidget* parent, const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
44+ double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
45+ double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
46+ const string& helpURL, const string& helpTag)
47+ : QDialog (parent, QtConfiguration::modalDialogWFlags),
48+ _xTextField (0 ), _yTextField (0 ), _zTextField (0 ), _modifyXCheckBox (0 ), _modifyYCheckBox (0 ), _modifyZCheckBox (0 ), _closurePanel (0 )
49+ {
50+ createGui (title, xLabel, yLabel, zLabel, x, y, z, checkboxesEnabled, xEnabled, yEnabled, zEnabled, xmin, xmax, ymin, ymax, zmin, zmax, helpURL, helpTag);
51+ } // QtCoordinatesDialog::QtCoordinatesDialog
52+
53+
54+ void QtCoordinatesDialog::createGui (const UTF8String& title, const UTF8String& xLabel, const UTF8String& yLabel, const UTF8String& zLabel,
55+ double x, double y, double z, bool checkboxesEnabled, bool xEnabled, bool yEnabled, bool zEnabled,
56+ double xmin, double xmax, double ymin, double ymax, double zmin, double zmax,
57+ const string& helpURL, const string& helpTag)
58+ {
4559 setModal (true );
4660 setWindowTitle (UTF8TOQSTRING (title));
4761
@@ -74,6 +88,16 @@ QtCoordinatesDialog::QtCoordinatesDialog (
7488 hboxLayout->addWidget (label);
7589 hboxLayout->addWidget (_xTextField);
7690 hboxLayout->addWidget (_modifyXCheckBox);
91+ if (xmax >= xmin)
92+ { // v 6.3.0
93+ UTF8String rangeLabel;
94+ rangeLabel << " [" << xmin << " , " << xmax << " ]" ;
95+ UTF8String tooltip = UTF8String (" Domaine : " , charset) + rangeLabel;
96+ label->setToolTip (UTF8TOQSTRING (tooltip));
97+ _xTextField->setToolTip (UTF8TOQSTRING (tooltip));
98+ label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
99+ hboxLayout->addWidget (label);
100+ } // if (xmax >= xmin)
77101
78102 // Ligne 2 : Y
79103 hbox = new QWidget (groupBox);
@@ -92,6 +116,16 @@ QtCoordinatesDialog::QtCoordinatesDialog (
92116 hboxLayout->addWidget (label);
93117 hboxLayout->addWidget (_yTextField);
94118 hboxLayout->addWidget (_modifyYCheckBox);
119+ if (ymax >= ymin)
120+ { // v 6.3.0
121+ UTF8String rangeLabel;
122+ rangeLabel << " [" << ymin << " , " << ymax << " ]" ;
123+ UTF8String tooltip = UTF8String (" Domaine : " , charset) + rangeLabel;
124+ label->setToolTip (UTF8TOQSTRING (tooltip));
125+ _yTextField->setToolTip (UTF8TOQSTRING (tooltip));
126+ label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
127+ hboxLayout->addWidget (label);
128+ } // if (ymax >= ymin)
95129
96130 // Ligne 3 : Y
97131 hbox = new QWidget (groupBox);
@@ -110,18 +144,30 @@ QtCoordinatesDialog::QtCoordinatesDialog (
110144 hboxLayout->addWidget (label);
111145 hboxLayout->addWidget (_zTextField);
112146 hboxLayout->addWidget (_modifyZCheckBox);
147+ if (zmax >= zmin)
148+ { // v 6.3.0
149+ UTF8String rangeLabel;
150+ rangeLabel << " [" << zmin << " , " << zmax << " ]" ;
151+ UTF8String tooltip = UTF8String (" Domaine : " , charset) + rangeLabel;
152+ label->setToolTip (UTF8TOQSTRING (tooltip));
153+ _zTextField->setToolTip (UTF8TOQSTRING (tooltip));
154+ label = new QLabel (UTF8TOQSTRING (rangeLabel), hbox);
155+ hboxLayout->addWidget (label);
156+ } // if (zmax >= zmin)
157+
158+ int width = _xTextField->sizeHint ( ).width ( ) > _yTextField->sizeHint ( ).width ( ) ? _xTextField->sizeHint ( ).width ( ) : _yTextField->sizeHint ( ).width ( );
159+ width = _zTextField->sizeHint ( ).width ( ) > width ? _zTextField->sizeHint ( ).width ( ) : width;
160+ _xTextField->setMinimumWidth (width); // v 6.3.0
161+ _yTextField->setMinimumWidth (width); // v 6.3.0
162+ _zTextField->setMinimumWidth (width); // v 6.3.0
113163
114164 // Les boutons :
115165 layout->addWidget (new QLabel (" " , this ));
116- _closurePanel =
117- new QtDlgClosurePanel (this , false , " Appliquer" , " " , " Annuler" ,
118- helpURL, helpTag);
166+ _closurePanel = new QtDlgClosurePanel (this , false , " Appliquer" , " " , " Annuler" , helpURL, helpTag);
119167 layout->addWidget (_closurePanel);
120168 _closurePanel->setMinimumSize (_closurePanel->sizeHint ( ));
121- connect (_closurePanel->getApplyButton ( ), SIGNAL (clicked ( )), this ,
122- SLOT (accept ( )));
123- connect (_closurePanel->getCancelButton ( ), SIGNAL (clicked ( )), this ,
124- SLOT (reject ( )));
169+ connect (_closurePanel->getApplyButton ( ), SIGNAL (clicked ( )), this , SLOT (accept ( )));
170+ connect (_closurePanel->getCancelButton ( ), SIGNAL (clicked ( )), this , SLOT (reject ( )));
125171
126172 // Par defaut le bouton OK est artificellement clique par QDialog quand
127173 // l'utilisateur fait return dans un champ de texte => on inhibe ce
0 commit comments