static int Main () { FlowLayoutPanel panel = new FlowLayoutPanel (); panel.Controls.AddRange (new Control [] { new TestControl (), new TestControl () }); if (panel.PreferredSize != new Size (212, 106)) return 1; return 0; }
static Control GroupWidget(Racr.AstNode n) { var panel = new FlowLayoutPanel(); panel.AutoSize = true; panel.BorderStyle = BorderStyle.Fixed3D; panel.Dock = DockStyle.Fill; panel.FlowDirection = FlowDirection.TopDown; panel.WrapContents = false; n.Parent().Widget().Controls.Add(panel); return panel; }
static Control FormWidget(Racr.AstNode n) { var form = new System.Windows.Forms.Form(); form.Text = "Questionnaire"; var file = new MenuItem("&File"); var open = new MenuItem("&Open"); var save = new MenuItem("&Save"); var quit = new MenuItem("&Quit"); open.Click += (object sender, EventArgs e) => { var ofd = new OpenFileDialog(); if (ofd.ShowDialog() == DialogResult.OK) { var parser = new Parser(QL.Ql, File.ReadAllText(ofd.FileName)); var ast = parser.ParseAst(); ast.Render(); Questionnaire.UpdateQuestions(ast); form.Closed -= FormClosed; form.Close(); } }; save.Click += (object sender, EventArgs e) => { var sfd = new SaveFileDialog(); if (sfd.ShowDialog() == DialogResult.OK && sfd.FileName != "") { File.WriteAllText(sfd.FileName, n.SExpr()); } }; quit.Click += (object sender, EventArgs e) => form.Close(); form.Closed += FormClosed; file.MenuItems.Add(open); file.MenuItems.Add(save); file.MenuItems.Add(quit); form.Menu = new MainMenu(); form.Menu.MenuItems.Add(file); var panel = new FlowLayoutPanel(); panel.AutoSize = true; panel.AutoScroll = true; panel.Dock = DockStyle.Fill; panel.FlowDirection = FlowDirection.TopDown; panel.WrapContents = false; form.Controls.Add(panel); form.Show(); return panel; }
private void InitializeComponent() { this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.label3 = new System.Windows.Forms.Label(); this.TBox_Target = new Ratatoskr.Forms.RoundTextBox(); this.label2 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.TBox_Replace = new Ratatoskr.Forms.RoundTextBox(); this.flowLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // flowLayoutPanel1 // this.flowLayoutPanel1.Controls.Add(this.label3); this.flowLayoutPanel1.Controls.Add(this.TBox_Target); this.flowLayoutPanel1.Controls.Add(this.label2); this.flowLayoutPanel1.Controls.Add(this.label1); this.flowLayoutPanel1.Controls.Add(this.TBox_Replace); this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0); this.flowLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(587, 25); this.flowLayoutPanel1.TabIndex = 10; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(3, 0); this.label3.Name = "label3"; this.label3.Padding = new System.Windows.Forms.Padding(0, 6, 0, 0); this.label3.Size = new System.Drawing.Size(66, 18); this.label3.TabIndex = 10; this.label3.Text = "Target code"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // TBox_Target // this.TBox_Target.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TBox_Target.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); this.TBox_Target.Location = new System.Drawing.Point(75, 3); this.TBox_Target.Name = "TBox_Target"; this.TBox_Target.Size = new System.Drawing.Size(200, 19); this.TBox_Target.TabIndex = 17; this.TBox_Target.TextChanged += new System.EventHandler(this.TBox_TextChanged); this.TBox_Target.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TBox_KeyDown); // // label2 // this.label2.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.label2.Location = new System.Drawing.Point(281, 0); this.label2.Name = "label2"; this.label2.Padding = new System.Windows.Forms.Padding(0, 2, 0, 0); this.label2.Size = new System.Drawing.Size(2, 24); this.label2.TabIndex = 15; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(289, 0); this.label1.Name = "label1"; this.label1.Padding = new System.Windows.Forms.Padding(0, 6, 0, 0); this.label1.Size = new System.Drawing.Size(74, 18); this.label1.TabIndex = 12; this.label1.Text = "Replace code"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // TBox_Replace // this.TBox_Replace.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.TBox_Replace.Font = new System.Drawing.Font("MS ゴシック", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(128))); this.TBox_Replace.Location = new System.Drawing.Point(369, 3); this.TBox_Replace.Name = "TBox_Replace"; this.TBox_Replace.Size = new System.Drawing.Size(200, 19); this.TBox_Replace.TabIndex = 18; this.TBox_Replace.TextChanged += new System.EventHandler(this.TBox_TextChanged); this.TBox_Replace.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TBox_KeyDown); // // AlgorithmObjectImpl // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.Controls.Add(this.flowLayoutPanel1); this.Margin = new System.Windows.Forms.Padding(0); this.Name = "AlgorithmObjectImpl"; this.Size = new System.Drawing.Size(587, 25); this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.ResumeLayout(false); }
private void khoiTao() { dictionaryDataSource = new Dictionary <string, Dictionary <string, HangHoaDataSource> >(); listLayoutHangHoa = new List <FlowLayoutPanel>(); listDictionaryHangHoa = new List <Dictionary <int, List <FoodLayout> > >(); TongCong = 0; loaiHienTai = 1; giamGia = 0.0f; //txtGiamGia.Text = giamGia.ToString() + "%"; listFoodLayout = new List <FoodLayout>(); hashMaHangHoa = new HashSet <string>(); dGVHoaDon.AllowUserToAddRows = false; bindingSource.Add(new HangHoaDataSource()); dGVHoaDon.DataSource = bindingSource; bindingSource.RemoveAt(0); dGVHoaDon.Columns["Ten"].HeaderText = "Tên"; dGVHoaDon.Columns["Gia"].HeaderText = "Giá"; dGVHoaDon.Columns["Soluong"].HeaderText = "Số lượng"; dGVHoaDon.Columns["Thanhtien"].HeaderText = "Thành tiền"; dGVHoaDon.Columns["DonViTinh"].HeaderText = "Đơn vị tính"; dGVHoaDon.Columns["Ma"].Visible = false; dGVHoaDon.Columns["Loai"].Visible = false; dGVHoaDon.Columns["IndexDict"].Visible = false; dGVHoaDon.Columns["MaLoaiHangHoa"].Visible = false; dGVHoaDon.Columns["TenLoaiHangHoa"].Visible = false; dGVHoaDon.Columns["IndexList"].Visible = false; dGVHoaDon.Columns["Gia"].ReadOnly = true; dGVHoaDon.Columns["Ten"].ReadOnly = true; dGVHoaDon.Columns["Thanhtien"].ReadOnly = true; var grouper = new Subro.Controls.DataGridViewGrouper(dGVHoaDon); grouper.SetGroupOn("MaLoaiHangHoa"); //grouper.Options.GroupSortOrder = SortOrder.None; grouper.DisplayGroup += grouper_DisplayGroup; //lấy danh sách loại sản phẩm đưa vào tabcontrol lớn List <LoaiHangHoa> listLoaiHangHoa = BUS.HangHoaBUS.XemLoaiMon(1); if (listLoaiHangHoa != null) { //tabControl.TabPages.Clear(); for (int i = 0; i < listLoaiHangHoa.Count; i++) { FlowLayoutPanel flowFoodLayout = new FlowLayoutPanel(); flowFoodLayout.Dock = DockStyle.Fill; listLayoutHangHoa.Add(flowFoodLayout); Dictionary <int, List <FoodLayout> > dictionary = new Dictionary <int, List <FoodLayout> >(); TabPage tabPage = new TabPage(listLoaiHangHoa[i].Ten); tabPage.Controls.Add(flowFoodLayout); tabPage.Name = listLoaiHangHoa[i].Ma; tabControl.TabPages.Add(tabPage); listDictionaryHangHoa.Add(dictionary); } } listTenGroup = new List <LoaiHangHoa>(); listTenGroup.AddRange(BUS.HangHoaBUS.XemLoaiMon(2)); if (listTenGroup != null) { for (int i = 0; i < listTenGroup.Count; i++) { dictionaryDataSource.Add(listTenGroup[i].Ten, new Dictionary <string, HangHoaDataSource>()); } } List <HangHoaDataSource> temp = BUS.SanPhamBUS.XemChiTietPhieuNhapSanPham(phieuNhapHang.SoPhieu); if (temp != null) { uint tongCong = 0; for (int i = 0; i < temp.Count; i++) { hashMaHangHoa.Add(temp[i].Ma); dictionaryDataSource[temp[i].TenLoaiHangHoa].Add(temp[i].Ma, temp[i]); bindingSource.Add(temp[i]); tongCong += uint.Parse(temp[i].Thanhtien); } TongCong = tongCong; } thayDoiLoai(); }
/// <summary> /// /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void flytbProduxtList_Paint(object sender, PaintEventArgs e) { FlowLayoutPanel panel = (FlowLayoutPanel)sender; }
private void addHeader() { //1 hid = new Label(); hid.Text = "ID"; hid.Width = w1; hid.TextAlign = ContentAlignment.MiddleCenter; hid.BackColor = hbg; hid.ForeColor = fcl; hid.Font = hf; hid.Tag = -1; //2 htitle = new Label(); htitle.Text = "TITLE"; htitle.Width = w2; htitle.TextAlign = ContentAlignment.MiddleCenter; htitle.BackColor = hbg; htitle.ForeColor = fcl; htitle.Font = hf; htitle.Tag = -1; //3 hpath = new Label(); hpath.Text = "PATH"; hpath.Width = w3; hpath.TextAlign = ContentAlignment.MiddleCenter; hpath.BackColor = hbg; hpath.ForeColor = fcl; hpath.Font = hf; hpath.Tag = -1; //4 hfilter = new Label(); hfilter.Text = "FILTER"; hfilter.Width = w4; hfilter.TextAlign = ContentAlignment.MiddleCenter; hfilter.BackColor = hbg; hfilter.ForeColor = fcl; hfilter.Font = hf; hfilter.Tag = -1; //5 hcontent = new Label(); hcontent.Text = "CONTENT"; hcontent.Width = w5; hcontent.TextAlign = ContentAlignment.MiddleCenter; hcontent.BackColor = hbg; hcontent.ForeColor = fcl; hcontent.Font = hf; hcontent.Tag = -1; //6 hopen = new Label(); hopen.Text = "OPEN"; hopen.Width = w6; hopen.TextAlign = ContentAlignment.MiddleCenter; hopen.BackColor = hbg; hopen.ForeColor = fcl; hopen.Font = hf; hopen.Tag = -1; hrow = new FlowLayoutPanel(); hrow.FlowDirection = FlowDirection.LeftToRight; hrow.Width = outerBox.Width; hrow.Tag = -1; hrow.Controls.Add(hid); hrow.Controls.Add(htitle); hrow.Controls.Add(hpath); hrow.Controls.Add(hfilter); hrow.Controls.Add(hcontent); hrow.Controls.Add(hopen); hrow.Height = hh; hrow.BackColor = Color.Transparent; outerBox.Controls.Add(hrow); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(UI)); this.pnWiz0x001f = new System.Windows.Forms.Panel(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.label1 = new System.Windows.Forms.Label(); this.pnObject = new System.Windows.Forms.Panel(); this.cbAttrPicker = new System.Windows.Forms.CheckBox(); this.cbDecimal = new System.Windows.Forms.CheckBox(); this.cbPicker1 = new System.Windows.Forms.ComboBox(); this.tbVal1 = new System.Windows.Forms.TextBox(); this.cbDataOwner1 = new System.Windows.Forms.ComboBox(); this.ckbNID = new System.Windows.Forms.CheckBox(); this.ckbOrigGUID = new System.Windows.Forms.CheckBox(); this.label2 = new System.Windows.Forms.Label(); this.flowLayoutPanel2 = new System.Windows.Forms.FlowLayoutPanel(); this.tbGUID = new System.Windows.Forms.TextBox(); this.lbGUIDText = new System.Windows.Forms.Label(); this.ckbTemp01 = new System.Windows.Forms.CheckBox(); this.pnWiz0x001f.SuspendLayout(); this.flowLayoutPanel1.SuspendLayout(); this.pnObject.SuspendLayout(); this.flowLayoutPanel2.SuspendLayout(); this.SuspendLayout(); // // pnWiz0x001f // this.pnWiz0x001f.Controls.Add(this.flowLayoutPanel1); resources.ApplyResources(this.pnWiz0x001f, "pnWiz0x001f"); this.pnWiz0x001f.Name = "pnWiz0x001f"; // // flowLayoutPanel1 // this.flowLayoutPanel1.Controls.Add(this.label1); this.flowLayoutPanel1.Controls.Add(this.pnObject); this.flowLayoutPanel1.Controls.Add(this.ckbNID); this.flowLayoutPanel1.Controls.Add(this.ckbOrigGUID); this.flowLayoutPanel1.Controls.Add(this.label2); this.flowLayoutPanel1.Controls.Add(this.flowLayoutPanel2); this.flowLayoutPanel1.Controls.Add(this.ckbTemp01); resources.ApplyResources(this.flowLayoutPanel1, "flowLayoutPanel1"); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; // // label1 // resources.ApplyResources(this.label1, "label1"); this.label1.Name = "label1"; // // pnObject // this.pnObject.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnObject.Controls.Add(this.cbAttrPicker); this.pnObject.Controls.Add(this.cbDecimal); this.pnObject.Controls.Add(this.cbPicker1); this.pnObject.Controls.Add(this.tbVal1); this.pnObject.Controls.Add(this.cbDataOwner1); resources.ApplyResources(this.pnObject, "pnObject"); this.pnObject.Name = "pnObject"; // // cbAttrPicker // resources.ApplyResources(this.cbAttrPicker, "cbAttrPicker"); this.cbAttrPicker.Name = "cbAttrPicker"; // // cbDecimal // resources.ApplyResources(this.cbDecimal, "cbDecimal"); this.cbDecimal.Name = "cbDecimal"; // // cbPicker1 // this.cbPicker1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbPicker1.DropDownWidth = 384; resources.ApplyResources(this.cbPicker1, "cbPicker1"); this.cbPicker1.Name = "cbPicker1"; // // tbVal1 // resources.ApplyResources(this.tbVal1, "tbVal1"); this.tbVal1.Name = "tbVal1"; // // cbDataOwner1 // this.cbDataOwner1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.cbDataOwner1.DropDownWidth = 384; resources.ApplyResources(this.cbDataOwner1, "cbDataOwner1"); this.cbDataOwner1.Name = "cbDataOwner1"; // // ckbNID // resources.ApplyResources(this.ckbNID, "ckbNID"); this.ckbNID.Name = "ckbNID"; this.ckbNID.UseVisualStyleBackColor = true; // // ckbOrigGUID // resources.ApplyResources(this.ckbOrigGUID, "ckbOrigGUID"); this.flowLayoutPanel1.SetFlowBreak(this.ckbOrigGUID, true); this.ckbOrigGUID.Name = "ckbOrigGUID"; this.ckbOrigGUID.UseVisualStyleBackColor = true; // // label2 // resources.ApplyResources(this.label2, "label2"); this.label2.Name = "label2"; // // flowLayoutPanel2 // this.flowLayoutPanel2.Controls.Add(this.tbGUID); this.flowLayoutPanel2.Controls.Add(this.lbGUIDText); resources.ApplyResources(this.flowLayoutPanel2, "flowLayoutPanel2"); this.flowLayoutPanel2.Name = "flowLayoutPanel2"; // // tbGUID // resources.ApplyResources(this.tbGUID, "tbGUID"); this.tbGUID.Name = "tbGUID"; this.tbGUID.TextChanged += new System.EventHandler(this.tbGUID_TextChanged); this.tbGUID.Validated += new System.EventHandler(this.hex32_Validated); this.tbGUID.Validating += new System.ComponentModel.CancelEventHandler(this.hex32_Validating); // // lbGUIDText // resources.ApplyResources(this.lbGUIDText, "lbGUIDText"); this.lbGUIDText.Name = "lbGUIDText"; // // ckbTemp01 // resources.ApplyResources(this.ckbTemp01, "ckbTemp01"); this.ckbTemp01.Name = "ckbTemp01"; this.ckbTemp01.UseVisualStyleBackColor = true; // // UI // resources.ApplyResources(this, "$this"); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; this.Controls.Add(this.pnWiz0x001f); this.Name = "UI"; this.pnWiz0x001f.ResumeLayout(false); this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.pnObject.ResumeLayout(false); this.pnObject.PerformLayout(); this.flowLayoutPanel2.ResumeLayout(false); this.flowLayoutPanel2.PerformLayout(); this.ResumeLayout(false); }
private void InitializeComponent() { this.tblMain = new TableLayoutPanel(); this.label1 = new Label(); this.label2 = new Label(); this.txtName = new TextBox(); this.cmbTab = new ComboBox(); this.label3 = new Label(); this.btnSelect = new Button(); this.cmbColor = new ComboBox(); this.flp = new FlowLayoutPanel(); this.pnlColor = new Panel(); this.tblMain.SuspendLayout(); this.flp.SuspendLayout(); base.SuspendLayout(); this.tblMain.ColumnCount = 2; this.tblMain.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 100f)); this.tblMain.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100f)); this.tblMain.Controls.Add(this.label1, 0, 0); this.tblMain.Controls.Add(this.label2, 0, 1); this.tblMain.Controls.Add(this.txtName, 1, 0); this.tblMain.Controls.Add(this.cmbTab, 1, 1); this.tblMain.Controls.Add(this.label3, 0, 2); this.tblMain.Controls.Add(this.cmbColor, 1, 2); this.tblMain.Controls.Add(this.flp, 1, 3); this.tblMain.Dock = DockStyle.Fill; this.tblMain.Location = new Point(0, 0); this.tblMain.Name = "tblMain"; this.tblMain.RowCount = 5; this.tblMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 26f)); this.tblMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 26f)); this.tblMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 26f)); this.tblMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 26f)); this.tblMain.RowStyles.Add(new RowStyle(SizeType.Absolute, 20f)); this.tblMain.Size = new Size(0xfb, 0x89); this.tblMain.TabIndex = 0; this.label1.Anchor = AnchorStyles.Left; this.label1.AutoSize = true; this.label1.Location = new Point(3, 6); this.label1.Name = "label1"; this.label1.Size = new Size(0x23, 13); this.label1.TabIndex = 0; this.label1.Text = "Name"; this.label2.Anchor = AnchorStyles.Left; this.label2.AutoSize = true; this.label2.Location = new Point(3, 0x20); this.label2.Name = "label2"; this.label2.Size = new Size(0x38, 13); this.label2.TabIndex = 1; this.label2.Text = "Show Tab"; this.txtName.Dock = DockStyle.Fill; this.txtName.Location = new Point(0x67, 3); this.txtName.Name = "txtName"; this.txtName.Size = new Size(0x91, 20); this.txtName.TabIndex = 2; this.cmbTab.Dock = DockStyle.Fill; this.cmbTab.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbTab.FormattingEnabled = true; object[] items = new object[] { "Yes", "No" }; this.cmbTab.Items.AddRange(items); this.cmbTab.Location = new Point(0x67, 0x1d); this.cmbTab.Name = "cmbTab"; this.cmbTab.Size = new Size(0x91, 0x15); this.cmbTab.TabIndex = 3; this.label3.Anchor = AnchorStyles.Left; this.label3.AutoSize = true; this.label3.Location = new Point(3, 0x3a); this.label3.Name = "label3"; this.label3.Size = new Size(0x4b, 13); this.label3.TabIndex = 4; this.label3.Text = "Highlight Color"; this.btnSelect.Location = new Point(30, 0); this.btnSelect.Margin = new Padding(3, 0, 0, 0); this.btnSelect.Name = "btnSelect"; this.btnSelect.Size = new Size(0x4b, 0x17); this.btnSelect.TabIndex = 5; this.btnSelect.Text = "Select"; this.btnSelect.UseVisualStyleBackColor = true; this.btnSelect.Click += new EventHandler(this.btnSelect_Click); this.cmbColor.Dock = DockStyle.Fill; this.cmbColor.DropDownStyle = ComboBoxStyle.DropDownList; this.cmbColor.FormattingEnabled = true; object[] objArray2 = new object[] { "Yes", "No" }; this.cmbColor.Items.AddRange(objArray2); this.cmbColor.Location = new Point(0x67, 0x37); this.cmbColor.Name = "cmbColor"; this.cmbColor.Size = new Size(0x91, 0x15); this.cmbColor.TabIndex = 6; this.cmbColor.SelectedIndexChanged += new EventHandler(this.cmbColor_SelectedIndexChanged); this.flp.Controls.Add(this.pnlColor); this.flp.Controls.Add(this.btnSelect); this.flp.Dock = DockStyle.Fill; this.flp.Location = new Point(100, 0x4e); this.flp.Margin = new Padding(0); this.flp.Name = "flp"; this.flp.Size = new Size(0x97, 0x1a); this.flp.TabIndex = 7; this.pnlColor.BackColor = SystemColors.ActiveCaptionText; this.pnlColor.BorderStyle = BorderStyle.FixedSingle; this.pnlColor.Location = new Point(3, 0); this.pnlColor.Margin = new Padding(3, 0, 0, 0); this.pnlColor.Name = "pnlColor"; this.pnlColor.Size = new Size(0x18, 0x18); this.pnlColor.TabIndex = 0; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = AutoScaleMode.Font; base.Controls.Add(this.tblMain); base.Name = "TagEdit"; base.Size = new Size(0xfb, 0x89); this.tblMain.ResumeLayout(false); this.tblMain.PerformLayout(); this.flp.ResumeLayout(false); base.ResumeLayout(false); }
private void Columnbuilder() { #region Construtor inicial //panel for side legends int x = 60; int y = 40; string[] leftlabels = { "Doses/ Vacinas", "1ª Dose", "2ª Dose", "3ª Dose" }; //add panels descriptions FlowLayoutPanel column2 = new FlowLayoutPanel(); column2.BackColor = Color.White; var margin = column2.Margin; margin.All = 0; margin.Right = 1; column2.Margin = margin; column2.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, VacinaPanel.Size.Height); column2.MinimumSize = new Size((VacinaPanel.Size.Width - 6) / 6, VacinaPanel.Size.Height); _columDimentions[0] = column2.Size; bool aux = true; foreach (var item in leftlabels) { //deal with square containing labels Panel pnlegendaDose = new Panel(); //var margim = pnlegendaDose.Margin; margin.All = 1; pnlegendaDose.Margin = margin; pnlegendaDose.BackColor = Color.DarkGray; //create labels to be added to control Label dosevacina = new Label(); dosevacina.MaximumSize = new Size(50, 45); dosevacina.AutoSize = true; dosevacina.Size = new Size(60, 40); dosevacina.Text = item; dosevacina.Font = new Font(dosevacina.Font.Name, 8, FontStyle.Underline); //pnlegendaDose.AutoScroll = true; pnlegendaDose.Controls.Add(dosevacina); //deal with first square that has smaller size if (aux) { pnlegendaDose.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, 40); pnlegendaDose.MinimumSize = new Size((VacinaPanel.Size.Width - 6) / 6, 40); //code to centralize text into panel _columDimentions[1] = pnlegendaDose.Size; aux = false; } else { //other size legens pnlegendaDose.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 46) / 3); pnlegendaDose.MinimumSize = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 46) / 3); _columDimentions[2] = pnlegendaDose.Size; } y = column2.Size.Height; x = column2.Size.Width; y = y - 48; y = y / 3; dosevacina.Left = (pnlegendaDose.ClientSize.Width - dosevacina.Width) / 2; dosevacina.Top = (pnlegendaDose.ClientSize.Height - dosevacina.Height) / 2; column2.Controls.Add(pnlegendaDose); //vacinaPanel.Controls.Add(Column); } VacinaPanel.Controls.Add(column2); #endregion string[] vaccinenames = { "Heb B", "Trip. Viral", "Febre Amar.", "Rubeola", "Dupla Adulta" }; //creates the 5 colums for vaccines Color[] colors = { Color.Red, Color.Blue, Color.Yellow, Color.Green, Color.Red, Color.Red }; var controlcolor = true; for (int i = 0; i < vaccinenames.Count(); i++) { //creates the 5 panels for vaccines FlowLayoutPanel panelVaccines = new FlowLayoutPanel(); panelVaccines.Tag = vaccinenames[i]; panelVaccines.AutoSize = false; margin.All = 0; panelVaccines.Margin = margin; panelVaccines.Padding = new Padding(0, 0, 0, 0); //sets size by previously stored variables panelVaccines.Size = new Size((((_columDimentions[0].Width * 4) / 5)), _columDimentions[0].Height); panelVaccines.FlowDirection = FlowDirection.TopDown; //panelVaccines.BackColor = colors[i]; //------------STARTS INSERT OF DATE INSIDE COLUMN Panel panelVacinaName = new Panel(); panelVacinaName.Size = new Size(panelVaccines.Width, _columDimentions[1].Height); _columDimentions[1].Width = panelVaccines.Width; _columDimentions[2].Width = _columDimentions[1].Width; //sets color interhange if (controlcolor) { panelVacinaName.BackColor = Color.LightGray; controlcolor = false; } else { panelVacinaName.BackColor = Color.White; controlcolor = true; } //add label with anme of vaccine Label vacinaa = new Label(); vacinaa.Text = vaccinenames[i]; panelVacinaName.Controls.Add(vacinaa); vacinaa.Left = 15; vacinaa.Top = (panelVacinaName.ClientSize.Height - vacinaa.Height) / 2; //inserts panel with label inside colum with vaccine name panelVacinaName.Controls.Add(vacinaa); //setsup objects at right margins and paddings var margim = panelVaccines.Margin; margim.All = 1; panelVaccines.Margin = margim; panelVacinaName.Margin = margim; panelVaccines.Controls.Add(panelVacinaName); //add dummy items to keep vaccinelist full int dosestotake = 0; switch (vaccinenames[i]) { case "Heb B": { dosestotake = 3; } break; case "Dupla Adulta": { dosestotake = 1; } break; case "Rubeola": { dosestotake = 1; } break; case "Febre Amar.": { dosestotake = 2; } break; case "Trip. Viral": { dosestotake = 2; } break; default: break; } for (int j = 0; j < dosestotake; j++) { ViewControls.Vacinas.VaccineViewer objClearVaccine = new ViewControls.Vacinas.VaccineViewer(); objClearVaccine.Margin = margim; objClearVaccine.Size = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 48) / 3); objClearVaccine.Padding = new Padding(0, 0, 0, 0); objClearVaccine.Tag = (j + 1); panelVaccines.Controls.Add(objClearVaccine); } //insert colum VacinaPanel.Controls.Add(panelVaccines); } var teste = VacinaPanel; }
/// <summary> /// Рисуем главное меню /// </summary> private void DrawMainMenu() { if (flowPanel != null) { this.Controls.Remove(flowPanel); } flowPanel = new FlowLayoutPanel(); flowPanel.Dock = DockStyle.Fill; flowPanel.AutoScroll = true; flowPanel.Controls.Clear(); for (var i = 0; i < Count; i++) { var panel = new Panel(); panel.Size = new Size(440, 200); panel.Margin = new Padding(5, 35, 20, 0); panel.BorderStyle = BorderStyle.Fixed3D; flowPanel.Controls.Add(panel); var pb = new PictureBox(); pb.SizeMode = PictureBoxSizeMode.StretchImage; pb.Size = new Size(240, 130); pb.Image = Properties.Resources.NotSignal; // pb.BorderStyle = BorderStyle.Fixed3D; pb.Location = new Point(5, 35); panel.Controls.Add(pb); Lstpbx.Add(pb); var lb = new Label(); lb.Text = ipUser[i]; lb.ForeColor = Color.White; lb.Font = new Font("Calibri", 10); lb.Dock = DockStyle.Top; lb.TextAlign = ContentAlignment.MiddleCenter; panel.Controls.Add(lb); Lstlbx.Add(lb); var btn = new Button(); //btn.Text = "Включить трансляцию"; btn.BackgroundImageLayout = ImageLayout.Zoom; btn.BackgroundImage = Properties.Resources.Start; //btn.FlatAppearance.BorderSize = 0; //btn.FlatStyle = FlatStyle.Flat; btn.FlatAppearance.BorderColor = Color.Orange; btn.FlatStyle = FlatStyle.Flat; btn.Location = new Point(265, 35); btn.Size = new Size(150, 50); btn.ForeColor = Color.White; btn.Tag = i; btn.Font = new Font("Calibri", 12); btn.Click += Btn_Click; panel.Controls.Add(btn); LstbtnStart.Add(btn); var btnEnd = new Button(); // btnEnd.Text = "Выключить трансляцию"; btnEnd.BackgroundImageLayout = ImageLayout.Zoom; btnEnd.BackgroundImage = Properties.Resources.Pause; //btnEnd.FlatAppearance.BorderSize = 0; btnEnd.FlatAppearance.BorderColor = Color.Orange; btnEnd.FlatStyle = FlatStyle.Flat; btnEnd.Location = new Point(265, 95); btnEnd.Size = new Size(150, 50); btnEnd.ForeColor = Color.White; btnEnd.Tag = i; btnEnd.Font = new Font("Calibri", 12); btnEnd.Click += BtnEnd_Click; panel.Controls.Add(btnEnd); LstbtnEnd.Add(btnEnd); panel.Controls.Add(btn); } this.Controls.Add(flowPanel); }
internal async void RenderDoubleHandAsyncFor(string Who, Game Game, bool IsFlip1, bool IsFlip2) { FlowLayoutPanel Hand1Panel = new FlowLayoutPanel(); FlowLayoutPanel Hand2Panel = new FlowLayoutPanel(); Hand1Panel.Location = new Point(3, 3); Hand1Panel.Size = new Size(427, 299); Hand1Panel.TabIndex = 0; Hand2Panel.Location = new Point(436, 3); Hand2Panel.Size = new Size(427, 299); Hand2Panel.TabIndex = 1; if (Who == "Player") { PlayerHandCards.Controls.Clear(); PlayerHandCards.Controls.Add(Hand1Panel); PlayerHandCards.Controls.Add(Hand2Panel); Panel HandCard = new Panel(); foreach (Card Card in Game.Player.Hand1.ToList()) { Hand1Panel.Controls.Add(HandCard); PictureBox CardPhoto = new PictureBox(); RenderCardToPanelForPlayer(Card, CardPhoto, HandCard, IsFlip1); await Task.Delay(1500); } foreach (Card Card in Game.Player.Hand2.ToList()) { Hand2Panel.Controls.Add(HandCard); PictureBox CardPhoto = new PictureBox(); RenderCardToPanelForPlayer(Card, CardPhoto, HandCard, IsFlip2); await Task.Delay(1500); } } else { HouseHandCards.Controls.Clear(); HouseHandCards.Controls.Add(Hand1Panel); HouseHandCards.Controls.Add(Hand2Panel); foreach (Card Card in Game.Machine.Hand1.ToList()) { PictureBox CardPhoto = new PictureBox(); RenderCardToPanelForHouse(Card, CardPhoto, IsFlip1); Hand1Panel.Controls.Add(CardPhoto); await Task.Delay(1500); } foreach (Card Card in Game.Machine.Hand2.ToList()) { PictureBox CardPhoto = new PictureBox(); RenderCardToPanelForHouse(Card, CardPhoto, IsFlip2); Hand2Panel.Controls.Add(CardPhoto); await Task.Delay(1500); } } }
private void BlackJack_Load(object sender, EventArgs e) { SplitLabel1.Enabled = false; SplitLabel2.Enabled = false; //プレイヤーの作成 player = new Player(); player.Number = 1; //ディーラーの作成 dealer = new Player(); dealer.Number = 0; //スプリットしたとき用のプレイヤー splitPlayer = new Player(); splitPlayer.Number = 2; //フローレイアウトパネルの設定 flp = new FlowLayoutPanel[2]; for (int i = 0; i < flp.Length; i++) { flp[i] = new FlowLayoutPanel(); } flp[0].Dock = DockStyle.Left; flp[1].Dock = DockStyle.Top; flp[1].FlowDirection = FlowDirection.RightToLeft; flp[0].Size = new Size(this.ClientSize.Width, 140); flp[1].Size = new Size(this.ClientSize.Width, 140); tableLayoutPanel1.Controls.Add(flp[0], 1, 6); tableLayoutPanel1.Controls.Add(flp[1], 1, 1); ////スプリット用の画面配置にする //for (int i = 0; i < 2; i++) //{ // sflp[i] = new FlowLayoutPanel(); // //flp[0].Controls.Add(sflp[i]); // sflp[i].Parent = flp[0]; //} //sflp[0].Size = new Size(this.ClientSize.Width / 2 - 120, 300); //sflp[1].Size = new Size(this.ClientSize.Width / 2 - 100, 300); for (int i = 0; i < 2; i++) { playerPictureBoxes[i] = new List <PictureBox>(); } //引いたカードリストの作成 drawnCardList = new DrawnCard(); //プレイヤーの初期化 for (int i = 0; i < 2; i++) { player.DrawCard(drawnCardList); } label1.Text = player.Total().ToString(); //プレイヤーのカードの描画 PlayerDraw(); //ディーラーの初期化 for (int i = 0; i < 2; i++) { dealer.DrawCard(drawnCardList); } //ディーラーのカードの描画 DealerDraw(true); SplitButton.Enabled = false; Split(); }
private void InitializeComponent() { this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.classSettingsGroupBox = new System.Windows.Forms.GroupBox(); this.deleteSettingsButton = new System.Windows.Forms.Button(); this.addSettingsButton = new System.Windows.Forms.Button(); this.characterListBox = new System.Windows.Forms.ListBox(); this.runesGroupBox = new System.Windows.Forms.GroupBox(); this.runeFlowLayout = new System.Windows.Forms.FlowLayoutPanel(); this.runeListEditBox = new System.Windows.Forms.GroupBox(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.difficultyComboBox = new System.Windows.Forms.ComboBox(); this.characterClassComboBox = new System.Windows.Forms.ComboBox(); this.classLabel = new System.Windows.Forms.Label(); this.difficultyLabel = new System.Windows.Forms.Label(); this.runeComboBox = new System.Windows.Forms.ComboBox(); this.runeButton = new System.Windows.Forms.Button(); this.runewordComboBox = new System.Windows.Forms.ComboBox(); this.runewordButton = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.classSettingsGroupBox.SuspendLayout(); this.runesGroupBox.SuspendLayout(); this.runeListEditBox.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.Location = new System.Drawing.Point(0, 0); // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.classSettingsGroupBox); this.splitContainer1.Panel1MinSize = 140; // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.runesGroupBox); this.splitContainer1.Panel2.Controls.Add(this.runeListEditBox); this.splitContainer1.Panel2MinSize = 200; this.splitContainer1.Size = new System.Drawing.Size(497, 440); this.splitContainer1.SplitterDistance = 149; // // classSettingsGroupBox // this.classSettingsGroupBox.Controls.Add(this.deleteSettingsButton); this.classSettingsGroupBox.Controls.Add(this.addSettingsButton); this.classSettingsGroupBox.Controls.Add(this.characterListBox); this.classSettingsGroupBox.Dock = System.Windows.Forms.DockStyle.Fill; this.classSettingsGroupBox.Location = new System.Drawing.Point(0, 0); this.classSettingsGroupBox.MinimumSize = new System.Drawing.Size(140, 0); this.classSettingsGroupBox.Size = new System.Drawing.Size(149, 440); this.classSettingsGroupBox.Text = "Class Settings"; // // deleteSettingsButton // this.deleteSettingsButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; this.deleteSettingsButton.Location = new System.Drawing.Point(31, 414); this.deleteSettingsButton.Size = new System.Drawing.Size(59, 23); this.deleteSettingsButton.Text = "Remove"; this.deleteSettingsButton.Click += new System.EventHandler(this.DeleteSettingsButtonOnClick); // // addSettingsButton // this.addSettingsButton.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; this.addSettingsButton.Location = new System.Drawing.Point(96, 414); this.addSettingsButton.Size = new System.Drawing.Size(50, 23); this.addSettingsButton.Text = "Add"; this.addSettingsButton.Click += new System.EventHandler(this.AddSettingsButtonOnClick); // // characterListBox // this.characterListBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; this.characterListBox.FormattingEnabled = true; this.characterListBox.Location = new System.Drawing.Point(3, 16); this.characterListBox.Size = new System.Drawing.Size(143, 394); this.characterListBox.MouseDoubleClick += new System.Windows.Forms.MouseEventHandler(this.CharacterListBoxOnMouseDoubleClick); // // runesGroupBox // this.runesGroupBox.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; this.runesGroupBox.Controls.Add(this.runeFlowLayout); this.runesGroupBox.Location = new System.Drawing.Point(3, 3); this.runesGroupBox.Size = new System.Drawing.Size(337, 313); this.runesGroupBox.Text = "Runes"; // // runeFlowLayout // this.runeFlowLayout.Dock = System.Windows.Forms.DockStyle.Fill; this.runeFlowLayout.Location = new System.Drawing.Point(3, 16); this.runeFlowLayout.Size = new System.Drawing.Size(331, 294); // // runeListEditBox // this.runeListEditBox.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right; this.runeListEditBox.Controls.Add(this.tableLayoutPanel1); this.runeListEditBox.Controls.Add(this.runeComboBox); this.runeListEditBox.Controls.Add(this.runeButton); this.runeListEditBox.Controls.Add(this.runewordComboBox); this.runeListEditBox.Controls.Add(this.runewordButton); this.runeListEditBox.Location = new System.Drawing.Point(3, 322); this.runeListEditBox.Size = new System.Drawing.Size(337, 115); this.runeListEditBox.Text = "Edit"; // // tableLayoutPanel1 // this.tableLayoutPanel1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.tableLayoutPanel1.ColumnCount = 2; this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 50F)); this.tableLayoutPanel1.Controls.Add(this.difficultyComboBox, 1, 1); this.tableLayoutPanel1.Controls.Add(this.characterClassComboBox, 0, 1); this.tableLayoutPanel1.Controls.Add(this.classLabel, 0, 0); this.tableLayoutPanel1.Controls.Add(this.difficultyLabel, 1, 0); this.tableLayoutPanel1.Location = new System.Drawing.Point(3, 14); this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(0); this.tableLayoutPanel1.RowCount = 2; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 14F)); this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 22F)); this.tableLayoutPanel1.Size = new System.Drawing.Size(331, 38); // // difficultyComboBox // this.difficultyComboBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.difficultyComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.difficultyComboBox.FormattingEnabled = true; this.difficultyComboBox.Location = new System.Drawing.Point(168, 17); this.difficultyComboBox.Size = new System.Drawing.Size(160, 21); this.difficultyComboBox.SelectedValueChanged += new System.EventHandler(this.DifficultyComboBoxOnSelectedValueChanged); // // characterClassComboBox // this.characterClassComboBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.characterClassComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.characterClassComboBox.FormattingEnabled = true; this.characterClassComboBox.Location = new System.Drawing.Point(3, 17); this.characterClassComboBox.Size = new System.Drawing.Size(159, 21); this.characterClassComboBox.SelectedValueChanged += new System.EventHandler(this.CharacterClassComboBoxOnSelectedValueChanged); // // classLabel // this.classLabel.AutoSize = true; this.classLabel.Location = new System.Drawing.Point(3, 0); this.classLabel.Size = new System.Drawing.Size(32, 13); this.classLabel.Text = "Class"; // // difficultyLabel // this.difficultyLabel.AutoSize = true; this.difficultyLabel.Location = new System.Drawing.Point(168, 0); this.difficultyLabel.Size = new System.Drawing.Size(47, 13); this.difficultyLabel.Text = "Difficulty"; // // runeComboBox // this.runeComboBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.runeComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.runeComboBox.FormattingEnabled = true; this.runeComboBox.Location = new System.Drawing.Point(6, 57); this.runeComboBox.Size = new System.Drawing.Size(229, 21); // // runeButton // this.runeButton.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.runeButton.Location = new System.Drawing.Point(241, 55); this.runeButton.Size = new System.Drawing.Size(90, 23); this.runeButton.Text = "Add"; this.runeButton.Click += new System.EventHandler(this.RuneButtonOnClick); // // runewordComboBox // this.runewordComboBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.runewordComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.runewordComboBox.FormattingEnabled = true; this.runewordComboBox.Location = new System.Drawing.Point(6, 86); this.runewordComboBox.Size = new System.Drawing.Size(229, 21); // // runewordButton // this.runewordButton.Anchor = AnchorStyles.Top | AnchorStyles.Right; this.runewordButton.Location = new System.Drawing.Point(241, 84); this.runewordButton.Size = new System.Drawing.Size(90, 23); this.runewordButton.Text = "Add"; this.runewordButton.Click += new System.EventHandler(this.RunewordButtonOnClick); // // RuneSettingsPage // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.Controls.Add(this.splitContainer1); this.Name = "RuneSettingsPage"; this.Size = new System.Drawing.Size(497, 440); this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); this.classSettingsGroupBox.ResumeLayout(false); this.runesGroupBox.ResumeLayout(false); this.runeListEditBox.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); this.ResumeLayout(false); }
public ItemForm(GameVersion version, ItemDat itemDat, TSSFile TSS, T8BTSK.T8BTSK skills, T8BTEMST.T8BTEMST enemies, COOKDAT.COOKDAT cookdat, WRLDDAT.WRLDDAT locations) { InitializeComponent(); this.Version = version; this.itemDat = itemDat; this.TSS = TSS; this.Skills = skills; this.Enemies = enemies; this.Recipes = cookdat; this.Locations = locations; this.InGameIdDict = TSS.GenerateInGameIdDictionary(); labels = new List <Label>(); textboxes = new List <TextBox>(); for (int i = 0; i < ItemDatSingle.size / 4; ++i) { Label l = new Label(); l.Text = ""; l.Size = new System.Drawing.Size(100, 20); TextBox b = new TextBox(); b.Size = new System.Drawing.Size(50, 20); b.Text = ""; labels.Add(l); textboxes.Add(b); FlowLayoutPanel p = new FlowLayoutPanel(); p.Size = new System.Drawing.Size(200, 20); p.FlowDirection = FlowDirection.LeftToRight; p.Controls.Add(l); p.Controls.Add(b); switch ((ItemData)i) { case ItemData.NamePointer: case ItemData.DescriptionPointer: case ItemData.UnknownTextPointer: case ItemData.TextIDPart1: case ItemData.TextIDPart2: case ItemData.TextIDPart3: case ItemData.TextIDPart4: case ItemData.TextIDPart5: case ItemData.TextIDPart6: case ItemData.TextIDPart7: case ItemData.TextIDPart8: break; default: flowLayoutPanel1.Controls.Add(p); break; } } foreach (ItemDatSingle i in itemDat.items) { var entry = GetEntry(i.Data[(int)ItemData.NamePointer]); listBox1.Items.Add(entry.StringEngOrJpn); } }
public TgcVertex3fModifier(string varName, Vector3 minValue, Vector3 maxValue, Vector3 defaultValue) : base(varName) { this.minValue = minValue; this.maxValue = maxValue; //numericUpDownX numericUpDownX = new NumericUpDown(); numericUpDownX.Size = new System.Drawing.Size(50, 20); numericUpDownX.Margin = new Padding(0); numericUpDownX.DecimalPlaces = 4; numericUpDownX.Minimum = (decimal)minValue.X; numericUpDownX.Maximum = (decimal)maxValue.X; numericUpDownX.Value = (decimal)defaultValue.X; numericUpDownX.Increment = (decimal)(2f * (maxValue.X - minValue.X) / 100f); numericUpDownX.ValueChanged += new EventHandler(numericUpDownX_ValueChanged); //numericUpDownY numericUpDownY = new NumericUpDown(); numericUpDownY.Size = new System.Drawing.Size(50, 20); numericUpDownY.Margin = new Padding(0); numericUpDownY.DecimalPlaces = 4; numericUpDownY.Minimum = (decimal)minValue.Y; numericUpDownY.Maximum = (decimal)maxValue.Y; numericUpDownY.Value = (decimal)defaultValue.Y; numericUpDownY.Increment = (decimal)(2f * (maxValue.Y - minValue.Y) / 100f); numericUpDownY.ValueChanged += new EventHandler(numericUpDownY_ValueChanged); //numericUpDownZ numericUpDownZ = new NumericUpDown(); numericUpDownZ.Size = new System.Drawing.Size(50, 20); numericUpDownZ.Margin = new Padding(0); numericUpDownZ.DecimalPlaces = 4; numericUpDownZ.Minimum = (decimal)minValue.Z; numericUpDownZ.Maximum = (decimal)maxValue.Z; numericUpDownZ.Value = (decimal)defaultValue.Z; numericUpDownZ.Increment = (decimal)(2f * (maxValue.Z - minValue.Z) / 100f); numericUpDownZ.ValueChanged += new EventHandler(numericUpDownZ_ValueChanged); //Panel para los tres numericUpDown vertexValuesPanel = new FlowLayoutPanel(); vertexValuesPanel.Margin = new Padding(0); vertexValuesPanel.AutoSize = true; vertexValuesPanel.FlowDirection = FlowDirection.LeftToRight; vertexValuesPanel.Controls.Add(numericUpDownX); vertexValuesPanel.Controls.Add(numericUpDownY); vertexValuesPanel.Controls.Add(numericUpDownZ); //trackBarX trackBarX = new TrackBar(); trackBarX.Size = new System.Drawing.Size(100, 20); trackBarX.Margin = new Padding(0); trackBarX.Minimum = 0; trackBarX.Maximum = 20; trackBarX.Value = (int)((defaultValue.X - minValue.X) * 20 / (maxValue.X - minValue.X)); trackBarX.ValueChanged += new EventHandler(trackBarX_ValueChanged); //trackBarY trackBarY = new TrackBar(); trackBarY.Size = new System.Drawing.Size(100, 20); trackBarY.Margin = new Padding(0); trackBarY.Minimum = 0; trackBarY.Maximum = 20; trackBarY.Value = (int)((defaultValue.Y - minValue.Y) * 20 / (maxValue.Y - minValue.Y)); trackBarY.ValueChanged += new EventHandler(trackBarY_ValueChanged); //trackBarZ trackBarZ = new TrackBar(); trackBarZ.Size = new System.Drawing.Size(100, 20); trackBarZ.Margin = new Padding(0); trackBarZ.Minimum = 0; trackBarZ.Maximum = 20; trackBarZ.Value = (int)((defaultValue.Z - minValue.Z) * 20 / (maxValue.Z - minValue.Z)); trackBarZ.ValueChanged += new EventHandler(trackBarZ_ValueChanged); contentPanel.Controls.Add(vertexValuesPanel); contentPanel.Controls.Add(trackBarX); contentPanel.Controls.Add(trackBarY); contentPanel.Controls.Add(trackBarZ); }
/// <summary> /// Semiautomatically generated code /// </summary> private void InitializeComponent() { tableLayoutPanelReferences = new TableLayoutPanel(); mainPanel = new Panel(); flowLayoutPanelBaseDetailsContainer = new FlowLayoutPanel(); aircraftReferencesControl1 = new TemplateAircraftReferencesControl(); aircraftInfoReference = new TemplateAircraftInfoReference(currentAircraft); footerControl = new FooterControl(); headerControl = new HeaderControl(); aircraftHeader = new TemplateAircraftHeaderControl(currentAircraft, true, false); buttonAddTemplate = new RichReferenceButton(); buttonDeleteTemplate = new RichReferenceButton(); buttonAddBaseDetail = new AvButtonT(); aircraftFrameControl = new TemplateBaseDetailControl(currentAircraft.AircraftFrame); landingGearsButtons = new TemplateLandingGearsButtonsControl(currentAircraft); linkLandingGearStatus = new ReferenceStatusImageLinkLabel(); permissionForDelete = currentAircraft.HasPermission(Users.CurrentUser, DataEvent.Remove); // // tableLayoutPanelReferences // tableLayoutPanelReferences.AutoSize = true; tableLayoutPanelReferences.AutoSizeMode = AutoSizeMode.GrowAndShrink; tableLayoutPanelReferences.ColumnStyles.Add(new ColumnStyle()); tableLayoutPanelReferences.Controls.Add(aircraftReferencesControl1, 0, 0); tableLayoutPanelReferences.Controls.Add(aircraftInfoReference, 0, 1); tableLayoutPanelReferences.Location = new Point(0, 0); tableLayoutPanelReferences.Margin = new Padding(10); tableLayoutPanelReferences.RowStyles.Add(new RowStyle()); tableLayoutPanelReferences.RowStyles.Add(new RowStyle()); tableLayoutPanelReferences.RowStyles.Add(new RowStyle()); tableLayoutPanelReferences.MinimumSize = new Size(REFERENCES_WIDTH, REFERENCES_HEIGHT); tableLayoutPanelReferences.TabIndex = 0; // // mainPanel // mainPanel.Controls.Add(flowLayoutPanelBaseDetailsContainer); mainPanel.Controls.Add(tableLayoutPanelReferences); mainPanel.Controls.Add(landingGearsButtons); mainPanel.Controls.Add(linkLandingGearStatus); mainPanel.Controls.Add(buttonAddBaseDetail); mainPanel.Controls.Add(buttonDeleteTemplate); mainPanel.Controls.Add(buttonAddTemplate); mainPanel.AutoScroll = true; mainPanel.Dock = DockStyle.Fill; mainPanel.TabIndex = 1; mainPanel.SizeChanged += mainPanel_SizeChanged; // // flowLayoutPanelBaseDetailsContainer // flowLayoutPanelBaseDetailsContainer.FlowDirection = FlowDirection.TopDown; flowLayoutPanelBaseDetailsContainer.AutoScroll = true; flowLayoutPanelBaseDetailsContainer.AutoSize = true; flowLayoutPanelBaseDetailsContainer.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanelBaseDetailsContainer.Location = new Point(REFERENCES_WIDTH, 0); flowLayoutPanelBaseDetailsContainer.Padding = new Padding(0, 27, 0, 0); flowLayoutPanelBaseDetailsContainer.TabIndex = 1; flowLayoutPanelBaseDetailsContainer.SizeChanged += flowLayoutPanelContentContainer_SizeChanged; flowLayoutPanelBaseDetailsContainer.Controls.Add(aircraftFrameControl); // // aircraftReferencesControl1 // aircraftReferencesControl1.AutoSize = true; aircraftReferencesControl1.AutoSizeMode = AutoSizeMode.GrowAndShrink; aircraftReferencesControl1.BackColor = Css.CommonAppearance.Colors.BackColor; aircraftReferencesControl1.Caption = "Aircraft references"; aircraftReferencesControl1.DescriptionTextColor = Color.DimGray; aircraftReferencesControl1.Dock = DockStyle.Top; aircraftReferencesControl1.Location = new Point(30, 30); aircraftReferencesControl1.Margin = new Padding(30, 30, 3, 3); aircraftReferencesControl1.MinimumSize = new Size(50, 50); aircraftReferencesControl1.Size = new Size(362, 528); aircraftReferencesControl1.TabIndex = 0; aircraftReferencesControl1.UpperLeftIcon = icons.GrayArrow; aircraftReferencesControl1.LinkADStatusDisplayerRequested += linkADStatus_DisplayerRequested; aircraftReferencesControl1.LinkAgingProgramDisplayerRequested += linkAgingProgram_DisplayerRequested; aircraftReferencesControl1.LinkAircraftGeneralDataDisplayerRequested += linkAircraftGeneralData_DisplaeyRequested; aircraftReferencesControl1.LinkComponentStatusDisplayerRequested += linkComponentStatus_DisplayerRequested; aircraftReferencesControl1.LinkCPCPStatusDisplayerRequested += linkCPCPStatus_DisplayerRequested; aircraftReferencesControl1.LinkLandingGearStatusDisplayerRequested += LinkLandingGearStatus_DisplayerRequested; aircraftReferencesControl1.LinkMaintenanceStatusDisplayerRequested += linkMaintenanceStatusDisplayerRequested; aircraftReferencesControl1.LinkSBStatusDisplayerRequested += linkSBStatus_DisplayerRequested; // // aircraftInfoReference // aircraftInfoReference.AutoSize = true; aircraftInfoReference.AutoSizeMode = AutoSizeMode.GrowAndShrink; aircraftInfoReference.BackColor = Css.CommonAppearance.Colors.BackColor; aircraftInfoReference.Caption = "Aircraft information"; aircraftInfoReference.DescriptionTextColor = Color.DimGray; aircraftInfoReference.Margin = new Padding(30, 15, 30, 3); aircraftInfoReference.MinimumSize = new Size(50, 50); aircraftInfoReference.TabIndex = 1; aircraftInfoReference.UpperLeftIcon = icons.GrayArrow; // // footerControl // footerControl.TabIndex = 2; // // headerControl // headerControl.Controls.Add(aircraftHeader); headerControl.TabIndex = 0; headerControl.ReloadRised += headerControl_ReloadRised; headerControl.EditDisplayerRequested += linkAircraftGeneralData_DisplaeyRequested; headerControl.ActionControl.ShowEditButton = true; headerControl.ContextActionControl.ButtonHelp.TopicID = "entering_an_aircraft_to_the_cas_database"; // // buttonAddBaseDetail // buttonAddBaseDetail.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonAddBaseDetail.FontMain = Css.HeaderControl.Fonts.PrimaryFont; buttonAddBaseDetail.ForeColorMain = Css.HeaderControl.Colors.PrimaryColor; buttonAddBaseDetail.Icon = icons.Add; buttonAddBaseDetail.IconNotEnabled = icons.AddGray; buttonAddBaseDetail.Width = 160; buttonAddBaseDetail.TextMain = "Add Base Component"; buttonAddBaseDetail.Click += buttonAddBaseDetail_Click; // // buttonDeleteTemplate // buttonDeleteTemplate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonDeleteTemplate.FontMain = Css.HeaderControl.Fonts.PrimaryFont; buttonDeleteTemplate.ForeColorMain = Css.HeaderControl.Colors.PrimaryColor; buttonDeleteTemplate.Icon = icons.Delete; buttonDeleteTemplate.IconNotEnabled = icons.DeleteGray; buttonDeleteTemplate.ReflectionType = ReflectionTypes.CloseSelected; buttonDeleteTemplate.Width = 150; buttonDeleteTemplate.Location = new Point(mainPanel.Right - buttonDeleteTemplate.Width, mainPanel.Bottom - buttonDeleteTemplate.Height - BOTTOM_MARGIN); buttonDeleteTemplate.TextMain = "Delete Template"; buttonDeleteTemplate.DisplayerRequested += buttonDeleteTemplate_DisplayerRequested; buttonDeleteTemplate.Visible = permissionForDelete; // // buttonAddTemplate // buttonAddTemplate.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; buttonAddTemplate.FontMain = Css.HeaderControl.Fonts.PrimaryFont; buttonAddTemplate.ForeColorMain = Css.HeaderControl.Colors.PrimaryColor; buttonAddTemplate.FontSecondary = Css.HeaderControl.Fonts.PrimaryFont; buttonAddTemplate.ForeColorSecondary = Css.HeaderControl.Colors.PrimaryColor; buttonAddTemplate.Icon = icons.Add; buttonAddTemplate.IconNotEnabled = icons.AddGray; buttonAddTemplate.Width = 350; buttonAddTemplate.PaddingMain = new Padding(3, 0, 0, 0); buttonAddTemplate.TextAlignMain = ContentAlignment.BottomLeft; buttonAddTemplate.TextAlignSecondary = ContentAlignment.TopLeft; buttonAddTemplate.TextMain = "Add " + currentAircraft.Model; if (OperatorCollection.Instance.Count == 1) { buttonAddTemplate.TextSecondary = " to " + OperatorCollection.Instance[0].Name; } else { buttonAddTemplate.TextSecondary = " to operator"; } buttonAddTemplate.DisplayerRequested += buttonAddTemplate_DisplayerRequested; // // linkLandingGearStatus // Css.ImageLink.Adjust(linkLandingGearStatus); linkLandingGearStatus.Margin = new Padding(1); linkLandingGearStatus.Size = new Size(300, 30); linkLandingGearStatus.Text = "View Landing Gear Status"; linkLandingGearStatus.TextAlign = ContentAlignment.MiddleLeft; linkLandingGearStatus.ReflectionType = ReflectionTypes.DisplayInNew; linkLandingGearStatus.DisplayerRequested += LinkLandingGearStatus_DisplayerRequested; linkLandingGearStatus.Enabled = true; // // aircraftFrameControl // aircraftFrameControl.TabIndex = 0; // // landingGearsButtons // landingGearsButtons.LocationChanged += landingGearsButtons_LocationChanged; landingGearsButtons.SizeChanged += landingGearsButtons_SizeChanged; // // TemplateAircraftScreen // BackColor = Css.CommonAppearance.Colors.BackColor; Controls.Add(mainPanel); Controls.Add(footerControl); Controls.Add(headerControl); }
/** * Method to create a radio button group with radio buttons. We'll use the FlowLayout Panel to group the radio buttons **/ private FlowLayoutPanel CreateRadioGroupUIElement(Element element, int viewID) { FlowLayoutPanel panel = new FlowLayoutPanel(); // fetch element options for each radio button if (element.HasOptions == false) { element.FetchElementOptions(); } // apply element options foreach (string option in element.ElementOptions) { RadioButton rb = new RadioButton(); rb.Text = option.ToString(); panel.Controls.Add(rb); } return panel; }
/// <summary> /// Performs the custom layout. /// </summary> private void PerformCustomLayout() { // Remove controls and dispose them IEnumerable <Control> oldControls = MainFlowLayoutPanel.Controls.Cast <Control>().ToList(); MainFlowLayoutPanel.Controls.Clear(); foreach (Control ctl in oldControls) { ctl.Dispose(); } IEnumerable <Character> characters = GetCharacters; // Add controls for characters if (Settings.UI.SystemTrayPopup.GroupBy == TrayPopupGrouping.Account && Settings.UI.SystemTrayPopup.IndentGroupedAccounts) { List <APIKey> prevAPIKeys = new List <APIKey>(); foreach (Character character in characters) { OverviewItem charPanel = GetOverviewItem(character); List <APIKey> apiKeys = character.Identity.APIKeys.ToList(); if (!apiKeys.Exists(apiKey => prevAPIKeys.Contains(apiKey))) { MainFlowLayoutPanel.Controls.Add(charPanel); prevAPIKeys = apiKeys; } else { FlowLayoutPanel tempAccountGroupPanel = null; try { tempAccountGroupPanel = new FlowLayoutPanel(); tempAccountGroupPanel.Controls.Add(charPanel); tempAccountGroupPanel.AutoSize = true; tempAccountGroupPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; tempAccountGroupPanel.FlowDirection = FlowDirection.TopDown; tempAccountGroupPanel.Padding = new Padding(10, 0, 0, 0); tempAccountGroupPanel.CreateControl(); FlowLayoutPanel accountGroupPanel = tempAccountGroupPanel; tempAccountGroupPanel = null; MainFlowLayoutPanel.Controls.Add(accountGroupPanel); } finally { tempAccountGroupPanel?.Dispose(); } prevAPIKeys = apiKeys; } } } else { MainFlowLayoutPanel.Controls.AddRange(characters.Select(GetOverviewItem).ToArray <Control>()); } }
/// <summary> /// 成果物内の要素を、要素編集画面を開くリンク付きでパネルに表示する。 /// </summary> /// <param name="elemPanel">表示すべき成果物パネル</param> /// <param name="elements">要素リスト</param> /// <param name="depth">ネストの深さ</param> private void addElementLabels(FlowLayoutPanel elemPanel, IList <ElementVO> elements, int depth) { string nameLabel; string stereotypeStr; foreach (ElementVO elem in elements) { if (checkDisplayableType(elem.eaType)) { LinkLabel labelElement = new LinkLabel(); if (elem.stereoType != null && elem.stereoType != "") { stereotypeStr = "<<" + elem.stereoType + ">> "; } else { stereotypeStr = ""; } // ノート要素の場合、もしくはname属性の中身が空の場合 if ("Notes".Equals(elem.eaType) || elem.name == null || elem.name == "") { // ノートの始めの30文字分を出だしとして出力 if (elem.notes.Length > 30) { nameLabel = "(" + elem.eaType + ") " + elem.notes.Substring(0, 30) + ".."; } else { nameLabel = "(" + elem.eaType + ") " + elem.notes; } } else { nameLabel = "(" + elem.eaType + ") " + stereotypeStr + elem.name; } switch (elem.changed) { case ' ': labelElement.Text = nameLabel; labelElement.Click += new System.EventHandler(this.LblElemOpenClick); break; case 'C': case 'D': labelElement.Text = nameLabel + " [" + elem.changed + "]"; labelElement.Click += new System.EventHandler(this.LblElemOpenClick); break; case 'U': labelElement.Text = nameLabel + " [" + elem.changed + "]"; labelElement.Click += new System.EventHandler(this.LblElemOpenClick); break; } labelElement.Margin = new System.Windows.Forms.Padding(12 * depth, 3, 3, 3); labelElement.Tag = elem; labelElement.AutoSize = true; elemPanel.Controls.Add(labelElement); } } }
/// <summary> /// Creates a panel contains the warning message for accounts not in training. /// </summary> /// <param name="warningMessage"></param> /// <returns></returns> private static FlowLayoutPanel CreateAccountsNotTrainingPanel(string warningMessage) { // Create a flowlayout to hold the content FlowLayoutPanel warningPanel; FlowLayoutPanel tempWarningPanel = null; try { tempWarningPanel = new FlowLayoutPanel { AutoSize = true, AutoSizeMode = AutoSizeMode.GrowAndShrink, Margin = new Padding(0, 0, 0, 2) }; // Add a picture on the left with a warning icon if (!Settings.UI.SafeForWork) { int portraitSize = Int32.Parse(Settings.UI.SystemTrayPopup.PortraitSize.ToString().Substring(1), CultureConstants.InvariantCulture); PictureBox tempPictureBoxWarning = null; try { tempPictureBoxWarning = new PictureBox(); tempPictureBoxWarning.Image = SystemIcons.Warning.ToBitmap(); tempPictureBoxWarning.SizeMode = PictureBoxSizeMode.StretchImage; tempPictureBoxWarning.Size = new Size(portraitSize, portraitSize); tempPictureBoxWarning.Margin = new Padding(2); PictureBox pbWarning = tempPictureBoxWarning; tempPictureBoxWarning = null; tempWarningPanel.Controls.Add(pbWarning); } finally { tempPictureBoxWarning?.Dispose(); } } // Adds a label to hold the message Label tempLabelMessage = null; try { tempLabelMessage = new Label { AutoSize = true, Text = warningMessage }; Label lblMessage = tempLabelMessage; tempLabelMessage = null; tempWarningPanel.Controls.Add(lblMessage); } finally { tempLabelMessage?.Dispose(); } tempWarningPanel.CreateControl(); warningPanel = tempWarningPanel; tempWarningPanel = null; } finally { tempWarningPanel?.Dispose(); } return(warningPanel); }
public void PopulateColumns(FuncionarioVaccinaColletion func) { if (func.ListaVacinas != null) { if (func.ListaVacinas.Count > 0) { foreach (Vacina vacina in func.ListaVacinas) { //insert column //deal with square containing labels Panel pnlegendaDose = new Panel(); //pnlegendaDose.Name = "nome"; var margim = pnlegendaDose.Margin; margim.All = 1; pnlegendaDose.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, 40); pnlegendaDose.Margin = margim; pnlegendaDose.BackColor = Color.LightGray; Label dosevacina = new Label(); dosevacina.Text = vacina.Nome; //panel for name of vaccine handler pnlegendaDose.Controls.Add(dosevacina); dosevacina.Left = (pnlegendaDose.ClientSize.Width - dosevacina.Width) / 2; dosevacina.Top = (pnlegendaDose.ClientSize.Height - dosevacina.Height) / 2; //panel for name of vaccine 1st dose //check if there s acolumn for related vaccine bool auxControl = true; Control aux1 = null; //foreach (Control c in vacinaPanel.Controls) //{ // if (vacina._nome == c.Tag) // { // if (vacina._nome == c.Name) // { // //c.Controls.Add(); // aux1 = c; // c.BackColor = Color.Red; // auxControl = false; // } // } //} FlowLayoutPanel column2 = new FlowLayoutPanel(); if (auxControl) { column2.BackColor = Color.Yellow; column2.Tag = vacina.Nome; column2.Name = vacina.Nome; var margin = column2.Margin; margin.All = 0; margin.Right = 1; column2.Margin = margin; column2.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, VacinaPanel.Size.Height); column2.MinimumSize = new Size((VacinaPanel.Size.Width - 6) / 6, VacinaPanel.Size.Height); } Panel teste = new Panel(); dosevacina.Left = (pnlegendaDose.ClientSize.Width - dosevacina.Width) / 2; dosevacina.Top = (pnlegendaDose.ClientSize.Height - dosevacina.Height) / 2; Panel pn1Dose = new Panel(); pn1Dose.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 46) / 3); pn1Dose.MinimumSize = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 46) / 3); margim = pnlegendaDose.Margin; margim.All = 1; pn1Dose.Margin = margim; pn1Dose.BackColor = Color.LightGray; Label lbData = new Label(); Label lbLote = new Label(); Label lbUnid = new Label(); lbData.Text = String.Format("Data:" + vacina.Dados.Data.ToString("dd/MM/yyyy")); lbLote.Text = String.Format("Lote:" + vacina.Dados.Lote); lbUnid.Text = String.Format("Unid:" + vacina.Dados.Unidade); margim.All = 1; //lbData.Dock = DockStyle.Top; lbData.Margin = margim; lbData.Left = (pn1Dose.ClientSize.Width - lbData.Width) / 2; lbData.Top = (pn1Dose.ClientSize.Height - lbData.Height) / 5; pn1Dose.Controls.Add(lbData); pn1Dose.Controls.Add(lbLote); lbLote.Left = lbData.Left; lbLote.Top = lbData.Top + 25; //lbLote.Dock = DockStyle.Top; lbLote.Margin = margim; //lbUnid.Dock = DockStyle.Top; lbUnid.Margin = margim; pn1Dose.Controls.Add(lbUnid); lbUnid.Left = lbData.Left; lbUnid.Top = lbData.Top + 50; teste = pn1Dose; if (aux1 != null) { aux1.Controls.Add(pn1Dose); } foreach (Control c in VacinaPanel.Controls) { if (vacina.Nome == c.Tag) { if (vacina.Nome == c.Name) { //c.Controls.Add(); aux1 = c; c.BackColor = Color.Red; auxControl = false; VacinaPanel.Controls.Remove(c); c.Controls.Add(pn1Dose); VacinaPanel.Controls.Add(c); } } } //vacinaPanel.Controls.Add(Column2); if (auxControl) { column2.Controls.Add(pnlegendaDose); VacinaPanel.Controls.Add(column2); } else { VacinaPanel.Controls.Remove(aux1); aux1.Controls.Add(teste); VacinaPanel.Controls.Add(aux1); } } } } }
private void InitializeComponent() { var resources = new System.ComponentModel.ComponentResourceManager(typeof(AboutBox)); PictureBox1 = new System.Windows.Forms.PictureBox(); txtAbout = new System.Windows.Forms.TextBox(); Label1 = new System.Windows.Forms.Label(); lblVersion = new System.Windows.Forms.Label(); lblHomepage = new System.Windows.Forms.LinkLabel(); flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); ((System.ComponentModel.ISupportInitialize)(PictureBox1)).BeginInit(); flowLayoutPanel1.SuspendLayout(); SuspendLayout(); // // PictureBox1 // PictureBox1.Dock = System.Windows.Forms.DockStyle.Top; PictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("PictureBox1.Image"))); PictureBox1.Location = new System.Drawing.Point(0, 0); PictureBox1.Name = "PictureBox1"; PictureBox1.Size = new System.Drawing.Size(454, 158); PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; PictureBox1.TabIndex = 0; PictureBox1.TabStop = false; // // txtAbout // txtAbout.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; txtAbout.Dock = System.Windows.Forms.DockStyle.Fill; txtAbout.Location = new System.Drawing.Point(0, 158); txtAbout.Multiline = true; txtAbout.Name = "txtAbout"; txtAbout.ReadOnly = true; txtAbout.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; txtAbout.Size = new System.Drawing.Size(454, 154); txtAbout.TabIndex = 1; txtAbout.TabStop = false; txtAbout.Text = "Gump Studio was written by Bradley Uffner in January of 2003."; // // Label1 // Label1.Anchor = System.Windows.Forms.AnchorStyles.None; Label1.AutoSize = true; Label1.Location = new System.Drawing.Point(6, 3); Label1.Name = "Label1"; Label1.Size = new System.Drawing.Size(120, 13); Label1.TabIndex = 3; Label1.Text = "(C) Bradley Uffner, 2004"; // // lblVersion // lblVersion.AutoSize = true; lblVersion.Location = new System.Drawing.Point(138, 3); lblVersion.Name = "lblVersion"; lblVersion.Size = new System.Drawing.Size(42, 13); lblVersion.TabIndex = 4; lblVersion.Text = "Version"; // // lblHomepage // lblHomepage.Anchor = System.Windows.Forms.AnchorStyles.None; lblHomepage.AutoSize = true; lblHomepage.Location = new System.Drawing.Point(132, 3); lblHomepage.Name = "lblHomepage"; lblHomepage.Size = new System.Drawing.Size(0, 13); lblHomepage.TabIndex = 5; // // flowLayoutPanel1 // flowLayoutPanel1.AutoSize = true; flowLayoutPanel1.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; flowLayoutPanel1.Controls.Add(Label1); flowLayoutPanel1.Controls.Add(lblHomepage); flowLayoutPanel1.Controls.Add(lblVersion); flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Bottom; flowLayoutPanel1.Location = new System.Drawing.Point(0, 312); flowLayoutPanel1.Name = "flowLayoutPanel1"; flowLayoutPanel1.Padding = new System.Windows.Forms.Padding(3); flowLayoutPanel1.Size = new System.Drawing.Size(454, 19); flowLayoutPanel1.TabIndex = 6; flowLayoutPanel1.WrapContents = false; // // AboutBox // AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; AutoSize = true; ClientSize = new System.Drawing.Size(454, 331); Controls.Add(txtAbout); Controls.Add(flowLayoutPanel1); Controls.Add(PictureBox1); FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); Name = "AboutBox"; Text = "About Gump Studio.NET"; Load += new System.EventHandler(frmAboutBox_Load); ((System.ComponentModel.ISupportInitialize)(PictureBox1)).EndInit(); flowLayoutPanel1.ResumeLayout(false); flowLayoutPanel1.PerformLayout(); ResumeLayout(false); PerformLayout(); }
private void ShowVaccineInfo(FuncionarioVaccinaColletion vacina) { int squares = 1; foreach (Vacina vacinainfo in vacina.ListaVacinas) { FlowLayoutPanel pn1Dose = new FlowLayoutPanel(); pn1Dose.MaximumSize = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 46) / 3); pn1Dose.MinimumSize = new Size((VacinaPanel.Size.Width - 6) / 6, (VacinaPanel.Size.Height - 46) / 3); var margim = pn1Dose.Margin; margim.All = 1; pn1Dose.Margin = margim; pn1Dose.BackColor = Color.LightGray; Label lbData = new Label(); Label lbLote = new Label(); Label lbUnid = new Label(); lbData.Text = String.Format("Data:" + vacinainfo.Dados.Data.ToString("dd/MM/yyyy")); lbLote.Text = String.Format("Lote:" + vacinainfo.Dados.Lote); lbUnid.Text = String.Format("Unid:" + vacinainfo.Dados.Unidade); ViewControls.Vacinas.VaccineViewer vacineInfo = new ViewControls.Vacinas.VaccineViewer(vacinainfo.Nome, vacinainfo.Dados.Data.ToString("dd/MM/yyyy"), vacinainfo.Dados.Lote, vacinainfo.Dados.Unidade); margim.All = 1; vacineInfo.Margin = margim; //lbData.Dock = DockStyle.Top; lbData.Margin = margim; lbData.Left = (pn1Dose.ClientSize.Width - lbData.Width) / 2; lbData.Top = (pn1Dose.ClientSize.Height - lbData.Height) / 5; //pn1Dose.Controls.Add(lbData); //pn1Dose.Controls.Add(lbLote); lbLote.Left = lbData.Left; lbLote.Top = lbData.Top + 25; //lbLote.Dock = DockStyle.Top; lbLote.Margin = margim; //lbUnid.Dock = DockStyle.Top; lbUnid.Margin = margim; //pn1Dose.Controls.Add(lbUnid); lbUnid.Left = lbData.Left; string nomevacina = ""; switch (vacinainfo.Nome) { case "HEPATITE B": { nomevacina = "Heb B"; squares = 3; } break; case "DUPLA ADULTA": { nomevacina = "Dupla Adulta"; squares = 1; } break; case "RUBEOLA": { nomevacina = "Rubeola"; squares = 1; } break; case "FEBREAMARELA": { nomevacina = "Febre Amar."; squares = 2; } break; case "TRIPLICE VIRAL": { nomevacina = "Trip. Viral"; squares = 2; } break; default: nomevacina = "nao deu"; break; } //finds flowpanel with vaccine name Control panelToadd = HelperClass.FindTag(VacinaPanel.Controls, nomevacina); int dose = vacinainfo.Dose; //Size sizetose = pn1Dose.Size; vacineInfo.Size = new Size(_columDimentions[2].Width, (_columDimentions[2].Height - 1)); panelToadd.Controls.RemoveAt(dose); panelToadd.Controls.Add(vacineInfo); panelToadd.Controls.SetChildIndex(vacineInfo, (dose)); } var helper = HelperClass.FindTag(VacinaPanel.Controls, "teste"); }
//a function to load lab test costs private void LoadLabCost() { MySqlConnection con = new MySqlConnection(); con.ConnectionString = login.DBconnection; string test = " select Id,test,cost from lab_test where pID = '" + patientId + "' and status = 'New'"; MySqlCommand com = new MySqlCommand(test, con); DataTable table = new DataTable(); MySqlDataReader rd; try { con.Open(); rd = com.ExecuteReader(); table.Load(rd); rd.Close(); if (table.Rows.Count > 0) { for (int i = 0; i < table.Rows.Count; i++) { //Lab Test panel flpanel1 = new FlowLayoutPanel(); flpanel1.FlowDirection = FlowDirection.TopDown; flpanel1.Height = 25; flpanel1.Width = 500; flpanel1.BorderStyle = BorderStyle.FixedSingle; flpanel1.WrapContents = false; lb1 = new Label(); lb1.ForeColor = Color.White; lb1.Font = new Font("Cambria", 10, FontStyle.Bold); lb1.AutoSize = true; lb1.Text = table.Rows[i][1].ToString(); flpanel1.Controls.Add(lb1); flowLayoutPanel2.Controls.Add(flpanel1); //Test cost panel flpanel2 = new FlowLayoutPanel(); flpanel2.FlowDirection = FlowDirection.TopDown; flpanel2.Height = 25; flpanel2.Width = 150; flpanel2.BorderStyle = BorderStyle.FixedSingle; flpanel2.WrapContents = false; lb2 = new Label(); lb2.ForeColor = Color.White; lb2.Font = new Font("Cambria", 10, FontStyle.Bold); lb2.AutoSize = true; lb2.Text = table.Rows[i][2].ToString(); totalLabCost += int.Parse(table.Rows[i][2].ToString()); flpanel2.Controls.Add(lb2); flowLayoutPanel3.Controls.Add(flpanel2); //Test cost panel flpanel6 = new FlowLayoutPanel(); flpanel6.FlowDirection = FlowDirection.TopDown; flpanel6.Height = 25; flpanel6.Width = 150; flpanel6.BorderStyle = BorderStyle.FixedSingle; flpanel6.WrapContents = false; //the button to remove the test bt1 = new BunifuImageButton(); bt1.Height = 20; bt1.Name = table.Rows[i][0].ToString(); bt1.Width = 20; bt1.Cursor = Cursors.Hand; bt1.BackColor = Color.Transparent; bt1.Image = Properties.Resources.delete; bt1.Click += new EventHandler(RemoveTest); flpanel6.Controls.Add(bt1); flowLayoutPanel4.Controls.Add(flpanel6); //string update = "update lab_test set status = 'Approved' where Id = '" + table.Rows[i][0].ToString() + "'"; //MySqlCommand com1 = new MySqlCommand(update, con); //rd = com1.ExecuteReader(); //rd.Close(); } labCost.Text = totalLabCost.ToString(); labCostLable.Text = labCost.Text + "/="; } else { labCost.Text = totalLabCost.ToString(); labCostLable.Text = labCost.Text + "/="; } } catch (MySqlException ex) { MessageBox.Show(ex.Message); } con.Close(); }
private void addRow() { //1 Label nid = new Label(); nid.Text = seq.ToString(); nid.Width = w1; nid.TextAlign = ContentAlignment.MiddleCenter; nid.Tag = seq; nid.DoubleClick += id_DoubleClick; if (seq % 3 == 0) { nid.BackColor = Color.OrangeRed; } else if (seq % 3 == 1) { nid.BackColor = Color.GreenYellow; } else if (seq % 3 == 2) { nid.BackColor = Color.CornflowerBlue; } //2 TextBox ntitle = new TextBox(); ntitle.Width = w2; ntitle.Tag = seq; //3 TextBox npath = new TextBox(); npath.Width = w3; npath.Name = "path"; npath.Tag = seq; npath.TextChanged += getContent; npath.DoubleClick += txtPath_DoubleClick; npath.KeyDown += enter_copy; //4 TextBox nfilter = new TextBox(); nfilter.Width = w4; nfilter.Name = "filter"; nfilter.Tag = seq; nfilter.TextChanged += filterContent; //5 ComboBox ncontent = new ComboBox(); ncontent.Width = w5; ncontent.Name = "content"; ncontent.DropDownStyle = ComboBoxStyle.DropDownList; ncontent.Tag = seq; ncontent.KeyDown += enter_copy; //ncontent.SelectedIndexChanged += cbxContent_SelectedIndexChanged; //6 Button nopen = new Button(); nopen.Width = w6; nopen.Text = ">>"; nopen.Name = "open"; nopen.Tag = seq; nopen.Click += btnOpen_Click; FlowLayoutPanel nrow = new FlowLayoutPanel(); nrow.FlowDirection = FlowDirection.LeftToRight; nrow.Width = outerBox.Width; nrow.Tag = seq; nrow.Controls.Add(nid); nrow.Controls.Add(ntitle); nrow.Controls.Add(npath); nrow.Controls.Add(nfilter); nrow.Controls.Add(ncontent); nrow.Controls.Add(nopen); nrow.Height = hr; nrow.BackColor = Color.Transparent; npathList.Add(npath); nfilterList.Add(nfilter); ncontentList.Add(ncontent); nrowList.Add(nrow); outerBox.Controls.Add(nrow); seq++; }
public void BuildSubURLTabs(object sender, EventArgs ev, URLTabPlugin.TabTypes tt) { if (sender != null) { /* Create a panel, find the parent form and maximize it */ Panel p = (Panel)sender; TabPage c = (TabPage)p.Parent; Form f = c.FindForm(); f.WindowState = FormWindowState.Maximized; TabControl tc = new TabControl(); p.Controls.Add(tc); tc.Dock = DockStyle.Fill; /* Create a list of URLTabs */ this.propertyString = "URLTabPlugin+" + c.Text.Replace(" ", "_"); string result = objHost.GetSQL("SELECT Value FROM properties where Name LIKE '%" + this.propertyString + "%'"); var UTP = Activator.CreateInstance<List<URLTabPlugin>>(); if (result != "-9999") { using (var memoryStream = new MemoryStream(Encoding.Unicode.GetBytes(result))) { var serializer = new DataContractJsonSerializer(UTP.GetType()); UTP = (List<URLTabPlugin>)serializer.ReadObject(memoryStream); } foreach (URLTabPlugin utp in UTP) { if (utp.TabType == tt) { TabPage tp = new TabPage(utp.TabLabel); tc.Controls.Add(tp); tp.Dock = DockStyle.Fill; tp.BringToFront(); WebBrowser wb = new WebBrowser(); wb.AllowNavigation = true; wb.AllowWebBrowserDrop = false; wb.ScriptErrorsSuppressed = true; wb.ScrollBarsEnabled = true; wb.IsWebBrowserContextMenuEnabled = true; tp.Controls.Add(wb); wb.Dock = DockStyle.Fill; wb.BringToFront(); wb.Navigate(utp.TabUrl); wb.Refresh(); } } } /* Build the config tab */ TabPage tconfig = new TabPage("Config"); tc.Controls.Add(tconfig); tconfig.Dock = DockStyle.Fill; /* Dynamic flow layout to hold the buttons */ FlowLayoutPanel buttonFlowLayoutPanel = new FlowLayoutPanel(); buttonFlowLayoutPanel.BringToFront(); buttonFlowLayoutPanel.FlowDirection = FlowDirection.LeftToRight; buttonFlowLayoutPanel.Location = new System.Drawing.Point(8, 10); buttonFlowLayoutPanel.Size = new System.Drawing.Size(510, 32); tconfig.Controls.Add(buttonFlowLayoutPanel); Button btnSaveConfig = new Button(); btnSaveConfig.Text = "Save Config"; btnSaveConfig.Click += new EventHandler(btnSaveConfig_Click); Button btnAddTab = new Button(); btnAddTab.Text = "Add Tab"; btnAddTab.Click += new EventHandler(btnAddTab_Click); buttonFlowLayoutPanel.Controls.Add(btnSaveConfig); buttonFlowLayoutPanel.Controls.Add(btnAddTab); /* Dynamic Flow Layout to hold taburlconfigs */ dynamicFlowLayoutPanel = new FlowLayoutPanel(); dynamicFlowLayoutPanel.BringToFront(); dynamicFlowLayoutPanel.FlowDirection = FlowDirection.TopDown; dynamicFlowLayoutPanel.Location = new System.Drawing.Point(0, 40); dynamicFlowLayoutPanel.Size = new System.Drawing.Size(510,600); dynamicFlowLayoutPanel.AutoScroll = true; dynamicFlowLayoutPanel.WrapContents = false; tconfig.Controls.Add(dynamicFlowLayoutPanel); string results = objHost.GetSQL("SELECT Value FROM properties where Name LIKE '%" + propertyString + "%'"); if (results != "-9999") { List<string> TabsCompleted = new List<string>(); /* Rewrite, this doesn't make sense. Deserialize it instead and loop through those results. */ foreach (URLTabPlugin utp in UTP) { URLTabPluginConfigTab utpct; // If the tab isn't in the list yet, create it if (TabsCompleted.IndexOf(utp.TabLabel) < 0) { TabsCompleted.Add(utp.TabLabel); utpct = new URLTabPluginConfigTab(); utpct.tabLabel = utp.TabLabel; utpct.tabClientUrl = utp.TabUrl; utpct.tabClientCheck = CheckState.Checked; dynamicFlowLayoutPanel.Controls.Add(utpct); } // if it is, find it. else { Control[] utpcts = dynamicFlowLayoutPanel.Controls.Find("txtTabLabel",true); foreach(Control utpctss in utpcts) { if (utpctss.Text == utp.TabLabel) { /* ..And check and fill in the right datafields based on the Tab type */ if (utp.TabType == URLTabPlugin.TabTypes.Client) { utpctss.Parent.Controls.Find("txtClientUrl", true)[0].Text = utp.TabUrl; CheckBox ck = (CheckBox)utpctss.Parent.Controls.Find("chkClient", true)[0]; ck.CheckState = CheckState.Checked; } else if(utp.TabType == URLTabPlugin.TabTypes.Location) { utpctss.Parent.Controls.Find("txtLocationUrl", true)[0].Text = utp.TabUrl; CheckBox ck = (CheckBox)utpctss.Parent.Controls.Find("chkLocation", true)[0]; ck.CheckState = CheckState.Checked; } else if (utp.TabType == URLTabPlugin.TabTypes.Computer) { utpctss.Parent.Controls.Find("txtComputerUrl", true)[0].Text = utp.TabUrl; CheckBox ck = (CheckBox)utpctss.Parent.Controls.Find("chkComputer", true)[0]; ck.CheckState = CheckState.Checked; } } } } /* if (utp.TabType == URLTabPlugin.TabTypes.Client) { utpct.tabClientUrl = utp.TabUrl; }*/ } } } }
/// <summary> /// Initializes the strategy field /// </summary> public Strategy_Layout(Strategy strategy) { this.strategy = strategy; slots = strategy.Slots; slotMinMidMax = SlotSizeMinMidMax.mid; toolTip = new ToolTip(); flowLayoutStrategy = new FlowLayoutPanel(); VScrollBarStrategy = new VScrollBar(); apnlSlot = new Panel[slots]; pnlProperties = new Panel(); for (int iSlot = 0; iSlot < slots; iSlot++) { apnlSlot[iSlot] = new Panel(); } if (bShowRemoveSlotButtons) { abtnRemoveSlot = new Button[slots]; for (int iSlot = 0; iSlot < slots; iSlot++) { abtnRemoveSlot[iSlot] = new Button(); } } // FlowLayoutStrategy flowLayoutStrategy.Parent = this; flowLayoutStrategy.AutoScroll = false; //VScrollBarStrategy VScrollBarStrategy.Parent = this; VScrollBarStrategy.TabStop = true; VScrollBarStrategy.Scroll += new ScrollEventHandler(VScrollBarStrategy_Scroll); if (bShowAddSlotButtons) { // btnAddOpenFilter btnAddOpenFilter = new Button(); btnAddOpenFilter.Tag = strategy.OpenSlot; btnAddOpenFilter.Text = Language.T("Add an Opening Logic Condition"); btnAddOpenFilter.Margin = new Padding(30, 0, 0, space); btnAddOpenFilter.UseVisualStyleBackColor = true; toolTip.SetToolTip(btnAddOpenFilter, Language.T("Add a new entry logic slot to the strategy.")); // btnAddCloseFilter btnAddCloseFilter = new Button(); btnAddCloseFilter.Tag = strategy.CloseSlot; btnAddCloseFilter.Text = Language.T("Add a Closing Logic Condition"); btnAddCloseFilter.Margin = new Padding(30, 0, 0, space); btnAddCloseFilter.UseVisualStyleBackColor = true; toolTip.SetToolTip(btnAddCloseFilter, Language.T("Add a new exit logic slot to the strategy.")); // btnClosingFilterHelp btnClosingFilterHelp = new Button(); btnClosingFilterHelp.Image = Properties.Resources.info; btnClosingFilterHelp.Margin = new Padding(2, 2, 0, space); btnClosingFilterHelp.TabStop = false; btnClosingFilterHelp.Click += new EventHandler(BtnClosingFilterHelp_Click); btnClosingFilterHelp.UseVisualStyleBackColor = true; } return; }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.lblBlue = new System.Windows.Forms.Label(); this.lblGreen = new System.Windows.Forms.Label(); this.lblRed = new System.Windows.Forms.Label(); this.lblValue = new System.Windows.Forms.Label(); this.lblSaturation = new System.Windows.Forms.Label(); this.lblHue = new System.Windows.Forms.Label(); this.pnlColor = new System.Windows.Forms.Panel(); this.label5 = new System.Windows.Forms.Label(); this.pnlBrightness = new System.Windows.Forms.Panel(); this.lblAlpha2 = new System.Windows.Forms.Label(); this.tbHexCode = new System.Windows.Forms.TextBox(); this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel(); this.labelRed = new System.Windows.Forms.Label(); this.tbRed = new System.Windows.Forms.TrackBar(); this.labelGreen = new System.Windows.Forms.Label(); this.tbGreen = new System.Windows.Forms.TrackBar(); this.labelBlue = new System.Windows.Forms.Label(); this.tbBlue = new System.Windows.Forms.TrackBar(); this.labelAlpha1 = new System.Windows.Forms.Label(); this.tbAlpha = new System.Windows.Forms.TrackBar(); this.tbHue = new System.Windows.Forms.TrackBar(); this.label1 = new System.Windows.Forms.Label(); this.tbSaturation = new System.Windows.Forms.TrackBar(); this.label2 = new System.Windows.Forms.Label(); this.tbValue = new System.Windows.Forms.TrackBar(); this.pnlSelectedColor = new System.Windows.Forms.Panel(); this.buttonCancel = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button(); this.flowLayoutPanel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbRed)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbGreen)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbBlue)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbAlpha)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbHue)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbSaturation)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.tbValue)).BeginInit(); this.SuspendLayout(); // // lblBlue // this.lblBlue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblBlue.Location = new System.Drawing.Point(340, 70); this.lblBlue.Name = "lblBlue"; this.lblBlue.Size = new System.Drawing.Size(39, 23); this.lblBlue.TabIndex = 54; this.lblBlue.Text = "Blue"; this.lblBlue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblGreen // this.lblGreen.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblGreen.Location = new System.Drawing.Point(340, 35); this.lblGreen.Name = "lblGreen"; this.lblGreen.Size = new System.Drawing.Size(39, 23); this.lblGreen.TabIndex = 53; this.lblGreen.Text = "Green"; this.lblGreen.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblRed // this.lblRed.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblRed.Location = new System.Drawing.Point(340, 0); this.lblRed.Name = "lblRed"; this.lblRed.Size = new System.Drawing.Size(39, 23); this.lblRed.TabIndex = 52; this.lblRed.Text = "Red"; this.lblRed.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblValue // this.lblValue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblValue.Location = new System.Drawing.Point(623, 217); this.lblValue.Name = "lblValue"; this.lblValue.Size = new System.Drawing.Size(39, 23); this.lblValue.TabIndex = 51; this.lblValue.Text = "Value"; this.lblValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblValue.Visible = false; // // lblSaturation // this.lblSaturation.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblSaturation.Location = new System.Drawing.Point(623, 182); this.lblSaturation.Name = "lblSaturation"; this.lblSaturation.Size = new System.Drawing.Size(39, 23); this.lblSaturation.TabIndex = 50; this.lblSaturation.Text = "Sat"; this.lblSaturation.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblSaturation.Visible = false; // // lblHue // this.lblHue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblHue.Location = new System.Drawing.Point(623, 155); this.lblHue.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.lblHue.Name = "lblHue"; this.lblHue.Size = new System.Drawing.Size(41, 23); this.lblHue.TabIndex = 49; this.lblHue.Text = "Hue"; this.lblHue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.lblHue.Visible = false; // // pnlColor // this.pnlColor.Location = new System.Drawing.Point(5, 8); this.pnlColor.Name = "pnlColor"; this.pnlColor.Size = new System.Drawing.Size(224, 216); this.pnlColor.TabIndex = 38; this.pnlColor.Visible = false; // // label5 // this.label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label5.Location = new System.Drawing.Point(304, 155); this.label5.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(72, 18); this.label5.TabIndex = 35; this.label5.Text = "Hue"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label5.Visible = false; // // pnlBrightness // this.pnlBrightness.Location = new System.Drawing.Point(254, 8); this.pnlBrightness.Name = "pnlBrightness"; this.pnlBrightness.Size = new System.Drawing.Size(24, 216); this.pnlBrightness.TabIndex = 39; this.pnlBrightness.Visible = false; // // lblAlpha2 // this.lblAlpha2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblAlpha2.Location = new System.Drawing.Point(340, 111); this.lblAlpha2.Name = "lblAlpha2"; this.lblAlpha2.Size = new System.Drawing.Size(39, 24); this.lblAlpha2.TabIndex = 57; this.lblAlpha2.Text = "Alpha"; this.lblAlpha2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // tbHexCode // this.tbHexCode.BackColor = System.Drawing.Color.White; this.tbHexCode.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.tbHexCode.Location = new System.Drawing.Point(295, 50); this.tbHexCode.MaxLength = 8; this.tbHexCode.Name = "tbHexCode"; this.tbHexCode.ReadOnly = true; this.tbHexCode.Size = new System.Drawing.Size(96, 22); this.tbHexCode.TabIndex = 58; this.tbHexCode.MouseDown += new System.Windows.Forms.MouseEventHandler(this.TbHexCodeMouseDown); // // flowLayoutPanel1 // this.flowLayoutPanel1.Controls.Add(this.labelRed); this.flowLayoutPanel1.Controls.Add(this.tbRed); this.flowLayoutPanel1.Controls.Add(this.lblRed); this.flowLayoutPanel1.Controls.Add(this.labelGreen); this.flowLayoutPanel1.Controls.Add(this.tbGreen); this.flowLayoutPanel1.Controls.Add(this.lblGreen); this.flowLayoutPanel1.Controls.Add(this.labelBlue); this.flowLayoutPanel1.Controls.Add(this.tbBlue); this.flowLayoutPanel1.Controls.Add(this.lblBlue); this.flowLayoutPanel1.Controls.Add(this.labelAlpha1); this.flowLayoutPanel1.Controls.Add(this.tbAlpha); this.flowLayoutPanel1.Controls.Add(this.lblAlpha2); this.flowLayoutPanel1.Location = new System.Drawing.Point(5, 232); this.flowLayoutPanel1.Name = "flowLayoutPanel1"; this.flowLayoutPanel1.Size = new System.Drawing.Size(396, 157); this.flowLayoutPanel1.TabIndex = 59; // // labelRed // this.labelRed.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelRed.Location = new System.Drawing.Point(3, 8); this.labelRed.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.labelRed.Name = "labelRed"; this.labelRed.Size = new System.Drawing.Size(72, 18); this.labelRed.TabIndex = 42; this.labelRed.Text = "Red"; this.labelRed.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tbRed // this.tbRed.AutoSize = false; this.tbRed.LargeChange = 16; this.tbRed.Location = new System.Drawing.Point(78, 3); this.tbRed.Margin = new System.Windows.Forms.Padding(0, 3, 3, 0); this.tbRed.Maximum = 255; this.tbRed.Name = "tbRed"; this.tbRed.Size = new System.Drawing.Size(256, 32); this.tbRed.TabIndex = 43; this.tbRed.TickFrequency = 32; this.tbRed.Scroll += new System.EventHandler(this.HandleRGBScroll); // // labelGreen // this.labelGreen.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelGreen.Location = new System.Drawing.Point(3, 43); this.labelGreen.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.labelGreen.Name = "labelGreen"; this.labelGreen.Size = new System.Drawing.Size(72, 18); this.labelGreen.TabIndex = 44; this.labelGreen.Text = "Green"; this.labelGreen.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tbGreen // this.tbGreen.AutoSize = false; this.tbGreen.LargeChange = 16; this.tbGreen.Location = new System.Drawing.Point(78, 38); this.tbGreen.Margin = new System.Windows.Forms.Padding(0, 3, 3, 0); this.tbGreen.Maximum = 255; this.tbGreen.Name = "tbGreen"; this.tbGreen.Size = new System.Drawing.Size(256, 32); this.tbGreen.TabIndex = 45; this.tbGreen.TickFrequency = 32; this.tbGreen.Scroll += new System.EventHandler(this.HandleRGBScroll); // // labelBlue // this.labelBlue.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelBlue.Location = new System.Drawing.Point(3, 78); this.labelBlue.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.labelBlue.Name = "labelBlue"; this.labelBlue.Size = new System.Drawing.Size(72, 18); this.labelBlue.TabIndex = 46; this.labelBlue.Text = "Blue"; this.labelBlue.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tbBlue // this.tbBlue.AutoSize = false; this.tbBlue.LargeChange = 16; this.tbBlue.Location = new System.Drawing.Point(78, 73); this.tbBlue.Margin = new System.Windows.Forms.Padding(0, 3, 3, 6); this.tbBlue.Maximum = 255; this.tbBlue.Name = "tbBlue"; this.tbBlue.Size = new System.Drawing.Size(256, 32); this.tbBlue.TabIndex = 47; this.tbBlue.TickFrequency = 32; this.tbBlue.Scroll += new System.EventHandler(this.HandleRGBScroll); // // labelAlpha1 // this.labelAlpha1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.labelAlpha1.Location = new System.Drawing.Point(3, 119); this.labelAlpha1.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.labelAlpha1.Name = "labelAlpha1"; this.labelAlpha1.Size = new System.Drawing.Size(72, 18); this.labelAlpha1.TabIndex = 55; this.labelAlpha1.Text = "Alpha"; this.labelAlpha1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tbAlpha // this.tbAlpha.AutoSize = false; this.tbAlpha.LargeChange = 16; this.tbAlpha.Location = new System.Drawing.Point(78, 114); this.tbAlpha.Margin = new System.Windows.Forms.Padding(0, 3, 3, 0); this.tbAlpha.Maximum = 255; this.tbAlpha.Name = "tbAlpha"; this.tbAlpha.Size = new System.Drawing.Size(256, 32); this.tbAlpha.TabIndex = 56; this.tbAlpha.TickFrequency = 32; this.tbAlpha.Scroll += new System.EventHandler(this.TbAlphaScroll); // // tbHue // this.tbHue.AutoSize = false; this.tbHue.LargeChange = 16; this.tbHue.Location = new System.Drawing.Point(379, 150); this.tbHue.Margin = new System.Windows.Forms.Padding(0, 3, 3, 0); this.tbHue.Maximum = 255; this.tbHue.Name = "tbHue"; this.tbHue.Size = new System.Drawing.Size(238, 32); this.tbHue.TabIndex = 36; this.tbHue.TickFrequency = 32; this.tbHue.Visible = false; this.tbHue.Scroll += new System.EventHandler(this.HandleHSVScroll); // // label1 // this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label1.Location = new System.Drawing.Point(304, 190); this.label1.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(72, 18); this.label1.TabIndex = 38; this.label1.Text = "Saturation"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label1.Visible = false; // // tbSaturation // this.tbSaturation.AutoSize = false; this.tbSaturation.LargeChange = 16; this.tbSaturation.Location = new System.Drawing.Point(379, 185); this.tbSaturation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 0); this.tbSaturation.Maximum = 255; this.tbSaturation.Name = "tbSaturation"; this.tbSaturation.Size = new System.Drawing.Size(238, 32); this.tbSaturation.TabIndex = 39; this.tbSaturation.TickFrequency = 32; this.tbSaturation.Visible = false; this.tbSaturation.Scroll += new System.EventHandler(this.HandleHSVScroll); // // label2 // this.label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.label2.Location = new System.Drawing.Point(304, 225); this.label2.Margin = new System.Windows.Forms.Padding(3, 8, 3, 0); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(72, 18); this.label2.TabIndex = 40; this.label2.Text = "Value"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; this.label2.Visible = false; // // tbValue // this.tbValue.AutoSize = false; this.tbValue.LargeChange = 16; this.tbValue.Location = new System.Drawing.Point(379, 220); this.tbValue.Margin = new System.Windows.Forms.Padding(0, 3, 3, 6); this.tbValue.Maximum = 255; this.tbValue.Name = "tbValue"; this.tbValue.Size = new System.Drawing.Size(238, 32); this.tbValue.TabIndex = 41; this.tbValue.TickFrequency = 32; this.tbValue.Visible = false; this.tbValue.Scroll += new System.EventHandler(this.HandleHSVScroll); // // pnlSelectedColor // this.pnlSelectedColor.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0)))), ((int)(((byte)(0))))); this.pnlSelectedColor.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pnlSelectedColor.Location = new System.Drawing.Point(295, 12); this.pnlSelectedColor.Name = "pnlSelectedColor"; this.pnlSelectedColor.Size = new System.Drawing.Size(96, 32); this.pnlSelectedColor.TabIndex = 40; this.pnlSelectedColor.Visible = false; // // buttonCancel // this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.buttonCancel.Location = new System.Drawing.Point(321, 406); this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Size = new System.Drawing.Size(80, 23); this.buttonCancel.TabIndex = 61; this.buttonCancel.Text = "C&ancel"; this.buttonCancel.UseVisualStyleBackColor = true; this.buttonCancel.Click += new System.EventHandler(this.buttonCancel_Click); // // buttonOK // this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.buttonOK.Location = new System.Drawing.Point(235, 406); this.buttonOK.Name = "buttonOK"; this.buttonOK.Size = new System.Drawing.Size(80, 23); this.buttonOK.TabIndex = 60; this.buttonOK.Text = "&OK"; this.buttonOK.UseVisualStyleBackColor = true; this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); // // ColorChooser // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(413, 441); this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonOK); this.Controls.Add(this.label5); this.Controls.Add(this.tbHue); this.Controls.Add(this.tbHexCode); this.Controls.Add(this.lblHue); this.Controls.Add(this.label1); this.Controls.Add(this.tbSaturation); this.Controls.Add(this.pnlColor); this.Controls.Add(this.lblSaturation); this.Controls.Add(this.pnlSelectedColor); this.Controls.Add(this.label2); this.Controls.Add(this.pnlBrightness); this.Controls.Add(this.tbValue); this.Controls.Add(this.flowLayoutPanel1); this.Controls.Add(this.lblValue); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.KeyPreview = true; this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "ColorChooser"; this.ShowIcon = false; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.Text = "Select color"; this.Load += new System.EventHandler(this.ColorChooserLoad); this.Paint += new System.Windows.Forms.PaintEventHandler(this.ColorChooserPaint); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ColorChooser_KeyDown); this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.HandleMouse); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.HandleMouse); this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.FormMainMouseUp); this.flowLayoutPanel1.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.tbRed)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbGreen)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbBlue)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbAlpha)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbHue)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbSaturation)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.tbValue)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
public MyMessageBox(string text, string caption, MessageBoxButtons buttons = MessageBoxButtons.OK, string checkBoxText = null, bool isChecked = false) { Icon = ShareXResources.Icon; Width = 180; Height = 100; Text = caption; FormBorderStyle = FormBorderStyle.FixedDialog; ShowInTaskbar = false; TopMost = true; StartPosition = FormStartPosition.CenterScreen; MinimizeBox = false; MaximizeBox = false; Shown += MyMessageBox_Shown; Label labelText = new Label(); labelText.Margin = new Padding(0); labelText.Font = SystemFonts.MessageBoxFont; labelText.TextAlign = ContentAlignment.MiddleLeft; labelText.AutoSize = true; labelText.MinimumSize = new Size(125, 0); labelText.MaximumSize = new Size(400, 400); labelText.Location = new Point(0, 0); labelText.Text = text; Button button1 = new Button(); button1.Margin = new Padding(0, ButtonPadding, ButtonPadding, ButtonPadding); button1.BackColor = Color.Transparent; button1.Size = new Size(80, 26); button1.UseVisualStyleBackColor = false; button1.Text = "button1"; button1.TabIndex = 0; button1.Click += (sender, e) => { DialogResult = button1Result; Close(); }; Button button2 = new Button(); button2.Margin = new Padding(0, ButtonPadding, ButtonPadding, ButtonPadding); button2.BackColor = Color.Transparent; button2.Size = new Size(80, 26); button2.UseVisualStyleBackColor = false; button2.Text = "button2"; button2.TabIndex = 1; button2.Click += (sender, e) => { DialogResult = button2Result; Close(); }; switch (buttons) { default: case MessageBoxButtons.OK: button1.Text = Resources.MyMessageBox_MyMessageBox_OK; button1Result = DialogResult.OK; button2.Visible = false; break; case MessageBoxButtons.OKCancel: button1.Text = Resources.MyMessageBox_MyMessageBox_OK; button1Result = DialogResult.OK; button2.Text = Resources.MyMessageBox_MyMessageBox_Cancel; button2Result = DialogResult.Cancel; break; case MessageBoxButtons.YesNo: button1.Text = Resources.MyMessageBox_MyMessageBox_Yes; button1Result = DialogResult.Yes; button2.Text = Resources.MyMessageBox_MyMessageBox_No; button2Result = DialogResult.No; break; } FlowLayoutPanel panel = new FlowLayoutPanel(); panel.BackColor = Color.FromArgb(240, 240, 240); panel.FlowDirection = FlowDirection.RightToLeft; FlowLayoutPanel labelPanel = new FlowLayoutPanel(); labelPanel.FlowDirection = FlowDirection.TopDown; labelPanel.AutoSize = true; labelPanel.AutoSizeMode = AutoSizeMode.GrowAndShrink; labelPanel.Location = new Point(LabelHorizontalPadding, LabelVerticalPadding); labelPanel.Controls.Add(labelText); if (checkBoxText != null) { IsChecked = isChecked; CheckBox checkBox = new CheckBox(); checkBox.Font = SystemFonts.MessageBoxFont; checkBox.Margin = new Padding(2, LabelVerticalPadding, 0, 0); checkBox.AutoSize = true; checkBox.Text = checkBoxText; checkBox.CheckedChanged += (sender, e) => IsChecked = checkBox.Checked; labelPanel.Controls.Add(checkBox); } panel.Controls.Add(button2); panel.Controls.Add(button1); Controls.Add(labelPanel); Controls.Add(panel); panel.Location = new Point(0, labelPanel.Bottom + LabelVerticalPadding); panel.Size = new Size(labelPanel.Width + (LabelHorizontalPadding * 2), button1.Height + (ButtonPadding * 2)); ClientSize = new Size(panel.Width, labelPanel.Height + (LabelVerticalPadding * 2) + panel.Height); }
public MainForm () { // // tabControl1 // tabControl1 = new TabControl (); tabControl1.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); tabControl1.Location = new Point (6, 6); tabControl1.Name = "tabControl1"; tabControl1.SelectedIndex = 0; tabControl1.Size = new Size (390, 400); tabControl1.TabIndex = 5; // // tabUpdates // tabUpdates = new TabPage (); tabUpdates.Location = new Point (4, 22); tabUpdates.Name = "tabUpdates"; tabUpdates.Padding = new Padding (3); tabUpdates.Size = new Size (384, 506); tabUpdates.TabIndex = 3; tabUpdates.Text = "Updates"; tabUpdates.UseVisualStyleBackColor = true; tabControl1.Controls.Add (tabUpdates); // // flowLayoutPanel11 // flowLayoutPanel11 = new FlowLayoutPanel (); flowLayoutPanel11.AutoSize = true; flowLayoutPanel11.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel11.FlowDirection = FlowDirection.TopDown; flowLayoutPanel11.Location = new Point (3, 3); flowLayoutPanel11.Size = new Size (478, 481); flowLayoutPanel11.TabIndex = 9; tabUpdates.Controls.Add (flowLayoutPanel11); // // flowLayoutPanel20 // flowLayoutPanel20 = new FlowLayoutPanel (); flowLayoutPanel20.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); flowLayoutPanel20.AutoSize = true; flowLayoutPanel20.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel20.FlowDirection = FlowDirection.TopDown; flowLayoutPanel20.Location = new Point (3, 75); flowLayoutPanel20.Size = new Size (200, 23); flowLayoutPanel20.TabIndex = 4; // // cbKeepCharacterPlans // cbKeepCharacterPlans = new CheckBox (); cbKeepCharacterPlans.AutoSize = true; cbKeepCharacterPlans.Location = new Point (3, 3); cbKeepCharacterPlans.Size = new Size (100, 17); cbKeepCharacterPlans.TabIndex = 1; cbKeepCharacterPlans.Text = "Keep plans"; cbKeepCharacterPlans.UseVisualStyleBackColor = true; flowLayoutPanel20.Controls.Add (cbKeepCharacterPlans); // // flowLayoutPanel19 // flowLayoutPanel19 = new FlowLayoutPanel (); flowLayoutPanel19.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); flowLayoutPanel19.AutoSize = true; flowLayoutPanel19.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel19.FlowDirection = FlowDirection.TopDown; flowLayoutPanel19.Location = new Point (45, 33); flowLayoutPanel19.Size = new Size (0, 0); flowLayoutPanel19.TabIndex = 3; // // flowLayoutPanel18 // flowLayoutPanel18 = new FlowLayoutPanel (); flowLayoutPanel18.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); flowLayoutPanel18.AutoSize = true; flowLayoutPanel18.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel18.FlowDirection = FlowDirection.TopDown; flowLayoutPanel18.Location = new Point (3, 46); flowLayoutPanel18.Size = new Size (153, 23); flowLayoutPanel18.TabIndex = 2; // // cbDeleteCharactersSilently // cbDeleteCharactersSilently = new CheckBox (); cbDeleteCharactersSilently.AutoSize = true; cbDeleteCharactersSilently.Location = new Point (3, 3); cbDeleteCharactersSilently.Size = new Size (147, 17); cbDeleteCharactersSilently.TabIndex = 1; cbDeleteCharactersSilently.Text = "Delete characters"; cbDeleteCharactersSilently.UseVisualStyleBackColor = true; flowLayoutPanel18.Controls.Add (cbDeleteCharactersSilently); // // flowLayoutPanel17 // flowLayoutPanel17 = new FlowLayoutPanel (); flowLayoutPanel17.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); flowLayoutPanel17.AutoSize = true; flowLayoutPanel17.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel17.FlowDirection = FlowDirection.TopDown; flowLayoutPanel17.Location = new Point (14, 19); flowLayoutPanel17.Size = new Size (0, 0); flowLayoutPanel17.TabIndex = 1; // // flowLayoutPanel12 // flowLayoutPanel12 = new FlowLayoutPanel (); flowLayoutPanel12.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); flowLayoutPanel12.AutoSize = true; flowLayoutPanel12.AutoSizeMode = AutoSizeMode.GrowAndShrink; flowLayoutPanel12.FlowDirection = FlowDirection.TopDown; flowLayoutPanel12.Location = new Point (3, 17); flowLayoutPanel12.Size = new Size (194, 23); flowLayoutPanel12.TabIndex = 0; // // cbAutomaticEOSkillUpdate // cbAutomaticEOSkillUpdate = new CheckBox (); cbAutomaticEOSkillUpdate.AutoSize = true; cbAutomaticEOSkillUpdate.Location = new Point (3, 3); cbAutomaticEOSkillUpdate.Size = new Size (200, 17); cbAutomaticEOSkillUpdate.TabIndex = 1; cbAutomaticEOSkillUpdate.Text = "Disable XML update"; cbAutomaticEOSkillUpdate.UseVisualStyleBackColor = true; flowLayoutPanel12.Controls.Add (cbAutomaticEOSkillUpdate); // // groupBox9 // groupBox9 = new GroupBox (); groupBox9.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right); groupBox9.Controls.Add (flowLayoutPanel12); groupBox9.Controls.Add (flowLayoutPanel17); groupBox9.Controls.Add (flowLayoutPanel19); groupBox9.Controls.Add (flowLayoutPanel20); groupBox9.Controls.Add (flowLayoutPanel18); groupBox9.AutoSize = true; groupBox9.AutoSizeMode = AutoSizeMode.GrowAndShrink; groupBox9.Location = new Point (3, 3); groupBox9.Size = new Size (600, 318); groupBox9.TabIndex = 9; groupBox9.TabStop = false; groupBox9.Text = "XML Update"; flowLayoutPanel11.Controls.Add (groupBox9); // // MainForm // AutoScaleDimensions = new SizeF (6F, 13F); AutoScaleMode = AutoScaleMode.Font; AutoSize = true; AutoSizeMode = AutoSizeMode.GrowAndShrink; ClientSize = new Size (400, 410); Controls.Add (tabControl1); Location = new Point (200, 100); StartPosition = FormStartPosition.Manual; Text = "bug #82488"; Load += new EventHandler (MainForm_Load); }
void FillSessionSettingsItems(bool loadFromConfig = false) { tableLayoutPanel1.RowCount = 0; tableLayoutPanel1.RowStyles.Clear(); tableLayoutPanel1.Controls.Clear(); Type sessionSettingsType = typeof(T); foreach (var sessionField in sessionSettingsType.GetFields(BindingFlags.Public | BindingFlags.Instance | BindingFlags.GetField | BindingFlags.SetField)) { if (sessionField.FieldType == typeof(MyOnlineModeEnum)) { continue; } if (sessionField.Name.Contains("Procedural")) { if (Sandbox.Engine.Utils.MyFakes.ENABLE_ASTEROID_FIELDS) { if (loadGameButton.Checked) { continue; // skip procedural stuff when editing existing world } } else { continue; // skip procredural stuff when disabled } } string displayName = sessionField.Name; var nameAttr = sessionField.GetCustomAttributes(typeof(DisplayAttribute), true); if (nameAttr.Length > 0) { displayName = ((DisplayAttribute)nameAttr[0]).Name; } if (string.IsNullOrEmpty(displayName)) { continue; } var gameAttr = sessionField.GetCustomAttributes(typeof(GameRelationAttribute), true); if (gameAttr.Length > 0) { var gameRel = ((GameRelationAttribute)gameAttr[0]).RelatedTo; if (gameRel != Sandbox.Common.ObjectBuilders.Game.Shared && gameRel != GameAttributes) { continue; } } var rangeAttr = sessionField.GetCustomAttributes(typeof(RangeAttribute), true); decimal minValue = decimal.MinValue; decimal maxValue = decimal.MaxValue; if (rangeAttr.Length > 0) { minValue = Convert.ToDecimal(((RangeAttribute)rangeAttr[0]).Minimum); maxValue = Convert.ToDecimal(((RangeAttribute)rangeAttr[0]).Maximum); } if (sessionField.FieldType == typeof(float)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); NumericUpDown nup = new NumericUpDown(); nup.Minimum = minValue; nup.Maximum = maxValue; nup.Value = (decimal)(float)sessionField.GetValue(m_selectedSessionSettings); nup.Tag = sessionField; nup.ValueChanged += nup_ValueChanged2; nup.Name = sessionField.Name; nup.DecimalPlaces = 2; fieldPanel.Controls.Add(nup); AddNewRow(fieldPanel); } if (sessionField.FieldType.BaseType == typeof(Enum)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); ComboBox combo = new ComboBox(); combo.DropDownStyle = ComboBoxStyle.DropDownList; combo.Name = sessionField.Name; int i = 0; foreach (var value in Enum.GetValues(sessionField.FieldType)) { combo.Items.Add(value); var val = sessionField.GetValue(m_selectedSessionSettings); if (value.Equals(val)) { combo.SelectedIndex = i; } i++; } combo.Tag = sessionField; fieldPanel.Controls.Add(combo); combo.SelectedIndexChanged += combo_SelectedIndexChanged; AddNewRow(fieldPanel); } if (sessionField.FieldType == typeof(short)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); NumericUpDown nup = new NumericUpDown(); nup.Minimum = minValue; nup.Maximum = maxValue; nup.Value = (decimal)System.Convert.ToInt16(sessionField.GetValue(m_selectedSessionSettings)); nup.DecimalPlaces = 0; nup.Increment = 1; nup.Tag = sessionField; nup.ValueChanged += nup_ValueChanged; nup.Name = sessionField.Name; fieldPanel.Controls.Add(nup); AddNewRow(fieldPanel); } if (sessionField.FieldType == typeof(int)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); NumericUpDown nup = new NumericUpDown(); nup.Minimum = minValue; nup.Maximum = maxValue; nup.Value = (decimal)System.Convert.ToInt32(sessionField.GetValue(m_selectedSessionSettings)); nup.DecimalPlaces = 0; nup.Increment = 1; nup.Tag = sessionField; nup.ValueChanged += nup_ValueChanged3; nup.Name = sessionField.Name; fieldPanel.Controls.Add(nup); AddNewRow(fieldPanel); } if (sessionField.FieldType == typeof(uint)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); NumericUpDown nup = new NumericUpDown(); nup.Minimum = minValue; nup.Maximum = maxValue; nup.Value = (decimal)System.Convert.ToUInt32(sessionField.GetValue(m_selectedSessionSettings)); nup.DecimalPlaces = 0; nup.Increment = 1; nup.Tag = sessionField; nup.ValueChanged += nup_ValueChanged4; nup.Name = sessionField.Name; fieldPanel.Controls.Add(nup); AddNewRow(fieldPanel); } if (sessionField.FieldType == typeof(bool)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); CheckBox checkBox = new CheckBox(); checkBox.Checked = (bool)sessionField.GetValue(m_selectedSessionSettings); checkBox.Tag = sessionField; checkBox.CheckedChanged += checkBox_CheckedChanged; checkBox.Name = sessionField.Name; fieldPanel.Controls.Add(checkBox); AddNewRow(fieldPanel); } if (sessionField.FieldType.IsGenericType && sessionField.FieldType.GetGenericArguments()[0] == typeof(bool)) { FlowLayoutPanel fieldPanel = AddFieldLabel(sessionField, displayName); CheckBox checkBox = new CheckBox(); var pops = sessionField.GetType().GetProperties(); var nulBool = (bool?)sessionField.GetValue(m_selectedSessionSettings); checkBox.Checked = nulBool.HasValue ? nulBool.Value : true; checkBox.Tag = sessionField; checkBox.CheckedChanged += checkBox_CheckedChanged; checkBox.Name = sessionField.Name; fieldPanel.Controls.Add(checkBox); AddNewRow(fieldPanel); } } EnableCopyPaste(null); EnableOxygen(loadFromConfig); }
private void initializePanel() { panel = new FlowLayoutPanel(); panel.SuspendLayout(); panel.Size = new Size(600, 30); var label = new Label(); label.Text = "Channel:"; label.Size = new Size(52, 20); label.TextAlign = ContentAlignment.MiddleLeft; panel.Controls.Add(label); channelSpinner = new NumericUpDown(); channelSpinner.Minimum = 1; channelSpinner.Maximum = 255; channelSpinner.Size = new Size(42, 20); channelSpinner.Value = Channel + 1; channelSpinner.ValueChanged += onChannelChange; panel.Controls.Add(channelSpinner); label = new Label(); label.Text = "Axis:"; label.Size = new Size(42, 20); label.TextAlign = ContentAlignment.MiddleLeft; panel.Controls.Add(label); joystickAxisDropdown = new ComboBox(); joystickAxisDropdown.DropDownStyle = ComboBoxStyle.DropDownList; joystickAxisDropdown.Size = new Size(42, 20); joystickAxisDropdown.Items.AddRange(Enum.GetNames(typeof(VJoy.Axes))); joystickAxisDropdown.SelectedIndex = Axis; joystickAxisDropdown.SelectedIndexChanged += onAxisChange; panel.Controls.Add(joystickAxisDropdown); label = new Label(); label.Text = "Input:"; label.Size = new Size(42, 20); label.TextAlign = ContentAlignment.MiddleLeft; panel.Controls.Add(label); inputLabel = new Label(); inputLabel.Text = "-"; inputLabel.Size = new Size(42, 20); inputLabel.TextAlign = ContentAlignment.MiddleLeft; panel.Controls.Add(inputLabel); label = new Label(); label.Text = "Output:"; label.Size = new Size(42, 20); label.TextAlign = ContentAlignment.MiddleLeft; panel.Controls.Add(label); progressBox = new PictureBox(); progressBox.Size = new Size(80, 20); progressBox.BorderStyle = BorderStyle.FixedSingle; progressBox.Paint += onProgressPaint; panel.Controls.Add(progressBox); var button = new Button(); button.Text = "Setup"; button.Click += onSetupClick; button.Size = new Size(50, 20); panel.Controls.Add(button); button = new Button(); button.Text = "Remove"; button.Click += onRemoveClick; button.Size = new Size(55, 20); panel.Controls.Add(button); panel.ResumeLayout(); }
private void InitializeComponent() { ComponentResourceManager resources = new ComponentResourceManager(typeof(ctFormBatchEditGroupTestPara)); this.btnQuit = new Button(); this.btnSubmit = new Button(); this.label_jkdh = new Label(); this.flowLayoutPanel1 = new FlowLayoutPanel(); this.label_DTThreshold = new Label(); this.label_JYThreshold = new Label(); this.label_JYTestTime = new Label(); this.label_JYVoltage = new Label(); this.label_NYThreshold = new Label(); this.label_NYTestTime = new Label(); this.label_NYVoltage = new Label(); this.flowLayoutPanel2 = new FlowLayoutPanel(); this.comboBox_jkdh = new ComboBox(); this.numericUpDown_DTThreshold = new NumericUpDown(); this.numericUpDown_JYThreshold = new NumericUpDown(); this.numericUpDown_JYTestTime = new NumericUpDown(); this.numericUpDown_JYVoltage = new NumericUpDown(); this.numericUpDown_NYThreshold = new NumericUpDown(); this.numericUpDown_NYTestTime = new NumericUpDown(); this.numericUpDown_NYVoltage = new NumericUpDown(); this.flowLayoutPanel1.SuspendLayout(); this.flowLayoutPanel2.SuspendLayout(); ((ISupportInitialize)this.numericUpDown_DTThreshold).BeginInit(); ((ISupportInitialize)this.numericUpDown_JYThreshold).BeginInit(); ((ISupportInitialize)this.numericUpDown_JYTestTime).BeginInit(); ((ISupportInitialize)this.numericUpDown_JYVoltage).BeginInit(); ((ISupportInitialize)this.numericUpDown_NYThreshold).BeginInit(); ((ISupportInitialize)this.numericUpDown_NYTestTime).BeginInit(); ((ISupportInitialize)this.numericUpDown_NYVoltage).BeginInit(); base.SuspendLayout(); this.btnQuit.Anchor = AnchorStyles.Bottom; this.btnQuit.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location = new System.Drawing.Point(363, 397); this.btnQuit.Location = location; this.btnQuit.Name = "btnQuit"; System.Drawing.Size size = new System.Drawing.Size(120, 30); this.btnQuit.Size = size; this.btnQuit.TabIndex = 12; this.btnQuit.Text = "取消"; this.btnQuit.UseVisualStyleBackColor = true; this.btnQuit.Click += new System.EventHandler(this.btnQuit_Click); this.btnSubmit.Anchor = AnchorStyles.Bottom; this.btnSubmit.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location2 = new System.Drawing.Point(172, 397); this.btnSubmit.Location = location2; this.btnSubmit.Name = "btnSubmit"; System.Drawing.Size size2 = new System.Drawing.Size(120, 30); this.btnSubmit.Size = size2; this.btnSubmit.TabIndex = 8; this.btnSubmit.Text = "确定"; this.btnSubmit.UseVisualStyleBackColor = true; this.btnSubmit.Click += new System.EventHandler(this.btnSubmit_Click); this.label_jkdh.AutoSize = true; this.label_jkdh.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location3 = new System.Drawing.Point(123, 10); this.label_jkdh.Location = location3; Padding margin = new Padding(10, 10, 10, 20); this.label_jkdh.Margin = margin; this.label_jkdh.Name = "label_jkdh"; System.Drawing.Size size3 = new System.Drawing.Size(95, 19); this.label_jkdh.Size = size3; this.label_jkdh.TabIndex = 11; this.label_jkdh.Text = "接口代号:"; this.flowLayoutPanel1.Anchor = AnchorStyles.Top; this.flowLayoutPanel1.Controls.Add(this.label_jkdh); this.flowLayoutPanel1.Controls.Add(this.label_DTThreshold); this.flowLayoutPanel1.Controls.Add(this.label_JYThreshold); this.flowLayoutPanel1.Controls.Add(this.label_JYTestTime); this.flowLayoutPanel1.Controls.Add(this.label_JYVoltage); this.flowLayoutPanel1.Controls.Add(this.label_NYThreshold); this.flowLayoutPanel1.Controls.Add(this.label_NYTestTime); this.flowLayoutPanel1.Controls.Add(this.label_NYVoltage); this.flowLayoutPanel1.FlowDirection = FlowDirection.RightToLeft; System.Drawing.Point location4 = new System.Drawing.Point(30, 22); this.flowLayoutPanel1.Location = location4; this.flowLayoutPanel1.Name = "flowLayoutPanel1"; System.Drawing.Size size4 = new System.Drawing.Size(228, 350); this.flowLayoutPanel1.Size = size4; this.flowLayoutPanel1.TabIndex = 22; this.label_DTThreshold.AutoSize = true; this.label_DTThreshold.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location5 = new System.Drawing.Point(84, 59); this.label_DTThreshold.Location = location5; Padding margin2 = new Padding(10); this.label_DTThreshold.Margin = margin2; this.label_DTThreshold.Name = "label_DTThreshold"; System.Drawing.Size size5 = new System.Drawing.Size(134, 19); this.label_DTThreshold.Size = size5; this.label_DTThreshold.TabIndex = 26; this.label_DTThreshold.Text = "导通阈值(Ω):"; this.label_JYThreshold.AutoSize = true; this.label_JYThreshold.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location6 = new System.Drawing.Point(74, 98); this.label_JYThreshold.Location = location6; Padding margin3 = new Padding(10); this.label_JYThreshold.Margin = margin3; this.label_JYThreshold.Name = "label_JYThreshold"; System.Drawing.Size size6 = new System.Drawing.Size(144, 19); this.label_JYThreshold.Size = size6; this.label_JYThreshold.TabIndex = 25; this.label_JYThreshold.Text = "绝缘阈值(MΩ):"; this.label_JYTestTime.AutoSize = true; this.label_JYTestTime.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location7 = new System.Drawing.Point(55, 137); this.label_JYTestTime.Location = location7; Padding margin4 = new Padding(10); this.label_JYTestTime.Margin = margin4; this.label_JYTestTime.Name = "label_JYTestTime"; System.Drawing.Size size7 = new System.Drawing.Size(163, 19); this.label_JYTestTime.Size = size7; this.label_JYTestTime.TabIndex = 28; this.label_JYTestTime.Text = "绝缘保持时间(s):"; this.label_JYVoltage.AutoSize = true; this.label_JYVoltage.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location8 = new System.Drawing.Point(73, 176); this.label_JYVoltage.Location = location8; Padding margin5 = new Padding(10); this.label_JYVoltage.Margin = margin5; this.label_JYVoltage.Name = "label_JYVoltage"; System.Drawing.Size size8 = new System.Drawing.Size(145, 19); this.label_JYVoltage.Size = size8; this.label_JYVoltage.TabIndex = 29; this.label_JYVoltage.Text = "绝缘电压(VDC):"; this.label_NYThreshold.AutoSize = true; this.label_NYThreshold.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location9 = new System.Drawing.Point(83, 215); this.label_NYThreshold.Location = location9; Padding margin6 = new Padding(10); this.label_NYThreshold.Margin = margin6; this.label_NYThreshold.Name = "label_NYThreshold"; System.Drawing.Size size9 = new System.Drawing.Size(135, 19); this.label_NYThreshold.Size = size9; this.label_NYThreshold.TabIndex = 27; this.label_NYThreshold.Text = "耐压阈值(mA):"; this.label_NYTestTime.AutoSize = true; this.label_NYTestTime.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location10 = new System.Drawing.Point(55, 254); this.label_NYTestTime.Location = location10; Padding margin7 = new Padding(10); this.label_NYTestTime.Margin = margin7; this.label_NYTestTime.Name = "label_NYTestTime"; System.Drawing.Size size10 = new System.Drawing.Size(163, 19); this.label_NYTestTime.Size = size10; this.label_NYTestTime.TabIndex = 30; this.label_NYTestTime.Text = "耐压保持时间(s):"; this.label_NYVoltage.AutoSize = true; this.label_NYVoltage.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location11 = new System.Drawing.Point(73, 293); this.label_NYVoltage.Location = location11; Padding margin8 = new Padding(10); this.label_NYVoltage.Margin = margin8; this.label_NYVoltage.Name = "label_NYVoltage"; System.Drawing.Size size11 = new System.Drawing.Size(145, 19); this.label_NYVoltage.Size = size11; this.label_NYVoltage.TabIndex = 31; this.label_NYVoltage.Text = "耐压电压(VAC):"; this.flowLayoutPanel2.Anchor = AnchorStyles.Top; this.flowLayoutPanel2.Controls.Add(this.comboBox_jkdh); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_DTThreshold); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_JYThreshold); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_JYTestTime); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_JYVoltage); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_NYThreshold); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_NYTestTime); this.flowLayoutPanel2.Controls.Add(this.numericUpDown_NYVoltage); this.flowLayoutPanel2.FlowDirection = FlowDirection.TopDown; System.Drawing.Point location12 = new System.Drawing.Point(264, 22); this.flowLayoutPanel2.Location = location12; this.flowLayoutPanel2.Name = "flowLayoutPanel2"; System.Drawing.Size size12 = new System.Drawing.Size(350, 350); this.flowLayoutPanel2.Size = size12; this.flowLayoutPanel2.TabIndex = 23; this.comboBox_jkdh.DropDownStyle = ComboBoxStyle.DropDownList; this.comboBox_jkdh.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); this.comboBox_jkdh.FormattingEnabled = true; System.Drawing.Point location13 = new System.Drawing.Point(6, 6); this.comboBox_jkdh.Location = location13; Padding margin9 = new Padding(6, 6, 6, 16); this.comboBox_jkdh.Margin = margin9; this.comboBox_jkdh.Name = "comboBox_jkdh"; System.Drawing.Size size13 = new System.Drawing.Size(300, 26); this.comboBox_jkdh.Size = size13; this.comboBox_jkdh.TabIndex = 21; this.numericUpDown_DTThreshold.DecimalPlaces = 3; this.numericUpDown_DTThreshold.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location14 = new System.Drawing.Point(6, 54); this.numericUpDown_DTThreshold.Location = location14; Padding margin10 = new Padding(6, 6, 6, 5); this.numericUpDown_DTThreshold.Margin = margin10; decimal maximum = new decimal(new int[] { 1000000000, 0, 0, 0 }); this.numericUpDown_DTThreshold.Maximum = maximum; this.numericUpDown_DTThreshold.Name = "numericUpDown_DTThreshold"; System.Drawing.Size size14 = new System.Drawing.Size(300, 28); this.numericUpDown_DTThreshold.Size = size14; this.numericUpDown_DTThreshold.TabIndex = 29; decimal value = new decimal(new int[] { 5, 0, 0, 0 }); this.numericUpDown_DTThreshold.Value = value; this.numericUpDown_DTThreshold.KeyUp += new KeyEventHandler(this.numericUpDown_DTThreshold_KeyUp); this.numericUpDown_JYThreshold.DecimalPlaces = 2; this.numericUpDown_JYThreshold.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location15 = new System.Drawing.Point(6, 93); this.numericUpDown_JYThreshold.Location = location15; Padding margin11 = new Padding(6, 6, 6, 5); this.numericUpDown_JYThreshold.Margin = margin11; decimal maximum2 = new decimal(new int[] { 1000000000, 0, 0, 0 }); this.numericUpDown_JYThreshold.Maximum = maximum2; this.numericUpDown_JYThreshold.Name = "numericUpDown_JYThreshold"; System.Drawing.Size size15 = new System.Drawing.Size(300, 28); this.numericUpDown_JYThreshold.Size = size15; this.numericUpDown_JYThreshold.TabIndex = 28; decimal value2 = new decimal(new int[] { 20, 0, 0, 0 }); this.numericUpDown_JYThreshold.Value = value2; this.numericUpDown_JYThreshold.KeyUp += new KeyEventHandler(this.numericUpDown_JYThreshold_KeyUp); this.numericUpDown_JYTestTime.DecimalPlaces = 1; this.numericUpDown_JYTestTime.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location16 = new System.Drawing.Point(6, 132); this.numericUpDown_JYTestTime.Location = location16; Padding margin12 = new Padding(6, 6, 6, 5); this.numericUpDown_JYTestTime.Margin = margin12; decimal maximum3 = new decimal(new int[] { 120, 0, 0, 0 }); this.numericUpDown_JYTestTime.Maximum = maximum3; this.numericUpDown_JYTestTime.Name = "numericUpDown_JYTestTime"; System.Drawing.Size size16 = new System.Drawing.Size(300, 28); this.numericUpDown_JYTestTime.Size = size16; this.numericUpDown_JYTestTime.TabIndex = 30; decimal value3 = new decimal(new int[] { 1, 0, 0, 0 }); this.numericUpDown_JYTestTime.Value = value3; this.numericUpDown_JYTestTime.KeyUp += new KeyEventHandler(this.numericUpDown_JYTestTime_KeyUp); this.numericUpDown_JYVoltage.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location17 = new System.Drawing.Point(6, 171); this.numericUpDown_JYVoltage.Location = location17; Padding margin13 = new Padding(6, 6, 6, 5); this.numericUpDown_JYVoltage.Margin = margin13; decimal maximum4 = new decimal(new int[] { 10000, 0, 0, 0 }); this.numericUpDown_JYVoltage.Maximum = maximum4; this.numericUpDown_JYVoltage.Name = "numericUpDown_JYVoltage"; System.Drawing.Size size17 = new System.Drawing.Size(300, 28); this.numericUpDown_JYVoltage.Size = size17; this.numericUpDown_JYVoltage.TabIndex = 32; decimal value4 = new decimal(new int[] { 100, 0, 0, 0 }); this.numericUpDown_JYVoltage.Value = value4; this.numericUpDown_JYVoltage.KeyUp += new KeyEventHandler(this.numericUpDown_JYVoltage_KeyUp); this.numericUpDown_NYThreshold.DecimalPlaces = 2; this.numericUpDown_NYThreshold.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location18 = new System.Drawing.Point(6, 210); this.numericUpDown_NYThreshold.Location = location18; Padding margin14 = new Padding(6, 6, 6, 5); this.numericUpDown_NYThreshold.Margin = margin14; decimal maximum5 = new decimal(new int[] { 10000, 0, 0, 0 }); this.numericUpDown_NYThreshold.Maximum = maximum5; this.numericUpDown_NYThreshold.Name = "numericUpDown_NYThreshold"; System.Drawing.Size size18 = new System.Drawing.Size(300, 28); this.numericUpDown_NYThreshold.Size = size18; this.numericUpDown_NYThreshold.TabIndex = 31; decimal value5 = new decimal(new int[] { 2, 0, 0, 0 }); this.numericUpDown_NYThreshold.Value = value5; this.numericUpDown_NYThreshold.KeyUp += new KeyEventHandler(this.numericUpDown_NYThreshold_KeyUp); this.numericUpDown_NYTestTime.DecimalPlaces = 1; this.numericUpDown_NYTestTime.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location19 = new System.Drawing.Point(6, 249); this.numericUpDown_NYTestTime.Location = location19; Padding margin15 = new Padding(6, 6, 6, 5); this.numericUpDown_NYTestTime.Margin = margin15; decimal maximum6 = new decimal(new int[] { 120, 0, 0, 0 }); this.numericUpDown_NYTestTime.Maximum = maximum6; this.numericUpDown_NYTestTime.Name = "numericUpDown_NYTestTime"; System.Drawing.Size size19 = new System.Drawing.Size(300, 28); this.numericUpDown_NYTestTime.Size = size19; this.numericUpDown_NYTestTime.TabIndex = 30; decimal value6 = new decimal(new int[] { 1, 0, 0, 0 }); this.numericUpDown_NYTestTime.Value = value6; this.numericUpDown_NYTestTime.KeyUp += new KeyEventHandler(this.numericUpDown_NYTestTime_KeyUp); this.numericUpDown_NYVoltage.Font = new System.Drawing.Font("宋体", 10.8f, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 134); System.Drawing.Point location20 = new System.Drawing.Point(6, 288); this.numericUpDown_NYVoltage.Location = location20; Padding margin16 = new Padding(6, 6, 6, 5); this.numericUpDown_NYVoltage.Margin = margin16; decimal maximum7 = new decimal(new int[] { 10000, 0, 0, 0 }); this.numericUpDown_NYVoltage.Maximum = maximum7; this.numericUpDown_NYVoltage.Name = "numericUpDown_NYVoltage"; System.Drawing.Size size20 = new System.Drawing.Size(300, 28); this.numericUpDown_NYVoltage.Size = size20; this.numericUpDown_NYVoltage.TabIndex = 32; decimal value7 = new decimal(new int[] { 100, 0, 0, 0 }); this.numericUpDown_NYVoltage.Value = value7; this.numericUpDown_NYVoltage.KeyUp += new KeyEventHandler(this.numericUpDown_NYVoltage_KeyUp); System.Drawing.SizeF autoScaleDimensions = new System.Drawing.SizeF(8f, 15f); base.AutoScaleDimensions = autoScaleDimensions; base.AutoScaleMode = AutoScaleMode.Font; System.Drawing.Size clientSize = new System.Drawing.Size(654, 465); base.ClientSize = clientSize; base.Controls.Add(this.flowLayoutPanel2); base.Controls.Add(this.flowLayoutPanel1); base.Controls.Add(this.btnQuit); base.Controls.Add(this.btnSubmit); base.FormBorderStyle = FormBorderStyle.FixedDialog; base.Icon = (System.Drawing.Icon)resources.GetObject("$this.Icon"); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "ctFormBatchEditGroupTestPara"; base.StartPosition = FormStartPosition.CenterScreen; this.Text = "批量修改分组测试参数"; base.Load += new System.EventHandler(this.ctFormBatchEditGroupTestPara_Load); this.flowLayoutPanel1.ResumeLayout(false); this.flowLayoutPanel1.PerformLayout(); this.flowLayoutPanel2.ResumeLayout(false); ((ISupportInitialize)this.numericUpDown_DTThreshold).EndInit(); ((ISupportInitialize)this.numericUpDown_JYThreshold).EndInit(); ((ISupportInitialize)this.numericUpDown_JYTestTime).EndInit(); ((ISupportInitialize)this.numericUpDown_JYVoltage).EndInit(); ((ISupportInitialize)this.numericUpDown_NYThreshold).EndInit(); ((ISupportInitialize)this.numericUpDown_NYTestTime).EndInit(); ((ISupportInitialize)this.numericUpDown_NYVoltage).EndInit(); base.ResumeLayout(false); }
/// <summary> /// 成果物パネルのアクティベート。 /// 主にパッケージツリーで成果物PKGを選択した時に呼び出され、新たに成果物情報をファイルから読んで成果物パネルを表示する。 /// あるいは既に成果物パネルの開いているタブ内で表示されている場合はそのタブをアクティベートして終了する。 /// </summary> /// <param name="atf"></param> /// <returns></returns> public ArtifactVO activateArtifactPanel(ArtifactVO atf) { // 既にタブページで対象の成果物を開いていないかをチェックする foreach (TabPage page in tabControl1.TabPages) { // 開こうとしている成果物のGUIDとページで記憶しているGUIDが一致したら string guid = (string)(page.Tag); if (atf.guid.Equals(guid)) { // 該当のタブページを選択状態にし、終了 tabControl1.SelectedTab = page; return(atf); } } string artifactDir = ProjectSetting.getVO().projectPath + "\\" + ProjectSetting.getVO().artifactsPath; ArtifactXmlReader atfReader = new ArtifactXmlReader(artifactDir, true); // 成果物パッケージ別のXMLファイル読み込み atfReader.readArtifactDesc(atf); // 新しく開くアーティファクト内のフォルダツリーを作成 TreeView folderTree = new TreeView(); folderTree.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); folderTree.ImageIndex = 0; folderTree.ImageList = this.imageList1; folderTree.Nodes.Add(makePackageNode(null, atf.package, true)); folderTree.ExpandAll(); // アーティファクト内の要素リストを作成 FlowLayoutPanel elemPanel = new FlowLayoutPanel(); elemPanel.Anchor = ((System.Windows.Forms.AnchorStyles) ((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); elemPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; elemPanel.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; elemPanel.WrapContents = false; elemPanel.AutoScroll = true; makeElementsPanelContents(elemPanel, atf.package); TabPage atfPage = new TabPage(); atfPage.Controls.Add(elemPanel); // atfPage.Text = ((atf.package.stereoType != null) ? "<<" + atf.package.stereoType + ">> " : "" ) + atf.name ; atfPage.Text = atf.name; atfPage.Tag = atf.guid; // タブクローズ用のコンテキストメニューをTabPageに登録 atfPage.ContextMenuStrip = tabContextMenuStrip; // 作成したタブページをタブコントロールに追加し、そのタブを選択状態にする tabControl1.TabPages.Add(atfPage); tabControl1.SelectedTab = atfPage; return(atf); }
/** * method to save app part data to its respective data table * @param appPartName * @param layout **/ public void SaveAppPartData(string appPartName, FlowLayoutPanel layout) { ElementDataAdapter adapter = new ElementDataAdapter(); List<string> elementNames = new List<string>(); List<string> appPartValues = new List<string>(); // loop through layout components and get values for items with storeable data foreach (Control control in layout.Controls) { if (control.GetType() == typeof(TextBox)) { TextBox textbox = (TextBox)control; appPartValues.Add(textbox.Text); Element element = adapter.GetElement(int.Parse(textbox.Name)); elementNames.Add(element.ElementID + "." + element.ElementName); } else if (control.GetType() == typeof(CheckBox)) { CheckBox checkbox = (CheckBox)control; if (checkbox.Checked) { appPartValues.Add("1"); } else { appPartValues.Add("0"); } Element element = adapter.GetElement(int.Parse(checkbox.Name)); elementNames.Add(element.ElementID + "." + element.ElementName); } else if (control.GetType() == typeof(ComboBox)) { ComboBox combobox = (ComboBox)control; appPartValues.Add(combobox.SelectedText); Element element = adapter.GetElement(int.Parse(combobox.Name)); elementNames.Add(element.ElementID + "." + element.ElementName); } else if (control.GetType() == typeof(FlowLayoutPanel)) { FlowLayoutPanel radiogroup = (FlowLayoutPanel)control; foreach (Control cntrl in radiogroup.Controls) { if (cntrl.GetType() == typeof(RadioButton)) { // TODO partial method stub. } } } } // build insert query string sql = "INSERT INTO " + appPartName + "("; // iterate though list arrays to build insert query foreach (string columnName in elementNames) { sql = sql + "'" + columnName + "', "; } // trim trailing ", " sql = sql.Substring(0, sql.Length - 2) + ") VALUES ("; // iterate through values foreach (string value in appPartValues) { sql = sql + "'" + value +"', "; } // trim trailing ", " sql = sql.Substring(0, sql.Length - 2) + ")"; try { this._conn.Open(); SqlCeCommand cmd = this._conn.CreateCommand(); cmd.CommandText = sql; cmd.ExecuteNonQuery(); } catch (Exception e) { Console.WriteLine(e.Message); } }
/// <summary> /// 成果物パネルの内容を作成する。 /// </summary> /// <param name="elemPanel">処理対象のパネル(成果物タブ内のパネルを想定)</param> /// <param name="pac">処理対象の成果物パッケージ</param> private void makeElementsPanelContents(FlowLayoutPanel elemPanel, PackageVO pac) { addPackageLabels(elemPanel, pac, 0); }
private void InitializeComponent() { // Configure dialog Text = "Debug Rhubarb"; Size = new Size(600, 400); Font = new Font(Font.FontFamily, 10); // Add property grid PropertyGrid propertyGrid1 = new PropertyGrid(); propertyGrid1.SelectedObject = config; Controls.Add(propertyGrid1); propertyGrid1.Dock = DockStyle.Fill; // Add button panel FlowLayoutPanel buttonPanel = new FlowLayoutPanel(); buttonPanel.FlowDirection = FlowDirection.RightToLeft; buttonPanel.AutoSize = true; buttonPanel.Dock = DockStyle.Bottom; Controls.Add(buttonPanel); // Add Cancel button Button cancelButton1 = new Button(); cancelButton1.Text = "Cancel"; cancelButton1.DialogResult = DialogResult.Cancel; buttonPanel.Controls.Add(cancelButton1); CancelButton = cancelButton1; // Add OK button Button okButton1 = new Button(); okButton1.Text = "OK"; okButton1.Click += OkButtonClickedHandler; buttonPanel.Controls.Add(okButton1); AcceptButton = okButton1; }
/** * Method to refresh container **/ public void RefreshPanel(FlowLayoutPanel panel) { // clear existing panel itmes panel.Controls.Clear(); // loop through elements and push to panel if (this._elements.Count() > 0) { foreach (Element element in this._elements) { switch (element.ElementType) { case ElementType.CLAYUI_TEXTBOX: panel.Controls.Add(this.CreateLabelUIElement(element)); panel.Controls.Add(this.CreateTextBoxUIElement(element, element.ElementID)); break; case ElementType.CLAYUI_LABEL: panel.Controls.Add(this.CreateLabelUIElement(element, element.ElementID)); break; case ElementType.CLAYUI_COMBOBOX: panel.Controls.Add(this.CreateLabelUIElement(element)); panel.Controls.Add(this.CreateComboBoxUIElement(element, element.ElementID)); break; case ElementType.CLAYUI_RADIOBUTTON: panel.Controls.Add(this.CreateLabelUIElement(element)); FlowLayoutPanel radioPanel = this.CreateRadioGroupUIElement(element, element.ElementID); radioPanel.Width = panel.Width; panel.Controls.Add(radioPanel); break; case ElementType.CLAYUI_CHECKBOX: panel.Controls.Add(this.CreateCheckBoxUIElement(element, element.ElementID)); break; } } } else { System.Console.WriteLine("Attempt to refresh layout with 0 elements. Did you forget to fetch elements?"); } }