From 2845505c9f31ec7bf6619b64a0529d10beab82f8 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Mon, 7 Apr 2014 12:17:48 -0300 Subject: [PATCH] Draft: preparing for units support --- src/Mod/Draft/DraftGui.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Mod/Draft/DraftGui.py b/src/Mod/Draft/DraftGui.py index b8bd5bb82..61c825b48 100644 --- a/src/Mod/Draft/DraftGui.py +++ b/src/Mod/Draft/DraftGui.py @@ -141,7 +141,7 @@ class DraftTaskPanel: else: self.form = widget def getStandardButtons(self): - return int(QtGui.QDialogButtonBox.Cancel) + return int(QtGui.QDialogButtonBox.Close) def accept(self): FreeCADGui.ActiveDocument.resetEdit() return True @@ -239,6 +239,16 @@ class DraftToolBar: layout.addWidget(lineedit) return lineedit + def _inputfield (self,name, layout, hide=True, width=None): + ui = FreeCADGui.UiLoader() + inputfield = ui.createWidget("Gui::InputField") + inputfield.setObjectName(name) + if hide: inputfield.hide() + if not width: width = 800 + inputfield.setMaximumSize(QtCore.QSize(width,22)) + layout.addWidget(inputfield) + return inputfield + def _spinbox (self,name, layout, val=None, vmax=None, hide=True, double=False, size=None): if double: sbox = QtGui.QDoubleSpinBox(self.baseWidget) @@ -568,7 +578,7 @@ class DraftToolBar: else: self.form = [extra] def getStandardButtons(self): - return int(QtGui.QDialogButtonBox.Cancel) + return int(QtGui.QDialogButtonBox.Close) def accept(self): FreeCADGui.ActiveDocument.resetEdit() return True @@ -905,7 +915,7 @@ class DraftToolBar: if extra: self.form = [extra] def getStandardButtons(self): - return int(QtGui.QDialogButtonBox.Cancel) + return int(QtGui.QDialogButtonBox.Close) def reject(self): if callback: callback()