def CreateFormControls(self): # Create table layout layout = forms.TableLayout() layout.Padding = drawing.Padding(10) layout.Spacing = drawing.Size(5, 5) # Add controls to layout layout.Rows.Add(forms.Label(Text='Rhino Objects:')) layout.Rows.Add(self.CreateListBoxRow()) layout.Rows.Add(self.CreateButtonRow()) # Set the content self.Content = layout
def __init__(self): # create a control text = forms.TextArea() text.Text = "Every Good Boy Deserves Fudge." # create a layout layout = forms.TableLayout() layout.Padding = drawing.Padding(10) layout.Spacing = drawing.Size(5, 5) layout.Rows.Add(text) # set the panel content self.Content = layout
def create_form_controls(self): # Create table layout layout = forms.TableLayout() layout.Padding = drawing.Padding(10) layout.Spacing = drawing.Size(20, 20) # Add controls to layout layout.Rows.Add(self.create_analysis_objects_group()) layout.Rows.Add(self.create_global_settings_table()) layout.Rows.Add(None) # Set the content self.Content = layout
def CreateButtonRow(self): # Select button select_button = forms.Button(Text='Select All') select_button.Click += self.OnSelectClick # Clear button clear_button = forms.Button(Text='Clear') clear_button.Click += self.OnClearClick # Create layout layout = forms.TableLayout(Spacing=drawing.Size(5, 5)) layout.Rows.Add(forms.TableRow(None, select_button, clear_button, None)) return layout
def create_button_row(self): """ Creates the table row that contains the button controls. Called by create_form_controls. """ # Select button select_button = forms.Button(Text='Open EPW') select_button.Click += self.on_load_epw # Create layout layout = forms.TableLayout(Spacing=drawing.Size(5, 5)) layout.Rows.Add(forms.TableRow(None, select_button, None)) return layout
def create_form_controls(self): """Create all of the controls used by the form.""" # Create table layout layout = forms.TableLayout() layout.Padding = drawing.Padding(10) layout.Spacing = drawing.Size(5, 5) # Add controls to layout layout.Rows.Add(forms.Label(Text='Location:')) layout.Rows.Add(self.create_list_box()) layout.Rows.Add(self.create_button_row()) # Set the content self.Content = layout
def create_layout_from_control_matrix(control_matrix, padding=drawing.Padding(5, 5), scale_height = False, spacing = drawing.Size(5, 5)): layout = forms.TableLayout(Spacing = spacing) layout.Padding = padding for control_row in control_matrix: cells = [forms.TableCell(elem) for elem in control_row] row = forms.TableRow(cells) row.ScaleHeight = scale_height layout.Rows.Add(row) return layout
def create_form_controls(self): # Create table layout layout = forms.TableLayout() layout.Padding = drawing.Padding(10) layout.Spacing = drawing.Size(20, 20) # Add controls to layout layout.Rows.Add(self.create_north_table()) layout.Rows.Add(self.create_location_group()) layout.Rows.Add(self.create_date_time_group()) layout.Rows.Add(self.create_global_settings_table()) # Set the content self.Content = layout
def __init__(self): self.Title = "EasyCut" self.selected = [] self.edgeshighlightMode = -1 self.m_gridview = forms.GridView() self.m_gridview.ShowHeader = True self.Padding = drawing.Padding(10) self.Resizable = True num = 0 for idx in range(len(ATTRS)): if num == QUANTITY_COLUMN_POS: attr = QUANT_FIELD column = forms.GridColumn() column.HeaderText = attr.name column.Editable = attr.isEditable column.DataCell = forms.TextBoxCell(num) self.m_gridview.Columns.Add(column) num += 1 attr = ATTRS[idx] if attr.isOn: column = forms.GridColumn() column.HeaderText = attr.name column.Editable = attr.isEditable column.DataCell = forms.TextBoxCell(num) self.m_gridview.Columns.Add(column) num += 1 self.precision_dropdownlist = forms.DropDown() self.precision_dropdownlist.DataStore = [ '1', '0.1', '0.01', '0.001', '0.0001', '0.00001' ] self.precision_dropdownlist.SelectedIndex = DIM_PRECISION self.precision_label = forms.Label(Text="Dimensions precision ") self.precision_dropdownlist.DropDownClosed += self.changePrecisionVal layout0 = forms.TableLayout() cell = forms.TableCell(self.precision_label, scaleWidth=False) cell.ScaleWidth = False cell2 = forms.TableCell(self.precision_dropdownlist, scaleWidth=False) cell2.ScaleWidth = False row = forms.TableRow(None, cell, cell2) row.ScaleHeight = False layout0.Rows.Add(row) self.m_gridview.CellClick += self.gridClick self.m_gridview.SelectionChanged += self.gridSelChanged self.m_gridview.CellEdited += self.gridEdited self.m_gridview.CellFormatting += self.OnCellFormatting self.buttonAutoNum = forms.Button(self.buttonAutoNumClick) self.buttonAutoNum.Text = "Auto number" self.button = forms.Button(self.buttonClick) self.button.Text = "Export" layout = forms.TableLayout() layout.Spacing = drawing.Size(5, 5) cell = forms.TableCell(self.m_gridview) row = forms.TableRow(cell) row.ScaleHeight = True layout.Rows.Add(layout0) layout.Rows.Add(row) layout2 = forms.TableLayout() layout2.Spacing = drawing.Size(5, 5) cell = forms.TableCell(self.button, True) cell2 = forms.TableCell(self.buttonAutoNum, True) row = forms.TableRow([cell, cell2]) layout2.Rows.Add(row) layout.Rows.Add(layout2) layout2 = forms.TableLayout() layout2.Spacing = drawing.Size(5, 5) self.m_linkbutton = forms.LinkButton(Text='Easycut') self.m_linkbutton.Click += self.OnLinkButtonClick self.m_donatebutton = forms.LinkButton(Text='Donate', Style="right-align") self.m_donatebutton.Click += self.OnDonateButtonClick cell = forms.TableCell(self.m_linkbutton, True) cell2 = forms.TableCell(None, False) cell3 = forms.TableCell(self.m_donatebutton, False) row = forms.TableRow([cell, cell2, cell3]) layout2.Rows.Add(row) layout.Rows.Add(layout2) self.Content = layout