def __init__(self): self.Text = __title__ textbox = TextBox() textbox.Location = Point(0, 0) textbox.Text = "Please input reports text or any list of IDs to select elements" textbox.AutoSize = False textbox.Size = Size(400, 200) textbox.Multiline = True textbox.Name = 'value' self.Controls.Add(textbox) saveSelection = CheckBox() saveSelection.Location = Point(260, 205) saveSelection.Text = "Save selection" saveSelection.Name = 'saveSelection' if not __shiftclick__: saveSelection.Checked = True self.Controls.Add(saveSelection) button_update = Button() button_update.Text = "Select" button_x = 8 button_y = 240 button_update.Location = Point(button_x, button_y) button_update.Click += self.form_update self.Controls.Add(button_update) self.Height = button_y + 70 self.Width = 400 self.MaximizeBox = False self.MinimizeBox = False self.FormBorderStyle = FormBorderStyle.FixedDialog
def __init__(self): self.Text = __title__ textbox = TextBox() textbox.Location = Point(0, 0) textbox.Text = "Please input reports text or any list of IDs to select elements" textbox.AutoSize = False textbox.Size = Size(400, 200) textbox.Multiline = True textbox.Name = 'value' self.Controls.Add(textbox) all_items = RadioButton() all_items.Location = Point(10, 205) all_items.Text = "All" all_items.Name = 'all' all_items.Width = 50 all_items.Checked = True self.Controls.Add(all_items) even = RadioButton() even.Location = Point(60, 205) even.Text = "Even only" even.Name = 'even_only' even.Width = 80 self.Controls.Add(even) odd = RadioButton() odd.Location = Point(140, 205) odd.Text = "Odd only" odd.Name = 'odd_only' self.Controls.Add(odd) saveSelection = CheckBox() saveSelection.Location = Point(260, 205) saveSelection.Text = "Save selection" saveSelection.Name = 'saveSelection' if not __shiftclick__: saveSelection.Checked = True self.Controls.Add(saveSelection) button_update = Button() button_update.Text = "Select" button_x = 8 button_y = 240 button_update.Location = Point(button_x, button_y) button_update.Click += self.form_update self.Controls.Add(button_update) self.Height = button_y + 70 self.Width = 400 self.MaximizeBox = False self.MinimizeBox = False self.FormBorderStyle = FormBorderStyle.FixedDialog
def __init__(self): self.Text = "CheckBox" self.Size = Size(220, 170) cb = CheckBox() cb.Parent = self cb.Location = Point(30, 30) cb.Text = "Show Title" cb.Checked = True cb.CheckedChanged += self.OnChanged self.CenterToScreen()
def __init__(self, curveId): offset = 10 index = 0 # header self.Text = "Annotate Curve" #label crvlabel = Label(Text="Curve ID = " + str(curveId), AutoSize=True) self.Controls.Add(crvlabel) width = crvlabel.Right pt = Point(crvlabel.Left, crvlabel.Bottom + offset) #textInput labelstart = Label(Text="Text at start", AutoSize=True) labelstart.Location = pt self.Controls.Add(labelstart) pt.X = labelstart.Right + offset inputstart = TextBox(Text="Start") inputstart.Location = pt self.Controls.Add(inputstart) if (inputstart.Right > width): width = inputstart.Right self.m_inputstart = inputstart index += 1 cb = CheckBox() cb.Parent = self cb.Location = Point(30, labelstart.Bottom + offset * index) cb.Text = "Show Title" cb.Checked = True pt.X = labelstart.Left pt.Y = labelstart.Bottom + offset * 3 buttonApply = Button(Text="Apply", DialogResult=DialogResult.OK) buttonApply.Location = pt self.Controls.Add(buttonApply) pt.X = buttonApply.Right + offset buttonCancel = Button(Text="Cancel", DialogResult=DialogResult.Cancel) buttonCancel.Location = pt self.Controls.Add(buttonCancel) if (buttonCancel.Right > width): width = buttonCancel.Right self.ClientSize = Size(width, buttonCancel.Bottom) self.AcceptButton = buttonApply self.CancelButton = buttonCancel
def __init__(self, curveId): label_width = 30 offset = 30 index = 0 # header self.Text = "Annotate Curve" #label index += 1 crvlabel = Label(Text="Curve ID = "+str(curveId), AutoSize=True) self.Controls.Add(crvlabel) width = crvlabel.Right pt = Point(crvlabel.Left,crvlabel.Bottom + offset) #textInput labelstart = Label(Text="Text at start", AutoSize=True) labelstart.Location = Point(label_width, offset* index) self.Controls.Add(labelstart) pt.X = labelstart.Right + offset inputstart = TextBox(Text="Start") inputstart.Location = pt self.Controls.Add(inputstart) if( inputstart.Right > width ): width = inputstart.Right self.m_inputstart = inputstart index += 1 cb = CheckBox( AutoSize=True) cb.Parent = self cb.Location = Point(label_width, offset* index) cb.Text = "Show Title" cb.Checked = True index += 1 cbb = ComboBox(Text="select tool", Location=Point(label_width, offset * index), Parent=self) cbb.Items.AddRange(("Inner contour", "Outer contour", "Pocket", "Engrave", "Clamex horizontal")) self.cbb_tool = cbb index += 1 cbb = ComboBox(Text="Outer contour", Location=Point(label_width, offset * index), Parent=self) cbb.Items.AddRange(("Inner contour", "Outer contour", "Pocket", "Engrave", "Clamex horizontal")) self.cbb_operation = cbb index += 1 sb = NumericUpDown( AutoSize=True, Location=Point(label_width, offset * index), Parent=self , DecimalPlaces = 2) sb.Parent = self sb.Location = Point(label_width, offset* index) sb.DecimalPlaces = 2 sb.Text = "Show Title" index += 1 pt.X = labelstart.Left pt.Y = labelstart.Bottom + offset*index buttonApply = Button(Text="Apply", DialogResult=DialogResult.OK) buttonApply.Location = pt self.Controls.Add(buttonApply) pt.X = buttonApply.Right + offset buttonCancel = Button(Text="Cancel", DialogResult=DialogResult.Cancel) buttonCancel.Location = pt self.Controls.Add(buttonCancel) if( buttonCancel.Right > width ): width = buttonCancel.Right self.ClientSize = Size(width, buttonCancel.Bottom) self.AcceptButton = buttonApply self.CancelButton = buttonCancel
cb.Items.Add(k) form.Controls.Add(cb) form.output.append(cb) cbindex += 1 elif j == 's': tb = TextBox() tb.Text = 'Default' tb.Width = inputwidth tb.Height = inputheight tb.Location = Point(xinput, y) form.Controls.Add(tb) form.Controls.Add(label) form.output.append(tb) elif j == 'bool': yn = CheckBox() yn.Location = Point(xinput, y) yn.Text = 'Yes/No' form.Controls.Add(yn) form.output.append(yn) elif j == 'fp': fp = Button() fp.Width = inputwidth fp.Height = inputheight fp.Text = 'FilePath' fp.Location = Point(xinput, y) form.Controls.Add(fp) fp.Click += form.openfile form.output.append(fp) elif j == 'dp': dp = Button() dp.Width = inputwidth