|
|
|
@ -162,6 +162,7 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
if self.isBrief():
|
|
|
|
|
self.print_brief(self.view.groups.GroupField, x)
|
|
|
|
|
return
|
|
|
|
|
lastTable = None
|
|
|
|
|
for Group in self.view.groups.GroupField:
|
|
|
|
|
if Group.name:
|
|
|
|
|
self.group_name_label = LabelWordWrap(Group.name, self)
|
|
|
|
@ -173,6 +174,9 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
x += 1
|
|
|
|
|
|
|
|
|
|
for field in Group.fields.Field:
|
|
|
|
|
if lastTable:
|
|
|
|
|
self.resize_table(lastTable)
|
|
|
|
|
lastTable = None
|
|
|
|
|
# add element in frame
|
|
|
|
|
if field.element == 'label':
|
|
|
|
|
self.add_element_label (field, x, y)
|
|
|
|
@ -247,6 +251,7 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
|
|
|
|
|
elif field.element == 'table' and field.type != 'steps':
|
|
|
|
|
self.add_element_table (field, x, y)
|
|
|
|
|
lastTable = self.view_dict[field.name]
|
|
|
|
|
x += 3
|
|
|
|
|
if field.type == 'writable':
|
|
|
|
|
x += 1
|
|
|
|
@ -258,6 +263,9 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
|
|
|
|
|
c = 1 if hasattr(self, 'group_name_label') else 0
|
|
|
|
|
|
|
|
|
|
if lastTable:
|
|
|
|
|
lastTable.bFixedHeight = False
|
|
|
|
|
self.resize_table(lastTable)
|
|
|
|
|
# When used page_offset and page_count
|
|
|
|
|
if self.grid.count() <= c:
|
|
|
|
|
# call_button = QtGui.QPushButton(self)
|
|
|
|
@ -302,13 +310,14 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
[self.method_name] ['steps_field'])
|
|
|
|
|
self.ClientObj.MainWidget.left_frame.changed_step \
|
|
|
|
|
(self.ClientObj.param_objects[self.method_name]['step'])
|
|
|
|
|
self.grid.addItem(QtGui.QSpacerItem( 0, 0, QtGui.QSizePolicy.\
|
|
|
|
|
Expanding, QtGui.QSizePolicy.Expanding), x+1, y, 1, 2)
|
|
|
|
|
if not lastTable:
|
|
|
|
|
self.grid.addItem(QtGui.QSpacerItem( 0, 0, QtGui.QSizePolicy.\
|
|
|
|
|
Expanding, QtGui.QSizePolicy.Expanding), x+1, y, 1, 2)
|
|
|
|
|
|
|
|
|
|
self.common_layout.addLayout(self.grid)
|
|
|
|
|
# add spacer
|
|
|
|
|
self.common_layout.addItem(QtGui.QSpacerItem( 0, 0, \
|
|
|
|
|
QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
|
|
|
|
|
#self.common_layout.addItem(QtGui.QSpacerItem( 0, 0, \
|
|
|
|
|
# QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding))
|
|
|
|
|
self.update()
|
|
|
|
|
self.ClientObj.app.processEvents()
|
|
|
|
|
self.updateGeometry()
|
|
|
|
@ -1307,7 +1316,8 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
brief)
|
|
|
|
|
|
|
|
|
|
minimum = QtGui.QSizePolicy.Minimum
|
|
|
|
|
self.table_widget.setSizePolicy(minimum, minimum)
|
|
|
|
|
expanding = QtGui.QSizePolicy.Expanding
|
|
|
|
|
self.table_widget.setSizePolicy(minimum, expanding)
|
|
|
|
|
|
|
|
|
|
self.view_dict[field.name] = self.table_widget
|
|
|
|
|
self.label_dict[field.name] = LabelWordWrap(field.label, self)
|
|
|
|
@ -1420,8 +1430,8 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
self.view_dict[field.name].hideColumn(0)
|
|
|
|
|
|
|
|
|
|
# set width column
|
|
|
|
|
self.view_dict[field.name].horizontalHeader().resizeSections\
|
|
|
|
|
(QtGui.QHeaderView.ResizeMode.ResizeToContents)
|
|
|
|
|
#self.view_dict[field.name].horizontalHeader().resizeSections\
|
|
|
|
|
# (QtGui.QHeaderView.ResizeMode.ResizeToContents)
|
|
|
|
|
|
|
|
|
|
# No Selection
|
|
|
|
|
self.view_dict[field.name].setSelectionMode \
|
|
|
|
@ -1437,8 +1447,6 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
unit_widget.setToolTip(field.uncompatible)
|
|
|
|
|
unit_widget.setDisabled(True)
|
|
|
|
|
|
|
|
|
|
# Resize table
|
|
|
|
|
self.resize_table(self.table_widget)
|
|
|
|
|
self.table_widget.setColor()
|
|
|
|
|
|
|
|
|
|
wfg_layout.addWidget(self.view_dict[field.name])
|
|
|
|
@ -1674,12 +1682,13 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
|
|
|
|
|
def resize_table(self, table):
|
|
|
|
|
# Resize table
|
|
|
|
|
h = table.horizontalHeader().height() + \
|
|
|
|
|
2 * table.frameWidth()
|
|
|
|
|
h += table.horizontalScrollBar().height()
|
|
|
|
|
for row_in_table in range (table.rowCount()):
|
|
|
|
|
h += table.rowHeight(row_in_table)
|
|
|
|
|
table.setFixedHeight(h)
|
|
|
|
|
if table.bFixedHeight:
|
|
|
|
|
h = table.horizontalHeader().height() + \
|
|
|
|
|
2 * table.frameWidth()
|
|
|
|
|
h += table.horizontalScrollBar().height()
|
|
|
|
|
for row_in_table in range (table.rowCount()):
|
|
|
|
|
h += table.rowHeight(row_in_table)
|
|
|
|
|
table.setFixedHeight(h)
|
|
|
|
|
table.horizontalHeader().resizeSections\
|
|
|
|
|
(QtGui.QHeaderView.ResizeMode.ResizeToContents)
|
|
|
|
|
table.setColumnWidth(0, 40)
|
|
|
|
@ -1917,6 +1926,7 @@ class MainFrame(QtGui.QWidget):
|
|
|
|
|
field.default = False
|
|
|
|
|
self.add_element_table (field, x, y, brief = True,
|
|
|
|
|
gb_layout = gb_layout)
|
|
|
|
|
self.resize_table(self.view_dict[field.name])
|
|
|
|
|
x += 3
|
|
|
|
|
if field.type == 'writable':
|
|
|
|
|
x += 1
|
|
|
|
|