-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskPanelTest.FCMacro
More file actions
47 lines (35 loc) · 1.4 KB
/
TaskPanelTest.FCMacro
File metadata and controls
47 lines (35 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import FreeCAD,FreeCADGui,Part
from PySide import QtCore,QtGui
'''
creating a dialog window in the task panel
'''
path_to_ui = os.path.dirname(__file__) + "/SketcherSettings.ui"
class DefinePanel:
def __init__(self):
self.form = dialogFenster()
class dialogFenster(QtGui.QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("Stair Stringer Dialog")
self.createGridLayout()
windowLayout = QtGui.QVBoxLayout()
windowLayout.addWidget(self.horizontalGroupBox)
windowLayout.addWidget(self.horizontalGroupBox1)
self.setLayout(windowLayout)
self.show()
def createGridLayout(self):
self.horizontalGroupBox = QtGui.QGroupBox("Stair Case")
layout = QtGui.QGridLayout()
self.horizontalGroupBox1 = QtGui.QGroupBox("Stair Treads")
layout = QtGui.QGridLayout()
self.PB_01= QtGui.QPushButton(self.horizontalGroupBox)
self.PB_01.setText("Button 01")
self.PB_01.clicked.connect(self.on_PB_01_clicked) # slot: "PB 01"
layout.addWidget(self.PB_01,0,0)
self.horizontalGroupBox.setLayout(layout)
def on_PB_01_clicked(self): # slot: PushButton
''' Push Button 01 clicked '''
print('Push Button 01 clicked')
FreeCADGui.Control.closeDialog()
panel=DefinePanel()
FreeCADGui.Control.showDialog(panel)