Draft: preparing for units support
This commit is contained in:
parent
f62ff52302
commit
2845505c9f
|
@ -141,7 +141,7 @@ class DraftTaskPanel:
|
||||||
else:
|
else:
|
||||||
self.form = widget
|
self.form = widget
|
||||||
def getStandardButtons(self):
|
def getStandardButtons(self):
|
||||||
return int(QtGui.QDialogButtonBox.Cancel)
|
return int(QtGui.QDialogButtonBox.Close)
|
||||||
def accept(self):
|
def accept(self):
|
||||||
FreeCADGui.ActiveDocument.resetEdit()
|
FreeCADGui.ActiveDocument.resetEdit()
|
||||||
return True
|
return True
|
||||||
|
@ -239,6 +239,16 @@ class DraftToolBar:
|
||||||
layout.addWidget(lineedit)
|
layout.addWidget(lineedit)
|
||||||
return 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):
|
def _spinbox (self,name, layout, val=None, vmax=None, hide=True, double=False, size=None):
|
||||||
if double:
|
if double:
|
||||||
sbox = QtGui.QDoubleSpinBox(self.baseWidget)
|
sbox = QtGui.QDoubleSpinBox(self.baseWidget)
|
||||||
|
@ -568,7 +578,7 @@ class DraftToolBar:
|
||||||
else:
|
else:
|
||||||
self.form = [extra]
|
self.form = [extra]
|
||||||
def getStandardButtons(self):
|
def getStandardButtons(self):
|
||||||
return int(QtGui.QDialogButtonBox.Cancel)
|
return int(QtGui.QDialogButtonBox.Close)
|
||||||
def accept(self):
|
def accept(self):
|
||||||
FreeCADGui.ActiveDocument.resetEdit()
|
FreeCADGui.ActiveDocument.resetEdit()
|
||||||
return True
|
return True
|
||||||
|
@ -905,7 +915,7 @@ class DraftToolBar:
|
||||||
if extra:
|
if extra:
|
||||||
self.form = [extra]
|
self.form = [extra]
|
||||||
def getStandardButtons(self):
|
def getStandardButtons(self):
|
||||||
return int(QtGui.QDialogButtonBox.Cancel)
|
return int(QtGui.QDialogButtonBox.Close)
|
||||||
def reject(self):
|
def reject(self):
|
||||||
if callback:
|
if callback:
|
||||||
callback()
|
callback()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user