def __init__(self, curveId): offset = 10 self.Text = "Annotate Curve" crvlabel = Label(Text="Curve ID = "+str(curveId), AutoSize=True) self.Controls.Add(crvlabel) width = crvlabel.Right pt = Point(crvlabel.Left,crvlabel.Bottom + offset) 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 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): self.Title="Timer" self.timer1=Timer() self.timer1.Interval=1000 self.timer1.Tick+=self.timer1_tick label1=Label() label1.AutoSize=True label1.Location=Point(41,22) label1.Text="00:00:00" label1.Font=Font("MS UI Gothic",24.0,FontStyle.Regular) self.label1=label1 self.Controls.Add(self.label1) clientwidth=255 b1=Button() b1.Location=Point((clientwidth-b1.Width*2)/3,68) b1.Text="Click" b1.Click+=self.start_Click self.Controls.Add(b1) b2=Button() b2.Location=Point((clientwidth-b1.Width*2)*2/3+b1.Width,68) b2.Text="Stop" b2.Click+=self.stop_Click self.Controls.Add(b2) self.ClientSize=Size(clientwidth,103) self.Text="Stop Watch" self.StartPosition=FormStartPosition.CenterScreen
def DublicateLogic(form): form.choosers.append(form.logicChooser1) #remove the placeholder controls created in __init__ form.tabPageLogic.Controls.Remove(form.logicChooser1); form.tabPageLogic.Controls.Remove(form.labelPatternRate); #for each row in the logic choosers for i in range(0, form.MaxPattern): offset = 22; lc = LogicChooser(); lc.Top = form.logicChooser1.Top + i * offset; lc.Left = form.logicChooser1.Left; lc.Visible = True; lc.TabIndex = form.logicChooser1.TabIndex + 20 * i; lc.Name = form.logicChooser1.Name + str(i); form.choosers.append(lc) #for each button for the channel selectors for j in range(0,form.MaxPattern): form.choosers[i].Controls[j].Top = form.logicChooser1.Top + i * offset; form.choosers[i].Controls[j].Left += form.logicChooser1.Left; form.tabPageLogic.Controls.Add(form.choosers[i].Controls[j]); l=Label(); #form.DublicateControl(l, form.labelPatternRate, i, offset); DublicateControl(l, form.labelPatternRate, i, offset); l.TextAlign = form.labelPatternRate.TextAlign; form.patternRateLabels[1+i] = l; form.tabPageLogic.Controls.Add(l);
def addNameLabel(self, name, imageName, location): label = Label() label.Parent = self label.AutoSize = True label.Location = location label.Text = name label.MouseEnter += lambda *_: self.switchImage(imageName) label.MouseLeave += self.resetImage
def __build_label(self): ''' builds and returns the text label for this form ''' label = Label() label.UseMnemonic = False label.Location = Point(10, 110 if self.__fail_label_is_visible else 10) label.Size = Size(415, 20) label.Text = i18n.get("SearchFormText") return label
def __init__(self): self.Text = "Via Generator" self.Width = 300 self.Height = 200 self.label1 = Label() self.label1.Text = "Number of Layers:" self.label1.Location = Point(50, 25) self.label1.Height = 25 self.label1.Width = 120 self.textbox1 = TextBox() self.textbox1.Text = "8" self.textbox1.Location = Point(200, 25) self.textbox1.Width = 50 self.label2 = Label() self.label2.Text = "Input Layer:" self.label2.Location = Point(50, 50) self.label2.Height = 25 self.label2.Width = 120 self.textbox2 = TextBox() self.textbox2.Text = "1" self.textbox2.Location = Point(200, 50) self.textbox2.Width = 50 self.label3 = Label() self.label3.Text = "Output Layer:" self.label3.Location = Point(50, 75) self.label3.Height = 25 self.label3.Width = 120 self.textbox3 = TextBox() self.textbox3.Text = "8" self.textbox3.Location = Point(200, 75) self.textbox3.Width = 50 self.button1 = Button() self.button1.Text = 'Generate' self.button1.Location = Point(25, 125) self.button1.Click += self.update self.AcceptButton = self.button1 self.Controls.Add(self.label1) self.Controls.Add(self.label2) self.Controls.Add(self.label3) self.Controls.Add(self.textbox1) self.Controls.Add(self.textbox2) self.Controls.Add(self.textbox3) self.Controls.Add(self.button1)
def testEnumWithFlagsAttrConversion(self): """Test enumeration conversion with FlagsAttribute set.""" from System.Windows.Forms import Label # This works because the AnchorStyles enum has FlagsAttribute. label = Label() label.Anchor = 99 # This should fail because our test enum doesn't have it. def test(): Test.FieldTest().EnumField = 99 self.failUnlessRaises(ValueError, test)
def header(self, x, y): style = FontStyle.Bold levels_selected = '-' objects_selected = '-' self.sublabel = Label() self.sublabel.Text = "Number of Levels Selected: " + str( levels_selected) self.sublabel.Location = Point(x + 40, y + 10) self.sublabel.Width = width - 200 self.sublabel.Font = Font("Calibri Light", 12) #self.sublabel.ForeColor = Color.White #self.sublabel.ForeColor = Color.FromArgb(242, 112, 108) #self.sublabel.ForeColor = Color.Black self.sublabel_objects = Label() self.sublabel_objects.Text = "Number of Objects Current Selection: " + str( objects_selected) self.sublabel_objects.Location = Point(x + 40, y + 30) self.sublabel_objects.Width = width - 200 self.sublabel_objects.Font = Font("Calibri Light", 12) #self.sublabel_objects.ForeColor = Color.White self.sublabel_objects.ForeColor = Color.FromArgb(242, 112, 108) self.sublabel_objects.ForeColor = Color.Black self.sublabel_no_selection = Label() self.sublabel_no_selection.Text = "" self.sublabel_no_selection.Location = Point(x + 40, y + 50) self.sublabel_no_selection.Width = width - 200 self.sublabel_no_selection.Font = Font("Calibri Light", 12) #self.sublabel_no_selection.ForeColor = Color.White self.sublabel_no_selection.ForeColor = Color.FromArgb(242, 112, 108) self.sublabel_no_selection.ForeColor = Color.Black self.header = Panel() self.header.Width = width self.header.Height = 80 self.header.AutoSize = True self.header.Font = Font("Calibri", 12) self.header.Location = Point(x, y) self.header.BackColor = Color.FromArgb(145, 201, 213) self.header.Controls.Add(self.sublabel) self.header.Controls.Add(self.sublabel_objects) self.header.Controls.Add(self.sublabel_no_selection) self.header.AutoScroll = True return self.header
def __build_label(self, series_ref): ''' builds and returns the main text label for this form ''' # 1. compute the best possible full name for the given SeriesRef name_s = series_ref.series_name_s publisher_s = series_ref.publisher_s vol_year_n = series_ref.volume_year_n vol_year_s = sstr(vol_year_n) if vol_year_n > 0 else '' fullname_s = '' if name_s: if publisher_s: if vol_year_s: fullname_s = "'"+name_s+"' ("+publisher_s+", " + vol_year_s + ")" else: fullname_s = "'"+name_s+"' (" + publisher_s + ")" else: fullname_s = "'"+name_s+"'" label = Label() label.UseMnemonic = False sep = ' ' if len(fullname_s) > 40 else '\n' label.Text = i18n.get("IssueFormChooseText").format(fullname_s, sep) if self.__config.show_covers_b: label.Location = Point(218, 20) label.Size = Size(480, 40) else: label.Location = Point(10, 20) label.Size = Size(680, 40) return label
def header(self, x, y): style = FontStyle.Bold assembly_codes_selected = '-' objects_selected = '-' self.sublabel = Label() self.sublabel.Text = "ProjectBasePoint (E/W, N/S, Elev)" self.sublabel.Location = Point(x+40, y+10) self.sublabel.Width = width-200 self.sublabel.Font = Font("Calibri Light", 12) self.sublabel.Width = 400 #self.sublabel.ForeColor = Color.White self.sublabel.ForeColor = Color.Black self.sublabel_objects = Label() self.sublabel_objects.Text = "SharedBasePoint (E/W, N/S, Elev)" self.sublabel_objects.Location = Point(x+40, y+30) self.sublabel_objects.Width = width-200 self.sublabel_objects.Font = Font("Calibri Light", 12) self.sublabel_objects.Width = 400 #self.sublabel_objects.ForeColor = Color.White self.sublabel.ForeColor = Color.Black self.sublabel_no_selection = Label() self.sublabel_no_selection.Text = "" self.sublabel_no_selection.Location = Point(x+40, y+50) self.sublabel_no_selection.Width = width-200 self.sublabel_no_selection.Font = Font("Calibri Light", 12, style) #self.sublabel_no_selection.ForeColor = Color.White self.sublabel.ForeColor = Color.Black self.header = Panel() self.header.Width = width self.header.Height = 80 self.header.AutoSize = True self.header.Font = Font("Calibri", 12) self.header.Location = Point(x,y) #self.header.BackColor = Color.FromArgb(0, 0, 0) self.header.BackColor = Color.FromArgb(145, 201, 213) self.header.Controls.Add(self.sublabel) self.header.Controls.Add(self.sublabel_objects) self.header.Controls.Add(self.sublabel_no_selection) self.header.AutoScroll = True return self.header
def __init__(self, strName, strID): print("Create ListRow") self.initLabel() self.lblName = Label() self.lblID = Label() self.tbNumber = TextBox() self.initTextBoxNumber() self.initLabelName(strName) self.initLabelID(strID) self.Controls.Add(self.lblName) self.Controls.Add(self.lblID) self.Controls.Add(self.tbNumber)
def setupPanel2(self): self.panel2 = Panel() # self.panel2.Text = "Panel" self.panel2.Width = self.Width self.panel2.Height = 120 self.panel2.Location = Point(0, 120) self.panel2.BorderStyle = BorderStyle.FixedSingle self.p2title1 = Label() self.p2title1.Text = "Create Lumped Port" self.p2title1.Location = Point(25, 22) self.p2title1.Height = 25 self.p2title1.AutoSize = True self.p2label1 = Label() self.p2label1.Text = "Ground Metal Name: " self.p2label1.Location = Point(25, 50) self.p2label1.Height = 25 self.p2label1.Width = 150 self.p2button1 = Button() self.p2button1.Text = 'Create' self.p2button1.Location = Point(25, 75) self.p2button1.Width = 100 self.p2button1.Click += self.p2update self.p2button2 = Button() self.p2button2.Text = 'Reset' self.p2button2.Location = Point(180, 75) self.p2button2.Width = 100 self.p2button2.Click += self.p2reset self.p2list1 = ComboBox() self.p2list1.Text = '——Select' self.p2list1.Location = Point(180, 47) self.p2list1.Width = 100 self.p2list1.Height = 35 self.DropDownHeight = 50 self.p2list1.Click += self.p2listUpdate self.AcceptButton = self.p2button1 self.CancelButton = self.p2button2 self.panel2.Controls.Add(self.p2title1) self.panel2.Controls.Add(self.p2label1) self.panel2.Controls.Add(self.p2button1) self.panel2.Controls.Add(self.p2button2) self.panel2.Controls.Add(self.p2list1)
def __init__(self): self.m_testport = 'COM3' #: Port on test system self.m_test_meter = "300001162" #: Test V4 meter ekm_set_log(ekm_print_log) print "\n****\nInitializing v3 and v4 for db test" self.Text = 'Sample EKM Iron Python App' self.label = Label() self.label.Text = "0.0" self.label.Location = Point(50, 50) self.label.Height = 30 self.label.Width = 200 self.count = 0 button = Button() button.Text = "Read Meter: " + self.m_test_meter button.Location = Point(50, 100) button.Width = 180 button.Click += self.buttonPressed self.Controls.Add(self.label) self.Controls.Add(button)
def __init__(self, items): self.exEvent = None self.Width = 360 self.Height = 140 self.combo_box = ComboBox() self.combo_box.Width = 300 self.combo_box.Location = Point(20, 30) items = list(items) items.sort() for i in items: self.combo_box.Items.Add(i) self.combo_box.SelectedIndex = 0 self.label = Label() self.label.Text = "Выберете лист на который нужно добавить текущий вид" self.label.Width = 400 self.label.Location = Point(20, 10) self.button = Button() self.button.Width = 300 self.button.Text = "Расположить" self.button.Location = Point(20, 60) self.button.Click += self.run self.Controls.Add(self.combo_box) self.Controls.Add(self.label) self.Controls.Add(self.button)
def __init__(self, param): super(PanelBool, self).__init__() self.Height = Fconfig.unitline tooltips = ToolTip() self.value = True self.textlabel = Label() self.textlabel.Parent = self self.textlabel.Text = param[0] + ' :' self.textlabel.Location = Point(0, 0) self.textlabel.Size = Size(Fconfig.lblwidth, Fconfig.unitline) self.textlabel.TextAlign = ContentAlignment.MiddleLeft self.checkyes = RadioButton() self.checkyes.Parent = self self.checkyes.Location = Point( self.textlabel.Right + 2 * Fconfig.margin, 10) self.checkyes.Text = Fconfig.buttonYES self.checkyes.Checked = True self.checkyes.CheckedChanged += self.onChanged self.checkno = RadioButton() self.checkno.Parent = self self.checkno.Location = Point(self.checkyes.Right, 10) self.checkno.Text = Fconfig.buttonNO self.checkno.CheckedChanged += self.onChanged tooltips.SetToolTip(self, Types.types(param[1], 'tooltip')) ModeDBG.say('panel {0}, top {1}, height :{2}'.format( param[1], self.Top, self.Height))
def __init__(self): """MonthCalendarSample class init function.""" # setup title self.Text = "MonthCalendar control" # setup monthcalendar self.monthcalendar = MonthCalendar() # set one days that can be selected in a month calendar control self.monthcalendar.MaxSelectionCount = 2 self.monthcalendar.ShowWeekNumbers = True #NOTE: Strongwind tests depend on this date setting! Make sure to update them if you change it initialRange = SelectionRange(DateTime.Parse("1/23/2008"), DateTime.Parse("1/23/2008")) self.monthcalendar.SelectionRange = initialRange self.monthcalendar.DateChanged += self.date_select # setup label self.label = Label() self.label.Width = 200 self.label.Height = 50 self.label.Location = Point(5, 170) self.label.Text = ( "Your selection is:\n" + (self.monthcalendar.SelectionRange.Start).ToString('o')[:10]) # add controls self.Controls.Add(self.monthcalendar) self.Controls.Add(self.label)
def setupPanel2(self): self.panel2 = Panel() self.panel2.Text = "Change_unit Panel" self.panel2.Width = self.Width self.panel2.Height = 50 self.panel2.Location = Point(0, 0) self.panel2.BorderStyle = BorderStyle.FixedSingle self.label3 = Label() self.label3.Text = "设置视图单位:" self.label3.Location = Point(25, 15) self.label3.Height = 15 self.label3.Width = 100 self.textbox3 = TextBox() self.textbox3.Text = "um" self.textbox3.Location = Point(125, 12) self.textbox3.Width = 60 self.button3 = Button() self.button3.Text = 'ok' self.button3.Location = Point(200, 10) self.button3.Width = 40 self.button3.Click += self.c_unit self.panel2.Controls.Add(self.label3) self.panel2.Controls.Add(self.textbox3) self.panel2.Controls.Add(self.button3)
def __init__(self): self.StartPosition = FormStartPosition.CenterScreen self.FormBorderStyle = FormBorderStyle.FixedDialog self.Text = 'Текст' self.Name = 'Имя' self.Size = Size(500, 250) self.MaximizeBox = False self.MinimizeBox = False self.msg = [] gb = GroupBox() gb.Text = "Категории" gb.Size = Size(120, 110) gb.Location = Point(20, 20) gb.Parent = self j = 25 for c in cats: self.cb = CheckBox() self.cb.Text = c self.cb.Location = Point(25, j) j += 25 self.cb.Width = 200 self.cb.Checked += self.OnChanged gb.Size = Size(120, 20 + j) gb.Controls.Add(self.cb) self.label = Label() self.label.Text = "Результат" self.label.Location = Point(225, 20) self.label.Height = 25 self.label.Width = 225 self.Controls.Add(self.label) self.label.Text = "".join(self.msg)
def __init__(self, formParent, myIndex, strName, strID): self.initLabel() self.checkBox = CheckBox() self.lblName = Label() self.lblID = Label() self.formParent = formParent self.strName = strName self.strID = strID self.initCheckBox() self.initLabelName(strName) self.initLabelID(strID) self.Controls.Add(self.checkBox) self.Controls.Add(self.lblName) self.Controls.Add(self.lblID)
def __init__(self, param): super(PanelDate, self).__init__() self.Height = 170 self.paramtype = param[1] tooltips = ToolTip() self.value = '' self.textlabel = Label() self.textlabel.Parent = self self.textlabel.Text = param[0] + ' :' self.textlabel.Location = Point(0, 0) self.textlabel.Size = Size(Fconfig.lblwidth, Fconfig.unitline * 2) self.textlabel.TextAlign = ContentAlignment.MiddleLeft self.textbox = TextBox() self.textbox.Parent = self self.textbox.Text = Fconfig.defdate self.textbox.Location = Point(0, Fconfig.unitline * 2) self.textbox.Width = Fconfig.lblwidth - Fconfig.margin self.textbox.TextAlign = HorizontalAlignment.Center self.textbox.TextChanged += self.onInput self.calend = MonthCalendar() self.calend.Parent = self self.calend.Location = Point(Fconfig.lblwidth + 5, 0) self.calend.MaxSelectionCount = 1 self.calend.DateChanged += self.onSelect tooltips.SetToolTip(self.calend, Types.types(param[1], 'tooltip')) ModeDBG.say('panel {0}, top {1}, height :{2}'.format( param[1], self.Top, self.Height))
def __init__(self, funct, *signature): ''' funct : reference to function (use __doc__ to give details or overide infomain.Text after creation) signature : optional, given with array ['str','str'] title, type ''' self.infunction = funct self.signature = list(signature) self.parameters = [] self.Text = Fconfig.formtitle self.Font = Font(Fconfig.basefont, Fconfig.sizefont) #SystemFonts.DialogFont self.infomain = Label() self.infomain.Parent = self self.infomain.Text = funct.__doc__ self.infomain.Location = Point(Fconfig.margin, Fconfig.margin) self.infomain.Size = Size(Fconfig.smwidth, Fconfig.unitline) self.panel = Panel() self.panel.Parent = self self.panel.Location = Point(0, self.infomain.Bottom) self.panel.AutoSize = True self.panelparams = [] ref = 0 for i, param in enumerate(self.signature): p = Types.types(param[1], 'panel')(param) p.Parent = self.panel p.Location = Point(Fconfig.margin, ref) p.Width = Fconfig.smwidth self.panelparams.append(p) ref += p.Height
def setupCheckButtons(self): self.checkPanel = self.newPanel(0,0) self.checkLabel = Label() self.checkLabel.Text = "Choose the ROI(s) that represents GTV68" self.checkLabel.Location = Point(25, 25) self.checkLabel.AutoSize = True self.checkBoxList = [CheckBox() for i in range(0, len(self.roi_names))] checkBoxJumper = [i*4 for i in range(1, int(ceil(len(self.roi_names)/4.)))] xcounter = 0 ycounter = 1 for i in range(0, len(self.roi_names)): for j in checkBoxJumper: if i == j: xcounter = 0 ycounter += 1 self.checkBoxList[i].Text = self.roi_names[i] self.checkBoxList[i].Location = Point(xcounter*160 + 25, 55*ycounter) xcounter += 1 self.checkBoxList[i].Width = 150 self.checkPanel.Controls.Add(self.checkBoxList[i]) self.checkPanel.Controls.Add(self.checkLabel)
def panel(self, x, y): self.panel = Panel() self.panel.Width = width - 15 self.panel.Height = 800 self.panel.Location = Point(x, y) self.panel.BorderStyle = BorderStyle.Fixed3D self.panel.BackColor = Color.White self.panel.AutoScroll = True j = 35 for i in total_point_list: for x in i: self.label = Label() if (len(x)) > 1: if x[1] is not None: self.label.Text = str(x[0]) + " " + str(x[1]) self.label.Location = Point(35, j) self.label.Width = 400 self.label.Font = Font("Calibri Light", 12) self.panel.Controls.Add(self.label) j += 25 return self.panel
def __init__(self): self.Text = "SolverStudio" self.FormBorderStyle = FormBorderStyle.FixedDialog self.Height = 150 self.Width = 400 self.label1 = Label() self.label1.Text = "Pyomo is not installed by default in SolverStudio. You should install it yourself from the link below.\n\nBe sure to add the location of 'pyomo.exe' (usually '\\PythonXY\\Scripts') to the system path environment variable." self.label1.Location = Point(10, 10) self.label1.Height = 75 self.label1.Width = 380 self.myOK = Button() self.myOK.Text = "OK" self.myOK.Location = Point(310, 90) self.myOK.Click += self.CloseForm self.link1 = LinkLabel() self.link1.Location = Point(10, 95) self.link1.Width = 380 self.link1.Height = 20 self.link1.LinkClicked += VisitPYOMODownloadPage self.link1.VisitedLinkColor = Color.Blue self.link1.LinkBehavior = LinkBehavior.HoverUnderline self.link1.LinkColor = Color.Navy self.link1.Text = 'http://www.pyomo.org/installation/' self.link1.LinkArea = LinkArea(0, 49) self.AcceptButton = self.myOK self.Controls.Add(self.myOK) self.Controls.Add(self.link1) self.Controls.Add(self.label1) self.CenterToScreen()
def __init__(self, posx, posy, hight, width, title, curvlaue, values, name): # print( width ,"^^^^^^^^^^^^^^^") self._Padding = 3 super(ComboCtrlview, self).__init__(self) self._Values = values self.Notify = None self.curvalue = "" self.ctrlwidth = (width - self._Padding) / 2 self.Size = Size(width, hight) self.Location = Point(posx, posy) self.name = name self.Font = self.getFont() self.label = Label() self.label.Parent = self self.label.Text = title self.label.Font = self.Font self.label.Location = Point(0, 0) self.label.Size = Size(self.ctrlwidth, hight) self.label.TextAlign = ContentAlignment.MiddleRight self.cb = ComboBox() self.cb.Parent = self self.cb.Items.AddRange(self._Values) if len(curvlaue) > 0: self.cb.Text = curvlaue self.cb.Font = self.Font self.cb.ForeColor = Color.Blue self.cb.SelectedValueChanged += self.OnChanged self.cb.DropDown += self.TextUpdate self.cb.Location = Point(self.label.Right + self._Padding, 0) self.cb.Size = Size(self.ctrlwidth, hight)
def panel(self, x, y): self.panel = Panel() self.panel.Width = width - 15 self.panel.Height = 800 self.panel.Location = Point(x, y) self.panel.BorderStyle = BorderStyle.Fixed3D self.panel.BackColor = Color.White self.panel.AutoScroll = True j = 30 for i in sorted_list: self.checkbox = CheckBox() self.checkbox.Text = i[0] self.checkbox.Location = Point(35, j) self.checkbox.Font = Font("Calibri Light", 10) self.checkbox_description = Label() self.checkbox_description.Text = i[1] self.checkbox_description.Location = Point(150, j + 2) self.checkbox_description.Width = 500 self.checkbox_description.Font = Font("Calibri Light", 10) self.panel.Controls.Add(self.checkbox) self.panel.Controls.Add(self.checkbox_description) self.check_value.append(self.checkbox) j += 25 return self.panel
def __init__(self): """ProgressBarSample class init function.""" # setup title self.Text = "ProgressBar control" self.Width = 260 self.Height = 100 # setup label self.label = Label() self.label.Text = "It is %d percent of 100%%" % 0 self.label.Width = 150 self.label.Location = Point(0, 0) # setup button self.button = Button() self.button.Text = "Click" self.button.Location = Point(170, 0) self.button.Click += self.start_progress # setup progressbar self.progressbar = ProgressBar() self.progressbar.Width = 250 self.progressbar.Visible = True self.progressbar.Minimum = 0 self.progressbar.Maximum = 100 self.progressbar.Value = 0 self.progressbar.Step = 20 self.progressbar.Location = Point(0, 50) # add controls self.Controls.Add(self.label) self.Controls.Add(self.button) self.Controls.Add(self.progressbar)
def __init__(self, posx, posy, hight, width, title, curvlaue, name): super(金额Entry, self).__init__(self) self.格式说明 = "数值,或者类似 5吨*3元每吨*付款比例30%-扣减金额1000" # self.Font= Font("楷体_GB2312", 24); self.Notify = None self.curvalue = self.格式说明 self.ctrlwidth = width / 2 self.Location = Point(posx, posy) self.Size = Size(width, hight) self.title = title self.name = name # fontsize = self.ClientSize.Height*7/10 # print(self.ClientSize.Height ,self.Size.Height ) self.Font = self.getFont() self.label = Label() self.label.Location = Point(0, 0) self.label.Size = Size(self.ctrlwidth, hight) self.label.Parent = self self.label.Text = title self.label.Font = self.Font self.label.TextAlign = ContentAlignment.MiddleRight self.cb = TextBox() self.cb.Parent = self self.cb.Location = Point(self.ctrlwidth, 0) self.cb.Size = Size(self.ctrlwidth, hight) self.cb.Text = self.curvalue self.cb.Font = self.Font self.cb.ForeColor = Color.Blue self.cb.TextChanged += self.OnChanged
def __init__(self, posx, posy, hight, width, title, curvlaue, name): super(generalEntry, self).__init__(self) self.格式说明 = "不能为空" self.Notify = None self.curvalue = self.格式说明 # self.Width = width self.ctrlwidth = width / 2 # self.Height =hight self.Size = Size(width, hight) self.Location = Point(posx, posy) self.title = title self.name = name self.Font = self.getFont() self.label = Label() self.label.Location = Point(0, 0) self.label.Size = Size(self.ctrlwidth, hight) self.label.Parent = self self.label.Text = title self.label.Font = self.Font self.label.TextAlign = ContentAlignment.MiddleRight self.cb = TextBox() self.cb.Parent = self self.cb.Location = Point(self.ctrlwidth, 0) self.cb.Size = Size(self.ctrlwidth, hight) self.cb.Text = self.curvalue self.cb.Font = self.Font self.cb.ForeColor = Color.Blue self.cb.TextChanged += self.OnChanged
def __init__(self): self.Text = "SolverStudio" self.FormBorderStyle = FormBorderStyle.FixedDialog self.Height = 360 self.Width = 370 self.label = Label() self.label.Text = "" self.label.Location = Point(10, 10) self.label.Height = 20 self.label.Width = 200 self.bOK = Button() self.bOK.Text = "OK" self.bOK.Location = Point(150, 300) self.bOK.Click += self.OK self.Results = TextBox() self.Results.Multiline = True self.Results.ScrollBars = ScrollBars.Vertical self.Results.Location = Point(10, 40) self.Results.Width = 350 self.Results.Height = 250 self.AcceptButton = self.bOK self.Controls.Add(self.label) self.Controls.Add(self.bOK) self.Controls.Add(self.Results) self.CenterToScreen()
def setupOKButtons(self): self.OKbuttonPanel = self.newPanel(0, 600) okButton = Button() okButton.Text = "OK" okButton.Location = Point(25, 50) self.AcceptButton = okButton okButton.Click += self.okClicked cancelButton = Button() cancelButton.Text = "Cancel" cancelButton.Location = Point(okButton.Left + okButton.Width + 10, okButton.Top) self.CancelButton = cancelButton cancelButton.Click += self.cancelClicked self.Status = Label() self.Status.Text = "" self.Status.Location = Point(200, 50) self.Status.AutoSize = True self.Status.Font = Font("Arial", 12, FontStyle.Bold) self.Status.ForeColor = Color.Black self.OKbuttonPanel.Controls.Add(okButton) self.OKbuttonPanel.Controls.Add(cancelButton) self.OKbuttonPanel.Controls.Add(self.Status) for CT in patient.Examinations: self.scancombo.Items.Add(CT.Name) try: self.scancombo.SelectedIndex = self.scancombo.FindStringExact( "CT 1") except: self.scancombo.SelectedIndex = 0
def __init__(self): """ComboBoxSample class init function.""" # setup title self.Text = "ComboBox control" self.Height = 400 # setup label self.label = Label() self.label.Text = "You select " self.label.AutoSize = True self.label.Dock = DockStyle.Top # setup combobox self.combobox = ComboBox() self.combobox.Dock = DockStyle.Top self.combobox.SelectionChangeCommitted += self.select self.combobox.DropDownStyle = ComboBoxStyle.Simple self.combobox.SelectedIndexChanged += self.select self.combobox.Height = 300 # add items in ComboBox for i in range(10): self.combobox.Items.Add(str(i)) # add controls self.Controls.Add(self.combobox) self.Controls.Add(self.label)
def __init__(self): """ComboBoxSample class init function.""" # setup title self.Text = "ComboBox Style Changes" self.Width = 400 self.Height = 500 self.is_x10 = False # setup buttons self.dropdownlistbutton = Button() self.dropdownlistbutton.Text = "DropDownList" self.dropdownlistbutton.Width = 110 self.dropdownlistbutton.Location = Point(5, 5) self.dropdownlistbutton.Click += self.change_to_dropdownlist self.dropdownbutton = Button() self.dropdownbutton.Text = "DropDown" self.dropdownbutton.Width = 110 self.dropdownbutton.Location = Point(135, 5) self.dropdownbutton.Click += self.change_to_dropdown self.dropdownbutton.BackColor = Color.Lime self.simplebutton = Button() self.simplebutton.Text = "Simple" self.simplebutton.Width = 110 self.simplebutton.Location = Point(265, 5) self.simplebutton.Click += self.change_to_simple self.xtenbutton = Button() self.xtenbutton.Text = "Toggle x10" self.xtenbutton.Width = 110 self.xtenbutton.Location = Point(5, 55) self.xtenbutton.Click += self.toggle_x10 # setup label self.label = Label() self.label.Text = "You select " self.label.Location = Point(5, 100) # setup combobox self.combobox = ComboBox() self.combobox.DropDownStyle = ComboBoxStyle.DropDown self.combobox.SelectionChangeCommitted += self.select self.combobox.TextChanged += self.select self.combobox.Width = 390 self.combobox.Location = Point(0, 130) # add items in ComboBox for i in range(10): self.combobox.Items.Add(str(i)) self.combobox.SelectedIndex = 1 # add controls self.Controls.Add(self.combobox) self.Controls.Add(self.label) self.Controls.Add(self.dropdownlistbutton) self.Controls.Add(self.dropdownbutton) self.Controls.Add(self.simplebutton) self.Controls.Add(self.xtenbutton)
def setupPanel1(self): self.panel1 = Panel() self.panel1.Width = self.Width self.panel1.Height = 120 self.panel1.Location = Point(0, 0) self.panel1.BorderStyle = BorderStyle.FixedSingle self.title1 = Label() self.title1.Text = "ReAssign Terminal" self.title1.Location = Point(25, 22) self.title1.Height = 25 self.title1.AutoSize = True self.label2 = Label() self.label2.Text = "Ground Metal Name: " self.label2.Location = Point(25, 50) self.label2.Height = 25 self.label2.Width = 150 self.button1 = Button() self.button1.Text = 'Assign' self.button1.Location = Point(25, 75) self.button1.Width = 100 self.button1.Click += self.update self.button2 = Button() self.button2.Text = 'Reset' self.button2.Location = Point(180, 75) self.button2.Width = 100 self.button2.Click += self.reset self.list1 = ComboBox() self.list1.Text = '——Select' self.list1.Location = Point(180, 47) self.list1.Width = 100 self.list1.Height = 35 self.DropDownHeight = 50 self.list1.Click += self.listUpdate self.AcceptButton = self.button1 self.CancelButton = self.button2 self.panel1.Controls.Add(self.label2) self.panel1.Controls.Add(self.title1) self.panel1.Controls.Add(self.button1) self.panel1.Controls.Add(self.button2) self.panel1.Controls.Add(self.list1)
def add_param_label(text, panel): # add param label label = Label() label.Parent = panel label.Text = text label.AutoSize = True label.Font = BODY_FONT label.Margin = Padding(0, 5, 0, 0) label.Width = panel.Width
def DublicateDelays(form): offset = 18; #remove placeholder controls form.tabPageDelay.Controls.Remove(form.textBoxDelay); form.tabPageDelay.Controls.Remove(form.labelDelayName); for i in range(0,16): tb = TextBox(); #form.DublicateControl(tb, form.textBoxDelay, i, offset); DublicateControl(tb, form.textBoxDelay, i, offset); form.tabPageDelay.Controls.Add(tb); form.delayBoxes[i] = tb; lb = Label(); #form.DublicateControl(lb, form.labelDelayName, i, offset); DublicateControl(lb, form.labelDelayName, i, offset); lb.Text = form.nameBoxes[i].Text; form.tabPageDelay.Controls.Add(lb); form.delayLabels[i] = lb;
def __init__(self, imagePath): Form.__init__(self) self.Width = 346 self.Height = 215 self.images = dict((name, loadImage(imagePath, name + '.jpg')) for name in ('pycon', 'andrzej', 'michael', 'christian')) self.pictureBox = PictureBox() self.pictureBox.Parent = self self.pictureBox.Location = Point(234, 12) self.pictureBox.TabStop = False self.switchImage("pycon") self.mainText = Label() self.mainText.Parent = self self.mainText.AutoSize = True self.mainText.Location = Point(12, 12); self.mainText.Text = ("Tabbed Image Viewer\r\n\r\nWritten for PyCon 2007\r\n" "Using IronPython and Windows Forms\r\n\r\nBy:") self.addNameLabel("Andrzej Krzywda", "andrzej", Point(36, 90)) self.addNameLabel("Christian Muirhead", "christian", Point(36, 105)) self.addNameLabel("Michael Foord", "michael", Point(36, 120)) versionLabel = Label() versionLabel.Parent = self versionLabel.AutoSize = True versionLabel.Location = Point(12, 151) versionLabel.Text = "Version: " + __revision__ self.okButton = Button() self.okButton.Parent = self self.okButton.Text = "OK" self.okButton.Location = Point(251, 146) self.okButton.Click += self.onOK self.AcceptButton = self.okButton self.Text = "About" self.FormBorderStyle = FormBorderStyle.FixedDialog self.MinimizeBox = False self.MaximizeBox = False
def __build_label(self, series_ref): """ builds and returns the main text label for this form """ # 1. compute the best possible full name for the given SeriesRef name_s = series_ref.series_name_s publisher_s = series_ref.publisher_s vol_year_n = series_ref.volume_year_n vol_year_s = sstr(vol_year_n) if vol_year_n > 0 else "" fullname_s = "" if name_s: if publisher_s: if vol_year_s: fullname_s = "'" + name_s + "' (" + publisher_s + ", " + vol_year_s + ")" else: fullname_s = "'" + name_s + "' (" + publisher_s + ")" else: fullname_s = "'" + name_s + "'" label = Label() label.UseMnemonic = False sep = " " if len(fullname_s) > 40 else "\n" label.Text = i18n.get("IssueFormChooseText").format(fullname_s, sep) if self.__config.show_covers_b: label.Location = Point(218, 20) label.Size = Size(480, 40) else: label.Location = Point(10, 20) label.Size = Size(680, 40) return label
def __build_label(self): ''' Builds and returns the label for this form. ''' label = Label() label.UseMnemonic = False label.Text = '' # updated everytime we start scraping a new comic label.Location = Point(13, 45) label.Size = Size(320, 15) label.Anchor = AnchorStyles.Top | AnchorStyles.Left |AnchorStyles.Right label.AutoSize = False return label
def __init__(self): self.Text = "Hello World" self.FormBorderStyle = FormBorderStyle.Fixed3D self.Height = 150 newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic) label = Label() label.AutoSize = True label.Text = "My Hello World Label" label.Location = Point(10, 50) label.BackColor = Color.Aquamarine label.ForeColor = Color.DarkMagenta label.Font = newFont self.Controls.Add(label)
def __build_fail_label(self, failed_search_s): ''' builds and returns the 'search failed' text label for this form. if there is no failed search terms, this returns None. ''' label = Label() label.UseMnemonic = False label.Location = Point(10, 10) label.Size = Size(415, 100) label.Visible = self.__fail_label_is_visible if self.__fail_label_is_visible: label.Text = i18n.get("SeriesSearchFailedText").format(failed_search_s) return label
def __build_skip_label(self, skipped_n): ''' Builds and returns the 'number skipped' Label for this form. 'skipped_n' -> the number of books that were skipped. ''' label = Label() label.UseMnemonic = False label.Location = Point(10, 30) label.Size = Size(280, 13) label.TextAlign = ContentAlignment.MiddleCenter label.Text = i18n.get("FinishFormSkippedSingle") if skipped_n==1 else \ i18n.get("FinishFormSkippedPlural").format(skipped_n) return label
def __init__(self): self.Text = "You know I'm No Good" font = Font("Serif", 10) lyrics = Label() lyrics.Parent = self lyrics.Text = text lyrics.Font = font lyrics.Location = Point(10, 10) lyrics.Size = Size(390, 390) self.Size = Size(400,400) self.CenterToScreen()
def __build_comicvinetab(self): ''' builds and returns the "ComicVine" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormComicVineTab") tabpage.Name = "comicvine" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = False label.Location = Point(34, 80) label.Size = Size(315, 54) label.Text = i18n.get("ConfigFormComicVineText") # 2. --- the API key text box fired_update_gui = self.__fired_update_gui class ApiKeyTextBox(TextBox): def OnTextChanged(self, args): fired_update_gui() self.__api_key_tbox = ApiKeyTextBox() tbox = self.__api_key_tbox tbox.Location = Point(34, 135) tbox.Size = Size(315, 1) menu = ContextMenu() items = menu.MenuItems items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) ) items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) ) items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) ) tbox.ContextMenu = menu # 3. --- add a clickable link to send the user to ComicVine linklabel = LinkLabel() linklabel.UseMnemonic = False linklabel.AutoSize = False linklabel.Location = Point(34, 170) linklabel.Size = Size(315, 34) linklabel.Text = i18n.get("ConfigFormComicVineClickHere") linklabel.LinkClicked += self.__fired_linkclicked # 4. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(tbox) tabpage.Controls.Add(linklabel) return tabpage
def __build_label(self, books): ''' Builds and returns the Label for this form. 'books' -> a list of all the comic books being scraped. ''' plural = len(books) != 1 label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(9, 10) label.Size = Size(319, 13) label.Text = i18n.get("WelcomeFormTextPlural").format(len(books)) \ if plural else i18n.get("WelcomeFormTextSingle") return label
def __build_label(self, search_terms_s, num_matches_n): ''' Builds and return the text label for this form. 'search_terms_s' -> user's search string that was used to find series 'num_matches_n' -> number of series (table rows) the user's search matched ''' label = Label() label.UseMnemonic = False label.Location = Point(10, 20) label.Size = Size(480, 40) if num_matches_n > 1: label.Text = i18n.get("SeriesFormChooseText")\ .format(search_terms_s, num_matches_n ) else: label.Text = i18n.get("SeriesFormConfirmText").format(search_terms_s) return label
def __build_advancedtab(self): ''' builds and returns the "Advanced" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormAdvancedTab") # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(14, 25) label.Size = Size(299, 17) label.Text = i18n.get("ConfigFormAdvancedText") # 2. --- build the update checklist (contains all the 'data' checkboxes) tbox = RichTextBox() tbox.Multiline=True tbox.MaxLength=65536 tbox.WordWrap = True tbox.Location = Point(15, 50) tbox.Size = Size(355, 200) menu = ContextMenu() items = menu.MenuItems items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) ) items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) ) items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) ) tbox.ContextMenu = menu self.__advanced_tbox = tbox # 3. --- add 'em all to the tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(self.__advanced_tbox) return tabpage
import clr clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') from System.Windows.Forms import ( Application, Form, FormBorderStyle, Label ) from System.Drawing import ( Color, Font, FontStyle, Point ) form = Form() form.Text = "Hello World" form.FormBorderStyle = FormBorderStyle.Fixed3D form.Height = 150 newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic) label = Label() label.AutoSize = True label.Text = "My Hello World Label" label.Font = newFont label.BackColor = Color.Aquamarine label.ForeColor = Color.DarkMagenta label.Location = Point(10, 50) form.Controls.Add(label) Application.Run(form)
def __build_detailstab(self): ''' builds and returns the "Details" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormDetailsTab") tabpage.Name = "details" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(14, 35) label.Size = Size(299, 17) label.Text = i18n.get("ConfigFormDetailsText") # 2. --- the 'select all' button checkall_button = Button() checkall_button.Click += self.__fired_checkall checkall_button.Location = Point(280, 107) checkall_button.Size = Size(100, 23) checkall_button.Text = i18n.get("ConfigFormDetailsAll") # 3. --- the 'deselect all' button uncheckall_button = Button() uncheckall_button.Click += self.__fired_uncheckall uncheckall_button.Location = Point(280, 138) uncheckall_button.Size = Size(100, 23) uncheckall_button.Text = i18n.get("ConfigFormDetailsNone") # 4. --- build the update checklist (contains all the 'data' checkboxes) self.__update_checklist = CheckedListBox() self.__update_checklist.CheckOnClick = True self.__update_checklist.ColumnWidth = 125 self.__update_checklist.ThreeDCheckBoxes = True self.__update_checklist.Location = Point(15, 65) self.__update_checklist.MultiColumn = True self.__update_checklist.SelectionMode = SelectionMode.One self.__update_checklist.Size = Size(260, 170) self.__update_checklist.ItemCheck += self.__fired_update_gui self.__update_checklist.Items.Add(ConfigForm.__SERIES_CB) self.__update_checklist.Items.Add(ConfigForm.__VOLUME_CB) self.__update_checklist.Items.Add(ConfigForm.__NUMBER_CB) self.__update_checklist.Items.Add(ConfigForm.__TITLE_CB) self.__update_checklist.Items.Add(ConfigForm.__PUBLISHED_CB) self.__update_checklist.Items.Add(ConfigForm.__RELEASED_CB) self.__update_checklist.Items.Add(ConfigForm.__CROSSOVERS_CB) self.__update_checklist.Items.Add(ConfigForm.__PUBLISHER_CB) self.__update_checklist.Items.Add(ConfigForm.__IMPRINT_CB) self.__update_checklist.Items.Add(ConfigForm.__WRITER_CB) self.__update_checklist.Items.Add(ConfigForm.__PENCILLER_CB) self.__update_checklist.Items.Add(ConfigForm.__INKER_CB) self.__update_checklist.Items.Add(ConfigForm.__COLORIST_CB) self.__update_checklist.Items.Add(ConfigForm.__LETTERER_CB) self.__update_checklist.Items.Add(ConfigForm.__COVER_ARTIST_CB) self.__update_checklist.Items.Add(ConfigForm.__EDITOR_CB) self.__update_checklist.Items.Add(ConfigForm.__SUMMARY_CB) self.__update_checklist.Items.Add(ConfigForm.__CHARACTERS_CB) self.__update_checklist.Items.Add(ConfigForm.__TEAMS_CB) self.__update_checklist.Items.Add(ConfigForm.__LOCATIONS_CB) self.__update_checklist.Items.Add(ConfigForm.__WEBPAGE_CB) # 5. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(checkall_button) tabpage.Controls.Add(uncheckall_button) tabpage.Controls.Add(self.__update_checklist) return tabpage
def __build_behaviourtab(self): ''' builds and returns the "Behaviour" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormBehaviourTab") # 1. --- build the 'When scraping for the first time' label first_scrape_label = Label() first_scrape_label.AutoSize = False first_scrape_label.FlatStyle = FlatStyle.System first_scrape_label.Location = Point(52, 27) first_scrape_label.Text = i18n.get("ConfigFormFirstScrapeLabel") first_scrape_label.Size = Size(300, 17) # 1. --- build the 'autochoose series' checkbox self.__autochoose_series_cb = CheckBox() self.__autochoose_series_cb.AutoSize = False self.__autochoose_series_cb.FlatStyle = FlatStyle.System self.__autochoose_series_cb.Location = Point(82, 45) self.__autochoose_series_cb.Size = Size(300, 34) self.__autochoose_series_cb.Text =i18n.get("ConfigFormAutochooseSeriesCB") self.__autochoose_series_cb.CheckedChanged += self.__fired_update_gui # 2. --- build the 'confirm issue' checkbox self.__confirm_issue_cb = CheckBox() self.__confirm_issue_cb.AutoSize = False self.__confirm_issue_cb.FlatStyle = FlatStyle.System self.__confirm_issue_cb.Location = Point(82, 75) self.__confirm_issue_cb.Size = Size(300, 34) self.__confirm_issue_cb.Text = i18n.get("ConfigFormConfirmIssueCB") self.__confirm_issue_cb.CheckedChanged += self.__fired_update_gui # 3. -- build the 'use fast rescrape' checkbox self.__fast_rescrape_cb = CheckBox() self.__fast_rescrape_cb.AutoSize = False self.__fast_rescrape_cb.FlatStyle = FlatStyle.System self.__fast_rescrape_cb.Location = Point(52, 116) self.__fast_rescrape_cb.Size = Size(300, 34) self.__fast_rescrape_cb.Text = i18n.get("ConfigFormRescrapeCB") self.__fast_rescrape_cb.CheckedChanged += self.__fired_update_gui # 4. -- build the 'add rescrape hints to notes' checkbox self.__rescrape_notes_cb = CheckBox() self.__rescrape_notes_cb.AutoSize = False self.__rescrape_notes_cb.FlatStyle = FlatStyle.System self.__rescrape_notes_cb.Location = Point(82, 151) self.__rescrape_notes_cb.Size = Size(270, 17) self.__rescrape_notes_cb.Text = i18n.get("ConfigFormRescrapeNotesCB") self.__rescrape_notes_cb.CheckedChanged += self.__fired_update_gui # 5. -- build the 'add rescrape hints to tags' checkbox self.__rescrape_tags_cb = CheckBox() self.__rescrape_tags_cb.AutoSize = False self.__rescrape_tags_cb.FlatStyle = FlatStyle.System self.__rescrape_tags_cb.Location = Point(82, 181) self.__rescrape_tags_cb.Size = Size(270, 17) self.__rescrape_tags_cb.Text = i18n.get("ConfigFormRescrapeTagsCB") self.__rescrape_tags_cb.CheckedChanged += self.__fired_update_gui # 6. --- build the 'specify series name' checkbox self.__summary_dialog_cb = CheckBox() self.__summary_dialog_cb.AutoSize = False self.__summary_dialog_cb.FlatStyle = FlatStyle.System self.__summary_dialog_cb.Location = Point(52, 214) self.__summary_dialog_cb.Size = Size(300, 34) self.__summary_dialog_cb.Text = i18n.get("ConfigFormShowSummaryCB") self.__summary_dialog_cb.CheckedChanged += self.__fired_update_gui # 7. --- add 'em all to the tabpage tabpage.Controls.Add(first_scrape_label) tabpage.Controls.Add(self.__autochoose_series_cb) tabpage.Controls.Add(self.__confirm_issue_cb) tabpage.Controls.Add(self.__fast_rescrape_cb) tabpage.Controls.Add(self.__rescrape_tags_cb) tabpage.Controls.Add(self.__rescrape_notes_cb) tabpage.Controls.Add(self.__summary_dialog_cb) return tabpage
def __init__(self): self.patient = patient self.Text = 'My Form' #title of the new format self.AutoSize = True labelX1 = Label() labelX2 = Label() labelX1.Text = 'What is' labelX2.Text = 'this?' labelX1.Location = Point(15,28) labelX2.Location = Point(120,28) labelX1.Width = 50 labelX2.Width = 50 labelX1.Height = 20 labelX2.Height = 40 self.Controls.Add(labelX1) self.Controls.Add(labelX2) # create a textbox property of the form self.textbox1 = TextBox() self.textbox1.Location = Point(50,200) self.textbox1.Width = 120 self.textbox1.Height = 50 self.Controls.Add(self.textbox1) # implement an interaction button self.button1 = Button() self.button1.Text = "Auto-fill current patient name" self.button1.Location = Point(50, 120) self.button1.Width = 150 self.button1.Height = 45 self.Controls.Add(self.button1) self.button1.Click += self.button1_clicked # add checklist question self.question1 = Label() self.question1.Text = "Which actions have you finished so far?" self.question1.Location = Point(15,280) self.question1.AutoSize = True self.Controls.Add(self.question1) # first checkbox self.check1 = CheckBox() self.check1.Text = "Patient modelling" self.check1.Location = Point(20,310) self.check1.AutoSize = True self.check1.Checked = False self.Controls.Add(self.check1) self.check1.CheckedChanged += self.checkedChanged # second checkbox self.check2 = CheckBox() self.check2.Text = "Plan design" self.check2.Location = Point(20,340) self.check2.AutoSize = True self.check2.Checked = False self.Controls.Add(self.check2) self.check2.CheckedChanged += self.checkedChanged # add checklist response message self.response1 = Label() self.response1.Text = "-" self.response1.Location = Point(160,340) self.response1.AutoSize = True self.Controls.Add(self.response1) # generate combobox self.question2 = Label() self.question2.Text = "Select an ROI" self.question2.Location = Point(320,310) self.question2.AutoSize = True self.Controls.Add(self.question2) rois = [r.Name for r in patient.PatientModel.RegionsOfInterest] self.combobox = ComboBox() self.combobox.Location = Point(320,340) self.combobox.DataSource = rois self.Controls.Add(self.combobox) self.combobox.SelectionChangeCommitted += self.comboSelection # generate combobox response self.response2 = Label() self.response2.Text = "" self.response2.Location = Point(320,380) self.response2.AutoSize = True self.Controls.Add(self.response2)