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, 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 DublicateInputs(form): offset = 18; #remove placeholder controls from designers form.tabPageInputs.Controls.Remove(form.textBoxInputName); form.tabPageInputs.Controls.Remove(form.textBoxInputLevel); form.tabPageInputs.Controls.Remove(form.checkBoxInvers); form.tabPageInputs.Controls.Remove(form.buttonLed); for i in range(0,16): #channel name labels tb=TextBox(); #form.DublicateControl(tb, form.textBoxInputName, i, offset); DublicateControl(tb, form.textBoxInputName, i, offset); tb.Text = "Input " + str(i+1); form.nameBoxes[i] = tb; form.tabPageInputs.Controls.Add(tb); #voltage inputs tb =TextBox(); #form.DublicateControl(tb, form.textBoxInputLevel, i, offset); DublicateControl(tb, form.textBoxInputLevel, i, offset); form.voltageBoxes[i] = tb; form.tabPageInputs.Controls.Add(tb); #negative input level voltage checkboxes cb =CheckBox(); #form.DublicateControl(cb, form.checkBoxInvers, i, offset); DublicateControl(cb, form.checkBoxInvers, i, offset); form.tabPageInputs.Controls.Add(cb); form.negativeBoxes[i] = cb; form.negativeBoxes[i].CheckedChanged +=form.CheckedChanged; #active indicators b =Button(); #b = form.DublicateControl(b, form.buttonLed, i, offset); DublicateControl(b, form.buttonLed, i, offset); form.tabPageInputs.Controls.Add(b); form.ledButtons[i]= b;
def init(self): """Initialize the form. Returns ------- None """ textbox = TextBox() textbox.Text = str(self.value) textbox.Location = Point(10, 10) textbox.Width = 40 textbox.TextChanged += System.EventHandler(self.on_textchanged) trackbar = TrackBar() trackbar.Minimum = self.minval trackbar.Maximum = self.maxval trackbar.SmallChange = self.step trackbar.LargeChange = self.step trackbar.TickFrequency = self.step trackbar.Value = self.value trackbar.Width = 460 trackbar.Location = Point(60, 10) trackbar.Scroll += System.EventHandler(self.on_scroll) self.Controls.Add(textbox) self.Controls.Add(trackbar) self.ClientSize = Size(10 + textbox.Width + 10 + trackbar.Width + 10, trackbar.Height + 10) self.textbox = textbox self.trackbar = trackbar
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 __init__(self, placeholdertext, formtype=str): TextBox.__init__(self) self.LOGGER.info("Initializing formbox {}.".format(placeholdertext)) self.Enter += self.__receive_focus self.Leave += self.__lose_focus self.tag_getter_method = None self.tag_setter_method = None self.placeholder = placeholdertext self.formtype = formtype self.original = None # Initalize formbox to placeholder text/styling self.__clear()
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): textbox = TextBox() textbox.ReadOnly = True textbox.Dock = DockStyle.Fill textbox.Multiline = True textbox.ScrollBars = ScrollBars.Vertical textbox.Font = Font(FontFamily.GenericMonospace, 8.0) if isinstance(self.text, (str, unicode)): textbox.Text = self.text else: try: textbox.Text = (NewLine).join(self.text) except Exception as e: textbox.Text = str(e) self.Controls.Add(textbox)
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): """PropertyGridSample class init function.""" self.count = 0 # setup title self.Text = "PropertyGrid control" self.Height = 500 # setup text self.text = TextBox() #self.text.AutoSize = True self.text.Height = 100 self.text.Dock = DockStyle.Top self.text.Text = "The Property Grid of text control" # setup propertygrid self.propertygrid = PropertyGrid() self.propertygrid.CommandsVisibleIfAvailable = True self.propertygrid.Dock = DockStyle.Top self.propertygrid.TabIndex = 1 self.propertygrid.Text = "Property Grid" self.propertygrid.SelectedObject = self.text self.propertygrid.PropertyValueChanged += self.color_change # add controls self.Controls.Add(self.propertygrid) self.Controls.Add(self.text)
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, chracters): self.existingchracters = chracters self.TextBox = TextBox() self.TextBox.Size = Size(250, 20) self.TextBox.Location = Point(15, 12) self.TextBox.TabIndex = 1 self.TextBox.MaxLength = 1 self.OK = Button() self.OK.Text = "OK" self.OK.Size = Size(75, 23) self.OK.Location = Point(109, 38) self.OK.DialogResult = DialogResult.OK self.OK.Click += self.CheckTextBox self.Cancel = Button() self.Cancel.Size = Size(75, 23) self.Cancel.Text = "Cancel" self.Cancel.Location = Point(190, 38) self.Cancel.DialogResult = DialogResult.Cancel self.Size = Size(300, 100) self.Text = "Please enter the character" self.Controls.Add(self.OK) self.Controls.Add(self.Cancel) self.Controls.Add(self.TextBox) self.AcceptButton = self.OK self.CancelButton = self.Cancel self.FormBorderStyle = FormBorderStyle.FixedDialog self.StartPosition = FormStartPosition.CenterParent self.Icon = System.Drawing.Icon(ICON) self.ActiveControl = self.TextBox
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, 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): 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 __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 setupStatusBox(self): statusBox = TextBox() statusBox.Text = "" statusBox.Location = Point(self.EditPanelHpos+80, 220) statusBox.Width = 860 statusBox.Height = 100 #statusBox.ScrollBars = ScrollBars.Vertical statusBox.AcceptsTab = True #statusBox.AcceptsReturn = True #statusBox.WordWrap = True statusBox.Font = Font("Consolas", 10) self.statusBox = statusBox statusBox.ReadOnly=True
def __init__(self): self.Text = 'TextBox' self.text = Label() self.text.Parent = self self.text.Text = "..." self.text.AutoSize = True self.text.Location = Point(60, 40) tbox = TextBox() tbox.Parent = self tbox.Location = Point(60, 100) tbox.KeyUp += self.OnKeyUp self.Size = Size(250, 200) 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 ShowDialog(self, controller, title, text, default_input, exp_index): # set controller self.controller = controller # set exp index self.exp_index = exp_index # initialize exp name variable self.exp_name = None # initialize invalid name label self.invalid_name_label = None # create the form self.dialog_window = Form() self.dialog_window.AutoSize = True self.dialog_window.Width = 400 self.dialog_window.MaximumSize = Size(400, 160) self.dialog_window.StartPosition = FormStartPosition.CenterScreen self.dialog_window.Text = title self.dialog_window.FormBorderStyle = FormBorderStyle.FixedSingle # create the main panel self.panel = FlowLayoutPanel() self.panel.Parent = self.dialog_window self.panel.BackColor = DIALOG_COLOR self.panel.Dock = DockStyle.Top self.panel.Padding = Padding(10, 10, 0, 10) self.panel.FlowDirection = FlowDirection.TopDown self.panel.WrapContents = False self.panel.AutoSize = True self.panel.Font = BODY_FONT # add the dialog text exp_name_label = Label() exp_name_label.Parent = self.panel exp_name_label.Text = text exp_name_label.Width = self.panel.Width exp_name_label.AutoSize = True exp_name_label.Margin = Padding(0, 5, 0, 0) # add the textbox self.exp_name_box = TextBox() self.exp_name_box.Text = default_input self.exp_name_box.Parent = self.panel self.exp_name_box.Width = self.panel.Width - 30 self.exp_name_box.AutoSize = True self.exp_name_box.BackColor = BUTTON_PANEL_COLOR self.exp_name_box.Font = Font(BODY_FONT.FontFamily, 9) # add save button panel self.add_save_button_panel() # show the dialog self.dialog_window.ShowDialog() # return the exp name return self.exp_name
def OnKeyPress(self, args): if args.KeyChar == chr(13): searchbutton.PerformClick() args.Handled = True elif args.KeyChar == chr(27): cancelbutton.PerformClick() args.Handled = True else: TextBox.OnKeyPress(self, args)
def EditValue(self, context, provider, value) : service = provider.GetService(clr.GetClrType(IWindowsFormsEditorService)) if service != None : from System.Windows.Forms import Form, TextBox, FormBorderStyle, DockStyle, DialogResult tb = TextBox() tb.Multiline = True tb.Text = value f = Form() f.Controls.Add(tb) f.FormBorderStyle = FormBorderStyle.None f.TopLevel = False tb.Dock = DockStyle.Fill service.DropDownControl(f) value = tb.Text return value
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()
def __init__(self): # Window Settings self.Text = 'Switch Generator' self.Width = 200 self.Height = 220 self.MinimizeBox = False self.MaximizeBox = False self.BackgroundColor = Color.Red self.FormBorderStyle = FormBorderStyle.FixedSingle self.ShowIcon = False self.label1 = Label() self.label1.Text = 'Input number:' self.label1.Location = Point(10, 0) self.tb = TextBox() self.tb.Text = "8" self.tb.Location = Point(10, 25) self.tb.Width = 160 self.label2 = Label() self.label2.Text = 'file name:' self.label2.Location = Point(10, 60) self.filepath = TextBox() self.filepath.Text = "c:/switch.cir" self.filepath.Location = Point(10, 85) self.filepath.Width = 160 button = Button() button.Text = 'Generate' button.Location = Point(10, 120) button.Width = 100 button.Height = 30 button.Click += self.button_click self.Controls.Add(self.label1) self.Controls.Add(self.tb) self.Controls.Add(self.label2) self.Controls.Add(self.filepath) 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) 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 add_TTL_param_to_window(self, name, label_text): # add param label add_param_label(label_text + ':', self.TTL_param_panel) # add param textbox self.TTL_param_textboxes[name] = TextBox() self.TTL_param_textboxes[name].Parent = self.TTL_param_panel self.TTL_param_textboxes[name].Text = str(self.TTL_params[name]) self.TTL_param_textboxes[name].Width = 150 self.TTL_param_textboxes[name].BackColor = TEXTBOX_COLOR self.TTL_param_textboxes[name].AutoSize = True self.TTL_param_textboxes[name].Font = Font(BODY_FONT.FontFamily, 18)
def add_stim_param_to_window(self, name, label_text): # add param label add_param_label(label_text + ':', self.stim_param_panel) # add param textbox self.stim_param_textboxes[name] = TextBox() self.stim_param_textboxes[name].Parent = self.stim_param_panel self.stim_param_textboxes[name].Text = str(self.stim_parameters[name]) self.stim_param_textboxes[name].AutoSize = True self.stim_param_textboxes[name].Width = 360 self.stim_param_textboxes[name].BackColor = TEXTBOX_COLOR self.stim_param_textboxes[name].Font = BODY_FONT
class ShowTextFile(Form): def __init__(self, fName): fContent="" try: with open(fName, 'r') as f: for line in f: fContent += line + "\r\n" #print line f.close() except Exception,e : fContent="No content " self.Text = "SolverStudio pyCMPL Viewer: "+fName self.FormBorderStyle = FormBorderStyle.Sizable # SizableToolWindow # FixedDialog self.Height=500 self.Width = 600 self.Content = TextBox() self.Content.Text=fContent self.Content.ReadOnly=True self.Content.SelectionStart = 0 self.Content.Multiline = True self.Content.WordWrap = False self.Content.ScrollBars = ScrollBars.Both self.Content.Dock = DockStyle.Fill self.Content.Font=Font("Courier New",10) self.bOK=Button() self.bOK.Text = "OK" self.bOK.Anchor = (AnchorStyles.Bottom | AnchorStyles.Right); # self.bOK.Dock = DockStyle.Right # self.bOK.Width = 75 AJM: Go with the default height/width to be more Windows-like # self.bOK.Height = 25 self.bOK.Click += self.OK self.AcceptButton = self.bOK self.buttonPanel=Panel() self.buttonPanel.Dock=DockStyle.Bottom self.buttonPanel.Height=35 self.buttonPanel.Controls.Add(self.bOK) self.bOK.Left = self.buttonPanel.Width - self.bOK.Width - 20 # AJM: Position button nicely self.bOK.Top = 7 # AJM: Position button nicely self.Controls.Add(self.Content) self.Controls.Add(self.buttonPanel) self.CenterToScreen()
def setupCmdBox(self): cmdBox = TextBox() cmdBox.Text = "list directory" cmdBox.Location = Point(self.EditPanelHpos+80, 60) cmdBox.Width = 860 cmdBox.Height = 100 #cmdBox.ScrollBars = ScrollBars.Vertical cmdBox.AcceptsTab = True #cmdBox.AcceptsReturn = True #cmdBox.WordWrap = True cmdBox.Font = Font("Consolas", 10) cmdBox.KeyDown+=self.cmdBoxOnEnter cmdBox.MouseWheel+=self.cmdBoxOnMouseWheel self.cmdBox = cmdBox
def setupEditBox(self): editBox = TextBox() editBox.Text = "" editBox.Location = Point(self.EditPanelHpos+80,100) editBox.Width = 860 editBox.Height = 200 #editBox.ScrollBars = ScrollBars.Vertical editBox.AcceptsTab = True #editBox.AcceptsReturn = True #editBox.WordWrap = True editBox.Font = Font("Consolas", 10) editBox.KeyDown+=self.editBoxOnEnter # editBox.MouseWheel+=self.editBoxOnMouseWheel self.editBox = editBox
def __init__(self, RB_print): self.RB_print = RB_print self.Text = 'RedBim' self.Name = 'RedBimPrinter' self.Height = 500 self.Width = 700 self.label = TextBox() self.label.Dock = DockStyle.Fill self.label.Multiline = True self.label.ReadOnly = True self.label.Font = Font('Arial', 12) self.label.ScrollBars = ScrollBars.Vertical self.Controls.Add(self.label)
def generaAreaTexto(self): texto = TextBox() texto.Height = self.Height / 2 texto.Width = self.Width - 30 # para que no se salga texto.Location = Point(20,110) texto.Multiline = True texto.ScrollBars = ScrollBars.Vertical self.areaTexto = texto
def addTabPage(self, label, text): tabPage = TabPage() tabPage.Text = label textBox = TextBox() textBox.Multiline = True textBox.Dock = DockStyle.Fill textBox.ScrollBars = ScrollBars.Vertical textBox.AcceptsReturn = True textBox.AcceptsTab = True textBox.WordWrap = True textBox.Text = text tabPage.Controls.Add(textBox) self.tabControl.TabPages.Add(tabPage)
def create_fast_text_box( self,textBoxName,textBoxText,boxHorizontalPosition,boxVerticalPosition,boxWidth): self.fastTextBoxList[textBoxName] = TextBox() self.fastTextBoxList[textBoxName].Text=textBoxText self.fastTextBoxList[textBoxName].Location=Point(boxHorizontalPosition,boxVerticalPosition) self.fastTextBoxList[textBoxName].Width=boxWidth self.fastTextBoxList[textBoxName].Height=VoiceEditorSettings.fastBoxHeight #self.fastTextBoxList[textBoxName].ScrollBars = ScrollBars.Vertical self.fastTextBoxList[textBoxName].AcceptsTab = True #self.fastTextBoxList[textBoxName].AcceptsReturn = True #self.fastTextBoxList[textBoxName].WordWrap = True self.fastTextBoxList[textBoxName].Font=Font("Consolas",VoiceEditorSettings.fastBoxFontSize) self.fastTextBoxList[textBoxName].ReadOnly=True self.Controls.Add(self.fastTextBoxList[textBoxName])
def __init__(self): self.Text = "SolverStudio NEOS Email Address" self.FormBorderStyle = FormBorderStyle.FixedDialog self.Height= 140 self.Width = 460 self.label = Label() self.label.Text = "Some commercial solvers on NEOS, such as CPLEX, require a valid email address. Please enter the Email address, if any, you wish to send to NEOS when you solve:" self.label.Location = Point(10,10) self.label.Height = 35 self.label.Width = 430 self.KeyText = TextBox() self.KeyText.Location = Point(10,46) self.KeyText.Width = 430 self.KeyText.Height = 20 self.KeyText.Text = SolverStudio.GetRegistrySetting("NEOS","Email","") self.KeyText.AcceptsReturn = False; self.bOK=Button() self.bOK.Text = "OK" self.bOK.Location = Point(270,76) # self.bOK.Width = 100 self.bOK.Click += self.SetEmail self.link1 = LinkLabel() self.link1.Location = Point(10, 78) self.link1.Width = 250 self.link1.Height = 40 self.link1.LinkClicked += self.OpenTCs self.link1.VisitedLinkColor = Color.Blue; self.link1.LinkBehavior = LinkBehavior.HoverUnderline; self.link1.LinkColor = Color.Navy; self.link1.Text = "View NEOS terms and conditions" self.link1.LinkArea = LinkArea(5,25) self.bCancel=Button() self.bCancel.Text = "Cancel" self.bCancel.Location = Point(363,76) self.AcceptButton = self.bOK self.CancelButton = self.bCancel self.Controls.Add(self.label) self.Controls.Add(self.KeyText) # Add first to get focus self.Controls.Add(self.link1) self.Controls.Add(self.bOK) self.Controls.Add(self.bCancel) self.CenterToScreen()
def recursivevTextBoxCheck(self): isOK = True if (len(self.ListPanel.Controls) == 0): isOK = isOK & False MessageBox.Show("Please select list !") else: for panel in self.ListPanel.Controls: for control in panel.Controls: if (control.GetType() == type(TextBox())): if control.Text == "": isOK = isOK & False MessageBox.Show( "Please fill in number input box !") break return isOK
from System.Windows.Forms import (Form, DockStyle, Panel, TextBox, Button, SplitContainer, Orientation) from Microsoft.Ink import InkOverlay f = Form() f.Text = 'InkOverlay Example' btn = Button() btn.Text = 'Erase' pnl = Panel() pnl.BackColor = Color.Khaki overlay = InkOverlay(pnl) overlay.Enabled = True tb = TextBox() tb.Font = Font('serif', 20) tb.Multiline = True sc = SplitContainer() sc.SplitterWidth = 10 sc.Orientation = Orientation.Horizontal # Layout f.Width = 600 f.Height = 400 sc.Dock = DockStyle.Fill btn.Dock = DockStyle.Top tb.Dock = DockStyle.Fill pnl.Dock = DockStyle.Fill f.Controls.Add(sc)