ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change
on this file since 7969b9c was
4992ff2,
checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago
|
Initial, in-progress version. Not really working atm. SASVIEW-787
|
-
Property mode set to
100644
|
File size:
1.3 KB
|
Rev | Line | |
---|
[d3ca363] | 1 | """ |
---|
| 2 | Allows users to change the range of the current graph |
---|
| 3 | """ |
---|
[4992ff2] | 4 | from PyQt5 import QtCore |
---|
| 5 | from PyQt5 import QtGui |
---|
| 6 | from PyQt5 import QtWidgets |
---|
[d3ca363] | 7 | |
---|
| 8 | # Local UI |
---|
[cd2cc745] | 9 | from sas.qtgui.UI import main_resources_rc |
---|
[83eb5208] | 10 | from sas.qtgui.Plotting.UI.SetGraphRangeUI import Ui_setGraphRangeUI |
---|
[d3ca363] | 11 | |
---|
[4992ff2] | 12 | class SetGraphRange(QtWidgets.QDialog, Ui_setGraphRangeUI): |
---|
[d3ca363] | 13 | def __init__(self, parent=None, x_range=(0.0, 0.0), y_range=(0.0, 0.0)): |
---|
| 14 | super(SetGraphRange, self).__init__() |
---|
| 15 | |
---|
| 16 | self.setupUi(self) |
---|
| 17 | assert(isinstance(x_range, tuple)) |
---|
| 18 | assert(isinstance(y_range, tuple)) |
---|
| 19 | |
---|
| 20 | self.txtXmin.setValidator(QtGui.QDoubleValidator()) |
---|
| 21 | self.txtXmax.setValidator(QtGui.QDoubleValidator()) |
---|
| 22 | self.txtYmin.setValidator(QtGui.QDoubleValidator()) |
---|
| 23 | self.txtYmax.setValidator(QtGui.QDoubleValidator()) |
---|
| 24 | |
---|
| 25 | self.txtXmin.setText(str(x_range[0])) |
---|
| 26 | self.txtXmax.setText(str(x_range[1])) |
---|
| 27 | self.txtYmin.setText(str(y_range[0])) |
---|
| 28 | self.txtYmax.setText(str(y_range[1])) |
---|
| 29 | |
---|
| 30 | def xrange(self): |
---|
| 31 | """ |
---|
| 32 | Return a tuple with line edit content of (xmin, xmax) |
---|
| 33 | """ |
---|
| 34 | return (float(self.txtXmin.text()), |
---|
| 35 | float(self.txtXmax.text())) |
---|
| 36 | |
---|
| 37 | def yrange(self): |
---|
| 38 | """ |
---|
| 39 | Return a tuple with line edit content of (ymin, ymax) |
---|
| 40 | """ |
---|
| 41 | return (float(self.txtYmin.text()), |
---|
| 42 | float(self.txtYmax.text())) |
---|
Note: See
TracBrowser
for help on using the repository browser.