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.Text = 'Buttons' self.Size = Size(WIDTH, HEIGHT) ok = Button() PANEL_HEIGHT = ok.Height + PANEL_SPACE panel = Panel() panel.Height = PANEL_HEIGHT panel.Dock = DockStyle.Bottom panel.Parent = self x = ok.Width * 2 + BUTTONS_SPACE y = (PANEL_HEIGHT - ok.Height) / 2 ok.Text = "Ok" ok.Parent = panel ok.Location = Point(WIDTH-x, y) ok.Anchor = AnchorStyles.Right close = Button() x = close.Width close.Text = "Close" close.Parent = panel close.Location = Point(WIDTH-x-CLOSE_SPACE, y) close.Anchor = AnchorStyles.Right self.CenterToScreen()
def __init__(self, itemlist): height = len(itemlist)*17 self.Text = "Select the categories to export" self.Size = Size(300, height + 80) self.check = CheckedListBox() self.check.Parent = self self.check.Location = Point(5, 5) self.check.Size = Size(270, height) # load the list of relevant categories found in the project list_items = List[Object](itemlist) self.check.Items.AddRange(list_items.ToArray()) self.check.CheckOnClick = True # set checked by default for i in range(len(itemlist)): self.check.SetItemChecked(i , True) okay = Button() okay.Parent = self okay.Text = 'OK' okay.Location = Point(50, height+10) okay.Width = 140 okay.Click += self.onValidate cancel = Button() cancel.Parent = self cancel.Text = 'Cancel' cancel.Location = Point(okay.Right, height+10) cancel.Click += self.onCancel self.CenterToScreen()
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 __init__(self, itemlist): height = len(itemlist) * 17 self.Text = "Select the categories to export" self.Size = Size(300, height + 80) self.check = CheckedListBox() self.check.Parent = self self.check.Location = Point(5, 5) self.check.Size = Size(270, height) # load the list of relevant categories found in the project list_items = List[Object](itemlist) self.check.Items.AddRange(list_items.ToArray()) self.check.CheckOnClick = True # set checked by default for i in range(len(itemlist)): self.check.SetItemChecked(i, True) okay = Button() okay.Parent = self okay.Text = 'OK' okay.Location = Point(50, height + 10) okay.Width = 140 okay.Click += self.onValidate cancel = Button() cancel.Parent = self cancel.Text = 'Cancel' cancel.Location = Point(okay.Right, height + 10) cancel.Click += self.onCancel 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, plan): self.Text = "Choose the apropriate ROI" structure_set = plan.GetStructureSet() self.roi_names = sorted([rg.OfRoi.Name for rg in structure_set.RoiGeometries if rg.PrimaryShape != None]) self.roi_colors = [rg.OfRoi.Color for rg in structure_set.RoiGeometries if rg.PrimaryShape != None] self.Width = 160*4 + 50 self.Height = 55*int(ceil(len(self.roi_names)/4.)) + 150 print self.roi_colors self.setupCheckButtons() # Add button to press OK and close the Form button = Button() button.Text = "OK" button.AutoSize = True button.Location = Point(self.Width - 105, self.Height - 100) button.Click += self.ok_button_clicked # Add button to press Stop and close the Form button2 = Button() button2.Text = "Stop" button2.AutoSize = True button2.Location = Point(self.Width - 210, self.Height - 100) button2.Click += self.stop_button_clicked self.Controls.Add(button) self.Controls.Add(button2) self.Controls.Add(self.checkPanel)
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.Text = 'Directories' self.Size = Size(400, 400) self.tv = TreeView() self.SuspendLayout() self.tv.Parent = self self.tv.Location = Point(10,10) self.tv.Size = Size(self.ClientSize.Width - 20, self.Height - 200) self.tv.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right self.tv.FullRowSelect = False self.tv.ShowLines = True self.tv.ShowPlusMinus = True self.tv.Scrollable = True self.tv.AfterSelect += self.AfterSelect expand = Button() expand.Parent = self expand.Location = Point(20, self.tv.Bottom + 20) expand.Text = 'Expand' expand.Anchor = AnchorStyles.Left | AnchorStyles.Top expand.Click += self.OnExpand expandAll = Button() expandAll.Parent = self expandAll.Location = Point(20, expand.Bottom + 5) expandAll.Text = 'Expand All' expandAll.Anchor = AnchorStyles.Left | AnchorStyles.Top expandAll.Click += self.OnExpandAll collapse = Button() collapse.Parent = self collapse.Location = Point(expandAll.Right + 5, expand.Top) collapse.Text = 'Collapse' collapse.Anchor = AnchorStyles.Left | AnchorStyles.Top collapse.Click += self.OnCollapse collapseAll = Button() collapseAll.Parent = self collapseAll.Location = Point(collapse.Left, collapse.Bottom + 5) collapseAll.Text = 'Collapse All' collapseAll.Anchor = AnchorStyles.Left | AnchorStyles.Top collapseAll.Click += self.OnCollapseAll self.sb = StatusBar() self.sb.Parent = self self.ShowDirectories(self.tv.Nodes, HOME_DIR) self.ResumeLayout() self.CenterToScreen()
def showBox(self): ''' set the remaining box controls and launch ''' self.buttonpanel = Panel() self.buttonpanel.Parent = self self.buttonpanel.Location = Point(0, self.panel.Bottom) self.buttonpanel.Size = Size(Fconfig.smwidth, 2 * Fconfig.unitline) self.buttonpanel.Dock = DockStyle.Bottom self.warning = Label() self.warning.Parent = self.buttonpanel self.warning.Location = Point(Fconfig.margin, 0) self.warning.Size = Size(Fconfig.smwidth, Fconfig.unitline) self.warning.Font = Font(Fconfig.basefont, Fconfig.sizefont, FontStyle.Bold) self.warning.ForeColor = Color.Coral self.warning.TextAlign = ContentAlignment.MiddleCenter okay = Button() okay.Parent = self.buttonpanel okay.Text = Fconfig.buttonOK okay.Location = Point(50, Fconfig.unitline) okay.Width = 140 okay.Click += self.onValidate okay.Anchor = AnchorStyles.Right cancel = Button() cancel.Text = Fconfig.buttonCANCEL cancel.Parent = self.buttonpanel cancel.Location = Point(okay.Right, Fconfig.unitline) cancel.Click += self.onCancel cancel.Anchor = AnchorStyles.Right self.Width = Fconfig.width self.Height = self.panel.Bottom + 105 self.CenterToScreen() ModeDBG.say('\npanel top :{0}, bottom :{1}'.format( self.panel.Top, self.panel.Bottom)) ModeDBG.say('\n\nPanel loaded with {0} items\n'.format( len(self.panelparams))) # Display the form try: if Application.MessageLoop: TaskDialog.Show('UserForm', 'Another window is running...') else: Application.Run(self) except: TaskDialog.Show('UserForm', 'Loading failed...')
def showBox(self): ''' set the remaining box controls and launch ''' self.buttonpanel = Panel() self.buttonpanel.Parent = self self.buttonpanel.Location = Point(0,self.panel.Bottom) self.buttonpanel.Size = Size(Fconfig.smwidth, 2* Fconfig.unitline) self.buttonpanel.Dock = DockStyle.Bottom self.warning = Label() self.warning.Parent = self.buttonpanel self.warning.Location = Point(Fconfig.margin, 0) self.warning.Size = Size(Fconfig.smwidth, Fconfig.unitline) self.warning.Font = Font(Fconfig.basefont, Fconfig.sizefont, FontStyle.Bold) self.warning.ForeColor = Color.Coral self.warning.TextAlign = ContentAlignment.MiddleCenter okay = Button() okay.Parent = self.buttonpanel okay.Text = Fconfig.buttonOK okay.Location = Point(50, Fconfig.unitline) okay.Width = 140 okay.Click += self.onValidate okay.Anchor = AnchorStyles.Right cancel = Button() cancel.Text = Fconfig.buttonCANCEL cancel.Parent = self.buttonpanel cancel.Location = Point(okay.Right, Fconfig.unitline) cancel.Click += self.onCancel cancel.Anchor = AnchorStyles.Right self.Width = Fconfig.width self.Height = self.panel.Bottom + 105 self.CenterToScreen() ModeDBG.say('\npanel top :{0}, bottom :{1}'.format( self.panel.Top, self.panel.Bottom)) ModeDBG.say('\n\nPanel loaded with {0} items\n'.format( len(self.panelparams))) # Display the form try: if Application.MessageLoop: TaskDialog.Show('UserForm', 'Another window is running...') else: Application.Run(self) except: TaskDialog.Show('UserForm','Loading failed...')
def __init__(self): self.Text = 'Anchor' self.Size = Size(210, 210) btn1 = Button() btn1.Text = "Button" btn1.Parent = self btn1.Location = Point(30, 30) btn2 = Button() btn2.Text = "Button" btn2.Parent = self btn2.Location = Point(30, 80) btn2.Anchor = AnchorStyles.Right self.CenterToScreen()
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): 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, title, author): # Create the form self.Name = "Create Window" self.Text = title self.Size = Size(500, 150) self.CenterToScreen() self.value = "" # Create label for input title labelDiv = Label(Text=author + ":") labelDiv.Parent = self labelDiv.Size = Size(250, 250) labelDiv.Location = Point(30, 20) # Create TextBox for input self.textboxDiv = TextBox() self.textboxDiv.Parent = self self.textboxDiv.Text = "Date 1" self.textboxDiv.Size = Size(150, 150) self.textboxDiv.Location = Point(300, 20) # Create button button = Button() button.Parent = self button.Text = "Ok" button.Location = Point(300, 60) # Register event button.Click += self.ButtonClicked
def __init__(self, plan): # Set the size of the form self.Size = Size(500, 200) # Set title of the form self.Text = 'Approximate fiducial location' # Add a label label = Label() label.Text = 'Type the approximate fiducial location in mm' label.Location = Point(15, 15) label.AutoSize = True self.Controls.Add(label) # Add a TextBox self.textbox = TextBox() self.textbox.Location = Point(15, 60) self.textbox.Width = 150 self.Controls.Add(self.textbox) # Add button to press OK and close the form button = Button() button.Text = 'OK' button.AutoSize = True button.Location = Point(15, 100) button.Click += self.ok_button_clicked self.Controls.Add(button)
def __init__(self): self.Text = "Spreadsheet to HTML" self.Width = 220 self.Height = 90 self.FormBorderStyle = FormBorderStyle.Fixed3D self.openDialog = OpenFileDialog() self.openDialog.Title = "Choose a Python Spreadsheet File" self.openDialog.Filter = 'Python files (*.py)|*.py|All files (*.*)|*.*' self.folderDialog = FolderBrowserDialog() self.folderDialog.ShowNewFolderButton = True self.folderDialog.Description = "Choose a directory to save the HTML files in." l = Label() l.AutoSize = True l.Location = Point(50, 5) l.Text = "Choose a Spreadsheet" b = Button(Text="Choose") b.Click += self.convert b.Location = Point(70, 30) self.Controls.Add(l) self.Controls.Add(b)
def __init__(self): self.Text = 'Hello World' button = Button() button.Text = "Click Me" button.Location = Point(50, 100) button.Click += self.buttonPress self.Controls.Add(button)
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 makeMournButton(text, width, height, location, click): button = Button() button.Text = text button.Width = width button.Height = height button.Location = location button.Click += click 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_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_restore_button(self): ''' builds and returns the restore button for this form ''' button = Button() button.Click += self.__fired_restore_defaults button.Location = Point(10, 343) button.Size = Size(170, 23) button.Text = i18n.get("ConfigFormRestore") return button
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 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_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_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_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_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 setupOKButtons(self): self.OKbuttonPanel = self.miniPanel(0, 900) printButton = Button() printButton.Text = "Imprimer" printButton.Location = Point(25, 28) #self.AcceptButton = okButton printButton.Click += self.printClicked #cancelButton = Button() #cancelButton.Text = "Annuler" #cancelButton.Location = Point(110,10) #self.CancelButton = cancelButton #cancelButton.Click += self.cancelClicked levelwindowButton = Button() levelwindowButton.Text = "Level/Window" levelwindowButton.Location = Point(108, 28) levelwindowButton.Width = 85 levelwindowButton.Click += self.levelwindowClicked referencedoseButton = Button() referencedoseButton.Text = "Toggle Reference Dose" referencedoseButton.Location = Point(200, 28) referencedoseButton.Width = 140 referencedoseButton.Click += self.referencedoseClicked nbfxButton = Button() nbfxButton.Text = "Nb. de fx" nbfxButton.Location = Point(345, 28) nbfxButton.Width = 70 nbfxButton.Click += self.nbfxClicked self.message = Label() self.message.Text = "" self.message.Location = Point(30, 0) self.message.Font = Font("Arial", 11, FontStyle.Bold) self.message.AutoSize = True self.OKbuttonPanel.Controls.Add(printButton) self.OKbuttonPanel.Controls.Add(levelwindowButton) self.OKbuttonPanel.Controls.Add(referencedoseButton) self.OKbuttonPanel.Controls.Add(nbfxButton) self.OKbuttonPanel.Controls.Add(self.message)
def setupOKButtons(self): self.OKbuttonPanel = self.miniPanel(0, 950) printButton = Button() printButton.Text = "Imprimer" printButton.Location = Point(25, 28) #self.AcceptButton = okButton printButton.Click += self.printClicked #cancelButton = Button() #cancelButton.Text = "Annuler" #cancelButton.Location = Point(110,10) #self.CancelButton = cancelButton #cancelButton.Click += self.cancelClicked levelwindowButton = Button() levelwindowButton.Text = "Level/Window" levelwindowButton.Location = Point(25, 28) levelwindowButton.Width = 85 levelwindowButton.Click += self.levelwindowClicked referencedoseButton = Button() referencedoseButton.Text = "Toggle Reference Dose" referencedoseButton.Location = Point(117, 28) referencedoseButton.Width = 140 referencedoseButton.Click += self.referencedoseClicked nbfxButton = Button() nbfxButton.Text = "Nb. de fx" nbfxButton.Location = Point(263, 28) nbfxButton.Width = 70 nbfxButton.Click += self.nbfxClicked self.message = Label() self.message.Text = "" self.message.Location = Point(30, 0) self.message.Font = Font("Arial", 11, FontStyle.Bold) self.message.AutoSize = True #Printing has been disabled for verif 1, simply add the printButton back if you want to reactivate it self.OKbuttonPanel.Controls.Add(nbfxButton) self.OKbuttonPanel.Controls.Add(levelwindowButton) self.OKbuttonPanel.Controls.Add(referencedoseButton) self.OKbuttonPanel.Controls.Add(self.message)
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_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_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_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 __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 setupOKButtons(self): self.OKbuttonPanel = self.miniPanel(0, 750) cancelButton = Button() cancelButton.Text = "Cancel" cancelButton.Location = Point(25,25) self.CancelButton = cancelButton cancelButton.Click += self.cancelClicked self.OKbuttonPanel.Controls.Add(cancelButton)
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_settingsbutton(self): ''' Builds and returns the settings button for this form. ''' button = Button() button.Click += self.__show_configform button.Location = Point(208, 68) button.Size = Size(100, 23) button.Text = i18n.get("WelcomeFormSettings") button.UseVisualStyleBackColor = True return button
def init_btn(self, x, y, text, handler): btn = Button() btn.Text = text btn.BackColor = Color.FromArgb(50, 50, 50) btn.Location = self.btn_pos(x, y) btn.Size = Size(60, 30) btn.FlatStyle = FlatStyle.Flat btn.FlatAppearance.BorderSize = 1 btn.Click += handler return btn
def __init__(self): self.Text = "Button" self.CenterToScreen() self.Size = Size(200, 150) btn = Button() btn.Parent = self btn.Text = "Quit" btn.Location = Point(50, 50) btn.Click += self.OnClick btn.MouseEnter += self.OnEnter
def __build_prevbutton(self): ''' Builds and returns the 'previous' button for this panel. ''' button = Button() button.Location = Point(2, 332) button.Size = Size(20, 24) button.Text = '<' button.Font = Font(button.Font, FontStyle.Bold) button.UseVisualStyleBackColor = True button.Click += self.__button_click_fired # note: this button's visibility is manipulated by __update return button
def __build_cancelbutton(self): ''' Builds and returns the cancel button for this form. ''' button = Button() button.Text="" # gets updated by the 'update' method def cancel(sender, args): button.Enabled = False self.Close() button.Click+=cancel button.Location = Point(78, 572) button.Size = Size(190, 23) button.Anchor = AnchorStyles.Bottom return button
def __init__(self): self.Text = 'Drag & Drop' button = Button() button.Parent = self button.Text = 'Button' button.MouseDown += self.OnMousDown button.MouseUp += self.OnMousUp button.MouseMove += self.OnMousMove button.Location = Point(20, 20) self.isDragging = False self.CenterToScreen()
def __init__(self): self.Text = "Tooltips" self.CenterToScreen() self.Size = Size(200, 150) tooltip = ToolTip() tooltip.SetToolTip(self, "This is a Form") button = Button() button.Parent = self button.Text = "Button" button.Location = Point(50, 70) tooltip.SetToolTip(button, "This is a Button")
def __init__(self): self.Text = 'Tooltips' self.CenterToScreen() xsize,ysize=300,200 self.Size = Size(xsize, ysize) tooltip = ToolTip() tooltip.SetToolTip(self, "This is a Form") button = Button() button.Parent = self button.Text = "Button" xloc,yloc=50,70 button.Location = Point(xloc,yloc) tooltip.SetToolTip(button, "This is a Button")
def __init__(self): self.Text = 'Drag & Drop' self.AllowDrop = True button = Button() button.Parent = self textBox = TextBox() textBox.Parent = self button.AllowDrop = True button.Location = Point(150, 50) button.DragDrop += self.OnDragDrop button.DragEnter += self.OnDragEnter textBox.Location = Point(15, 50) textBox.MouseDown += self.OnMousDown self.ClientSize = Size(250, 200) self.CenterToScreen()