def init(self): # table table = make_table('main', False) table.Size = Size(580, 700) table.Location = Point(10, 10) table.ColumnCount = 2 table.Columns[0].Name = 'Key' table.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable table.Columns[0].ReadOnly = True table.Columns[0].DefaultCellStyle.SelectionBackColor = Color.FromArgb(238, 238, 238) table.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb(238, 238, 238) table.Columns[1].Name = 'Value' table.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable keys = sorted(self.settings.keys()) for key in keys: table.Rows.Add(key, self.settings[key]) self.table = table # buttons ok = Button() ok.Text = 'OK' ok.DialogResult = DialogResult.OK cancel = Button() cancel.Text = 'Cancel' cancel.DialogResult = DialogResult.Cancel buttons = FlowLayoutPanel() buttons.FlowDirection = FlowDirection.RightToLeft # buttons.BorderStyle = BorderStyle.None buttons.Controls.Add(cancel) buttons.Controls.Add(ok) buttons.Size = Size(580, 30) buttons.Location = Point(10, 720) # layout self.ClientSize = Size(600, 800) self.Controls.Add(table) self.Controls.Add(buttons)
def _add_buttons(self): ok = Button() ok.Text = 'OK' ok.DialogResult = DialogResult.OK cancel = Button() cancel.Text = 'Cancel' cancel.DialogResult = DialogResult.Cancel self.buttons = FlowLayoutPanel() self.buttons.FlowDirection = FlowDirection.RightToLeft self.buttons.BorderStyle = BorderStyle.None self.buttons.Controls.Add(cancel) self.buttons.Controls.Add(ok) self.buttons.Size = Size(580, 30) self.buttons.Location = Point(10, 720) self.ClientSize = Size(600, 800) self.Controls.Add(self.buttons)
def init(self): # tabs tabs = TabControl() tabs.Size = Size(580, 700) tabs.Location = Point(10, 10) # buttons ok = Button() ok.Text = 'OK' ok.DialogResult = DialogResult.OK cancel = Button() cancel.Text = 'Cancel' cancel.DialogResult = DialogResult.Cancel buttons = FlowLayoutPanel() buttons.FlowDirection = FlowDirection.RightToLeft buttons.BorderStyle = BorderStyle.None buttons.Controls.Add(cancel) buttons.Controls.Add(ok) buttons.Size = Size(580, 30) buttons.Location = Point(10, 720) self.ClientSize = Size(600, 800) self.Controls.Add(tabs) self.Controls.Add(buttons) # pages and tables index = 0 for name in self.settings: page = make_page(name, name, index) page.TabIndex = index settings = self.settings[name] table = make_table(name) table.ColumnCount = 2 table.Columns[0].Name = 'Key' table.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable table.Columns[0].ReadOnly = True table.Columns[ 0].DefaultCellStyle.SelectionBackColor = Color.FromArgb( 238, 238, 238) table.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb( 238, 238, 238) table.Columns[1].Name = 'Value' table.Columns[1].SortMode = DataGridViewColumnSortMode.NotSortable keys = sorted(settings.keys()) for key in keys: table.Rows.Add(key, settings[key]) page.Controls.Add(table) tabs.Controls.Add(page) self.tables[name] = table index += 1
def init(self): # table table = make_table('main', False) table.Size = Size(980, 700) table.Location = Point(10, 10) table.ColumnCount = len(self.names) + 1 table.Columns[0].Name = 'Key' table.Columns[0].SortMode = DataGridViewColumnSortMode.NotSortable table.Columns[0].ReadOnly = True table.Columns[0].DefaultCellStyle.SelectionBackColor = Color.FromArgb( 238, 238, 238) table.Columns[0].DefaultCellStyle.BackColor = Color.FromArgb( 238, 238, 238) for i in range(len(self.names)): column = table.Columns[i + 1] column.Name = self.names[i] column.SortMode = DataGridViewColumnSortMode.NotSortable if self.types: if self.types[i] == 'f': column.AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill else: column.AutoSizeMode = DataGridViewAutoSizeColumnMode.AllCells keys = sorted(self.attributes.keys(), key=int) for key in keys: values = [self.attributes[key][name] for name in self.names] objects = [key] + values table.Rows.Add(*objects) self.table = table # buttons ok = Button() ok.Text = 'OK' ok.DialogResult = DialogResult.OK cancel = Button() cancel.Text = 'Cancel' cancel.DialogResult = DialogResult.Cancel buttons = FlowLayoutPanel() buttons.FlowDirection = FlowDirection.RightToLeft # buttons.BorderStyle = BorderStyle.None buttons.Controls.Add(cancel) buttons.Controls.Add(ok) buttons.Size = Size(980, 30) buttons.Location = Point(10, 720) # layout self.ClientSize = Size(1000, 800) self.Controls.Add(table) self.Controls.Add(buttons)
def __build_okbutton(self): ''' builds and returns the ok button for this form ''' button = Button() button.DialogResult = DialogResult.OK button.Location = Point(228, 343) button.Size = Size(80, 23) button.Text = i18n.get("ConfigFormOK") return button
def __build_skipbutton(self): ''' builds and return the skip button for this form ''' button = Button() button.DialogResult = DialogResult.Ignore button.Location = Point(110, 362) button.Size = Size(90, 24) button.Text = i18n.get("SeriesFormSkip") return button
def __build_cancel_button(self): ''' builds and returns the cancel button for this form ''' button = Button() button.DialogResult = DialogResult.Cancel button.Location = Point(315, 343) button.Size = Size(90, 23) button.Text = i18n.get("ConfigFormCancel") return button
def __build_okbutton(self): """ builds and returns the ok button for this form """ button = Button() button.DialogResult = DialogResult.OK button.Location = Point(223, 362) if self.__config.show_covers_b else Point(10, 362) button.Size = Size(90, 24) button.Text = i18n.get("IssueFormOK") return button
def __build_okbutton(self): ''' builds and returns the ok button for this form ''' button = Button() button.DialogResult = DialogResult.OK button.Location = Point(15, 362) button.Size = Size(90, 24) button.Text = i18n.get("SeriesFormOK") return button
def __build_skipbutton(self): """ builds and returns the skip button for this form """ button = Button() button.DialogResult = DialogResult.Ignore button.Location = Point(318, 362) if self.__config.show_covers_b else Point(105, 362) button.Size = Size(90, 24) button.Text = i18n.get("IssueFormSkip") return button
def __build_backbutton(self): """ builds and returns the back button for this form """ button = Button() button.DialogResult = DialogResult.Retry button.Location = Point(595, 362) button.Size = Size(125, 24) button.Text = i18n.get("IssueFormGoBack") return button
def __build_backbutton(self): ''' builds and returns the back button for this form ''' button = Button() button.DialogResult = DialogResult.Retry button.Location = Point(595, 362) button.Size = Size(125, 24) button.Text = i18n.get("IssueFormGoBack") return button
def __build_issuesbutton(self): ''' builds and return the 'show issues' button for this form ''' button = Button() button.DialogResult = DialogResult.Yes button.Location = Point(395, 362) \ if self.__config.show_covers_b else Point(605, 362) button.Size = Size(115, 24) button.Text = i18n.get("SeriesFormIssues") return button
def __build_cancelbutton(self): ''' builds and returns the cancel button for this form ''' button = Button() button.DialogResult = DialogResult.Cancel button.Location = Point(335, 170 if self.__fail_label_is_visible else 70) button.Size = Size(90, 23) button.Text = i18n.get("SearchFormCancel") button.UseVisualStyleBackColor = True return button
def __build_searchbutton(self): ''' builds and return the 'search again' button for this form ''' button = Button() button.DialogResult = DialogResult.Retry button.Location = Point(275, 362) \ if self.__config.show_covers_b else Point(485, 362) button.Size = Size(115, 24) button.Text = i18n.get("SeriesFormAgain") return button
def __build_skipbutton(self): ''' builds and returns the skip button for this form ''' button = Button() button.DialogResult = DialogResult.Ignore button.Location = Point(318, 362) \ if self.__config.show_covers_b else Point(105, 362) button.Size = Size(90, 24) button.Text = i18n.get("IssueFormSkip") return button
def __build_okbutton(self): ''' Builds and returns the ok button for this form. ''' button = Button() button.DialogResult = DialogResult.OK button.Location = Point(10, 68) button.Size = Size(145, 23) button.Text = i18n.get("WelcomeFormStart") button.UseVisualStyleBackColor = True return button
def __build_okbutton(self): ''' Builds and returns the ok button for this form. ''' button = Button() button.DialogResult = DialogResult.OK button.Location = Point(105, 58) button.Size = Size(90, 23) button.Text = i18n.get("MessageBoxOk") button.UseVisualStyleBackColor = True return button
def __build_cancelbutton(self): ''' Builds and returns the cancel button for this form. ''' button = Button() button.DialogResult = DialogResult.Cancel button.Location = Point(314, 68) button.Size = Size(90, 23) button.Text = i18n.get("WelcomeFormCancel") button.UseVisualStyleBackColor = True return button
def __build_okbutton(self): ''' builds and returns the ok button for this form ''' button = Button() button.DialogResult = DialogResult.OK button.Location = Point(223, 362) \ if self.__config.show_covers_b else Point(10, 362) button.Size = Size(90, 24) button.Text = i18n.get("IssueFormOK") return button
def init(self): ok = Button() ok.Text = 'OK' ok.DialogResult = DialogResult.OK cancel = Button() cancel.Text = 'Cancel' cancel.DialogResult = DialogResult.Cancel buttonlayout = FlowLayoutPanel() buttonlayout.Height = 30 buttonlayout.Anchor = AnchorStyles.Bottom | AnchorStyles.Right buttonlayout.FlowDirection = FlowDirection.RightToLeft buttonlayout.BorderStyle = BorderStyle.None buttonlayout.Controls.Add(cancel) buttonlayout.Controls.Add(ok) formlayout = TableLayoutPanel() formlayout.Dock = DockStyle.Fill formlayout.BorderStyle = BorderStyle.None formlayout.ColumnCount = 1 formlayout.RowCount = 2 formlayout.RowStyles.Add(RowStyle(SizeType.Percent, 100)) formlayout.Controls.Add(table, 0, 0) formlayout.Controls.Add(buttonlayout, 0, 1) self.Controls.Add(formlayout)
def initialiseButtons(self): buttonPanel = Panel() buttonPanel.Height = 23 buttonPanel.Dock = DockStyle.Bottom buttonPanel.Width = 170 acceptButton = Button() acceptButton.Text = "OK" acceptButton.DialogResult = DialogResult.OK acceptButton.Width = 75 acceptButton.Dock = DockStyle.Left self.AcceptButton = acceptButton buttonPanel.Controls.Add(acceptButton) cancelButton = Button() cancelButton.Text = "Cancel" cancelButton.DialogResult = DialogResult.Cancel cancelButton.Width = 75 cancelButton.Dock = DockStyle.Right self.CancelButton = cancelButton buttonPanel.Controls.Add(cancelButton) self.Controls.Add(buttonPanel)