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