public static NumericUpDown GetNumericUpDown(int min, int max) { NumericUpDown num = new NumericUpDown(); num.Minimum = min; num.Maximum = max; return num; }
public ToolStripNumericUpDownItem() : base(new NumericUpDown()) { numericUpDown = (NumericUpDown)this.Control; numericUpDown.AutoSize = false; numericUpDown.Maximum = 1000; numericUpDown.Size = new Size(30, 20); }
public void TestActualWidthOfNumericUpDownControl() { NumericUpDown nud = new NumericUpDown(); nud.Width = 150; TestAsync( nud, () => Assert.AreEqual(nud.ActualWidth, nud.Width)); }
public virtual void NumericUpDownCreatesAutomationPeer() { NumericUpDown item = new NumericUpDown(); NumericUpDownAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as NumericUpDownAutomationPeer, () => Assert.IsNotNull(peer, "NumericUpDown peer should not be null!"), () => Assert.AreEqual(item, peer.Owner, "NumericUpDown should be owner of the peer!")); }
public virtual void NumericUpDownAutomationPeerTypeAndClass() { NumericUpDown item = new NumericUpDown(); NumericUpDownAutomationPeer peer = null; TestAsync( item, () => peer = FrameworkElementAutomationPeer.CreatePeerForElement(item) as NumericUpDownAutomationPeer, () => Assert.AreEqual(AutomationControlType.Spinner, peer.GetAutomationControlType(), "Unexpected AutomationControlType!"), () => Assert.AreEqual("NumericUpDown", peer.GetClassName(), "Unexpected ClassType!")); }
public NumericUpDownStripItem(FormForImageDisplay Parent) : base(new NumericUpDown()) { this.ThisNumericUpDown = this.Control as NumericUpDown; this.ThisNumericUpDown.Maximum = 2000; this.Size = new System.Drawing.Size(83, 20); this.Parent = Parent; this.ThisNumericUpDown.ValueChanged += new EventHandler(ThisNumericUpDown_ValueChanged); }
public mnuChangeDarkness(string name, int price) : base(name) { this.price = price; this.Size = new Size(250, 250); this.MenuDirection = Enums.MenuDirection.Vertical; this.Location = Client.Logic.Graphics.DrawingSupport.GetCenter(Windows.WindowSwitcher.GameWindow.MapViewer.Size, this.Size); lblAddTile = new Label("lblAddTile"); lblAddTile.Location = new Point(25, 15); lblAddTile.AutoSize = false; lblAddTile.Size = new System.Drawing.Size(this.Width - lblAddTile.X * 2, 40); lblAddTile.Text = "Enter the size of the lights for the house (use -1 for full lighting):"; lblAddTile.ForeColor = Color.WhiteSmoke; nudAmount = new NumericUpDown("nudAmount"); nudAmount.Size = new Size(120, 24); nudAmount.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height + 10); nudAmount.Maximum = 20; nudAmount.Minimum = -1; nudAmount.Value = Logic.Maps.MapHelper.ActiveMap.Darkness; nudAmount.ValueChanged +=new EventHandler<ValueChangedEventArgs>(nudAmount_ValueChanged); lblPrice = new Label("lblPrice"); lblPrice.Location = new Point(lblAddTile.X, nudAmount.Y + nudAmount.Height + 10); lblPrice.AutoSize = false; lblPrice.Size = new System.Drawing.Size(180, 40); lblPrice.Text = "Adjusting the lighting will cost " + price + " " + Items.ItemHelper.Items[1].Name + "."; lblPrice.ForeColor = Color.WhiteSmoke; btnAccept = new Button("btnAccept"); btnAccept.Location = new Point(lblAddTile.X, lblPrice.Y + lblPrice.Height + 10); btnAccept.Size = new Size(80, 30); btnAccept.Text = "Set Lights"; btnAccept.Font = FontManager.LoadFont("tahoma", 10); Skins.SkinManager.LoadButtonGui(btnAccept); btnAccept.Click += new EventHandler<MouseButtonEventArgs>(btnAccept_Click); btnCancel = new Button("btnCancel"); btnCancel.Location = new Point(btnAccept.X + btnAccept.Width, lblPrice.Y + lblPrice.Height + 10); btnCancel.Size = new Size(80, 30); btnCancel.Text = "Cancel"; btnCancel.Font = FontManager.LoadFont("tahoma", 10); Skins.SkinManager.LoadButtonGui(btnCancel); btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click); this.AddWidget(lblAddTile); this.AddWidget(nudAmount); this.AddWidget(lblPrice); this.AddWidget(btnAccept); this.AddWidget(btnCancel); }
public mnuShopItemSelected(string name, int itemNum, int itemSlot, Enums.InvMenuType transactionType) : base(name) { transaction = transactionType; base.Size = new Size(185, 125); base.MenuDirection = Enums.MenuDirection.Horizontal; if (transaction == Enums.InvMenuType.Buy) { base.Location = new Point(435, 40); } else { base.Location = new Point(335, 40); } itemPicker = new Widgets.MenuItemPicker("itemPicker"); itemPicker.Location = new Point(18, 23); lblMove = new Label("lblMove"); lblMove.Font = FontManager.LoadFont("PMDCP", 32); lblMove.AutoSize = true; lblMove.Text = "Store"; lblMove.Location = new Point(30, 8); lblMove.HoverColor = Color.Red; lblMove.ForeColor = Color.WhiteSmoke; lblMove.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblMove_Click); nudAmount = new NumericUpDown("nudAmount"); nudAmount.Size = new Size(120, 24); nudAmount.Location = new Point(32, 42); nudAmount.Font = FontManager.LoadFont("PMDCP", 16); nudAmount.Minimum = 1; nudAmount.Maximum = Int32.MaxValue; lblSummary = new Label("lblSummary"); lblSummary.Font = FontManager.LoadFont("PMDCP", 32); lblSummary.AutoSize = true; lblSummary.Text = "Summary"; lblSummary.Location = new Point(30, 58); lblSummary.HoverColor = Color.Red; lblSummary.ForeColor = Color.WhiteSmoke; lblSummary.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblSummary_Click); this.AddWidget(itemPicker); this.AddWidget(lblMove); this.AddWidget(nudAmount); this.AddWidget(lblSummary); this.ItemSlot = itemSlot; this.ItemNum = itemNum; }
public MainForm () { // // _numericUpDown // _numericUpDown = new NumericUpDown (); _numericUpDown.Location = new Point (8, 8); _numericUpDown.Value = 1; Controls.Add (_numericUpDown); // // _tabControl // _tabControl = new TabControl (); _tabControl.Dock = DockStyle.Bottom; _tabControl.Height = 280; Controls.Add (_tabControl); // // _bugDescriptionText1 // _bugDescriptionText1 = new TextBox (); _bugDescriptionText1.Dock = DockStyle.Fill; _bugDescriptionText1.Multiline = true; _bugDescriptionText1.Text = string.Format (CultureInfo.InvariantCulture, "Steps to execute:{0}{0}" + "1. Click left of the number inside the NumericUpDown " + "and do not release the mouse button down.{0}{0}" + "2. Move to the right of the number.{0}{0}" + "3. Release the mouse button.{0}{0}" + "4. Move the mouse pointer left and right over the form.{0}{0}" + "5. Click to the right of the number.{0}{0}" + "Expected result:{0}{0}" + "1. On step 4, the number remains highlighted.{0}{0}" + "2. On step 5, the number is no longer highlighted.", Environment.NewLine); // // _tabPage1 // _tabPage1 = new TabPage (); _tabPage1.Text = "#1"; _tabPage1.Controls.Add (_bugDescriptionText1); _tabControl.Controls.Add (_tabPage1); // // MainForm // ClientSize = new Size (500, 320); StartPosition = FormStartPosition.CenterScreen; Text = "bug #357482"; }
public Player(Point pntlocation, double dblBank, NumericUpDown betControl, playerType type, Strategy strategy, CountMethod method) { // Since the game is limited to one split (two hands), just set them up now hands = new Hand[2]; hands[0] = new Hand(new Point(0, 0)); hands[1] = new Hand(new Point(50, 0)); // Player specific variables location = pntlocation; bank = dblBank; plyrStrategy = strategy; plyrMethod = method; plyrType = type; plyrBet = betControl; // Start out with one hand, they may split pairs to get two numberOfHands = 1; }
public UpDownExam() { numeric = new NumericUpDown(); numeric.Parent = this; numeric.SetBounds(20, 20, 100, 30); numeric.Minimum = -1000; numeric.Maximum = 9000; numeric.Value = 1000; numeric.Increment = 1000; numeric.ThousandsSeparator = true; numeric.ValueChanged += new EventHandler(numeric_ValueChanged); domain = new DomainUpDown(); domain.Parent = this; domain.SetBounds(20, 50, 100, 30); for (int i = 0; i < str.Length; i++) { domain.Items.Add(str[i]); } domain.Text = "색상 선택"; domain.SelectedItemChanged += new EventHandler(domain_SelectedItemChanged); }
private void InitializeComponent() { this.btnExec = new Button(); this.numUpDown = new NumericUpDown(); ((System.ComponentModel.ISupportInitialize)(this.numUpDown)).BeginInit(); this.SuspendLayout(); // // btnExec // this.btnExec.Location = new System.Drawing.Point(142, 6); this.btnExec.Name = "btnExec"; this.btnExec.Size = new System.Drawing.Size(66, 20); this.btnExec.TabIndex = 1; this.btnExec.Text = "Execute"; this.btnExec.UseVisualStyleBackColor = true; this.btnExec.Click += new System.EventHandler(this.btnExec_Click); // // numUpDown // this.numUpDown.Location = new System.Drawing.Point(12, 6); this.numUpDown.Maximum = 2; this.numUpDown.Minimum = -2; this.numUpDown.Name = "numUpDown"; this.numUpDown.Size = new System.Drawing.Size(77, 19); this.numUpDown.TabIndex = 2; this.numUpDown.Value = 1; // // mainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(220, 31); this.Controls.Add(this.numUpDown); this.Controls.Add(this.btnExec); this.Name = "mainForm"; this.Text = "Transpose"; ((System.ComponentModel.ISupportInitialize)(this.numUpDown)).EndInit(); this.ResumeLayout(false); }
public SetPosTest () { left_pos = new NumericUpDown (); top_pos = new NumericUpDown (); tool_window = new Form (); tool_window.FormBorderStyle = FormBorderStyle.FixedToolWindow; tool_window.LocationChanged += new EventHandler (ToolWindowLocationChanged); Label xlabel = new Label (); xlabel.Text = "Left:"; Label ylabel = new Label (); ylabel.Text = "Top:"; xlabel.Width = 45; ylabel.Width = 45; xlabel.Left = 10; left_pos.Left = 55; ylabel.Left = 10; top_pos.Left = 55; ylabel.Top = left_pos.Bottom + 25; top_pos.Top = left_pos.Bottom + 25; left_pos.Minimum = top_pos.Minimum = Int32.MinValue; left_pos.Maximum = top_pos.Maximum = Int32.MaxValue; left_pos.ValueChanged += new EventHandler (LeftPosChanged); top_pos.ValueChanged += new EventHandler (TopPosChanged); Controls.Add (xlabel); Controls.Add (ylabel); Controls.Add (left_pos); Controls.Add (top_pos); tool_window.Show (); }
public virtual void UpDownBasePeerOnlySupportsValuePattern() { NumericUpDown item = new NumericUpDown(); UpDownBaseAutomationPeer<double> peer = null; TestAsync( item, () => peer = new UpDownBaseAutomationPeer<double>(item), () => Assert.IsNull(peer.GetPattern(PatternInterface.Dock), "UpDownBaseAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ExpandCollapse), "UpDownBaseAutomationPeer should not support the ExpandCollapse pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Grid), "UpDownBaseAutomationPeer should not support the Grid pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.GridItem), "UpDownBaseAutomationPeer should not support the GridItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Invoke), "UpDownBaseAutomationPeer should not support the Dock pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.MultipleView), "UpDownBaseAutomationPeer should not support the MultipleView pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.RangeValue), "UpDownBaseAutomationPeer should not support the RangeValue pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Scroll), "UpDownBaseAutomationPeer should not support the Scroll pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.ScrollItem), "UpDownBaseAutomationPeer should not support the ScrollItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Selection), "UpDownBaseAutomationPeer should not support the Selection pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Table), "UpDownBaseAutomationPeer should not support the Table pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.TableItem), "UpDownBaseAutomationPeer should not support the TableItem pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Toggle), "UpDownBaseAutomationPeer should not support the Toggle pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Transform), "UpDownBaseAutomationPeer should not support the Transform pattern!"), () => Assert.IsNotNull(peer.GetPattern(PatternInterface.Value), "UpDownBaseAutomationPeer should support the Value pattern!"), () => Assert.IsNull(peer.GetPattern(PatternInterface.Window), "UpDownBaseAutomationPeer should not support the Window pattern!")); }
private void InitializeComponent() { groupVehicles = new System.Windows.Forms.GroupBox(); btnDeleteVehicle = new System.Windows.Forms.Button(); btnNewVehicle = new System.Windows.Forms.Button(); listVehicles = new System.Windows.Forms.ListBox(); groupProfile = new System.Windows.Forms.GroupBox(); groupBox1 = new System.Windows.Forms.GroupBox(); btnCalcSpeedo = new System.Windows.Forms.Button(); txtSpeedoFactor = new System.Windows.Forms.TextBox(); groupTimeout = new System.Windows.Forms.GroupBox(); lblTimeoutUnits = new System.Windows.Forms.Label(); numTimeout = new System.Windows.Forms.NumericUpDown(); lblTimeout = new System.Windows.Forms.Label(); btnSave = new System.Windows.Forms.Button(); btnDiscard = new System.Windows.Forms.Button(); groupNotes = new System.Windows.Forms.GroupBox(); txtNotes = new System.Windows.Forms.TextBox(); groupMisc = new System.Windows.Forms.GroupBox(); txtDragCoeff = new System.Windows.Forms.TextBox(); label1 = new System.Windows.Forms.Label(); lblPounds = new System.Windows.Forms.Label(); txtWeight = new System.Windows.Forms.TextBox(); lblWeight = new System.Windows.Forms.Label(); groupWheels = new System.Windows.Forms.GroupBox(); lblRimDiameterUnits = new System.Windows.Forms.Label(); lblTireAspectUnits = new System.Windows.Forms.Label(); lblTireWidthUnits = new System.Windows.Forms.Label(); lblExampleEnd = new System.Windows.Forms.Label(); lblExampleDiameter = new System.Windows.Forms.Label(); lblExampleAspect = new System.Windows.Forms.Label(); lblExampleSlash = new System.Windows.Forms.Label(); lblExampleDash = new System.Windows.Forms.Label(); lblExampleWidth = new System.Windows.Forms.Label(); lblExample = new System.Windows.Forms.Label(); txtRimDiameter = new System.Windows.Forms.TextBox(); lblRimDiameter = new System.Windows.Forms.Label(); txtAspectRatio = new System.Windows.Forms.TextBox(); lblTireAspectRatio = new System.Windows.Forms.Label(); txtTireWidth = new System.Windows.Forms.TextBox(); lblTireWidth = new System.Windows.Forms.Label(); groupDrivetrain = new System.Windows.Forms.GroupBox(); radioManual = new System.Windows.Forms.RadioButton(); radioAutomatic = new System.Windows.Forms.RadioButton(); txtName = new System.Windows.Forms.TextBox(); lblName = new System.Windows.Forms.Label(); btnExit = new System.Windows.Forms.Button(); groupVehicles.SuspendLayout(); groupProfile.SuspendLayout(); groupBox1.SuspendLayout(); groupTimeout.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(numTimeout)).BeginInit(); groupNotes.SuspendLayout(); groupMisc.SuspendLayout(); groupWheels.SuspendLayout(); groupDrivetrain.SuspendLayout(); SuspendLayout(); // // groupVehicles // groupVehicles.Controls.Add(btnDeleteVehicle); groupVehicles.Controls.Add(btnNewVehicle); groupVehicles.Controls.Add(listVehicles); groupVehicles.Location = new System.Drawing.Point(5, 9); groupVehicles.Name = "groupVehicles"; groupVehicles.Size = new System.Drawing.Size(150, 364); groupVehicles.TabIndex = 0; groupVehicles.TabStop = false; groupVehicles.Text = "Vehicles"; // // btnDeleteVehicle // btnDeleteVehicle.Location = new System.Drawing.Point(77, 330); btnDeleteVehicle.Name = "btnDeleteVehicle"; btnDeleteVehicle.Size = new System.Drawing.Size(63, 25); btnDeleteVehicle.TabIndex = 2; btnDeleteVehicle.Text = "&Delete"; btnDeleteVehicle.Click += new System.EventHandler(btnDeleteVehicle_Click); // // btnNewVehicle // btnNewVehicle.Location = new System.Drawing.Point(10, 330); btnNewVehicle.Name = "btnNewVehicle"; btnNewVehicle.Size = new System.Drawing.Size(62, 25); btnNewVehicle.TabIndex = 1; btnNewVehicle.Text = "&New"; btnNewVehicle.Click += new System.EventHandler(btnNewVehicle_Click); // // listVehicles // listVehicles.Location = new System.Drawing.Point(10, 20); listVehicles.Name = "listVehicles"; listVehicles.Size = new System.Drawing.Size(130, 303); listVehicles.TabIndex = 0; listVehicles.SelectedIndexChanged += new System.EventHandler(listVehicles_SelectedIndexChanged); // // groupProfile // groupProfile.Controls.Add(groupBox1); groupProfile.Controls.Add(groupTimeout); groupProfile.Controls.Add(btnSave); groupProfile.Controls.Add(btnDiscard); groupProfile.Controls.Add(groupNotes); groupProfile.Controls.Add(groupMisc); groupProfile.Controls.Add(groupWheels); groupProfile.Controls.Add(groupDrivetrain); groupProfile.Controls.Add(txtName); groupProfile.Controls.Add(lblName); groupProfile.Location = new System.Drawing.Point(160, 9); groupProfile.Name = "groupProfile"; groupProfile.Size = new System.Drawing.Size(424, 364); groupProfile.TabIndex = 1; groupProfile.TabStop = false; groupProfile.Text = "Selected vehicle profile"; // // groupBox1 // groupBox1.Controls.Add(btnCalcSpeedo); groupBox1.Controls.Add(txtSpeedoFactor); groupBox1.Location = new System.Drawing.Point(11, 177); groupBox1.Name = "groupBox1"; groupBox1.Size = new System.Drawing.Size(205, 65); groupBox1.TabIndex = 4; groupBox1.TabStop = false; groupBox1.Text = "Speedometer Calibration Factor"; // // btnCalcSpeedo // btnCalcSpeedo.Location = new System.Drawing.Point(105, 27); btnCalcSpeedo.Name = "btnCalcSpeedo"; btnCalcSpeedo.Size = new System.Drawing.Size(82, 23); btnCalcSpeedo.TabIndex = 1; btnCalcSpeedo.Text = "&Calculate"; btnCalcSpeedo.Click += new System.EventHandler(btnCalcSpeedo_Click); // // txtSpeedoFactor // txtSpeedoFactor.Location = new System.Drawing.Point(18, 28); txtSpeedoFactor.Name = "txtSpeedoFactor"; txtSpeedoFactor.Size = new System.Drawing.Size(72, 20); txtSpeedoFactor.TabIndex = 0; txtSpeedoFactor.Text = "1.000"; txtSpeedoFactor.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // groupTimeout // groupTimeout.Controls.Add(lblTimeoutUnits); groupTimeout.Controls.Add(numTimeout); groupTimeout.Controls.Add(lblTimeout); groupTimeout.Location = new System.Drawing.Point(10, 48); groupTimeout.Name = "groupTimeout"; groupTimeout.Size = new System.Drawing.Size(205, 58); groupTimeout.TabIndex = 2; groupTimeout.TabStop = false; groupTimeout.Text = "OBD-II Timing"; // // lblTimeoutUnits // lblTimeoutUnits.Location = new System.Drawing.Point(165, 20); lblTimeoutUnits.Name = "lblTimeoutUnits"; lblTimeoutUnits.Size = new System.Drawing.Size(22, 20); lblTimeoutUnits.TabIndex = 2; lblTimeoutUnits.Text = "ms"; lblTimeoutUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // numTimeout // numTimeout.Increment = new decimal(new int[] { 4, 0, 0, 0 }); numTimeout.Location = new System.Drawing.Point(93, 20); numTimeout.Maximum = new decimal(new int[] { 1020, 0, 0, 0 }); numTimeout.Minimum = new decimal(new int[] { 32, 0, 0, 0 }); numTimeout.Name = "numTimeout"; numTimeout.Size = new System.Drawing.Size(61, 20); numTimeout.TabIndex = 1; numTimeout.Value = new decimal(new int[] { 200, 0, 0, 0 }); numTimeout.ValueChanged += new System.EventHandler(numTimeout_ValueChanged); // // lblTimeout // lblTimeout.Location = new System.Drawing.Point(13, 20); lblTimeout.Name = "lblTimeout"; lblTimeout.Size = new System.Drawing.Size(75, 20); lblTimeout.TabIndex = 0; lblTimeout.Text = "ELM &Timeout:"; lblTimeout.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // btnSave // btnSave.Location = new System.Drawing.Point(255, 330); btnSave.Name = "btnSave"; btnSave.Size = new System.Drawing.Size(75, 25); btnSave.TabIndex = 8; btnSave.Text = "&Save"; btnSave.Click += new System.EventHandler(btnSave_Click); // // btnDiscard // btnDiscard.Location = new System.Drawing.Point(335, 330); btnDiscard.Name = "btnDiscard"; btnDiscard.Size = new System.Drawing.Size(75, 25); btnDiscard.TabIndex = 9; btnDiscard.Text = "D&iscard"; btnDiscard.Click += new System.EventHandler(btnDiscard_Click); // // groupNotes // groupNotes.Controls.Add(txtNotes); groupNotes.Location = new System.Drawing.Point(225, 177); groupNotes.Name = "groupNotes"; groupNotes.Size = new System.Drawing.Size(185, 148); groupNotes.TabIndex = 7; groupNotes.TabStop = false; groupNotes.Text = "Notes"; // // txtNotes // txtNotes.Location = new System.Drawing.Point(10, 20); txtNotes.Multiline = true; txtNotes.Name = "txtNotes"; txtNotes.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; txtNotes.Size = new System.Drawing.Size(165, 119); txtNotes.TabIndex = 0; txtNotes.TextChanged += new System.EventHandler(ValueChanged); // // groupMisc // groupMisc.Controls.Add(txtDragCoeff); groupMisc.Controls.Add(label1); groupMisc.Controls.Add(lblPounds); groupMisc.Controls.Add(txtWeight); groupMisc.Controls.Add(lblWeight); groupMisc.Location = new System.Drawing.Point(10, 250); groupMisc.Name = "groupMisc"; groupMisc.Size = new System.Drawing.Size(205, 75); groupMisc.TabIndex = 5; groupMisc.TabStop = false; groupMisc.Text = "Miscellaneous"; // // txtDragCoeff // txtDragCoeff.Location = new System.Drawing.Point(90, 45); txtDragCoeff.Name = "txtDragCoeff"; txtDragCoeff.Size = new System.Drawing.Size(50, 20); txtDragCoeff.TabIndex = 4; txtDragCoeff.TextChanged += new System.EventHandler(ValueChanged); // // label1 // label1.Location = new System.Drawing.Point(15, 45); label1.Name = "label1"; label1.Size = new System.Drawing.Size(70, 20); label1.TabIndex = 3; label1.Text = "&Drag coeff.:"; label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // lblPounds // lblPounds.Location = new System.Drawing.Point(145, 20); lblPounds.Name = "lblPounds"; lblPounds.Size = new System.Drawing.Size(50, 20); lblPounds.TabIndex = 2; lblPounds.Text = "lbs"; lblPounds.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // txtWeight // txtWeight.Location = new System.Drawing.Point(90, 20); txtWeight.Name = "txtWeight"; txtWeight.Size = new System.Drawing.Size(50, 20); txtWeight.TabIndex = 1; txtWeight.TextChanged += new System.EventHandler(ValueChanged); // // lblWeight // lblWeight.Location = new System.Drawing.Point(15, 20); lblWeight.Name = "lblWeight"; lblWeight.Size = new System.Drawing.Size(70, 20); lblWeight.TabIndex = 0; lblWeight.Text = "W&eight:"; lblWeight.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // groupWheels // groupWheels.Controls.Add(lblRimDiameterUnits); groupWheels.Controls.Add(lblTireAspectUnits); groupWheels.Controls.Add(lblTireWidthUnits); groupWheels.Controls.Add(lblExampleEnd); groupWheels.Controls.Add(lblExampleDiameter); groupWheels.Controls.Add(lblExampleAspect); groupWheels.Controls.Add(lblExampleSlash); groupWheels.Controls.Add(lblExampleDash); groupWheels.Controls.Add(lblExampleWidth); groupWheels.Controls.Add(lblExample); groupWheels.Controls.Add(txtRimDiameter); groupWheels.Controls.Add(lblRimDiameter); groupWheels.Controls.Add(txtAspectRatio); groupWheels.Controls.Add(lblTireAspectRatio); groupWheels.Controls.Add(txtTireWidth); groupWheels.Controls.Add(lblTireWidth); groupWheels.Location = new System.Drawing.Point(225, 48); groupWheels.Name = "groupWheels"; groupWheels.Size = new System.Drawing.Size(185, 122); groupWheels.TabIndex = 6; groupWheels.TabStop = false; groupWheels.Text = "Wheels"; // // lblRimDiameterUnits // lblRimDiameterUnits.Location = new System.Drawing.Point(145, 92); lblRimDiameterUnits.Name = "lblRimDiameterUnits"; lblRimDiameterUnits.Size = new System.Drawing.Size(30, 20); lblRimDiameterUnits.TabIndex = 15; lblRimDiameterUnits.Text = "in"; lblRimDiameterUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblTireAspectUnits // lblTireAspectUnits.Location = new System.Drawing.Point(145, 67); lblTireAspectUnits.Name = "lblTireAspectUnits"; lblTireAspectUnits.Size = new System.Drawing.Size(30, 20); lblTireAspectUnits.TabIndex = 12; lblTireAspectUnits.Text = "%"; lblTireAspectUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblTireWidthUnits // lblTireWidthUnits.Location = new System.Drawing.Point(145, 42); lblTireWidthUnits.Name = "lblTireWidthUnits"; lblTireWidthUnits.Size = new System.Drawing.Size(30, 20); lblTireWidthUnits.TabIndex = 9; lblTireWidthUnits.Text = "mm"; lblTireWidthUnits.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lblExampleEnd // lblExampleEnd.Location = new System.Drawing.Point(170, 20); lblExampleEnd.Name = "lblExampleEnd"; lblExampleEnd.Size = new System.Drawing.Size(5, 20); lblExampleEnd.TabIndex = 6; lblExampleEnd.Text = ")"; lblExampleEnd.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblExampleDiameter // lblExampleDiameter.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblExampleDiameter.ForeColor = System.Drawing.SystemColors.ControlText; lblExampleDiameter.Location = new System.Drawing.Point(145, 20); lblExampleDiameter.Name = "lblExampleDiameter"; lblExampleDiameter.Size = new System.Drawing.Size(25, 20); lblExampleDiameter.TabIndex = 5; lblExampleDiameter.Text = "17"; lblExampleDiameter.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblExampleAspect // lblExampleAspect.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblExampleAspect.ForeColor = System.Drawing.SystemColors.ControlText; lblExampleAspect.Location = new System.Drawing.Point(105, 20); lblExampleAspect.Name = "lblExampleAspect"; lblExampleAspect.Size = new System.Drawing.Size(30, 20); lblExampleAspect.TabIndex = 3; lblExampleAspect.Text = "40"; lblExampleAspect.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblExampleSlash // lblExampleSlash.Location = new System.Drawing.Point(95, 20); lblExampleSlash.Name = "lblExampleSlash"; lblExampleSlash.Size = new System.Drawing.Size(10, 20); lblExampleSlash.TabIndex = 2; lblExampleSlash.Text = "/"; lblExampleSlash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblExampleDash // lblExampleDash.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblExampleDash.ForeColor = System.Drawing.SystemColors.ControlText; lblExampleDash.Location = new System.Drawing.Point(135, 20); lblExampleDash.Name = "lblExampleDash"; lblExampleDash.Size = new System.Drawing.Size(10, 20); lblExampleDash.TabIndex = 4; lblExampleDash.Text = "-"; lblExampleDash.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblExampleWidth // lblExampleWidth.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); lblExampleWidth.ForeColor = System.Drawing.SystemColors.ControlText; lblExampleWidth.Location = new System.Drawing.Point(65, 20); lblExampleWidth.Name = "lblExampleWidth"; lblExampleWidth.Size = new System.Drawing.Size(30, 20); lblExampleWidth.TabIndex = 1; lblExampleWidth.Text = "275"; lblExampleWidth.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // lblExample // lblExample.Location = new System.Drawing.Point(5, 20); lblExample.Name = "lblExample"; lblExample.Size = new System.Drawing.Size(55, 20); lblExample.TabIndex = 0; lblExample.Text = "(Example:"; lblExample.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtRimDiameter // txtRimDiameter.Location = new System.Drawing.Point(90, 92); txtRimDiameter.Name = "txtRimDiameter"; txtRimDiameter.Size = new System.Drawing.Size(50, 20); txtRimDiameter.TabIndex = 14; txtRimDiameter.TextChanged += new System.EventHandler(ValueChanged); txtRimDiameter.Enter += new System.EventHandler(txtRimDiameter_Enter); txtRimDiameter.Leave += new System.EventHandler(txtRimDiameter_Leave); // // lblRimDiameter // lblRimDiameter.Location = new System.Drawing.Point(10, 92); lblRimDiameter.Name = "lblRimDiameter"; lblRimDiameter.Size = new System.Drawing.Size(75, 20); lblRimDiameter.TabIndex = 13; lblRimDiameter.Text = "Rim &diameter:"; lblRimDiameter.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtAspectRatio // txtAspectRatio.Location = new System.Drawing.Point(90, 67); txtAspectRatio.Name = "txtAspectRatio"; txtAspectRatio.Size = new System.Drawing.Size(50, 20); txtAspectRatio.TabIndex = 11; txtAspectRatio.TextChanged += new System.EventHandler(ValueChanged); txtAspectRatio.Enter += new System.EventHandler(txtAspectRatio_Enter); txtAspectRatio.Leave += new System.EventHandler(txtAspectRatio_Leave); // // lblTireAspectRatio // lblTireAspectRatio.Location = new System.Drawing.Point(10, 67); lblTireAspectRatio.Name = "lblTireAspectRatio"; lblTireAspectRatio.Size = new System.Drawing.Size(75, 20); lblTireAspectRatio.TabIndex = 10; lblTireAspectRatio.Text = "Tire &aspect:"; lblTireAspectRatio.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // txtTireWidth // txtTireWidth.Location = new System.Drawing.Point(90, 42); txtTireWidth.Name = "txtTireWidth"; txtTireWidth.Size = new System.Drawing.Size(50, 20); txtTireWidth.TabIndex = 8; txtTireWidth.TextChanged += new System.EventHandler(ValueChanged); txtTireWidth.Enter += new System.EventHandler(txtTireWidth_Enter); txtTireWidth.Leave += new System.EventHandler(txtTireWidth_Leave); // // lblTireWidth // lblTireWidth.Location = new System.Drawing.Point(10, 42); lblTireWidth.Name = "lblTireWidth"; lblTireWidth.Size = new System.Drawing.Size(75, 20); lblTireWidth.TabIndex = 7; lblTireWidth.Text = "Tire &width:"; lblTireWidth.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // groupDrivetrain // groupDrivetrain.Controls.Add(radioManual); groupDrivetrain.Controls.Add(radioAutomatic); groupDrivetrain.Location = new System.Drawing.Point(10, 114); groupDrivetrain.Name = "groupDrivetrain"; groupDrivetrain.Size = new System.Drawing.Size(205, 56); groupDrivetrain.TabIndex = 3; groupDrivetrain.TabStop = false; groupDrivetrain.Text = "Transmission"; // // radioManual // radioManual.Checked = true; radioManual.Location = new System.Drawing.Point(116, 20); radioManual.Name = "radioManual"; radioManual.Size = new System.Drawing.Size(75, 20); radioManual.TabIndex = 1; radioManual.TabStop = true; radioManual.Text = "&Manual"; radioManual.CheckedChanged += new System.EventHandler(ValueChanged); // // radioAutomatic // radioAutomatic.Location = new System.Drawing.Point(15, 20); radioAutomatic.Name = "radioAutomatic"; radioAutomatic.Size = new System.Drawing.Size(75, 20); radioAutomatic.TabIndex = 0; radioAutomatic.Text = "&Automatic"; radioAutomatic.CheckedChanged += new System.EventHandler(ValueChanged); // // txtName // txtName.Location = new System.Drawing.Point(60, 20); txtName.MaxLength = 20; txtName.Name = "txtName"; txtName.Size = new System.Drawing.Size(350, 20); txtName.TabIndex = 1; txtName.TextChanged += new System.EventHandler(ValueChanged); // // lblName // lblName.Location = new System.Drawing.Point(5, 20); lblName.Name = "lblName"; lblName.Size = new System.Drawing.Size(50, 20); lblName.TabIndex = 0; lblName.Text = "Name:"; lblName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // // btnExit // btnExit.Location = new System.Drawing.Point(496, 384); btnExit.Name = "btnExit"; btnExit.Size = new System.Drawing.Size(75, 25); btnExit.TabIndex = 2; btnExit.Text = "D&one"; btnExit.Click += new System.EventHandler(btnExit_Click); // // VehicleForm // AutoScaleBaseSize = new System.Drawing.Size(5, 13); ClientSize = new System.Drawing.Size(586, 416); Controls.Add(groupProfile); Controls.Add(groupVehicles); Controls.Add(btnExit); FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; MaximizeBox = false; MinimizeBox = false; Name = "VehicleForm"; StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; Text = "Vehicle Profile Manager"; Closing += new System.ComponentModel.CancelEventHandler(VehicleForm_Closing); Load += new System.EventHandler(VehicleForm_Load); groupVehicles.ResumeLayout(false); groupProfile.ResumeLayout(false); groupProfile.PerformLayout(); groupBox1.ResumeLayout(false); groupBox1.PerformLayout(); groupTimeout.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(numTimeout)).EndInit(); groupNotes.ResumeLayout(false); groupNotes.PerformLayout(); groupMisc.ResumeLayout(false); groupMisc.PerformLayout(); groupWheels.ResumeLayout(false); groupWheels.PerformLayout(); groupDrivetrain.ResumeLayout(false); ResumeLayout(false); }
private void InitializeComponent() { this.icontainer_0 = new Container(); this.panel1 = new Panel(); this.groupBox2 = new GroupBox(); this.listView1 = new ListView(); this.columnHeader_0 = new ColumnHeader(); this.columnHeader_1 = new ColumnHeader(); this.columnHeader_2 = new ColumnHeader(); this.columnHeader_3 = new ColumnHeader(); this.imageList_0 = new ImageList(this.icontainer_0); this.toolStrip1 = new ToolStrip(); this.btnAdd = new ToolStripButton(); this.btnEdit = new ToolStripButton(); this.btnDelete = new ToolStripButton(); this.panel2 = new Panel(); this.btnImport = new Button(); this.btnCancel = new Button(); this.btnOK = new Button(); this.groupBox1 = new GroupBox(); this.cboCommandType = new ComboBox(); this.label3 = new Label(); this.txtDataBase = new TextBox(); this.label2 = new Label(); this.txtName = new TextBox(); this.label1 = new Label(); this.splitter1 = new Splitter(); this.txtCode = new SyntaxHighlighterControl(); this.label4 = new Label(); this.nudTimeout = new NumericUpDown(); this.panel1.SuspendLayout(); this.groupBox2.SuspendLayout(); this.toolStrip1.SuspendLayout(); this.panel2.SuspendLayout(); this.groupBox1.SuspendLayout(); this.nudTimeout.BeginInit(); base.SuspendLayout(); this.panel1.Controls.Add(this.groupBox2); this.panel1.Controls.Add(this.panel2); this.panel1.Controls.Add(this.groupBox1); this.panel1.Dock = DockStyle.Right; this.panel1.Location = new Point(0x296, 3); this.panel1.Name = "panel1"; this.panel1.Size = new Size(0x189, 0x214); this.panel1.TabIndex = 0; this.groupBox2.Controls.Add(this.listView1); this.groupBox2.Controls.Add(this.toolStrip1); this.groupBox2.Dock = DockStyle.Fill; this.groupBox2.Location = new Point(0, 0x73); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new Size(0x189, 0x176); this.groupBox2.TabIndex = 2; this.groupBox2.TabStop = false; this.groupBox2.Text = "命令参数"; this.listView1.Columns.AddRange(new ColumnHeader[] { this.columnHeader_0, this.columnHeader_1, this.columnHeader_2, this.columnHeader_3 }); this.listView1.Dock = DockStyle.Fill; this.listView1.FullRowSelect = true; this.listView1.HideSelection = false; this.listView1.Location = new Point(3, 0x2a); this.listView1.MultiSelect = false; this.listView1.Name = "listView1"; this.listView1.Size = new Size(0x183, 0x149); this.listView1.SmallImageList = this.imageList_0; this.listView1.TabIndex = 1; this.listView1.UseCompatibleStateImageBehavior = false; this.listView1.View = View.Details; this.listView1.ItemActivate += new EventHandler(this.btnEdit_Click); this.listView1.Resize += new EventHandler(this.listView1_Resize); this.columnHeader_0.Text = "Name"; this.columnHeader_0.Width = 0x8e; this.columnHeader_1.Text = "Type"; this.columnHeader_1.Width = 0x54; this.columnHeader_2.Text = "Direction"; this.columnHeader_2.Width = 0x4e; this.columnHeader_3.Text = "Size"; this.columnHeader_3.TextAlign = HorizontalAlignment.Right; this.columnHeader_3.Width = 0x37; this.imageList_0.ColorDepth = ColorDepth.Depth8Bit; this.imageList_0.ImageSize = new Size(0x10, 0x10); this.imageList_0.TransparentColor = Color.Transparent; this.toolStrip1.Items.AddRange(new ToolStripItem[] { this.btnAdd, this.btnEdit, this.btnDelete }); this.toolStrip1.Location = new Point(3, 0x11); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new Size(0x183, 0x19); this.toolStrip1.TabIndex = 0; this.toolStrip1.Text = "toolStrip1"; //this.btnAdd.Image = Resources.NewDocumentHS; this.btnAdd.ImageTransparentColor = Color.Magenta; this.btnAdd.Name = "btnAdd"; this.btnAdd.Size = new Size(0x33, 0x16); this.btnAdd.Text = "新增"; this.btnAdd.Click += new EventHandler(this.btnAdd_Click); // this.btnEdit.Image = Resources.EditTableHS; this.btnEdit.ImageTransparentColor = Color.Magenta; this.btnEdit.Name = "btnEdit"; this.btnEdit.Size = new Size(0x33, 0x16); this.btnEdit.Text = "修改"; this.btnEdit.Click += new EventHandler(this.btnEdit_Click); //this.btnDelete.Image = Resources.DeleteHS; this.btnDelete.ImageTransparentColor = Color.Magenta; this.btnDelete.Name = "btnDelete"; this.btnDelete.Size = new Size(0x33, 0x16); this.btnDelete.Text = "删除"; this.btnDelete.Click += new EventHandler(this.btnDelete_Click); this.panel2.Controls.Add(this.btnImport); this.panel2.Controls.Add(this.btnCancel); this.panel2.Controls.Add(this.btnOK); this.panel2.Dock = DockStyle.Bottom; this.panel2.Location = new Point(0, 0x1e9); this.panel2.Name = "panel2"; this.panel2.Size = new Size(0x189, 0x2b); this.panel2.TabIndex = 1; this.btnImport.Location = new Point(7, 10); this.btnImport.Name = "btnImport"; this.btnImport.Size = new Size(100, 0x17); this.btnImport.TabIndex = 2; this.btnImport.Text = "从剪切板导入"; this.btnImport.UseVisualStyleBackColor = true; this.btnImport.Visible = false; this.btnImport.Click += new EventHandler(this.btnImport_Click); this.btnCancel.Anchor = AnchorStyles.Right | AnchorStyles.Top; this.btnCancel.DialogResult = DialogResult.Cancel; this.btnCancel.Location = new Point(0x12d, 10); this.btnCancel.Name = "btnCancel"; this.btnCancel.Size = new Size(0x4b, 0x17); this.btnCancel.TabIndex = 1; this.btnCancel.Text = "取消(&C)"; this.btnCancel.UseVisualStyleBackColor = true; this.btnOK.Anchor = AnchorStyles.Right | AnchorStyles.Top; this.btnOK.Location = new Point(0xce, 10); this.btnOK.Name = "btnOK"; this.btnOK.Size = new Size(0x4b, 0x17); this.btnOK.TabIndex = 0; this.btnOK.Text = "确定(&K)"; this.btnOK.UseVisualStyleBackColor = true; this.btnOK.Click += new EventHandler(this.btnOK_Click); this.groupBox1.Controls.Add(this.nudTimeout); this.groupBox1.Controls.Add(this.label4); this.groupBox1.Controls.Add(this.cboCommandType); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.txtDataBase); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.txtName); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Dock = DockStyle.Top; this.groupBox1.Location = new Point(0, 0); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new Size(0x189, 0x73); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "基本信息"; this.cboCommandType.DropDownStyle = ComboBoxStyle.DropDownList; this.cboCommandType.FormattingEnabled = true; this.cboCommandType.Location = new Point(0x3e, 0x4c); this.cboCommandType.Name = "cboCommandType"; this.cboCommandType.Size = new Size(0xae, 20); this.cboCommandType.TabIndex = 5; this.label3.AutoSize = true; this.label3.Location = new Point(10, 80); this.label3.Name = "label3"; this.label3.Size = new Size(0x1d, 12); this.label3.TabIndex = 4; this.label3.Text = "类型"; this.txtDataBase.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this.txtDataBase.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtDataBase.Location = new Point(0x3e, 0x2d); this.txtDataBase.Name = "txtDataBase"; this.txtDataBase.Size = new Size(0x13e, 0x15); this.txtDataBase.TabIndex = 3; this.label2.AutoSize = true; this.label2.Location = new Point(10, 50); this.label2.Name = "label2"; this.label2.Size = new Size(0x29, 12); this.label2.TabIndex = 2; this.label2.Text = "数据库"; this.txtName.Anchor = AnchorStyles.Right | AnchorStyles.Left | AnchorStyles.Top; this.txtName.Font = new Font("Courier New", 9f, FontStyle.Regular, GraphicsUnit.Point, 0); this.txtName.Location = new Point(0x3e, 0x12); this.txtName.Name = "txtName"; this.txtName.Size = new Size(0x13e, 0x15); this.txtName.TabIndex = 1; this.label1.AutoSize = true; this.label1.ForeColor = Color.Red; this.label1.Location = new Point(10, 0x17); this.label1.Name = "label1"; this.label1.Size = new Size(0x23, 12); this.label1.TabIndex = 0; this.label1.Text = "名称*"; this.splitter1.Dock = DockStyle.Right; this.splitter1.Location = new Point(0x28f, 3); this.splitter1.Name = "splitter1"; this.splitter1.Size = new Size(7, 0x214); this.splitter1.TabIndex = 1; this.splitter1.TabStop = false; this.txtCode.Dock = DockStyle.Fill; this.txtCode.Location = new Point(3, 3); this.txtCode.Name = "txtCode"; this.txtCode.method_6(false); this.txtCode.Size = new Size(0x28c, 0x214); this.txtCode.TabIndex = 2; this.label4.AutoSize = true; this.label4.Location = new Point(0xf3, 80); this.label4.Name = "label4"; this.label4.Size = new Size(0x35, 12); this.label4.TabIndex = 6; this.label4.Text = "超时(秒)"; this.nudTimeout.Font = new Font("Courier New", 9f); this.nudTimeout.Location = new Point(0x12d, 0x4c); int[] bits = new int[4]; bits[0] = 0x186a0; this.nudTimeout.Maximum = new decimal(bits); this.nudTimeout.Name = "nudTimeout"; this.nudTimeout.Size = new Size(0x4f, 0x15); this.nudTimeout.TabIndex = 7; bits = new int[4]; bits[0] = 30; this.nudTimeout.Value = new decimal(bits); base.AutoScaleDimensions = new SizeF(6f, 12f); base.AutoScaleMode = AutoScaleMode.Font; base.CancelButton = this.btnCancel; base.ClientSize = new Size(0x422, 0x21a); base.Controls.Add(this.txtCode); base.Controls.Add(this.splitter1); base.Controls.Add(this.panel1); base.MinimizeBox = false; base.Name = "EditCommandDialog"; base.Padding = new Padding(3); base.ShowIcon = false; base.ShowInTaskbar = false; base.StartPosition = FormStartPosition.CenterScreen; this.Text = "新增命令"; base.Load += new EventHandler(this.EditCommandDialog_Load); base.Shown += new EventHandler(this.EditCommandDialog_Shown); this.panel1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.panel2.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.nudTimeout.EndInit(); base.ResumeLayout(false); }
public virtual void CoerceInputTextOnLostFocus() { NumericUpDown nud = new NumericUpDown { Maximum = 100, Minimum = 0, Value = 50 }; TextBox part = null; TextBox other = new TextBox(); StackPanel panel = new StackPanel(); panel.Children.Add(nud); panel.Children.Add(other); TestAsync( 100, panel, () => part = nud.GetVisualDescendents().OfType<TextBox>().FirstOrDefault(), () => Assert.IsNotNull(part, "Could not find TextBox template part!"), () => part.Focus(), () => part.Text = "999", () => other.Focus(), () => Assert.AreEqual(100, nud.Value, "NumericUpDown did not coerce the value to 100!")); }
private void OnUpDownEnter(object sender, EventArgs e) { NumericUpDown nud = (NumericUpDown)sender; nud.Select(0, nud.Text.Length); }
public winShopPanel() : base("winShopPanel") { this.Windowed = true; this.ShowInWindowSwitcher = false; this.Size = new System.Drawing.Size(200, 230); this.Location = new System.Drawing.Point(210, WindowSwitcher.GameWindow.ActiveTeam.Y + WindowSwitcher.GameWindow.ActiveTeam.Height + 0); this.AlwaysOnTop = true; this.TitleBar.CloseButton.Visible = true; this.TitleBar.Font = Graphics.FontManager.LoadFont("tahoma", 10); this.TitleBar.Text = "Shop Panel"; pnlShopList = new Panel("pnlShopList"); pnlShopList.Size = new System.Drawing.Size(200, 230); pnlShopList.Location = new Point(0, 0); pnlShopList.BackColor = Color.White; pnlShopList.Visible = true; pnlShopEditor = new Panel("pnlShopEditor"); pnlShopEditor.Size = new System.Drawing.Size(440, 380); pnlShopEditor.Location = new Point(0, 0); pnlShopEditor.BackColor = Color.White; pnlShopEditor.Visible = false; lbxShopList = new ListBox("lbxShopList"); lbxShopList.Location = new Point(10, 10); lbxShopList.Size = new Size(180, 140); for (int i = 0; i < 10; i++) { lbiItem = new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Shops.ShopHelper.Shops[(i + 1) + 10 * currentTen].Name); lbxShopList.Items.Add(lbiItem); } lbxShopList.SelectItem(0); btnBack = new Button("btnBack"); btnBack.Location = new Point(10, 160); btnBack.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnBack.Size = new System.Drawing.Size(64, 16); btnBack.Visible = true; btnBack.Text = "<--"; btnBack.Click += new EventHandler<MouseButtonEventArgs>(btnBack_Click); btnForward = new Button("btnForward"); btnForward.Location = new Point(126, 160); btnForward.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnForward.Size = new System.Drawing.Size(64, 16); btnForward.Visible = true; btnForward.Text = "-->"; btnForward.Click += new EventHandler<MouseButtonEventArgs>(btnForward_Click); btnEdit = new Button("btnEdit"); btnEdit.Location = new Point(10, 190); btnEdit.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEdit.Size = new System.Drawing.Size(64, 16); btnEdit.Visible = true; btnEdit.Text = "Edit"; btnEdit.Click += new EventHandler<MouseButtonEventArgs>(btnEdit_Click); btnCancel = new Button("btnCancel"); btnCancel.Location = new Point(126, 190); btnCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnCancel.Size = new System.Drawing.Size(64, 16); btnCancel.Visible = true; btnCancel.Text = "Cancel"; btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click); btnEditorCancel = new Button("btnEditorCancel"); btnEditorCancel.Location = new Point(340, 334); btnEditorCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEditorCancel.Size = new System.Drawing.Size(64, 16); btnEditorCancel.Visible = true; btnEditorCancel.Text = "Cancel"; btnEditorCancel.Click += new EventHandler<MouseButtonEventArgs>(btnEditorCancel_Click); btnEditorOK = new Button("btnEditorOK"); btnEditorOK.Location = new Point(250, 334); btnEditorOK.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEditorOK.Size = new System.Drawing.Size(64, 16); btnEditorOK.Visible = true; btnEditorOK.Text = "OK"; btnEditorOK.Click += new EventHandler<MouseButtonEventArgs>(btnEditorOK_Click); lblName = new Label("lblName"); lblName.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblName.Text = "Shop Name:"; lblName.AutoSize = true; lblName.Location = new Point(10, 4); txtName = new TextBox("txtName"); txtName.Size = new Size(420, 16); txtName.Location = new Point(10, 16); //txtName.Text = "Loading..."; lblJoinSay = new Label("lblJoinSay"); lblJoinSay.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblJoinSay.Text = "Join Say:"; lblJoinSay.AutoSize = true; lblJoinSay.Location = new Point(10, 36); txtJoinSay = new TextBox("txtJoinSay"); txtJoinSay.Size = new Size(420, 16); txtJoinSay.Location = new Point(10, 48); lblLeaveSay = new Label("lblLeaveSay"); lblLeaveSay.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblLeaveSay.Text = "Leave Say:"; lblLeaveSay.AutoSize = true; lblLeaveSay.Location = new Point(10, 68); txtLeaveSay = new TextBox("txtLeaveSay"); txtLeaveSay.Size = new Size(420, 16); txtLeaveSay.Location = new Point(10, 80); lbxShopItems = new ListBox("lbxShopItems"); lbxShopItems.Location = new Point(10, 100); lbxShopItems.Size = new Size(220, 240); lbxShopItems.ItemSelected += new EventHandler(lbxShopItems_ItemSelected); for (int i = 0; i < MaxInfo.MAX_TRADES; i++) { lbiShopItem = new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": ---"); lbxShopItems.Items.Add(lbiShopItem); } //ListBoxTextItem lbiShopItem; lblGiveItem = new Label("lblGiveItem"); lblGiveItem.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblGiveItem.Text = "Item Paid [---]:"; lblGiveItem.AutoSize = true; lblGiveItem.Location = new Point(240, 100); nudGiveItem = new NumericUpDown("nudGiveItem"); nudGiveItem.Size = new Size(100, 16); nudGiveItem.Location = new Point(240, 112); nudGiveItem.Maximum = MaxInfo.MaxItems; nudGiveItem.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudGiveItem_ValueChanged); lblGiveAmount = new Label("lblGiveAmount"); lblGiveAmount.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblGiveAmount.Text = "Amount Paid: (integer)"; lblGiveAmount.AutoSize = true; lblGiveAmount.Location = new Point(240, 132); nudGiveAmount = new NumericUpDown("nudGiveAmount"); nudGiveAmount.Size = new Size(100, 16); nudGiveAmount.Maximum = 2147483647; nudGiveAmount.Location = new Point(240, 144); lblGetItem = new Label("lblGetItem"); lblGetItem.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblGetItem.Text = "Item Bought [---]:"; lblGetItem.AutoSize = true; lblGetItem.Location = new Point(240, 164); nudGetItem = new NumericUpDown("nudGetItem"); nudGetItem.Size = new Size(100, 16); nudGetItem.Location = new Point(240, 176); nudGetItem.Maximum = MaxInfo.MaxItems; nudGetItem.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudGetItem_ValueChanged); btnShiftUp = new Button("btnShiftUp"); btnShiftUp.Location = new Point(240, 206); btnShiftUp.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnShiftUp.Size = new System.Drawing.Size(64, 16); btnShiftUp.Visible = true; btnShiftUp.Text = "Shift Up"; btnShiftUp.Click += new EventHandler<MouseButtonEventArgs>(btnShiftUp_Click); btnChange = new Button("btnChange"); btnChange.Location = new Point(240, 226); btnChange.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnChange.Size = new System.Drawing.Size(64, 16); btnChange.Visible = true; btnChange.Text = "Change"; btnChange.Click += new EventHandler<MouseButtonEventArgs>(btnChange_Click); btnShiftDown = new Button("btnShiftDown"); btnShiftDown.Location = new Point(240, 246); btnShiftDown.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnShiftDown.Size = new System.Drawing.Size(64, 16); btnShiftDown.Visible = true; btnShiftDown.Text = "Shift Down"; btnShiftDown.Click += new EventHandler<MouseButtonEventArgs>(btnShiftDown_Click); pnlShopList.AddWidget(lbxShopList); pnlShopList.AddWidget(btnBack); pnlShopList.AddWidget(btnForward); pnlShopList.AddWidget(btnEdit); pnlShopList.AddWidget(btnCancel); pnlShopEditor.AddWidget(lblName); pnlShopEditor.AddWidget(txtName); pnlShopEditor.AddWidget(lblJoinSay); pnlShopEditor.AddWidget(txtJoinSay); pnlShopEditor.AddWidget(lblLeaveSay); pnlShopEditor.AddWidget(txtLeaveSay); pnlShopEditor.AddWidget(lbxShopItems); //pnlShopEditor.AddWidget(lbiShopItem); pnlShopEditor.AddWidget(lblGiveItem); pnlShopEditor.AddWidget(nudGiveItem); pnlShopEditor.AddWidget(lblGiveAmount); pnlShopEditor.AddWidget(nudGiveAmount); pnlShopEditor.AddWidget(lblGetItem); pnlShopEditor.AddWidget(nudGetItem); pnlShopEditor.AddWidget(btnChange); pnlShopEditor.AddWidget(btnShiftUp); pnlShopEditor.AddWidget(btnShiftDown); pnlShopEditor.AddWidget(btnEditorCancel); pnlShopEditor.AddWidget(btnEditorOK); this.AddWidget(pnlShopList); this.AddWidget(pnlShopEditor); }
private void InitializeComponent() { this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label2 = new System.Windows.Forms.Label(); this.numericUpDown1 = new System.Windows.Forms.NumericUpDown(); this.label1 = new System.Windows.Forms.Label(); this.checkBox2 = new System.Windows.Forms.CheckBox(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.ddlMountType = new System.Windows.Forms.ComboBox(); this.ckbBuyMount = new System.Windows.Forms.CheckBox(); this.groupBox3 = new System.Windows.Forms.GroupBox(); this.checkBox5 = new System.Windows.Forms.CheckBox(); this.checkBox4 = new System.Windows.Forms.CheckBox(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.label4 = new System.Windows.Forms.Label(); this.numGoldFactor = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.ckbSaveMoney = new System.Windows.Forms.CheckBox(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit(); this.groupBox2.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox4.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numGoldFactor)).BeginInit(); this.SuspendLayout(); // // groupBox1 // this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.numericUpDown1); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Controls.Add(this.checkBox2); this.groupBox1.Controls.Add(this.checkBox1); this.groupBox1.Location = new System.Drawing.Point(3, 3); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(330, 91); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "Tränke"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(150, 62); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(124, 13); this.label2.TabIndex = 4; this.label2.Text = "Pilze zum Blättern täglich"; // // numericUpDown1 // this.numericUpDown1.Enabled = false; this.numericUpDown1.Location = new System.Drawing.Point(96, 60); this.numericUpDown1.Name = "numericUpDown1"; this.numericUpDown1.Size = new System.Drawing.Size(48, 20); this.numericUpDown1.TabIndex = 3; // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(7, 62); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(83, 13); this.label1.TabIndex = 2; this.label1.Text = "Verwende max. "; // // checkBox2 // this.checkBox2.AutoSize = true; this.checkBox2.Enabled = false; this.checkBox2.Location = new System.Drawing.Point(10, 42); this.checkBox2.Name = "checkBox2"; this.checkBox2.Size = new System.Drawing.Size(207, 17); this.checkBox2.TabIndex = 1; this.checkBox2.Text = "Kaufe auch Trank des ewigen Lebens"; this.checkBox2.UseVisualStyleBackColor = true; // // checkBox1 // this.checkBox1.AutoSize = true; this.checkBox1.Enabled = false; this.checkBox1.Location = new System.Drawing.Point(10, 19); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(145, 17); this.checkBox1.TabIndex = 0; this.checkBox1.Text = "Automatischer Trankkauf"; this.checkBox1.UseVisualStyleBackColor = true; // // groupBox2 // this.groupBox2.Controls.Add(this.ddlMountType); this.groupBox2.Controls.Add(this.ckbBuyMount); this.groupBox2.Location = new System.Drawing.Point(3, 100); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(330, 48); this.groupBox2.TabIndex = 1; this.groupBox2.TabStop = false; this.groupBox2.Text = "Reittier"; // // ddlMountType // this.ddlMountType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.ddlMountType.FormattingEnabled = true; this.ddlMountType.Items.AddRange(new object[] { "None", "Schwein", "Wolf", "Raptor", "Drachengreif"}); this.ddlMountType.Location = new System.Drawing.Point(174, 17); this.ddlMountType.Name = "ddlMountType"; this.ddlMountType.Size = new System.Drawing.Size(121, 21); this.ddlMountType.TabIndex = 2; this.ddlMountType.SelectedIndexChanged += new System.EventHandler(this.ddlMountType_SelectedIndexChanged); // // ckbBuyMount // this.ckbBuyMount.AutoSize = true; this.ckbBuyMount.Location = new System.Drawing.Point(10, 19); this.ckbBuyMount.Name = "ckbBuyMount"; this.ckbBuyMount.Size = new System.Drawing.Size(158, 17); this.ckbBuyMount.TabIndex = 0; this.ckbBuyMount.Text = "Reittier automatisch kaufen:"; this.ckbBuyMount.UseVisualStyleBackColor = true; this.ckbBuyMount.CheckedChanged += new System.EventHandler(this.ckbBuyMount_CheckedChanged); // // groupBox3 // this.groupBox3.Controls.Add(this.checkBox5); this.groupBox3.Controls.Add(this.checkBox4); this.groupBox3.Location = new System.Drawing.Point(3, 233); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(330, 68); this.groupBox3.TabIndex = 2; this.groupBox3.TabStop = false; this.groupBox3.Text = "Sonstiges"; // // checkBox5 // this.checkBox5.AutoSize = true; this.checkBox5.Enabled = false; this.checkBox5.Location = new System.Drawing.Point(10, 42); this.checkBox5.Name = "checkBox5"; this.checkBox5.Size = new System.Drawing.Size(288, 17); this.checkBox5.TabIndex = 1; this.checkBox5.Text = "Sammelalbum der Akribie kaufen, wenn es im Laden ist."; this.checkBox5.UseVisualStyleBackColor = true; // // checkBox4 // this.checkBox4.AutoSize = true; this.checkBox4.Checked = true; this.checkBox4.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox4.Enabled = false; this.checkBox4.Location = new System.Drawing.Point(10, 19); this.checkBox4.Name = "checkBox4"; this.checkBox4.Size = new System.Drawing.Size(312, 17); this.checkBox4.TabIndex = 0; this.checkBox4.Text = "Verkaufe den billigsten Gegenstand falls das Inventar voll ist."; this.checkBox4.UseVisualStyleBackColor = true; // // groupBox4 // this.groupBox4.Controls.Add(this.label4); this.groupBox4.Controls.Add(this.numGoldFactor); this.groupBox4.Controls.Add(this.label3); this.groupBox4.Controls.Add(this.ckbSaveMoney); this.groupBox4.Location = new System.Drawing.Point(3, 154); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(330, 73); this.groupBox4.TabIndex = 3; this.groupBox4.TabStop = false; this.groupBox4.Text = "Gold aufbewahren"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(195, 45); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(88, 13); this.label4.TabIndex = 3; this.label4.Text = "ergibt Goldbetrag"; // // numGoldFactor // this.numGoldFactor.DecimalPlaces = 1; this.numGoldFactor.Increment = new decimal(new int[] { 1, 0, 0, 65536}); this.numGoldFactor.Location = new System.Drawing.Point(128, 43); this.numGoldFactor.Name = "numGoldFactor"; this.numGoldFactor.Size = new System.Drawing.Size(61, 20); this.numGoldFactor.TabIndex = 2; this.numGoldFactor.ValueChanged += new System.EventHandler(this.numGoldFactor_ValueChanged); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(7, 45); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(115, 13); this.label3.TabIndex = 1; this.label3.Text = "Teuerster Statpreis mal"; // // ckbSaveMoney // this.ckbSaveMoney.AutoSize = true; this.ckbSaveMoney.Location = new System.Drawing.Point(10, 19); this.ckbSaveMoney.Name = "ckbSaveMoney"; this.ckbSaveMoney.Size = new System.Drawing.Size(113, 17); this.ckbSaveMoney.TabIndex = 0; this.ckbSaveMoney.Text = "Gold aufbewahren"; this.ckbSaveMoney.UseVisualStyleBackColor = true; this.ckbSaveMoney.CheckedChanged += new System.EventHandler(this.ckbSaveMoney_CheckedChanged); // // ShopSettings // this.Controls.Add(this.groupBox4); this.Controls.Add(this.groupBox3); this.Controls.Add(this.groupBox2); this.Controls.Add(this.groupBox1); this.Name = "ShopSettings"; this.Size = new System.Drawing.Size(338, 307); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit(); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); this.groupBox3.ResumeLayout(false); this.groupBox3.PerformLayout(); this.groupBox4.ResumeLayout(false); this.groupBox4.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.numGoldFactor)).EndInit(); this.ResumeLayout(false); }
public static void clampedSet(NumericUpDown box, decimal value) { box.Value = clamp(value, box.Minimum, box.Maximum); }
private void InitializeComponent() { this._Label1 = new System.Windows.Forms.Label(); this._Label2 = new System.Windows.Forms.Label(); this._Label3 = new System.Windows.Forms.Label(); this._Label4 = new System.Windows.Forms.Label(); this._Label5 = new System.Windows.Forms.Label(); this._Label6 = new System.Windows.Forms.Label(); this._Label7 = new System.Windows.Forms.Label(); this._Label8 = new System.Windows.Forms.Label(); this._Label9 = new System.Windows.Forms.Label(); this._Label10 = new System.Windows.Forms.Label(); this._Label11 = new System.Windows.Forms.Label(); this._Label12 = new System.Windows.Forms.Label(); this._Label13 = new System.Windows.Forms.Label(); this._Label14 = new System.Windows.Forms.Label(); this._MenuStrip1 = new System.Windows.Forms.MenuStrip(); this._ArchivoToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._AbrirToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._GuardarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._CerrarToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._SalirToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this._txtNombre = new System.Windows.Forms.TextBox(); this._txtDomicilio = new System.Windows.Forms.TextBox(); this._txtCiudad = new System.Windows.Forms.TextBox(); this._txtRFC = new System.Windows.Forms.TextBox(); this._txtLugar = new System.Windows.Forms.TextBox(); this._txtPrecioU = new System.Windows.Forms.TextBox(); this._txtDescripcion = new System.Windows.Forms.TextBox(); this._txtImporte = new System.Windows.Forms.TextBox(); this._txtIVA = new System.Windows.Forms.TextBox(); this._txtRetencion = new System.Windows.Forms.TextBox(); this._txtTotal = new System.Windows.Forms.TextBox(); this._txtPrecioL = new System.Windows.Forms.TextBox(); this._nupCantidad = new System.Windows.Forms.NumericUpDown(); this._dtFecha = new System.Windows.Forms.DateTimePicker(); this.btnImprimir = new System.Windows.Forms.Button(); this._txtFolio = new System.Windows.Forms.TextBox(); this._Label15 = new System.Windows.Forms.Label(); this._btnVistaPrevia = new System.Windows.Forms.Button(); this._MenuStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this._nupCantidad)).BeginInit(); this.SuspendLayout(); // // _Label1 // this._Label1.AutoSize = true; this._Label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label1.Location = new System.Drawing.Point(35, 70); this._Label1.Name = "_Label1"; this._Label1.Size = new System.Drawing.Size(69, 20); this._Label1.TabIndex = 0; this._Label1.Text = "Nombre:"; // // _Label2 // this._Label2.AutoSize = true; this._Label2.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label2.Location = new System.Drawing.Point(35, 99); this._Label2.Name = "_Label2"; this._Label2.Size = new System.Drawing.Size(76, 20); this._Label2.TabIndex = 1; this._Label2.Text = "Domicilio:"; // // _Label3 // this._Label3.AutoSize = true; this._Label3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label3.Location = new System.Drawing.Point(35, 129); this._Label3.Name = "_Label3"; this._Label3.Size = new System.Drawing.Size(63, 20); this._Label3.TabIndex = 2; this._Label3.Text = "Ciudad:"; // // _Label4 // this._Label4.AutoSize = true; this._Label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label4.Location = new System.Drawing.Point(35, 159); this._Label4.Name = "_Label4"; this._Label4.Size = new System.Drawing.Size(54, 20); this._Label4.TabIndex = 3; this._Label4.Text = "R.F.C."; // // _Label5 // this._Label5.AutoSize = true; this._Label5.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label5.Location = new System.Drawing.Point(35, 189); this._Label5.Name = "_Label5"; this._Label5.Size = new System.Drawing.Size(157, 20); this._Label5.TabIndex = 4; this._Label5.Text = "Lugar de Expedicion:"; // // _Label6 // this._Label6.AutoSize = true; this._Label6.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label6.Location = new System.Drawing.Point(35, 221); this._Label6.Name = "_Label6"; this._Label6.Size = new System.Drawing.Size(161, 20); this._Label6.TabIndex = 5; this._Label6.Text = "Fecha de Expedicion:"; // // _Label7 // this._Label7.AutoSize = true; this._Label7.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label7.Location = new System.Drawing.Point(34, 249); this._Label7.Name = "_Label7"; this._Label7.Size = new System.Drawing.Size(77, 20); this._Label7.TabIndex = 6; this._Label7.Text = "Cantidad:"; // // _Label8 // this._Label8.AutoSize = true; this._Label8.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label8.Location = new System.Drawing.Point(34, 280); this._Label8.Name = "_Label8"; this._Label8.Size = new System.Drawing.Size(116, 20); this._Label8.TabIndex = 7; this._Label8.Text = "Precio Unitario:"; // // _Label9 // this._Label9.AutoSize = true; this._Label9.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label9.Location = new System.Drawing.Point(34, 312); this._Label9.Name = "_Label9"; this._Label9.Size = new System.Drawing.Size(96, 20); this._Label9.TabIndex = 8; this._Label9.Text = "Descripcion:"; // // _Label10 // this._Label10.AutoSize = true; this._Label10.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label10.Location = new System.Drawing.Point(34, 455); this._Label10.Name = "_Label10"; this._Label10.Size = new System.Drawing.Size(64, 20); this._Label10.TabIndex = 9; this._Label10.Text = "Importe"; // // _Label11 // this._Label11.AutoSize = true; this._Label11.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label11.Location = new System.Drawing.Point(34, 485); this._Label11.Name = "_Label11"; this._Label11.Size = new System.Drawing.Size(48, 20); this._Label11.TabIndex = 10; this._Label11.Text = "I.V.A."; // // _Label12 // this._Label12.AutoSize = true; this._Label12.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label12.Location = new System.Drawing.Point(34, 514); this._Label12.Name = "_Label12"; this._Label12.Size = new System.Drawing.Size(82, 20); this._Label12.TabIndex = 11; this._Label12.Text = "Retencion"; // // _Label13 // this._Label13.AutoSize = true; this._Label13.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label13.Location = new System.Drawing.Point(34, 543); this._Label13.Name = "_Label13"; this._Label13.Size = new System.Drawing.Size(48, 20); this._Label13.TabIndex = 12; this._Label13.Text = "Total:"; // // _Label14 // this._Label14.AutoSize = true; this._Label14.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label14.Location = new System.Drawing.Point(34, 573); this._Label14.Name = "_Label14"; this._Label14.Size = new System.Drawing.Size(120, 20); this._Label14.TabIndex = 13; this._Label14.Text = "Precio en Letra:"; // // _MenuStrip1 // this._MenuStrip1.Font = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._MenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this._ArchivoToolStripMenuItem, this._CerrarToolStripMenuItem, this._SalirToolStripMenuItem }); this._MenuStrip1.Location = new System.Drawing.Point(0, 0); this._MenuStrip1.Name = "_MenuStrip1"; this._MenuStrip1.Size = new System.Drawing.Size(855, 29); this._MenuStrip1.TabIndex = 14; this._MenuStrip1.Text = "MenuStrip1"; // // _ArchivoToolStripMenuItem // this._ArchivoToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this._AbrirToolStripMenuItem, this._GuardarToolStripMenuItem }); this._ArchivoToolStripMenuItem.Name = "_ArchivoToolStripMenuItem"; this._ArchivoToolStripMenuItem.Size = new System.Drawing.Size(75, 25); this._ArchivoToolStripMenuItem.Text = "Archivo"; // // _AbrirToolStripMenuItem // this._AbrirToolStripMenuItem.Name = "_AbrirToolStripMenuItem"; this._AbrirToolStripMenuItem.Size = new System.Drawing.Size(152, 26); this._AbrirToolStripMenuItem.Text = "Abrir"; this._AbrirToolStripMenuItem.Click += new System.EventHandler(this.lecturaEscrituraClick); // // _GuardarToolStripMenuItem // this._GuardarToolStripMenuItem.Name = "_GuardarToolStripMenuItem"; this._GuardarToolStripMenuItem.Size = new System.Drawing.Size(152, 26); this._GuardarToolStripMenuItem.Text = "Guardar"; this._GuardarToolStripMenuItem.Click += new System.EventHandler(this.lecturaEscrituraClick); // // _CerrarToolStripMenuItem // this._CerrarToolStripMenuItem.Name = "_CerrarToolStripMenuItem"; this._CerrarToolStripMenuItem.Size = new System.Drawing.Size(66, 25); this._CerrarToolStripMenuItem.Text = "Cerrar"; this._CerrarToolStripMenuItem.Click += new System.EventHandler(this._CerrarToolStripMenuItem_Click); // // _SalirToolStripMenuItem // this._SalirToolStripMenuItem.Name = "_SalirToolStripMenuItem"; this._SalirToolStripMenuItem.Size = new System.Drawing.Size(53, 25); this._SalirToolStripMenuItem.Text = "Salir"; this._SalirToolStripMenuItem.Click += new System.EventHandler(this._SalirToolStripMenuItem_Click); // // _txtNombre // this._txtNombre.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtNombre.Location = new System.Drawing.Point(254, 67); this._txtNombre.Name = "_txtNombre"; this._txtNombre.Size = new System.Drawing.Size(582, 26); this._txtNombre.TabIndex = 15; this._txtNombre.Text = "BBVA BANCOMER, S.A."; // // _txtDomicilio // this._txtDomicilio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtDomicilio.Location = new System.Drawing.Point(254, 96); this._txtDomicilio.Name = "_txtDomicilio"; this._txtDomicilio.Size = new System.Drawing.Size(582, 26); this._txtDomicilio.TabIndex = 16; this._txtDomicilio.Text = "AV. UNIVERSIDAD 1200 COLONIA XOCO"; // // _txtCiudad // this._txtCiudad.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtCiudad.Location = new System.Drawing.Point(254, 126); this._txtCiudad.Name = "_txtCiudad"; this._txtCiudad.Size = new System.Drawing.Size(582, 26); this._txtCiudad.TabIndex = 17; this._txtCiudad.Text = "MEXICO, D.F. C.P. 03339"; // // _txtRFC // this._txtRFC.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtRFC.Location = new System.Drawing.Point(254, 156); this._txtRFC.Name = "_txtRFC"; this._txtRFC.Size = new System.Drawing.Size(582, 26); this._txtRFC.TabIndex = 18; this._txtRFC.Text = "BBA-830831-LJ2"; // // _txtLugar // this._txtLugar.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtLugar.Location = new System.Drawing.Point(254, 186); this._txtLugar.Name = "_txtLugar"; this._txtLugar.Size = new System.Drawing.Size(582, 26); this._txtLugar.TabIndex = 19; this._txtLugar.Text = "CULIACAN, SINALOA"; // // _txtPrecioU // this._txtPrecioU.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtPrecioU.Location = new System.Drawing.Point(254, 277); this._txtPrecioU.Name = "_txtPrecioU"; this._txtPrecioU.Size = new System.Drawing.Size(582, 26); this._txtPrecioU.TabIndex = 20; // // _txtDescripcion // this._txtDescripcion.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtDescripcion.Location = new System.Drawing.Point(254, 309); this._txtDescripcion.Multiline = true; this._txtDescripcion.Name = "_txtDescripcion"; this._txtDescripcion.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this._txtDescripcion.Size = new System.Drawing.Size(582, 140); this._txtDescripcion.TabIndex = 21; this._txtDescripcion.Text = "\r\nDEPOSITO EN CUENTA 0074 0610 1421520776 (BBVA BANCOMER)\r\nCLAVE CODIGO INTERBANC" + "ARIO 012 730 0142 15207764\r\nPAGO HECHO EN UNA SOLA EXHIBICION RETENCION CONFORME" + " AL ART. 1a, Ley del IVA"; // // _txtImporte // this._txtImporte.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtImporte.Location = new System.Drawing.Point(254, 452); this._txtImporte.Name = "_txtImporte"; this._txtImporte.Size = new System.Drawing.Size(582, 26); this._txtImporte.TabIndex = 22; // // _txtIVA // this._txtIVA.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtIVA.Location = new System.Drawing.Point(254, 482); this._txtIVA.Name = "_txtIVA"; this._txtIVA.Size = new System.Drawing.Size(582, 26); this._txtIVA.TabIndex = 23; // // _txtRetencion // this._txtRetencion.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtRetencion.Location = new System.Drawing.Point(254, 511); this._txtRetencion.Name = "_txtRetencion"; this._txtRetencion.Size = new System.Drawing.Size(582, 26); this._txtRetencion.TabIndex = 24; // // _txtTotal // this._txtTotal.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtTotal.Location = new System.Drawing.Point(254, 540); this._txtTotal.Name = "_txtTotal"; this._txtTotal.Size = new System.Drawing.Size(582, 26); this._txtTotal.TabIndex = 25; // // _txtPrecioL // this._txtPrecioL.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtPrecioL.Location = new System.Drawing.Point(254, 570); this._txtPrecioL.Multiline = true; this._txtPrecioL.Name = "_txtPrecioL"; this._txtPrecioL.Size = new System.Drawing.Size(582, 59); this._txtPrecioL.TabIndex = 26; this._txtPrecioL.Text = "( PESOS 00/100 M.N )"; // // _nupCantidad // this._nupCantidad.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._nupCantidad.Location = new System.Drawing.Point(254, 247); this._nupCantidad.Maximum = new decimal(new int[] { 999, 0, 0, 0 }); this._nupCantidad.Name = "_nupCantidad"; this._nupCantidad.Size = new System.Drawing.Size(582, 26); this._nupCantidad.TabIndex = 27; // // _dtFecha // this._dtFecha.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._dtFecha.Location = new System.Drawing.Point(254, 216); this._dtFecha.Name = "_dtFecha"; this._dtFecha.Size = new System.Drawing.Size(582, 26); this._dtFecha.TabIndex = 28; // // btnImprimir // this.btnImprimir.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnImprimir.Location = new System.Drawing.Point(679, 635); this.btnImprimir.Name = "btnImprimir"; this.btnImprimir.Size = new System.Drawing.Size(157, 36); this.btnImprimir.TabIndex = 29; this.btnImprimir.Text = "Generar Factura"; this.btnImprimir.UseVisualStyleBackColor = true; this.btnImprimir.Click += new System.EventHandler(this._btnImprimir_Click); // // _txtFolio // this._txtFolio.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._txtFolio.Location = new System.Drawing.Point(254, 36); this._txtFolio.Name = "_txtFolio"; this._txtFolio.Size = new System.Drawing.Size(582, 26); this._txtFolio.TabIndex = 32; // // _Label15 // this._Label15.AutoSize = true; this._Label15.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._Label15.Location = new System.Drawing.Point(35, 39); this._Label15.Name = "_Label15"; this._Label15.Size = new System.Drawing.Size(47, 20); this._Label15.TabIndex = 31; this._Label15.Text = "Folio:"; // // _btnVistaPrevia // this._btnVistaPrevia.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this._btnVistaPrevia.Location = new System.Drawing.Point(431, 635); this._btnVistaPrevia.Name = "_btnVistaPrevia"; this._btnVistaPrevia.Size = new System.Drawing.Size(131, 36); this._btnVistaPrevia.TabIndex = 30; this._btnVistaPrevia.Text = "Vista Previa"; this._btnVistaPrevia.UseVisualStyleBackColor = true; this._btnVistaPrevia.Visible = false; // // Factura // this.ClientSize = new System.Drawing.Size(855, 678); this.Controls.Add(this._txtFolio); this.Controls.Add(this._Label15); this.Controls.Add(this._btnVistaPrevia); this.Controls.Add(this.btnImprimir); this.Controls.Add(this._dtFecha); this.Controls.Add(this._nupCantidad); this.Controls.Add(this._txtPrecioL); this.Controls.Add(this._txtTotal); this.Controls.Add(this._txtRetencion); this.Controls.Add(this._txtIVA); this.Controls.Add(this._txtImporte); this.Controls.Add(this._txtDescripcion); this.Controls.Add(this._txtPrecioU); this.Controls.Add(this._txtLugar); this.Controls.Add(this._txtRFC); this.Controls.Add(this._txtCiudad); this.Controls.Add(this._txtDomicilio); this.Controls.Add(this._txtNombre); this.Controls.Add(this._Label14); this.Controls.Add(this._Label13); this.Controls.Add(this._Label12); this.Controls.Add(this._Label11); this.Controls.Add(this._Label10); this.Controls.Add(this._Label9); this.Controls.Add(this._Label8); this.Controls.Add(this._Label7); this.Controls.Add(this._Label6); this.Controls.Add(this._Label5); this.Controls.Add(this._Label4); this.Controls.Add(this._Label3); this.Controls.Add(this._Label2); this.Controls.Add(this._Label1); this.Controls.Add(this._MenuStrip1); this.MainMenuStrip = this._MenuStrip1; this.MinimizeBox = false; this.Name = "Factura"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "Factura"; this._MenuStrip1.ResumeLayout(false); this._MenuStrip1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this._nupCantidad)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
private void BuildView(DataTable dt, bool isReportSet) { for (int i = 0; i < dt.Rows.Count; i++) { DataRow row = dt.Rows[i]; System.Windows.Forms.Label lblParamName = new System.Windows.Forms.Label(); System.Windows.Forms.ComboBox cbSettings = new System.Windows.Forms.ComboBox(); System.Windows.Forms.ComboBox cbGlobalVars = new System.Windows.Forms.ComboBox(); System.Windows.Forms.Label lblFrom = new System.Windows.Forms.Label(); System.Windows.Forms.ComboBox cbPrevReports = new System.Windows.Forms.ComboBox(); System.Windows.Forms.ComboBox cbOutputParams = new System.Windows.Forms.ComboBox(); UserControls.SmartDateTimePicker dtPicker = new UserControls.SmartDateTimePicker(); // // lblParamName // lblParamName.AutoSize = true; lblParamName.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(204))); lblParamName.Location = new System.Drawing.Point(3, 12 + i * 22); lblParamName.Name = "lblName" + i; lblParamName.Size = new System.Drawing.Size(100, 13); lblParamName.TabIndex = i * 10; lblParamName.Text = row["ParamName"].ToString(); this.Controls.Add(lblParamName); // // lblFrom // lblFrom.AutoSize = true; lblFrom.Location = new System.Drawing.Point(126, 12 + i * 22); lblFrom.Name = "lblFrom" + i; lblFrom.Size = new System.Drawing.Size(33, 13); lblFrom.TabIndex = i * 10 + 4; lblFrom.Text = "From:"; this.Controls.Add(lblFrom); // // cbSettings // cbSettings.FormattingEnabled = true; cbSettings.Items.AddRange(new object[] { "Settings", "Global Parameters" }); cbSettings.Location = new System.Drawing.Point(167, 12 + i * 22); cbSettings.Name = "cbSettings" + i; cbSettings.Size = new System.Drawing.Size(121, 21); cbSettings.TabIndex = i * 10 + 1; cbSettings.SelectedIndex = 0; this.Controls.Add(cbSettings); if (isReportSet) { cbSettings.Items.Add("Output Parameters"); } bool notSettings = false; // // cbGlobalVars // if (row["GlobalName"].ToString() != "") { if (!isReportSet || row["OutputSetID"].ToString() == "") { cbSettings.SelectedItem = "Global Parameters"; cbGlobalVars.FormattingEnabled = true; DataTable global = VWA4Common.DB.Retrieve("SELECT * FROM GlobalVars WHERE GVType = '" + row["ParamValueType"] + "'"); for (int j = 0; j < global.Rows.Count; j++) { cbGlobalVars.Items.Add(global.Rows[i]["GVName"]); } cbGlobalVars.Location = new System.Drawing.Point(294, 5); cbGlobalVars.Name = "cbGlobalVars" + i; cbGlobalVars.Size = new System.Drawing.Size(121, 21); cbGlobalVars.TabIndex = i * 10 + 2; this.Controls.Add(cbGlobalVars); notSettings = true; } // // cbPrevReports // else if (int.Parse(row["OutputSetID"].ToString()) > 0) { cbPrevReports.FormattingEnabled = true; string sql; if (isReportSet) { sql = "SELECT ReportSet.*, ReportMemorized.Title, ReportMemorized.ReportType " + " FROM ReportSet LEFT JOIN ReportMemorized ON ReportSet.ReportMemorized = ReportMemorized.ID " + " WHERE ReporSerie = " + row["SerieID"] + " AND Order < " + row["Order"]; } else { sql = "SELECT * FROM ReportMemorized WHERE ID = " + row["OutputID"].ToString(); } DataTable output = VWA4Common.DB.Retrieve(sql); for (int j = 0; j < output.Rows.Count; j++) { cbPrevReports.Items.Add(output.Rows[i]["Title"]); if (output.Rows[i]["ReportSet.ID"].ToString() == row["OutputID"].ToString()) { cbPrevReports.SelectedIndex = i; } //cbOutputParams.Items.Add(); } cbPrevReports.Location = new System.Drawing.Point(294, 12 + i * 22); cbPrevReports.Name = "cbPrevReports" + i; cbPrevReports.Size = new System.Drawing.Size(121, 21); cbPrevReports.TabIndex = i * 10 + 5; this.Controls.Add(cbPrevReports); // // cbOutputParams // cbOutputParams.FormattingEnabled = true; cbOutputParams.Location = new System.Drawing.Point(415, 12 + i * 22); cbOutputParams.Name = "cbOutputParams" + i; cbOutputParams.Size = new System.Drawing.Size(121, 21); cbOutputParams.TabIndex = i * 10 + 6; this.Controls.Add(cbOutputParams); notSettings = true; } } else { switch (row["ParamValueType"].ToString()) { case "DateTime": // // dtPicker // dtPicker.Location = new System.Drawing.Point(294, 12 + i * 22); dtPicker.Name = "dtPicker" + i; dtPicker.Size = new System.Drawing.Size(291, 20); dtPicker.TabIndex = i * 10 + 7; dtPicker.Value = DateTime.Parse(row["ParamValue"].ToString()); this.Controls.Add(dtPicker); break; case "Boolean": System.Windows.Forms.ComboBox cbBool = new System.Windows.Forms.ComboBox(); cbBool.Items.AddRange(new object[] { "True", "False" }); cbBool.Location = new System.Drawing.Point(294, 12 + i * 22); cbBool.Name = "cbBool" + i; cbBool.Size = new System.Drawing.Size(121, 21); cbBool.SelectedItem = row["ParamValue"].ToString(); this.Controls.Add(cbBool); break; case "String": System.Windows.Forms.TextBox txtString = new TextBox(); txtString.Location = new System.Drawing.Point(294, 12 + i * 22); txtString.Name = "txtString" + i; txtString.Size = new System.Drawing.Size(121, 21); txtString.Text = row["ParamValue"].ToString(); this.Controls.Add(txtString); break; case "Number": System.Windows.Forms.NumericUpDown num = new NumericUpDown(); num.Location = new System.Drawing.Point(294, 12 + i * 22); num.Name = "num" + i; num.Size = new System.Drawing.Size(121, 21); num.Text = row["ParamValue"].ToString(); this.Controls.Add(num); break; case "AggregatePeriod": System.Windows.Forms.ComboBox cbAggregatePeriod = new System.Windows.Forms.ComboBox(); cbAggregatePeriod.Items.AddRange(new object[] { "Day", "Week", "Month", "Quarter", "Year" }); cbAggregatePeriod.Location = new System.Drawing.Point(294, 12 + i * 22); cbAggregatePeriod.Name = "cbAggregatePeriod" + i; cbAggregatePeriod.Size = new System.Drawing.Size(121, 21); cbAggregatePeriod.SelectedItem = row["ParamValue"].ToString(); this.Controls.Add(cbAggregatePeriod); break; case "DayOfWeek": System.Windows.Forms.ComboBox cbDayOfWeek = new System.Windows.Forms.ComboBox(); cbDayOfWeek.Items.AddRange(new object[] { DayOfWeek.Sunday.ToString(), DayOfWeek.Monday.ToString(), DayOfWeek.Tuesday.ToString(), DayOfWeek.Wednesday.ToString(), DayOfWeek.Thursday.ToString(), DayOfWeek.Friday.ToString(), DayOfWeek.Saturday.ToString() }); cbDayOfWeek.Location = new System.Drawing.Point(294, 12 + i * 22); cbDayOfWeek.Name = "cbDayOfWeek" + i; cbDayOfWeek.Size = new System.Drawing.Size(121, 21); cbDayOfWeek.SelectedItem = row["ParamDisplayValue"].ToString(); this.Controls.Add(cbDayOfWeek); break; case "TimeFrame": System.Windows.Forms.ComboBox cbTimeFrame = new System.Windows.Forms.ComboBox(); cbTimeFrame.Items.AddRange(new object[] { "Custom", "Last week - by day ", "Last 2 weeks - by day ", "Last 4 weeks - by week ", "Last 3 months - by months ", "Last year - by month ", "All - by month " }); cbTimeFrame.Location = new System.Drawing.Point(294, 12 + i * 22); cbTimeFrame.Name = "cbTimeFrame" + i; cbTimeFrame.Size = new System.Drawing.Size(121, 21); cbTimeFrame.SelectedItem = row["ParamValue"].ToString(); this.Controls.Add(cbTimeFrame); break; case "ComparisionPeriod": System.Windows.Forms.ComboBox cbComparisionPeriod = new System.Windows.Forms.ComboBox(); cbComparisionPeriod.Items.AddRange(new object[] { "True", "False" }); cbComparisionPeriod.Location = new System.Drawing.Point(294, 12 + i * 22); cbComparisionPeriod.Name = "cbComparisionPeriod" + i; cbComparisionPeriod.Size = new System.Drawing.Size(121, 21); cbComparisionPeriod.SelectedItem = row["ParamValue"].ToString(); this.Controls.Add(cbComparisionPeriod); break; case "ComparisionType": System.Windows.Forms.ComboBox cbComparisionType = new System.Windows.Forms.ComboBox(); cbComparisionType.Items.AddRange(new object[] { "Days of Week", "Loss Categories", "Food Categories" }); cbComparisionType.Location = new System.Drawing.Point(294, 12 + i * 22); cbComparisionType.Name = "cbComparisionType" + i; cbComparisionType.Size = new System.Drawing.Size(121, 21); cbComparisionType.SelectedItem = row["ParamValue"].ToString(); this.Controls.Add(cbComparisionType); break; case "FinancialMode": System.Windows.Forms.ComboBox cbFinancialMode = new System.Windows.Forms.ComboBox(); cbFinancialMode.Items.AddRange(new object[] { "Points", "CPM" }); cbFinancialMode.Location = new System.Drawing.Point(294, 12 + i * 22); cbFinancialMode.Name = "cbFinancialMode" + i; cbFinancialMode.Size = new System.Drawing.Size(121, 21); cbFinancialMode.SelectedItem = row["ParamValue"].ToString(); this.Controls.Add(cbFinancialMode); break; default: System.Windows.Forms.TextBox txtDefault = new TextBox(); txtDefault.Location = new System.Drawing.Point(294, 12 + i * 22); txtDefault.Name = "txtDefault" + i; txtDefault.Size = new System.Drawing.Size(121, 21); txtDefault.Text = row["ParamValue"].ToString(); this.Controls.Add(txtDefault); break; } } } }
private void InitializeComponent() { this.WidthLbl = new Label(); this.WidthBox = new NumericUpDown(); this.HeightLbl = new Label(); this.HeightBox = new NumericUpDown(); this.OKBtn = new Button(); this.CancelBtn = new Button(); ((ISupportInitialize)this.WidthBox).BeginInit(); ((ISupportInitialize)this.HeightBox).BeginInit(); base.SuspendLayout(); this.WidthLbl.AutoSize = true; this.WidthLbl.Location = new Point(12, 14); this.WidthLbl.Name = "WidthLbl"; this.WidthLbl.Size = new System.Drawing.Size(58, 13); this.WidthLbl.TabIndex = 0; this.WidthLbl.Text = "Tile Width:"; this.WidthBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.WidthBox.Location = new Point(79, 12); NumericUpDown widthBox = this.WidthBox; int[] numArray = new int[] { 1, 0, 0, 0 }; widthBox.Minimum = new decimal(numArray); this.WidthBox.Name = "WidthBox"; this.WidthBox.Size = new System.Drawing.Size(175, 20); this.WidthBox.TabIndex = 1; NumericUpDown num = this.WidthBox; int[] numArray1 = new int[] { 1, 0, 0, 0 }; num.Value = new decimal(numArray1); this.HeightLbl.AutoSize = true; this.HeightLbl.Location = new Point(12, 40); this.HeightLbl.Name = "HeightLbl"; this.HeightLbl.Size = new System.Drawing.Size(61, 13); this.HeightLbl.TabIndex = 2; this.HeightLbl.Text = "Tile Height:"; this.HeightBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right; this.HeightBox.Location = new Point(79, 38); NumericUpDown heightBox = this.HeightBox; int[] numArray2 = new int[] { 1, 0, 0, 0 }; heightBox.Minimum = new decimal(numArray2); this.HeightBox.Name = "HeightBox"; this.HeightBox.Size = new System.Drawing.Size(175, 20); this.HeightBox.TabIndex = 3; NumericUpDown numericUpDown = this.HeightBox; int[] numArray3 = new int[] { 1, 0, 0, 0 }; numericUpDown.Value = new decimal(numArray3); this.OKBtn.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; this.OKBtn.DialogResult = System.Windows.Forms.DialogResult.OK; this.OKBtn.Location = new Point(98, 77); this.OKBtn.Name = "OKBtn"; this.OKBtn.Size = new System.Drawing.Size(75, 23); this.OKBtn.TabIndex = 4; this.OKBtn.Text = "OK"; this.OKBtn.UseVisualStyleBackColor = true; this.OKBtn.Click += new EventHandler(this.OKBtn_Click); this.CancelBtn.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; this.CancelBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.CancelBtn.Location = new Point(179, 77); this.CancelBtn.Name = "CancelBtn"; this.CancelBtn.Size = new System.Drawing.Size(75, 23); this.CancelBtn.TabIndex = 5; this.CancelBtn.Text = "Cancel"; this.CancelBtn.UseVisualStyleBackColor = true; base.AcceptButton = this.OKBtn; base.AutoScaleDimensions = new SizeF(6f, 13f); base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; base.CancelButton = this.CancelBtn; base.ClientSize = new System.Drawing.Size(266, 112); base.Controls.Add(this.CancelBtn); base.Controls.Add(this.OKBtn); base.Controls.Add(this.HeightBox); base.Controls.Add(this.HeightLbl); base.Controls.Add(this.WidthBox); base.Controls.Add(this.WidthLbl); base.MaximizeBox = false; base.MinimizeBox = false; base.Name = "TileSizeForm"; base.ShowIcon = false; base.ShowInTaskbar = false; base.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; base.StartPosition = FormStartPosition.CenterParent; this.Text = "Tile Size"; ((ISupportInitialize)this.WidthBox).EndInit(); ((ISupportInitialize)this.HeightBox).EndInit(); base.ResumeLayout(false); base.PerformLayout(); }
private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.grid = new MissionPlanner.Swarm.Grid(); this.comboBox1 = new System.Windows.Forms.ComboBox(); this.layoutsBindingSource = new System.Windows.Forms.BindingSource(this.components); this.bindingSource1 = new System.Windows.Forms.BindingSource(this.components); this.BUT_new = new System.Windows.Forms.Button(); this.BUT_load = new System.Windows.Forms.Button(); this.BUT_save = new System.Windows.Forms.Button(); this.listBox1 = new System.Windows.Forms.ListBox(); this.stepsBindingSource = new System.Windows.Forms.BindingSource(this.components); this.BUT_addstep = new System.Windows.Forms.Button(); this.BUT_runstep = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.BUT_resetstep = new System.Windows.Forms.Button(); this.num_drones = new System.Windows.Forms.NumericUpDown(); this.but_takeoff = new System.Windows.Forms.Button(); this.but_setimage = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.layoutsBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.stepsBindingSource)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.num_drones)).BeginInit(); this.SuspendLayout(); // // grid // this.grid.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))); this.grid.Location = new System.Drawing.Point(12, 52); this.grid.Name = "grid"; this.grid.Size = new System.Drawing.Size(725, 430); this.grid.TabIndex = 0; this.grid.Vertical = false; this.grid.UpdateOffsets += new MissionPlanner.Swarm.Grid.UpdateOffsetsEvent(this.grid_UpdateOffsets); // // comboBox1 // this.comboBox1.DataSource = this.layoutsBindingSource; this.comboBox1.DisplayMember = "Id"; this.comboBox1.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox1.FormattingEnabled = true; this.comboBox1.Location = new System.Drawing.Point(93, 3); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(121, 21); this.comboBox1.TabIndex = 1; this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged); // // layoutsBindingSource // this.layoutsBindingSource.DataMember = "Layouts"; this.layoutsBindingSource.DataSource = this.bindingSource1; // // bindingSource1 // this.bindingSource1.AllowNew = false; this.bindingSource1.DataSource = typeof(MissionPlanner.Swarm.Sequence.Sequence); // // BUT_new // this.BUT_new.Location = new System.Drawing.Point(220, 3); this.BUT_new.Name = "BUT_new"; this.BUT_new.Size = new System.Drawing.Size(75, 23); this.BUT_new.TabIndex = 2; this.BUT_new.Text = "New Layout"; this.BUT_new.UseVisualStyleBackColor = true; this.BUT_new.Click += new System.EventHandler(this.BUT_new_Click); // // BUT_load // this.BUT_load.Location = new System.Drawing.Point(12, 3); this.BUT_load.Name = "BUT_load"; this.BUT_load.Size = new System.Drawing.Size(75, 23); this.BUT_load.TabIndex = 3; this.BUT_load.Text = "Load"; this.BUT_load.UseVisualStyleBackColor = true; this.BUT_load.Click += new System.EventHandler(this.BUT_load_Click); // // BUT_save // this.BUT_save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.BUT_save.Location = new System.Drawing.Point(812, 3); this.BUT_save.Name = "BUT_save"; this.BUT_save.Size = new System.Drawing.Size(75, 23); this.BUT_save.TabIndex = 5; this.BUT_save.Text = "Save"; this.BUT_save.UseVisualStyleBackColor = true; this.BUT_save.Click += new System.EventHandler(this.BUT_save_Click); // // listBox1 // this.listBox1.AllowDrop = true; this.listBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Right))); this.listBox1.DataSource = this.stepsBindingSource; this.listBox1.FormattingEnabled = true; this.listBox1.Location = new System.Drawing.Point(744, 52); this.listBox1.Name = "listBox1"; this.listBox1.Size = new System.Drawing.Size(143, 433); this.listBox1.TabIndex = 6; this.listBox1.SelectedIndexChanged += new System.EventHandler(this.listBox1_SelectedIndexChanged); this.listBox1.DragDrop += new System.Windows.Forms.DragEventHandler(this.listBox1_DragDrop); this.listBox1.DragOver += new System.Windows.Forms.DragEventHandler(this.listBox1_DragOver); this.listBox1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.listBox1_KeyUp); this.listBox1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.listBox1_MouseDown); // // stepsBindingSource // this.stepsBindingSource.AllowNew = true; this.stepsBindingSource.DataMember = "Steps"; this.stepsBindingSource.DataSource = this.bindingSource1; // // BUT_addstep // this.BUT_addstep.Location = new System.Drawing.Point(382, 3); this.BUT_addstep.Name = "BUT_addstep"; this.BUT_addstep.Size = new System.Drawing.Size(75, 23); this.BUT_addstep.TabIndex = 7; this.BUT_addstep.Text = "Add Step"; this.BUT_addstep.UseVisualStyleBackColor = true; this.BUT_addstep.Click += new System.EventHandler(this.BUT_addstep_Click); // // BUT_runstep // this.BUT_runstep.Location = new System.Drawing.Point(609, 3); this.BUT_runstep.Name = "BUT_runstep"; this.BUT_runstep.Size = new System.Drawing.Size(75, 23); this.BUT_runstep.TabIndex = 8; this.BUT_runstep.Text = "Run Step"; this.BUT_runstep.UseVisualStyleBackColor = true; this.BUT_runstep.Click += new System.EventHandler(this.BUT_runstep_Click); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(691, 10); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(35, 13); this.label1.TabIndex = 9; this.label1.Text = "label1"; // // BUT_resetstep // this.BUT_resetstep.Location = new System.Drawing.Point(528, 3); this.BUT_resetstep.Name = "BUT_resetstep"; this.BUT_resetstep.Size = new System.Drawing.Size(75, 23); this.BUT_resetstep.TabIndex = 10; this.BUT_resetstep.Text = "Reset"; this.BUT_resetstep.UseVisualStyleBackColor = true; this.BUT_resetstep.Click += new System.EventHandler(this.BUT_resetstep_Click); // // num_drones // this.num_drones.Location = new System.Drawing.Point(301, 4); this.num_drones.Maximum = new decimal(new int[] { 1000, 0, 0, 0 }); this.num_drones.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); this.num_drones.Name = "num_drones"; this.num_drones.Size = new System.Drawing.Size(75, 20); this.num_drones.TabIndex = 11; this.num_drones.Value = new decimal(new int[] { 1, 0, 0, 0 }); this.num_drones.ValueChanged += new System.EventHandler(this.num_drones_ValueChanged); // // but_takeoff // this.but_takeoff.Location = new System.Drawing.Point(463, 3); this.but_takeoff.Name = "but_takeoff"; this.but_takeoff.Size = new System.Drawing.Size(59, 23); this.but_takeoff.TabIndex = 12; this.but_takeoff.Text = "Takeoff"; this.but_takeoff.UseVisualStyleBackColor = true; this.but_takeoff.Click += new System.EventHandler(this.but_takeoff_Click); // // but_setimage // this.but_setimage.Location = new System.Drawing.Point(690, 26); this.but_setimage.Name = "but_setimage"; this.but_setimage.Size = new System.Drawing.Size(75, 23); this.but_setimage.TabIndex = 14; this.but_setimage.Text = "set image"; this.but_setimage.UseVisualStyleBackColor = true; this.but_setimage.Click += new System.EventHandler(this.but_setimage_Click); // // LayoutEditor // this.ClientSize = new System.Drawing.Size(899, 494); this.Controls.Add(this.but_setimage); this.Controls.Add(this.but_takeoff); this.Controls.Add(this.num_drones); this.Controls.Add(this.BUT_resetstep); this.Controls.Add(this.label1); this.Controls.Add(this.BUT_runstep); this.Controls.Add(this.BUT_addstep); this.Controls.Add(this.listBox1); this.Controls.Add(this.BUT_save); this.Controls.Add(this.BUT_load); this.Controls.Add(this.BUT_new); this.Controls.Add(this.comboBox1); this.Controls.Add(this.grid); this.Name = "LayoutEditor"; this.Text = "Layout Editor"; ((System.ComponentModel.ISupportInitialize)(this.layoutsBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.bindingSource1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.stepsBindingSource)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.num_drones)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
static void InitializeInclude(Control root) { foreach (Control c in root.Controls) { string tag = c.Tag as string; if (!string.IsNullOrEmpty(tag)) { PropertyInfo prop = typeof(Properties.Settings).GetProperty(tag); if (prop == null) { continue; } object value = prop.GetValue(Properties.Settings.Default); if (prop.PropertyType == typeof(string)) { TextBox tb = c as TextBox; tb.Text = (string)value; tb.TextChanged += (s, e) => { prop.SetValue(Properties.Settings.Default, ((TextBox)s).Text); }; } else if (prop.PropertyType == typeof(char)) { TextBox tb = c as TextBox; tb.Text = value.ToString(); tb.TextChanged += (s, e) => { prop.SetValue(Properties.Settings.Default, ((TextBox)s).Text.FirstOrDefault()); }; } else if (prop.PropertyType == typeof(int)) { NumericUpDown control = c as NumericUpDown; control.Value = (int)value; control.ValueChanged += (s, e) => { prop.SetValue(Properties.Settings.Default, (int)control.Value); }; } else if (prop.PropertyType == typeof(StringCollection)) { TextBox tb = c as TextBox; tb.Text = ""; if (value != null) { foreach (var i in ((StringCollection)value)) { if (i.Length != 0) { tb.Text += i + "\r\n"; } } if (tb.Text.Length != 0) { tb.Text = tb.Text.Substring(0, tb.Text.Length - 1); } } tb.TextChanged += (s, e) => { StringCollection coll = new StringCollection(); coll.AddRange(((TextBox)s).Text.Replace("\r", "").Split('\n')); prop.SetValue(Properties.Settings.Default, coll); }; } else if (prop.PropertyType == typeof(bool)) { CheckBox control = c as CheckBox; control.Checked = (bool)value; control.CheckedChanged += (s, e) => { prop.SetValue(Properties.Settings.Default, control.Checked); }; } } else { InitializeInclude(c); } } }
private void numericUpDownValueChanged(object sender, EventArgs e) { NumericUpDown nUD = (NumericUpDown)sender; int i = int.Parse(nUD.Name.Substring(nUD.Name.Length - 1)); int pos = (int)nUD.Value; switch (i) { case 1: if (pos > oldPos[i - 1]) { cGL.xShift += 0.25f; cGL.intOptionC = 4; } else { cGL.xShift -= 0.25f; cGL.intOptionC = -4; } break; case 2: if (pos > oldPos[i - 1]) { cGL.yShift += 0.25f; cGL.intOptionC = 5; } else { cGL.yShift -= 0.25f; cGL.intOptionC = -5; } break; case 3: if (pos > oldPos[i - 1]) { cGL.zShift += 0.25f; cGL.intOptionC = 6; } else { cGL.zShift -= 0.25f; cGL.intOptionC = -6; } break; case 4: if (pos > oldPos[i - 1]) { cGL.xAngle += 5; cGL.intOptionC = 1; } else { cGL.xAngle -= 5; cGL.intOptionC = -1; } break; case 5: if (pos > oldPos[i - 1]) { cGL.yAngle += 5; cGL.intOptionC = 2; } else { cGL.yAngle -= 5; cGL.intOptionC = -2; } break; case 6: if (pos > oldPos[i - 1]) { cGL.zAngle += 5; cGL.intOptionC = 3; } else { cGL.zAngle -= 5; cGL.intOptionC = -3; } break; } cGL.Draw(); oldPos[i - 1] = pos; cGL.intOptionC = 0; }
protected IntegerSetting(NumericUpDown control) : base(control) { }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormMain)); this.pathBox = new King.Windows.Forms.PathTextBox(); this.label1 = new System.Windows.Forms.Label(); this.textBoxResult = new System.Windows.Forms.TextBox(); this.statusBar = new System.Windows.Forms.StatusBar(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.buttonCompute = new System.Windows.Forms.Button(); this.imageList = new System.Windows.Forms.ImageList(this.components); this.numericUpDownLevel = new System.Windows.Forms.NumericUpDown(); this.label4 = new System.Windows.Forms.Label(); this.buttonMove = new System.Windows.Forms.Button(); this.label5 = new System.Windows.Forms.Label(); this.numericUpDownSize = new System.Windows.Forms.NumericUpDown(); this.toolTip = new System.Windows.Forms.ToolTip(this.components); this.comboBoxUnits = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLevel)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSize)).BeginInit(); this.SuspendLayout(); // // pathBox // this.pathBox.AllowDrop = true; this.pathBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.pathBox.ButtonText = "Browse&..."; this.pathBox.Description = "Select the directory you wish to select files from."; this.pathBox.Location = new System.Drawing.Point(9, 27); this.pathBox.Name = "pathBox"; this.pathBox.Size = new System.Drawing.Size(601, 22); this.pathBox.TabIndex = 1; this.toolTip.SetToolTip(this.pathBox, "Directory to pick files from."); // // label1 // this.label1.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.label1.Location = new System.Drawing.Point(7, 11); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(100, 13); this.label1.TabIndex = 0; this.label1.Text = "Source &path:"; // // textBoxResult // this.textBoxResult.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))); this.textBoxResult.Location = new System.Drawing.Point(8, 128); this.textBoxResult.Multiline = true; this.textBoxResult.Name = "textBoxResult"; this.textBoxResult.ReadOnly = true; this.textBoxResult.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.textBoxResult.Size = new System.Drawing.Size(612, 263); this.textBoxResult.TabIndex = 10; this.toolTip.SetToolTip(this.textBoxResult, "The best combination of files found by the program to fill the target size."); // // statusBar // this.statusBar.Location = new System.Drawing.Point(0, 399); this.statusBar.Name = "statusBar"; this.statusBar.Size = new System.Drawing.Size(637, 22); this.statusBar.TabIndex = 11; // // label2 // this.label2.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.label2.Location = new System.Drawing.Point(7, 59); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(69, 15); this.label2.TabIndex = 2; this.label2.Text = "&Target size:"; // // label3 // this.label3.Location = new System.Drawing.Point(78, 59); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(62, 15); this.label3.TabIndex = 6; this.label3.Text = "MB"; // // buttonCompute // this.buttonCompute.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonCompute.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.buttonCompute.ImageIndex = 0; this.buttonCompute.ImageList = this.imageList; this.buttonCompute.Location = new System.Drawing.Point(390, 64); this.buttonCompute.Name = "buttonCompute"; this.buttonCompute.Size = new System.Drawing.Size(107, 42); this.buttonCompute.TabIndex = 7; this.buttonCompute.Text = "&Compute"; this.toolTip.SetToolTip(this.buttonCompute, "Start searching for best combination of files."); this.buttonCompute.Click += new System.EventHandler(this.buttonCompute_Click); // // imageList // this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream"))); this.imageList.TransparentColor = System.Drawing.Color.Transparent; this.imageList.Images.SetKeyName(0, ""); this.imageList.Images.SetKeyName(1, ""); // // numericUpDownLevel // this.numericUpDownLevel.Location = new System.Drawing.Point(89, 82); this.numericUpDownLevel.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); this.numericUpDownLevel.Name = "numericUpDownLevel"; this.numericUpDownLevel.Size = new System.Drawing.Size(53, 20); this.numericUpDownLevel.TabIndex = 6; this.toolTip.SetToolTip(this.numericUpDownLevel, "How far down in directories to pick single files/subfolders. Set to 1 for files/f" + "olders in selected directory only (no subfiles/folders)."); this.numericUpDownLevel.Value = new decimal(new int[] { 1, 0, 0, 0 }); // // label4 // this.label4.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.label4.Location = new System.Drawing.Point(7, 84); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(81, 15); this.label4.TabIndex = 5; this.label4.Text = "&Max recursion:"; // // buttonMove // this.buttonMove.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.buttonMove.Enabled = false; this.buttonMove.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; this.buttonMove.ImageIndex = 1; this.buttonMove.ImageList = this.imageList; this.buttonMove.Location = new System.Drawing.Point(501, 64); this.buttonMove.Name = "buttonMove"; this.buttonMove.Size = new System.Drawing.Size(107, 42); this.buttonMove.TabIndex = 8; this.buttonMove.Text = "&Move files"; this.toolTip.SetToolTip(this.buttonMove, "Move the best match files to a directory of your choice."); this.buttonMove.Click += new System.EventHandler(this.buttonMove_Click); // // label5 // this.label5.ImageAlign = System.Drawing.ContentAlignment.TopLeft; this.label5.Location = new System.Drawing.Point(7, 111); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(100, 16); this.label5.TabIndex = 9; this.label5.Text = "Selected files:"; // // numericUpDownSize // this.numericUpDownSize.DecimalPlaces = 1; this.numericUpDownSize.Location = new System.Drawing.Point(75, 57); this.numericUpDownSize.Maximum = new decimal(new int[] { 2000, 0, 0, 0 }); this.numericUpDownSize.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); this.numericUpDownSize.Name = "numericUpDownSize"; this.numericUpDownSize.Size = new System.Drawing.Size(55, 20); this.numericUpDownSize.TabIndex = 3; this.toolTip.SetToolTip(this.numericUpDownSize, "The (maximum) size you wish the selected files to occupy."); this.numericUpDownSize.Value = new decimal(new int[] { 700, 0, 0, 0 }); // // toolTip // this.toolTip.AutoPopDelay = 5000; this.toolTip.InitialDelay = 400; this.toolTip.ReshowDelay = 100; // // comboBoxUnits // this.comboBoxUnits.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBoxUnits.Items.AddRange(new object[] { "KB", "MB", "GB" }); this.comboBoxUnits.Location = new System.Drawing.Point(134, 57); this.comboBoxUnits.Name = "comboBoxUnits"; this.comboBoxUnits.Size = new System.Drawing.Size(40, 21); this.comboBoxUnits.TabIndex = 4; // // FormMain // this.AcceptButton = this.buttonCompute; this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(637, 421); this.Controls.Add(this.comboBoxUnits); this.Controls.Add(this.numericUpDownSize); this.Controls.Add(this.label5); this.Controls.Add(this.buttonMove); this.Controls.Add(this.label4); this.Controls.Add(this.numericUpDownLevel); this.Controls.Add(this.buttonCompute); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.statusBar); this.Controls.Add(this.textBoxResult); this.Controls.Add(this.label1); this.Controls.Add(this.pathBox); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.MinimumSize = new System.Drawing.Size(408, 256); this.Name = "FormMain"; this.Closing += new System.ComponentModel.CancelEventHandler(this.FormMain_Closing); this.Load += new System.EventHandler(this.FormMain_Load); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownLevel)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDownSize)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
public PercentVoltsControlGroup(NumericUpDown percentsUpDown, NumericUpDown voltsUpDown) { PercentsUpDown = percentsUpDown; VoltsUpDown = voltsUpDown; }
public static int IntValue(this NumericUpDown nud) { return(Convert.ToInt32(nud.Value)); }
// Erzeugt/Aktualisiert das Verkaufspanel neu private void redrawPanel() { List <IProductCategory> categoryList; // Wenn Keine Kategorie zur filterung ausgewählt ist werden alle Produkte angezeigt if (comboBoxFilterCategory.SelectedIndex < 1) { categoryList = _ListCategory; } // Ansonsten wird die ausgewälte kategorie als Filter gesetzt else { categoryList = new List <IProductCategory>(); categoryList.Add(_ListCategory[comboBoxFilterCategory.SelectedIndex - 1]); } // Falls vorhanden wird das Verkaufspanel gelöscht um es zu Erstellen if (this.Controls.Find("tableLayoutPanelSelling", true).Length > 0) { this.Controls.Find("tableLayoutPanelSelling", true)[0].Dispose(); } // Setzt die Eigenschaften des Verkaufspanels TableLayoutPanel newPanel = new TableLayoutPanel(); newPanel.Name = "tableLayoutPanelSelling"; newPanel.Location = new Point(12, 86); newPanel.Size = new Size(700, 453); newPanel.Anchor = AnchorStyles.Left; newPanel.AutoScroll = true; newPanel.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single; newPanel.ColumnCount = 5; for (int i = 0; i < 5; i++) { newPanel.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize)); } newPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30)); newPanel.Controls.AddRange(new Control[5] { newHeaderLabel("Kategoriename"), newHeaderLabel("Produktname"), newHeaderLabel("Lagerbestand"), newHeaderLabel("Verkaufte Stückzahl"), newHeaderLabel("Preis") }); _ListDisplayedIProduct.Clear(); // Fügt die nötigen Elemente wie Producktname KAtegorie Preis und einen regler für die Anzahl der zu Verkaufenden Produkte in das Verkaufspanel ein foreach (IProduct product in _ListIProduct) { if (categoryList.Contains(product.Category)) { _ListDisplayedIProduct.Add(product); double price = (double)product.Price; Label col0cat = new Label(); col0cat.Text = product.Category.Name; col0cat.TextAlign = ContentAlignment.BottomRight; col0cat.AutoSize = true; col0cat.Anchor = (AnchorStyles.Top | AnchorStyles.Right); Label col1name = new Label(); col1name.Text = product.Name.ToString(); col1name.TextAlign = ContentAlignment.BottomRight; col1name.AutoSize = true; col1name.Anchor = (AnchorStyles.Top | AnchorStyles.Right); Label col2stock = new Label(); col2stock.Text = product.Stock.ToString(); col2stock.TextAlign = ContentAlignment.BottomRight; col2stock.AutoSize = true; col2stock.Anchor = (AnchorStyles.Top | AnchorStyles.Right); NumericUpDown col3tosell = new NumericUpDown(); col3tosell.ValueChanged += (sender, e) => this.numericUpDownInPanel_ValueChanged(sender, e, price); col3tosell.Value = 0; col3tosell.Minimum = 0; col3tosell.TextAlign = HorizontalAlignment.Right; col3tosell.AutoSize = true; col3tosell.Anchor = (AnchorStyles.Top | AnchorStyles.Right); Label col4price = new Label(); col4price.Text = price.ToString("F") + "€"; col4price.TextAlign = ContentAlignment.BottomRight; col4price.AutoSize = true; col4price.Anchor = (AnchorStyles.Top | AnchorStyles.Right); // Füllt die Aktuelle Spalte des tableLayoutPanelRestock mit drei Control Objekten zur bearbeitung Control[] rowcontrols = new Control[5] { col0cat, col1name, col2stock, col3tosell, col4price }; newPanel.RowStyles.Add(new RowStyle(SizeType.Absolute, 30)); newPanel.Controls.AddRange(rowcontrols); } } newPanel.Visible = true; this.Controls.Add(newPanel); }
public mnuChangeBounds(string name, int price) : base(name) { this.price = price; currX = Logic.Maps.MapHelper.ActiveMap.MaxX + 1; currY = Logic.Maps.MapHelper.ActiveMap.MaxY + 1; this.Size = new Size(250, 250); this.MenuDirection = Enums.MenuDirection.Vertical; this.Location = Client.Logic.Graphics.DrawingSupport.GetCenter(Windows.WindowSwitcher.GameWindow.MapViewer.Size, this.Size); lblAddTile = new Label("lblAddTile"); lblAddTile.Location = new Point(25, 15); lblAddTile.AutoSize = false; lblAddTile.Size = new System.Drawing.Size(this.Width - lblAddTile.X * 2, 40); lblAddTile.Text = "Enter the new dimensions for your house:"; lblAddTile.ForeColor = Color.WhiteSmoke; lblXY = new Label("lblXY"); lblXY.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height + 5); lblXY.AutoSize = false; lblXY.Size = new System.Drawing.Size(this.Width - lblXY.X * 2, 40); lblXY.Text = "Width: Height:"; lblXY.ForeColor = Color.WhiteSmoke; nudAmountX = new NumericUpDown("nudAmountX"); nudAmountX.Size = new Size(60, 24); nudAmountX.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height + 20); nudAmountX.Maximum = 50; nudAmountX.Minimum = 20; nudAmountX.Value = currX; nudAmountX.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudAmount_ValueChanged); nudAmountY = new NumericUpDown("nudAmountY"); nudAmountY.Size = new Size(60, 24); nudAmountY.Location = new Point(lblAddTile.X + nudAmountX.Width + 20, lblAddTile.Y + lblAddTile.Height + 20); nudAmountY.Maximum = 50; nudAmountY.Minimum = 15; nudAmountY.Value = currY; nudAmountY.ValueChanged += new EventHandler <ValueChangedEventArgs>(nudAmount_ValueChanged); lblPrice = new Label("lblPrice"); lblPrice.Location = new Point(lblAddTile.X, nudAmountX.Y + nudAmountX.Height + 10); lblPrice.AutoSize = false; lblPrice.Size = new System.Drawing.Size(120, 40); int deltaPrice = ((nudAmountX.Value * nudAmountY.Value - currX * currY) * price); if (deltaPrice < 0) { deltaPrice = 0; } lblPrice.Text = "New dimensions will cost " + deltaPrice + " " + Items.ItemHelper.Items[1].Name + "."; lblPrice.ForeColor = Color.WhiteSmoke; btnAccept = new Button("btnAccept"); btnAccept.Location = new Point(lblAddTile.X, lblPrice.Y + lblPrice.Height + 10); btnAccept.Size = new Size(80, 30); btnAccept.Text = "OK"; btnAccept.Font = FontManager.LoadFont("tahoma", 10); Skins.SkinManager.LoadButtonGui(btnAccept); btnAccept.Click += new EventHandler <MouseButtonEventArgs>(btnAccept_Click); btnCancel = new Button("btnCancel"); btnCancel.Location = new Point(btnAccept.X + btnAccept.Width, lblPrice.Y + lblPrice.Height + 10); btnCancel.Size = new Size(80, 30); btnCancel.Text = "Cancel"; btnCancel.Font = FontManager.LoadFont("tahoma", 10); Skins.SkinManager.LoadButtonGui(btnCancel); btnCancel.Click += new EventHandler <MouseButtonEventArgs>(btnCancel_Click); this.AddWidget(lblAddTile); this.AddWidget(lblXY); this.AddWidget(nudAmountX); this.AddWidget(nudAmountY); this.AddWidget(lblPrice); this.AddWidget(btnAccept); this.AddWidget(btnCancel); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.label1 = new System.Windows.Forms.Label(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.label2 = new System.Windows.Forms.Label(); this.groupBox2 = new System.Windows.Forms.GroupBox(); this.loadLastProjectCheckBox = new System.Windows.Forms.CheckBox(); this.fullGuiRadioButton = new System.Windows.Forms.RadioButton(); this.miniGuiRadioButton = new System.Windows.Forms.RadioButton(); this.helpProvider1 = new System.Windows.Forms.HelpProvider(); this.checkFilesExistCheckBox = new System.Windows.Forms.CheckBox(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.recentFilesCountUpDown = new System.Windows.Forms.NumericUpDown(); this.showStatusBarCheckBox = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.recentFilesCountUpDown)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(8, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(60, 13); this.label1.TabIndex = 7; this.label1.Text = "Gui Display"; // // groupBox1 // this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.groupBox1.Location = new System.Drawing.Point(135, 0); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(313, 8); this.groupBox1.TabIndex = 6; this.groupBox1.TabStop = false; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(8, 127); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(66, 13); this.label2.TabIndex = 9; this.label2.Text = "Recent Files"; // // groupBox2 // this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.groupBox2.Location = new System.Drawing.Point(135, 127); this.groupBox2.Name = "groupBox2"; this.groupBox2.Size = new System.Drawing.Size(313, 8); this.groupBox2.TabIndex = 8; this.groupBox2.TabStop = false; // // loadLastProjectCheckBox // this.loadLastProjectCheckBox.AutoSize = true; this.helpProvider1.SetHelpString(this.loadLastProjectCheckBox, "If checked, most recent project is loaded at startup."); this.loadLastProjectCheckBox.Location = new System.Drawing.Point(32, 229); this.loadLastProjectCheckBox.Name = "loadLastProjectCheckBox"; this.helpProvider1.SetShowHelp(this.loadLastProjectCheckBox, true); this.loadLastProjectCheckBox.Size = new System.Drawing.Size(193, 17); this.loadLastProjectCheckBox.TabIndex = 31; this.loadLastProjectCheckBox.Text = "Load most recent project at startup."; // // fullGuiRadioButton // this.fullGuiRadioButton.AutoSize = true; this.helpProvider1.SetHelpString(this.fullGuiRadioButton, "If selected, the full Gui is displayed, including the progress bar and output tab" + "s."); this.fullGuiRadioButton.Location = new System.Drawing.Point(32, 24); this.fullGuiRadioButton.Name = "fullGuiRadioButton"; this.helpProvider1.SetShowHelp(this.fullGuiRadioButton, true); this.fullGuiRadioButton.Size = new System.Drawing.Size(215, 17); this.fullGuiRadioButton.TabIndex = 32; this.fullGuiRadioButton.Text = "Full Gui with progress bar and result tabs"; this.fullGuiRadioButton.CheckedChanged += new System.EventHandler(this.fullGuiRadioButton_CheckedChanged); // // miniGuiRadioButton // this.miniGuiRadioButton.AutoSize = true; this.helpProvider1.SetHelpString(this.miniGuiRadioButton, "If selected, the mini-Gui, consisting of only the tree of tests, is displayed."); this.miniGuiRadioButton.Location = new System.Drawing.Point(32, 80); this.miniGuiRadioButton.Name = "miniGuiRadioButton"; this.helpProvider1.SetShowHelp(this.miniGuiRadioButton, true); this.miniGuiRadioButton.Size = new System.Drawing.Size(148, 17); this.miniGuiRadioButton.TabIndex = 33; this.miniGuiRadioButton.Text = "Mini Gui showing tree only"; // // checkFilesExistCheckBox // this.checkFilesExistCheckBox.AutoSize = true; this.checkFilesExistCheckBox.Location = new System.Drawing.Point(32, 190); this.checkFilesExistCheckBox.Name = "checkFilesExistCheckBox"; this.checkFilesExistCheckBox.Size = new System.Drawing.Size(185, 17); this.checkFilesExistCheckBox.TabIndex = 34; this.checkFilesExistCheckBox.Text = "Check that files exist before listing"; this.checkFilesExistCheckBox.UseVisualStyleBackColor = true; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(125, 155); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(65, 13); this.label3.TabIndex = 30; this.label3.Text = "files in menu"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(32, 155); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(23, 13); this.label4.TabIndex = 28; this.label4.Text = "List"; // // recentFilesCountUpDown // this.recentFilesCountUpDown.Location = new System.Drawing.Point(61, 153); this.recentFilesCountUpDown.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); this.recentFilesCountUpDown.Name = "recentFilesCountUpDown"; this.recentFilesCountUpDown.Size = new System.Drawing.Size(58, 20); this.recentFilesCountUpDown.TabIndex = 35; this.recentFilesCountUpDown.Value = new decimal(new int[] { 1, 0, 0, 0 }); // // showStatusBarCheckBox // this.showStatusBarCheckBox.AutoSize = true; this.showStatusBarCheckBox.Location = new System.Drawing.Point(53, 52); this.showStatusBarCheckBox.Name = "showStatusBarCheckBox"; this.showStatusBarCheckBox.Size = new System.Drawing.Size(102, 17); this.showStatusBarCheckBox.TabIndex = 36; this.showStatusBarCheckBox.Text = "Show StatusBar"; this.showStatusBarCheckBox.UseVisualStyleBackColor = true; // // GuiSettingsPage // this.Controls.Add(this.showStatusBarCheckBox); this.Controls.Add(this.recentFilesCountUpDown); this.Controls.Add(this.checkFilesExistCheckBox); this.Controls.Add(this.miniGuiRadioButton); this.Controls.Add(this.fullGuiRadioButton); this.Controls.Add(this.label3); this.Controls.Add(this.label4); this.Controls.Add(this.loadLastProjectCheckBox); this.Controls.Add(this.groupBox2); this.Controls.Add(this.label2); this.Controls.Add(this.groupBox1); this.Controls.Add(this.label1); this.Name = "GuiSettingsPage"; ((System.ComponentModel.ISupportInitialize)(this.recentFilesCountUpDown)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
public LineDDADrawTool(Bitmap bitmap, NumericUpDown alphaInput, NumericUpDown rInput, NumericUpDown gInput, NumericUpDown bInput) : base(bitmap, alphaInput, rInput, gInput, bInput) { }
public void InitMapEditorWidgets() { mapEditor_Menu = new Panel("mapEditor_Menu"); mapEditor_Menu.Location = new Point(0, this.shortcutBar.Y); mapEditor_Menu.Size = this.shortcutBar.Size; mapEditor_Menu.BackColor = Color.Transparent; tilesetViewer = new Widgets.TilesetViewer("tilesetViewer"); tilesetViewer.Location = new Point(0, this.pnlTeam.Height + 32); tilesetViewer.Size = new Size(this.mapViewer.X, Screen.Height - pnlTeam.Height - shortcutBar.Height - 32); tilesetViewer.ActiveTilesetSurface = Graphics.GraphicsManager.Tiles[0]; tilesetViewer.Visible = false; btnTerrain = new Button("btnTerrain"); btnTerrain.Font = Graphics.FontManager.LoadFont("PMU", 18); btnTerrain.Location = new Point(0, this.pnlTeam.Height); btnTerrain.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32); btnTerrain.Text = "Terrain"; btnTerrain.Selected = true; btnTerrain.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTerrain_Click); btnTerrain.Visible = false; Skins.SkinManager.LoadButtonGui(btnTerrain); btnAttributes = new Button("btnAttributes"); btnAttributes.Font = Graphics.FontManager.LoadFont("PMU", 18); btnAttributes.Location = new Point(this.mapViewer.X / 2, this.pnlTeam.Height); btnAttributes.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32); btnAttributes.Text = "Attributes"; btnAttributes.Selected = false; btnAttributes.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnAttributes_Click); btnAttributes.Visible = false; Skins.SkinManager.LoadButtonGui(btnAttributes); #region Attributes Widgets pnlAttributes = new Panel("pnlAttributes"); pnlAttributes.Size = tilesetViewer.Size; pnlAttributes.Location = tilesetViewer.Location; pnlAttributes.BackColor = Color.White; pnlAttributes.Visible = false; #region Attribute Options pnlAttOptions = new Panel("pnlAttOptions"); pnlAttOptions.Size = tilesetViewer.Size; pnlAttOptions.Location = new Point(0, this.pnlTeam.Height); pnlAttOptions.BackColor = Color.White; pnlAttOptions.Visible = false; btnTitle = new Button("btnTitle"); btnTitle.Location = new Point(0, 0); btnTitle.Size = new Size(134, 32); btnTitle.Font = Graphics.FontManager.LoadFont("PMU", 18); btnTitle.Visible = false; Skins.SkinManager.LoadButtonGui(btnTitle); lbl1 = new Label("lbl1"); lbl1.AutoSize = true; lbl1.Font = Graphics.FontManager.LoadFont("PMU", 18); lbl1.Location = new Point(0, 35); lbl1.Visible = false; lbl2 = new Label("lbl2"); lbl2.AutoSize = true; lbl2.Font = Graphics.FontManager.LoadFont("PMU", 18); lbl2.Visible = false; lbl3 = new Label("lbl3"); lbl3.AutoSize = true; lbl3.Font = Graphics.FontManager.LoadFont("PMU", 18); lbl3.Visible = false; lbl4 = new Label("lbl4"); lbl4.AutoSize = true; lbl4.Font = Graphics.FontManager.LoadFont("PMU", 18); lbl4.Visible = false; lblMode = new Label("lblMode"); lblMode.AutoSize = true; lblMode.Font = Graphics.FontManager.LoadFont("PMU", 18); lblMode.Location = new Point(); lblMode.Visible = false; txt1 = new TextBox("txt1"); txt1.Size = new Size(134, 18); txt1.Visible = false; txt2 = new TextBox("txt2"); txt2.Size = new Size(134, 18); txt2.Visible = false; txt3 = new TextBox("txt3"); txt3.Size = new Size(134, 18); txt3.Visible = false; hsb1 = new HScrollBar("hsb1"); hsb1.Size = new Size(134, 20); hsb1.Visible = false; hsb1.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsb1_ValueChanged); hsb2 = new HScrollBar("hsb2"); hsb2.Size = new Size(134, 20); hsb2.Visible = false; hsb2.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsb2_ValueChanged); hsb3 = new HScrollBar("hsb3"); hsb3.Size = new Size(134, 20); hsb3.Visible = false; hsb3.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsb3_ValueChanged); picSprite = new PictureBox("picSprite"); picSprite.Size = new Size(32, 64); picSprite.BlitToBuffer(Graphics.GraphicsManager.GetSpriteSheet(hsb1.Value).GetSheet(Graphics.FrameType.Idle, Enums.Direction.Down), new Rectangle(96, 0, 32, 64)); picSprite.Location = new Point(140, 35); picSprite.BackColor = Color.White; picSprite.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; picSprite.Visible = false; picSprite2 = new PictureBox("picSprite2"); picSprite2.Size = new Size(32, 64); picSprite2.BlitToBuffer(Graphics.GraphicsManager.GetSpriteSheet(hsb2.Value).GetSheet(Graphics.FrameType.Idle, Enums.Direction.Down), new Rectangle(96, 0, 32, 64)); picSprite2.Location = new Point(75, 130); picSprite2.BackColor = Color.White; picSprite2.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; picSprite2.Visible = false; lstSound = new ListBox("lstSound"); lstSound.Location = new Point(10, 60); lstSound.Size = new Size(180, 140); { SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("PMU", 18); string[] sfxFiles = System.IO.Directory.GetFiles(IO.Paths.SfxPath); for (int i = 0; i < sfxFiles.Length; i++) { lstSound.Items.Add(new ListBoxTextItem(font, System.IO.Path.GetFileName(sfxFiles[i]))); } } lstSound.Visible = false; chkTake = new CheckBox("chkTake"); chkTake.BackColor = Color.Transparent; chkTake.Size = new System.Drawing.Size(125, 17); chkTake.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); chkTake.Text = "Take away key upon use"; chkTake.Visible = false; chkHidden = new CheckBox("chkHidden"); chkHidden.BackColor = Color.Transparent; chkHidden.Size = new System.Drawing.Size(125, 17); chkHidden.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); chkHidden.Text = "Hidden"; chkHidden.Visible = false; chkHidden.CheckChanged += new EventHandler(chkHidden_CheckChanged); nudStoryLevel = new NumericUpDown("nudStoryLevel"); nudStoryLevel.Size = new Size(134, 20); nudStoryLevel.Font = Graphics.FontManager.LoadFont("PMU", 18); nudStoryLevel.Visible = false; optAllow = new RadioButton("optAllow"); optAllow.Size = new Size(75, 17); optAllow.Location = new Point(0, 200); optAllow.Font = Graphics.FontManager.LoadFont("tahoma", 12); optAllow.Text = "Allow"; optAllow.Visible = false; optAllow.CheckChanged += new EventHandler(optAllow_CheckChanged); optBlock = new RadioButton("optBlock"); optBlock.Size = new Size(75, 17); optBlock.Location = new Point(100, 200); optBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12); optBlock.Text = "Block"; optBlock.Visible = false; optBlock.CheckChanged += new EventHandler(optBlock_CheckChanged); btnOK = new Button("btnOK"); btnOK.Location = new Point(this.mapViewer.X / 4, Screen.Height - shortcutBar.Height - 32); btnOK.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32); btnOK.Font = Graphics.FontManager.LoadFont("PMU", 18); btnOK.Text = "Ok"; btnOK.Visible = false; btnOK.Click += new EventHandler<MouseButtonEventArgs>(btnOK_Click); Skins.SkinManager.LoadButtonGui(btnOK); /*btnBack = new Button("btnBack"); btnBack.Location = new Point(0, Screen.Height - shortcutBar.Height - 32); btnBack.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32); btnBack.Font = Graphics.FontManager.LoadFont("PMU", 18); btnBack.Text = "Back"; btnBack.Visible = false; btnBack.Click +=new EventHandler<MouseButtonEventArgs>(btnBack_Click); Skins.SkinManager.LoadButtonGui(btnBack);*/ pnlAttOptions.AddWidget(lbl1); pnlAttOptions.AddWidget(lbl2); pnlAttOptions.AddWidget(lbl3); pnlAttOptions.AddWidget(lbl4); pnlAttOptions.AddWidget(lblMode); pnlAttOptions.AddWidget(txt1); pnlAttOptions.AddWidget(txt2); pnlAttOptions.AddWidget(txt3); pnlAttOptions.AddWidget(hsb1); pnlAttOptions.AddWidget(hsb2); pnlAttOptions.AddWidget(hsb3); pnlAttOptions.AddWidget(picSprite); pnlAttOptions.AddWidget(picSprite2); pnlAttOptions.AddWidget(lstSound); pnlAttOptions.AddWidget(chkTake); pnlAttOptions.AddWidget(chkHidden); pnlAttOptions.AddWidget(nudStoryLevel); pnlAttOptions.AddWidget(optAllow); pnlAttOptions.AddWidget(optBlock); pnlAttOptions.AddWidget(btnTitle); #endregion optBlocked = new RadioButton("optBlocked"); optBlocked.BackColor = Color.Transparent; optBlocked.Font = Graphics.FontManager.LoadFont("tahoma", 12); optBlocked.Location = new Point(8, 6); optBlocked.Size = new System.Drawing.Size(95, 17); optBlocked.Text = "Blocked"; optBlocked.Checked = true; optNpcAvoid = new RadioButton("optNpcAvoid"); optNpcAvoid.BackColor = Color.Transparent; optNpcAvoid.Font = Graphics.FontManager.LoadFont("tahoma", 12); optNpcAvoid.Location = new Point(8, 75); optNpcAvoid.Size = new System.Drawing.Size(95, 17); optNpcAvoid.Text = "Npc Avoid"; optNotice = new RadioButton("optNotice"); optNotice.BackColor = Color.Transparent; optNotice.Font = Graphics.FontManager.LoadFont("tahoma", 12); optNotice.Location = new Point(8, 236); optNotice.Size = new System.Drawing.Size(95, 17); optNotice.Text = "Notice"; optNotice.Click += new EventHandler<MouseButtonEventArgs>(optNotice_CheckChanged); optSign = new RadioButton("optSign"); optSign.BackColor = Color.Transparent; optSign.Font = Graphics.FontManager.LoadFont("tahoma", 12); optSign.Location = new Point(105, 6); optSign.Size = new System.Drawing.Size(95, 17); optSign.Text = "Sign"; optSign.Click += new EventHandler<MouseButtonEventArgs>(optSign_CheckChanged); optHeal = new RadioButton("optHeal"); optHeal.BackColor = Color.Transparent; optHeal.Font = Graphics.FontManager.LoadFont("tahoma", 12); optHeal.Location = new Point(8, 144); optHeal.Size = new System.Drawing.Size(95, 17); optHeal.Text = "Heal"; optKill = new RadioButton("optKill"); optKill.BackColor = Color.Transparent; optKill.Font = Graphics.FontManager.LoadFont("tahoma", 12); optKill.Location = new Point(8, 167); optKill.Size = new System.Drawing.Size(95, 17); optKill.Text = "Kill"; optGuildBlock = new RadioButton("optGuildBlock"); optGuildBlock.BackColor = Color.Transparent; optGuildBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12); optGuildBlock.Location = new Point(105, 98); optGuildBlock.Size = new System.Drawing.Size(95, 17); optGuildBlock.Text = "Guild"; //optGuildBlock.Click += new EventHandler<MouseButtonEventArgs>(optGuildBlock_CheckChanged); optLevelBlock = new RadioButton("optLevelBlock"); optLevelBlock.BackColor = Color.Transparent; optLevelBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12); optLevelBlock.Location = new Point(105, 144); optLevelBlock.Size = new System.Drawing.Size(95, 17); optLevelBlock.Text = "Level Block"; optLevelBlock.Click += new EventHandler<MouseButtonEventArgs>(optLevelBlock_CheckChanged); optSpriteChange = new RadioButton("optSpriteChange"); optSpriteChange.BackColor = Color.Transparent; optSpriteChange.Font = Graphics.FontManager.LoadFont("tahoma", 12); optSpriteChange.Location = new Point(8, 282); optSpriteChange.Size = new System.Drawing.Size(112, 17); optSpriteChange.Text = "New Sprite"; optSpriteChange.Click += new EventHandler<MouseButtonEventArgs>(optSpriteChange_CheckChanged); optWarp = new RadioButton("optWarp"); optWarp.BackColor = Color.Transparent; optWarp.Font = Graphics.FontManager.LoadFont("tahoma", 12); optWarp.Location = new Point(8, 29); optWarp.Size = new System.Drawing.Size(95, 17); optWarp.Text = "Warp"; optWarp.CheckChanged += new EventHandler(optWarp_CheckChanged); optItem = new RadioButton("optItem"); optItem.BackColor = Color.Transparent; optItem.Font = Graphics.FontManager.LoadFont("tahoma", 12); optItem.Location = new Point(8, 52); optItem.Size = new System.Drawing.Size(95, 17); optItem.Text = "Item"; optItem.CheckChanged += new EventHandler(optItem_CheckChanged); optKey = new RadioButton("optKey"); optKey.BackColor = Color.Transparent; optKey.Font = Graphics.FontManager.LoadFont("tahoma", 12); optKey.Location = new Point(8, 98); optKey.Size = new System.Drawing.Size(95, 17); optKey.Text = "Key"; optKey.CheckChanged += new EventHandler(optKey_CheckChanged); optKeyOpen = new RadioButton("optKeyOpen"); optKeyOpen.BackColor = Color.Transparent; optKeyOpen.Font = Graphics.FontManager.LoadFont("tahoma", 12); optKeyOpen.Location = new Point(8, 121); optKeyOpen.Size = new System.Drawing.Size(95, 17); optKeyOpen.Text = "Key Open"; optKeyOpen.CheckChanged += new EventHandler(optKeyOpen_CheckChanged); optSound = new RadioButton("optSound"); optSound.BackColor = Color.Transparent; optSound.Font = Graphics.FontManager.LoadFont("tahoma", 12); optSound.Location = new Point(8, 190); optSound.Size = new System.Drawing.Size(95, 17); optSound.Text = "Sound"; optSound.CheckChanged += new EventHandler(optSound_CheckChanged); optScripted = new RadioButton("optScripted"); optScripted.BackColor = Color.Transparent; optScripted.Font = Graphics.FontManager.LoadFont("tahoma", 12); optScripted.Location = new Point(8, 213); optScripted.Size = new System.Drawing.Size(95, 17); optScripted.Text = "Scripted"; optScripted.CheckChanged += new EventHandler(optScripted_CheckChanged); optDoor = new RadioButton("optDoor"); optDoor.BackColor = Color.Transparent; optDoor.Font = Graphics.FontManager.LoadFont("tahoma", 12); optDoor.Location = new Point(8, 259); optDoor.Size = new System.Drawing.Size(95, 17); optDoor.Text = "Door"; optShop = new RadioButton("optShop"); optShop.BackColor = Color.Transparent; optShop.Font = Graphics.FontManager.LoadFont("tahoma", 12); optShop.Location = new Point(105, 29); optShop.Size = new System.Drawing.Size(95, 17); optShop.Text = "Shop"; optShop.CheckChanged += new EventHandler(optShop_CheckChanged); optArena = new RadioButton("optArena"); optArena.BackColor = Color.Transparent; optArena.Font = Graphics.FontManager.LoadFont("tahoma", 12); optArena.Location = new Point(105, 52); optArena.Size = new System.Drawing.Size(95, 17); optArena.Text = "Arena"; optArena.CheckChanged += new EventHandler(optArena_CheckChanged); optBank = new RadioButton("optBank"); optBank.BackColor = Color.Transparent; optBank.Font = Graphics.FontManager.LoadFont("tahoma", 12); optBank.Location = new Point(105, 75); optBank.Size = new System.Drawing.Size(95, 17); optBank.Text = "Bank"; optBank.CheckChanged += new EventHandler(optBank_CheckChanged); optSpriteBlock = new RadioButton("optSpriteBlock"); optSpriteBlock.BackColor = Color.Transparent; optSpriteBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12); optSpriteBlock.Location = new Point(105, 121); optSpriteBlock.Size = new System.Drawing.Size(105, 17); optSpriteBlock.Text = "Sprite Block"; optSpriteBlock.CheckChanged += new EventHandler(optSpriteBlock_CheckChanged); optAssembly = new RadioButton("optAssembly"); optAssembly.BackColor = Color.Transparent; optAssembly.Font = Graphics.FontManager.LoadFont("tahoma", 12); optAssembly.Location = new Point(8, 328); optAssembly.Size = new System.Drawing.Size(145, 17); optAssembly.Text = "Assembly"; optEvolution = new RadioButton("optEvolution"); optEvolution.BackColor = Color.Transparent; optEvolution.Font = Graphics.FontManager.LoadFont("tahoma", 12); optEvolution.Location = new Point(105, 167); optEvolution.Size = new System.Drawing.Size(95, 17); optEvolution.Text = "Evolution"; optStory = new RadioButton("optStory"); optStory.BackColor = Color.Transparent; optStory.Font = Graphics.FontManager.LoadFont("tahoma", 12); optStory.Location = new Point(105, 190); optStory.Size = new System.Drawing.Size(95, 17); optStory.Text = "Story"; optStory.CheckChanged += new EventHandler(optStory_CheckChanged); optLinkShop = new RadioButton("optLinkShop"); optLinkShop.BackColor = Color.Transparent; optLinkShop.Font = Graphics.FontManager.LoadFont("tahoma", 12); optLinkShop.Location = new Point(105, 213); optLinkShop.Size = new System.Drawing.Size(95, 17); optLinkShop.Text = "Link Shop"; optLinkShop.CheckChanged += new EventHandler(optLinkShop_CheckChanged); optMobileBlock = new RadioButton("optMobileBlock"); optMobileBlock.BackColor = Color.Transparent; optMobileBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12); optMobileBlock.Location = new Point(105, 236); optMobileBlock.Size = new System.Drawing.Size(105, 17); optMobileBlock.Text = "Mobile Block"; optMobileBlock.CheckChanged += new EventHandler(optMobileBlock_CheckChanged); optMission = new RadioButton("optMission"); optMission.BackColor = Color.Transparent; optMission.Font = Graphics.FontManager.LoadFont("tahoma", 12); optMission.Location = new Point(8, 351); optMission.Size = new System.Drawing.Size(115, 17); optMission.Text = "Mission Board"; optScriptedSign = new RadioButton("optScriptedSign"); optScriptedSign.BackColor = Color.Transparent; optScriptedSign.Font = Graphics.FontManager.LoadFont("tahoma", 12); optScriptedSign.Location = new Point(8, 305); optScriptedSign.Size = new System.Drawing.Size(105, 17); optScriptedSign.Text = "Scripted Sign"; optScriptedSign.CheckChanged += new EventHandler(optScriptedSign_CheckChanged); optAmbiguous = new RadioButton("optAmbiguous"); optAmbiguous.BackColor = Color.Transparent; optAmbiguous.Font = Graphics.FontManager.LoadFont("tahoma", 12); optAmbiguous.Location = new Point(105, 259); optAmbiguous.Size = new System.Drawing.Size(95, 17); optAmbiguous.Text = "Ambiguous"; optSlippery = new RadioButton("optSlippery"); optSlippery.BackColor = Color.Transparent; optSlippery.Font = Graphics.FontManager.LoadFont("tahoma", 12); optSlippery.Location = new Point(105, 282); optSlippery.Size = new System.Drawing.Size(95, 17); optSlippery.Text = "Slippery"; optSlippery.CheckChanged += new EventHandler(optSlippery_CheckChanged); optSlow = new RadioButton("optSlow"); optSlow.BackColor = Color.Transparent; optSlow.Font = Graphics.FontManager.LoadFont("tahoma", 12); optSlow.Location = new Point(105, 305); optSlow.Size = new System.Drawing.Size(95, 17); optSlow.Text = "Slow"; optSlow.CheckChanged += new EventHandler(optSlow_CheckChanged); optDropShop = new RadioButton("optDropShop"); optDropShop.BackColor = Color.Transparent; optDropShop.Font = Graphics.FontManager.LoadFont("tahoma", 12); optDropShop.Location = new Point(105, 328); optDropShop.Size = new System.Drawing.Size(95, 17); optDropShop.Text = "DropShop"; optDropShop.CheckChanged += new EventHandler(optDropShop_CheckChanged); lblDungeonTileValue = new Label("lblDungeonTileValue"); lblDungeonTileValue.AutoSize = true; lblDungeonTileValue.Font = Graphics.FontManager.LoadFont("PMU", 18); lblDungeonTileValue.Text = "Dungeon Tile Value:"; lblDungeonTileValue.Location = new Point(8, 376); nudDungeonTileValue = new NumericUpDown("nudDungeonTileValue"); nudDungeonTileValue.Size = new Size(134, 20); nudDungeonTileValue.Maximum = Int32.MaxValue; nudDungeonTileValue.Font = Graphics.FontManager.LoadFont("PMU", 18); nudDungeonTileValue.Location = new Point(10, 400); #region House Editor Attributes optRoomWarp = new RadioButton("optRoomWarp"); optRoomWarp.BackColor = Color.Transparent; optRoomWarp.Font = Graphics.FontManager.LoadFont("tahoma", 12); optRoomWarp.Location = new Point(115, 6); optRoomWarp.Size = new System.Drawing.Size(95, 17); optRoomWarp.Text = "Warp to Room"; #endregion tempArrayForMobility = new bool[16]; pnlAttributes.AddWidget(optBlocked); pnlAttributes.AddWidget(optWarp); pnlAttributes.AddWidget(optItem); pnlAttributes.AddWidget(optNpcAvoid); pnlAttributes.AddWidget(optKey); pnlAttributes.AddWidget(optKeyOpen); pnlAttributes.AddWidget(optHeal); pnlAttributes.AddWidget(optKill); pnlAttributes.AddWidget(optSound); pnlAttributes.AddWidget(optScripted); pnlAttributes.AddWidget(optNotice); pnlAttributes.AddWidget(optDoor); pnlAttributes.AddWidget(optSign); pnlAttributes.AddWidget(optSpriteChange); pnlAttributes.AddWidget(optShop); pnlAttributes.AddWidget(optArena); pnlAttributes.AddWidget(optBank); pnlAttributes.AddWidget(optGuildBlock); pnlAttributes.AddWidget(optSpriteBlock); pnlAttributes.AddWidget(optMobileBlock); pnlAttributes.AddWidget(optLevelBlock); pnlAttributes.AddWidget(optAssembly); pnlAttributes.AddWidget(optEvolution); pnlAttributes.AddWidget(optStory); pnlAttributes.AddWidget(optLinkShop); pnlAttributes.AddWidget(optMission); pnlAttributes.AddWidget(optScriptedSign); pnlAttributes.AddWidget(optAmbiguous); pnlAttributes.AddWidget(optSlippery); pnlAttributes.AddWidget(optSlow); pnlAttributes.AddWidget(optDropShop); pnlAttributes.AddWidget(lblDungeonTileValue); pnlAttributes.AddWidget(nudDungeonTileValue); #endregion #region Mapping Widgets btnMapping = new Button("btnMapping"); btnMapping.Size = new System.Drawing.Size(100, 30); btnMapping.Location = new Point(0, 0); btnMapping.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24); btnMapping.Text = "Mapping"; btnMapping.MouseHoverDelay = 100; btnMapping.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnMapping_Click); btnMapping.MouseHover += new EventHandler(btnMapping_MouseHover); Skins.SkinManager.LoadButtonGui(btnMapping); pnlMapping = new Panel("pnlMapping"); pnlMapping.Size = new Size(150, 190); pnlMapping.Location = new Point(0, btnMapping.Y + mapEditor_Menu.Y - pnlMapping.Height); pnlMapping.BackColor = Color.White; pnlMapping.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; pnlMapping.SetAutoHide(); btnMapProperties = new Button("btnMapProperties"); btnMapProperties.Size = new System.Drawing.Size(100, 30); btnMapProperties.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnMapProperties.Width), 10); btnMapProperties.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); btnMapProperties.Text = "Properties"; btnMapProperties.Click += new EventHandler<MouseButtonEventArgs>(btnMapProperties_Click); Skins.SkinManager.LoadButtonGui(btnMapProperties); btnHouseProperties = new Button("btnHouseProperties"); btnHouseProperties.Size = new System.Drawing.Size(100, 30); btnHouseProperties.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnMapProperties.Width), 10); btnHouseProperties.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); btnHouseProperties.Text = "Music"; btnHouseProperties.Click += new EventHandler<MouseButtonEventArgs>(btnHouseProperties_Click); Skins.SkinManager.LoadButtonGui(btnHouseProperties); btnLoadMap = new Button("btnLoadMap"); btnLoadMap.Size = new System.Drawing.Size(100, 30); btnLoadMap.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnLoadMap.Width), 40); btnLoadMap.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); btnLoadMap.Text = "Load Map"; btnLoadMap.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLoadMap_Click); Skins.SkinManager.LoadButtonGui(btnLoadMap); btnSaveMap = new Button("btnSaveMap"); btnSaveMap.Size = new System.Drawing.Size(100, 30); btnSaveMap.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnSaveMap.Width), 70); btnSaveMap.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); btnSaveMap.Text = "Save Map"; btnSaveMap.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnSaveMap_Click); Skins.SkinManager.LoadButtonGui(btnSaveMap); btnTakeScreenshot = new Button("btnTakeScreenshot"); btnTakeScreenshot.Size = new System.Drawing.Size(100, 30); btnTakeScreenshot.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnTakeScreenshot.Width), 100); btnTakeScreenshot.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); btnTakeScreenshot.Text = "Take Screenshot"; btnTakeScreenshot.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTakeScreenshot_Click); Skins.SkinManager.LoadButtonGui(btnTakeScreenshot); btnExit = new Button("btnExit"); btnExit.Size = new System.Drawing.Size(100, 30); btnExit.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnExit.Width), 130); btnExit.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); btnExit.Text = "Exit"; btnExit.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnExit_Click); Skins.SkinManager.LoadButtonGui(btnExit); pnlMapping.AddWidget(btnMapProperties); pnlMapping.AddWidget(btnHouseProperties); pnlMapping.AddWidget(btnLoadMap); pnlMapping.AddWidget(btnSaveMap); pnlMapping.AddWidget(btnTakeScreenshot); pnlMapping.AddWidget(btnExit); #endregion #region Layer Widgets btnLayers = new Button("btnLayers"); btnLayers.Size = new System.Drawing.Size(100, 30); btnLayers.Location = new Point(100, 0); btnLayers.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24); btnLayers.Text = "Layers"; btnLayers.MouseHoverDelay = 100; btnLayers.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLayers_Click); btnLayers.MouseHover += new EventHandler(btnLayers_MouseHover); Skins.SkinManager.LoadButtonGui(btnLayers); pnlLayers = new Panel("pnlLayers"); pnlLayers.Size = new Size(350, 100); pnlLayers.Location = new Point(100, btnLayers.Y + mapEditor_Menu.Y - pnlLayers.Height); pnlLayers.BackColor = Color.White; pnlLayers.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; pnlLayers.SetAutoHide(); optGround = new RadioButton("optGround"); optGround.BackColor = Color.Transparent; optGround.Location = new Point(8, 19); optGround.Size = new Size(60, 17); optGround.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); optGround.Text = "Ground"; optGround.Checked = true; optMask = new RadioButton("optMask"); optMask.BackColor = Color.Transparent; optMask.Location = new Point(74, 19); optMask.Size = new Size(51, 17); optMask.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); optMask.Text = "Mask"; optMask2 = new RadioButton("optMask2"); optMask2.BackColor = Color.Transparent; optMask2.Location = new Point(131, 19); optMask2.Size = new Size(60, 17); optMask2.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); optMask2.Text = "Mask 2"; optFringe = new RadioButton("optFringe"); optFringe.BackColor = Color.Transparent; optFringe.Location = new Point(197, 19); optFringe.Size = new Size(54, 17); optFringe.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); optFringe.Text = "Fringe"; optFringe2 = new RadioButton("optFringe2"); optFringe2.BackColor = Color.Transparent; optFringe2.Location = new Point(257, 19); optFringe2.Size = new Size(63, 17); optFringe2.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); optFringe2.Text = "Fringe 2"; chkAnim = new CheckBox("chkAnim"); chkAnim.BackColor = Color.Transparent; chkAnim.Location = new Point(8, 50); chkAnim.Size = new Size(70, 17); chkAnim.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); chkAnim.Text = "Animation"; btnFill = new Button("btnFill"); btnFill.Location = new Point(8, 70); btnFill.Size = new System.Drawing.Size(30, 20); btnFill.Text = "Fill"; btnFill.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); btnFill.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnFill_Click); Skins.SkinManager.LoadButtonGui(btnFill); btnClear = new Button("btnClear"); btnClear.Location = new Point(40, 70); btnClear.Size = new System.Drawing.Size(30, 20); btnClear.Text = "Clear"; btnClear.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8); btnClear.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnClear_Click); Skins.SkinManager.LoadButtonGui(btnClear); btnEyeDropper = new Button("btnEyeDropper"); btnEyeDropper.Location = new Point(72, 70); btnEyeDropper.Size = new System.Drawing.Size(100, 20); btnEyeDropper.Text = "Eye Dropper"; btnEyeDropper.Click += new EventHandler<MouseButtonEventArgs>(btnEyeDropper_Click); Skins.SkinManager.LoadButtonGui(btnEyeDropper); pnlLayers.AddWidget(optGround); pnlLayers.AddWidget(optMask); pnlLayers.AddWidget(optMask2); pnlLayers.AddWidget(optFringe); pnlLayers.AddWidget(optFringe2); pnlLayers.AddWidget(chkAnim); pnlLayers.AddWidget(btnFill); pnlLayers.AddWidget(btnClear); pnlLayers.AddWidget(btnEyeDropper); #endregion #region Tileset Widgets btnTileset = new Button("btnTileset"); btnTileset.Size = new System.Drawing.Size(100, 30); btnTileset.Location = new Point(200, 0); btnTileset.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24); btnTileset.Text = "Tilesets"; btnTileset.MouseHoverDelay = 100; btnTileset.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTileset_Click); btnTileset.MouseHover += new EventHandler(btnTileset_MouseHover); Skins.SkinManager.LoadButtonGui(btnTileset); pnlTileset = new Panel("pnlTileset"); pnlTileset.Size = new Size(300, 100); pnlTileset.Location = new Point(200, btnTileset.Y + mapEditor_Menu.Y - pnlTileset.Height); pnlTileset.BackColor = Color.White; pnlTileset.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; pnlTileset.SetAutoHide(); hTilesetSelect = new HScrollBar("hTilesetSelect"); hTilesetSelect.Location = new Point(5, 60); hTilesetSelect.Size = new Size(290, 12); hTilesetSelect.Maximum = 10; hTilesetSelect.ValueChanged += new EventHandler<ValueChangedEventArgs>(hTilesetSelect_ValueChanged); lblSelectedTileset = new Label("lblSelectedTileset"); lblSelectedTileset.AutoSize = true; lblSelectedTileset.Location = new Point(5, 75); lblSelectedTileset.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); lblSelectedTileset.Text = "Tileset -1"; btnLoadTileset = new Button("btnLoadTileset"); btnLoadTileset.Size = new System.Drawing.Size(30, 20); btnLoadTileset.Location = new Point(265, 75); btnLoadTileset.Text = "Load"; btnLoadTileset.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLoadTileset_Click); Skins.SkinManager.LoadButtonGui(btnLoadTileset); picTilesetPreview = new PictureBox[8]; for (int i = 0; i < picTilesetPreview.Length; i++) { picTilesetPreview[i] = new PictureBox("picTilesetPreview" + i); picTilesetPreview[i].Location = new Point(5 + (i * 37), 10); picTilesetPreview[i].Size = new System.Drawing.Size(32, 32); picTilesetPreview[i].BackColor = Color.White; picTilesetPreview[i].BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; } pnlTileset.AddWidget(hTilesetSelect); pnlTileset.AddWidget(lblSelectedTileset); pnlTileset.AddWidget(btnLoadTileset); for (int i = 0; i < picTilesetPreview.Length; i++) { pnlTileset.AddWidget(picTilesetPreview[i]); } #endregion #region Settings Widgets btnSettings = new Button("btnSettings"); btnSettings.Size = new System.Drawing.Size(100, 30); btnSettings.Location = new Point(300, 0); btnSettings.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24); btnSettings.Text = "Settings"; btnSettings.MouseHoverDelay = 100; btnSettings.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnSettings_Click); btnSettings.MouseHover += new EventHandler(btnSettings_MouseHover); Skins.SkinManager.LoadButtonGui(btnSettings); pnlSettings = new Panel("pnlOptions"); pnlSettings.Size = new Size(200, 200); pnlSettings.Location = new Point(300, btnSettings.Y + mapEditor_Menu.Y - pnlSettings.Height); pnlSettings.BackColor = Color.White; pnlSettings.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle; pnlSettings.SetAutoHide(); lblDisplaySettings = new Label("lblDisplaySettings"); lblDisplaySettings.AutoSize = true; lblDisplaySettings.Location = new Point(5, 5); lblDisplaySettings.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 12); lblDisplaySettings.Text = "Display Settings"; chkDisplayMapGrid = new CheckBox("chkDisplayMapGrid"); chkDisplayMapGrid.Location = new Point(5, 25); chkDisplayMapGrid.Size = new System.Drawing.Size(125, 17); chkDisplayMapGrid.BackColor = Color.Transparent; chkDisplayMapGrid.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); chkDisplayMapGrid.Text = "Map Grid"; chkDisplayMapGrid.Checked = IO.Options.MapGrid; chkDisplayMapGrid.CheckChanged += new EventHandler(chkDisplayMapGrid_CheckChanged); chkDisplayAttributes = new CheckBox("chkDisplayAttributes"); chkDisplayAttributes.Location = new Point(5, 45); chkDisplayAttributes.Size = new System.Drawing.Size(125, 17); chkDisplayAttributes.BackColor = Color.Transparent; chkDisplayAttributes.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); chkDisplayAttributes.Text = "Attributes"; chkDisplayAttributes.Checked = IO.Options.DisplayAttributes; chkDisplayAttributes.CheckChanged += new EventHandler(chkDisplayAttributes_CheckChanged); chkDisplayDungeonValues = new CheckBox("chkDisplayDungeonValues"); chkDisplayDungeonValues.Location = new Point(5, 65); chkDisplayDungeonValues.Size = new System.Drawing.Size(125, 17); chkDisplayDungeonValues.BackColor = Color.Transparent; chkDisplayDungeonValues.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); chkDisplayDungeonValues.Text = "DungeonValues"; chkDisplayDungeonValues.Checked = IO.Options.DisplayDungeonValues; chkDisplayDungeonValues.CheckChanged += new EventHandler(chkDisplayDungeonValues_CheckChanged); lblMappingSettings = new Label("lblMappingSettings"); lblMappingSettings.AutoSize = true; lblMappingSettings.Location = new Point(5, 85); lblMappingSettings.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 12); lblMappingSettings.Text = "Mapping Settings"; chkDragAndPlace = new CheckBox("chkDragAndPlace"); chkDragAndPlace.Location = new Point(5, 105); chkDragAndPlace.Size = new System.Drawing.Size(125, 17); chkDragAndPlace.BackColor = Color.Transparent; chkDragAndPlace.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10); chkDragAndPlace.Text = "Drag and Place"; chkDragAndPlace.Checked = IO.Options.DragAndPlace; chkDragAndPlace.CheckChanged += new EventHandler(chkDragAndPlace_CheckChanged); pnlSettings.AddWidget(lblDisplaySettings); pnlSettings.AddWidget(chkDisplayMapGrid); pnlSettings.AddWidget(chkDisplayAttributes); pnlSettings.AddWidget(chkDisplayDungeonValues); pnlSettings.AddWidget(lblMappingSettings); pnlSettings.AddWidget(chkDragAndPlace); #endregion Screen.AddWidget(tilesetViewer); Screen.AddWidget(btnTerrain); Screen.AddWidget(btnAttributes); Screen.AddWidget(btnOK); //this.AddWidget(btnBack); Screen.AddWidget(pnlAttributes); Screen.AddWidget(pnlAttOptions); mapEditor_Menu.AddWidget(btnMapping); Screen.AddWidget(pnlMapping); mapEditor_Menu.AddWidget(btnLayers); Screen.AddWidget(pnlLayers); mapEditor_Menu.AddWidget(btnTileset); Screen.AddWidget(pnlTileset); mapEditor_Menu.AddWidget(btnSettings); Screen.AddWidget(pnlSettings); mapEditor_Menu.Visible = false; Screen.AddWidget(mapEditor_Menu); hTilesetSelect_ValueChanged(hTilesetSelect, new ValueChangedEventArgs(0, 0)); }
public mnuChangeBounds(string name, int price) : base(name) { this.price = price; currX = Logic.Maps.MapHelper.ActiveMap.MaxX + 1; currY = Logic.Maps.MapHelper.ActiveMap.MaxY + 1; this.Size = new Size(250, 250); this.MenuDirection = Enums.MenuDirection.Vertical; this.Location = Client.Logic.Graphics.DrawingSupport.GetCenter(Windows.WindowSwitcher.GameWindow.MapViewer.Size, this.Size); lblAddTile = new Label("lblAddTile"); lblAddTile.Location = new Point(25, 15); lblAddTile.AutoSize = false; lblAddTile.Size = new System.Drawing.Size(this.Width - lblAddTile.X * 2, 40); lblAddTile.Text = "Enter the new dimensions for your house:"; lblAddTile.ForeColor = Color.WhiteSmoke; lblXY = new Label("lblXY"); lblXY.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height + 5); lblXY.AutoSize = false; lblXY.Size = new System.Drawing.Size(this.Width - lblXY.X * 2, 40); lblXY.Text = "Width: Height:"; lblXY.ForeColor = Color.WhiteSmoke; nudAmountX = new NumericUpDown("nudAmountX"); nudAmountX.Size = new Size(60, 24); nudAmountX.Location = new Point(lblAddTile.X, lblAddTile.Y + lblAddTile.Height + 20); nudAmountX.Maximum = 50; nudAmountX.Minimum = 20; nudAmountX.Value = currX; nudAmountX.ValueChanged +=new EventHandler<ValueChangedEventArgs>(nudAmount_ValueChanged); nudAmountY = new NumericUpDown("nudAmountY"); nudAmountY.Size = new Size(60, 24); nudAmountY.Location = new Point(lblAddTile.X + nudAmountX.Width + 20, lblAddTile.Y + lblAddTile.Height + 20); nudAmountY.Maximum = 50; nudAmountY.Minimum = 15; nudAmountY.Value = currY; nudAmountY.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudAmount_ValueChanged); lblPrice = new Label("lblPrice"); lblPrice.Location = new Point(lblAddTile.X, nudAmountX.Y + nudAmountX.Height + 10); lblPrice.AutoSize = false; lblPrice.Size = new System.Drawing.Size(120, 40); int deltaPrice = ((nudAmountX.Value * nudAmountY.Value - currX * currY) * price); if (deltaPrice < 0) deltaPrice = 0; lblPrice.Text = "New dimensions will cost " + deltaPrice + " " + Items.ItemHelper.Items[1].Name + "."; lblPrice.ForeColor = Color.WhiteSmoke; btnAccept = new Button("btnAccept"); btnAccept.Location = new Point(lblAddTile.X, lblPrice.Y + lblPrice.Height + 10); btnAccept.Size = new Size(80, 30); btnAccept.Text = "OK"; btnAccept.Font = FontManager.LoadFont("tahoma", 10); Skins.SkinManager.LoadButtonGui(btnAccept); btnAccept.Click += new EventHandler<MouseButtonEventArgs>(btnAccept_Click); btnCancel = new Button("btnCancel"); btnCancel.Location = new Point(btnAccept.X + btnAccept.Width, lblPrice.Y + lblPrice.Height + 10); btnCancel.Size = new Size(80, 30); btnCancel.Text = "Cancel"; btnCancel.Font = FontManager.LoadFont("tahoma", 10); Skins.SkinManager.LoadButtonGui(btnCancel); btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click); this.AddWidget(lblAddTile); this.AddWidget(lblXY); this.AddWidget(nudAmountX); this.AddWidget(nudAmountY); this.AddWidget(lblPrice); this.AddWidget(btnAccept); this.AddWidget(btnCancel); }
public override Control OnCreate(CellEventArgs args) { Initialize(args); if (!IsNull(Model.ToolboxValue)) { double number; var tv = Convert.ToString(Model.ToolboxValue, CultureInfo.InvariantCulture); var parsed = Double.TryParse(tv, NumberStyles.Any, NumberFormatInfo.InvariantInfo, out number); if (parsed) { Default = number; } } var layout = new TableLayout(2, 1); var numeric = new NumericUpDown { Increment = 1.0, DecimalPlaces = AllowDecimals ? 1 : 0, MaximumDecimalPlaces = 1 }; var chkbox = new CheckBox { ThreeState = false, Text = "null" }; if (Unsigned) { numeric.MinValue = 0; } if (Model.Property.CanWrite == false) { chkbox.Enabled = false; numeric.ReadOnly = true; } // used by the layout to show or hide checkbox Control left = null; var @default = Default; numeric .ValueBinding .BindDataContext(Binding.Property((PropertyEditorModel <object> t) => t.ToolboxValue) .Convert(v => ConvertValue(v, @default), v => v)); // capture model var model = Model; if (Nullable) { layout.Spacing = new Size(5, 0); chkbox.CheckedChanged += (s, e) => { if (!chkbox.Checked.HasValue) { return; } // toggle enabled numeric.Enabled = !chkbox.Checked.Value; if (chkbox.Checked.Value) { // null is checked; send 'null' string to design surface. model.ToolboxValue = "null"; } else { // reset to default value model.ToolboxValue = ConvertValue(model.ToolboxValue, @default); } }; left = chkbox; } layout.Add(left, 0, 0, false, true); layout.Add(numeric, 1, 0, true, true); return(layout); }
private Control CreateControlIfPropertyIsNumeric(PropertyInfo property, UserTypeAttribute attr) { var numericAttribute = attr as NumericAttribute; if (numericAttribute != null) { var value = settings.GetPropertyValue<int>(property); var numericField = new NumericUpDown { Name = property.Name, Minimum = numericAttribute.MinValue, Maximum = numericAttribute.MaxValue, Change = numericAttribute.Increment, Value = value }; return numericField; } return null; }
//============================================ public MainWindow() { SKIP = Convert.ToInt32(ConfigurationManager.AppSettings["NumofSkipLines"]); diPlotDetectorAppChannel = new WCFComm(ref lineArray); lineArray.OnLineAdded += new DataLines.NewLineEventHandler(lineArray_OnLineAdded); { InitializeComponent(); NumofEmulatorBoardsUpdown = new NumericUpDown(); NumofEmulatorBoardsUpdown.Minimum = 1; NumofEmulatorBoardsUpdown.Maximum = 100; NumofEmulatorBoardsUpdown.Increment = 1; windowsFormsHost3.Child = NumofEmulatorBoardsUpdown; NumofEmulatorBoardsUpdown.ValueChanged += new EventHandler(NumofEmulatorBoardsUpdown_ValueChanged); EmulatorEnabledChk.IsChecked = false; nofreadtbox.Items.Add("256"); nofreadtbox.Items.Add("512"); nofreadtbox.Items.Add("1024"); nofreadtbox.Items.Add("2048"); nofreadtbox.SelectedIndex = 0; CurrentSelDetNumUpDown = new NumericUpDown(); CurrentSelDetNumUpDown.Minimum = 1; CurrentSelDetNumUpDown.Maximum = 10000; CurrentSelDetNumUpDown.Increment = 1; windowsFormsHost5.Child = CurrentSelDetNumUpDown; AnChart.Tag = "An"; MyChart.Tag = "Pipe"; //1 SetupChart(MyChart, 1); //============================== foe estetic only AnChart.BorderColor = System.Drawing.Color.Black; AnChart.BorderDashStyle = ChartDashStyle.Solid; AnChart.BorderWidth = 2; //============================= ChartSaveImageBtn.IsEnabled = false; ChartSaveDataBtn.IsEnabled = false; ChartShowToolTipChk.IsEnabled = false; ChartAddCommentsBtn.IsEnabled = false; ChartSavedFileNameTxt.Visibility = System.Windows.Visibility.Hidden; //================ timer dispatcherTimer = new DispatcherTimer(); dispatcherTimer.Interval = new TimeSpan(0, 0, 3); dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick); dispatcherTimer.Stop(); //====================2 AnFileName = ""; ChartFileSaveTypeCmb.Items.Add("PXE"); ChartFileSaveTypeCmb.Items.Add("Binary"); ChartFileSaveTypeCmb.Items.Add("Both"); ChartFileSaveTypeCmb.SelectedIndex = 0; RunModeCmb.Items.Add("Spatial"); RunModeCmb.Items.Add("Time"); RunModeCmb.SelectedIndex = 0; MainBitsSowModeCmb.Items.Add("Full"); MainBitsSowModeCmb.Items.Add("Low"); MainBitsSowModeCmb.Items.Add("Middle"); MainBitsSowModeCmb.Items.Add("High"); MainBitsSowModeCmb.SelectedIndex = 0; ChartBitsShowModeCmb.Items.Add("Full"); ChartBitsShowModeCmb.Items.Add("Low"); ChartBitsShowModeCmb.Items.Add("Middle"); ChartBitsShowModeCmb.Items.Add("High"); ChartBitsShowModeCmb.SelectedIndex = 0; AnBitsShowModeCmb.Items.Add("Full"); AnBitsShowModeCmb.Items.Add("Low"); AnBitsShowModeCmb.Items.Add("Middle"); AnBitsShowModeCmb.Items.Add("High"); AnBitsShowModeCmb.SelectedIndex = 0; MarkerSizeCmb.Items.Add("1"); MarkerSizeCmb.Items.Add("2"); MarkerSizeCmb.Items.Add("3"); MarkerSizeCmb.Items.Add("4"); MarkerSizeCmb.Items.Add("5"); //=========================== ChartTT = new System.Windows.Forms.ToolTip(); ChartTT.UseFading = true; ChartTT.UseAnimation = true; ChartTT.IsBalloon = true; ChartTT.ShowAlways = true; ChartTT.AutoPopDelay = 5000; ChartTT.InitialDelay = 50; ChartTT.ReshowDelay = 50; ChartShowToolTipChk.IsChecked = false; AnCurrentDetectorSelUpDown = new NumericUpDown(); AnCurrentDetectorSelUpDown.Minimum = 1; AnCurrentDetectorSelUpDown.Maximum = 100; AnCurrentDetectorSelUpDown.Increment = 1; windowsFormsHost2.Child = AnCurrentDetectorSelUpDown; groupBox3.BorderThickness = new System.Windows.Thickness(1, 1, 1, 1); CurrPointinfoGB.Visibility = System.Windows.Visibility.Hidden; AnCurrPointinfoGB.Visibility = System.Windows.Visibility.Hidden; ChartTooltipScroll.Minimum = 0; ChartTooltipScroll.SmallChange = 1; ChartTooltipScroll.LargeChange = 1; AnShowToolScroll.Minimum = 0; AnShowToolScroll.SmallChange = 1; AnShowToolScroll.LargeChange = 1; textBlock36.Visibility = System.Windows.Visibility.Hidden; ChartTooltipSelDetCmb.Visibility = System.Windows.Visibility.Hidden; EmulatorDataTypeChk.IsChecked = false; AddAboutDialog(); //settings SeriesMarkerSize = Convert.ToInt32(ConfigurationManager.AppSettings["MarkerSize"]); if (SeriesMarkerSize == 0) SeriesMarkerSize = 1; SetMarkerSizeComboindex(); //================== show internal emulator int vis = Convert.ToInt32(ConfigurationManager.AppSettings["EmulatorEnabled"]); if (vis == 0) EmulatorGrBox.Visibility = System.Windows.Visibility.Hidden; else EmulatorGrBox.Visibility = System.Windows.Visibility.Visible; //try AnAddCommentBtn.IsEnabled = false; AnSaveFileBtn.IsEnabled = false; AnShowToolTipChk.IsEnabled = false; AnRestoreScaleBtn.IsEnabled = false; //AnDetSelList.Visibility = System.Windows.Visibility.Hidden; AnDetInfoGB.Visibility = System.Windows.Visibility.Hidden; DetectorDisplayGB.Visibility = System.Windows.Visibility.Hidden; this.MaxHeight = SystemParameters.PrimaryScreenHeight * 0.99;//???????????????? this.MaxWidth = SystemParameters.PrimaryScreenWidth * 0.99;//??????????????????? // MainViewBox.Height = MainViewBox.MaxHeight; } }
private void DefaultRepChanged(object sender, EventArgs e) { NumericUpDown _NumericUpDown = sender as NumericUpDown; network.defaultNodeReputation = (float)_NumericUpDown.Value; }
private void InitializeComponent() { ComponentResourceManager componentResourceManager = new ComponentResourceManager(typeof(EditTime)); nudMinutes = new NumericUpDown(); nudSeconds = new NumericUpDown(); nudTenth = new NumericUpDown(); label1 = new Label(); groupBox1 = new GroupBox(); groupBox2 = new GroupBox(); label3 = new Label(); nudShotTenth = new NumericUpDown(); label2 = new Label(); nudShotSeconds = new NumericUpDown(); nudMinutes.BeginInit(); nudSeconds.BeginInit(); nudTenth.BeginInit(); groupBox1.SuspendLayout(); groupBox2.SuspendLayout(); nudShotTenth.BeginInit(); nudShotSeconds.BeginInit(); SuspendLayout(); componentResourceManager.ApplyResources((object)nudMinutes, "nudMinutes"); nudMinutes.Maximum = new Decimal(new int[4] { 120, 0, 0, 0 }); nudMinutes.Name = "nudMinutes"; componentResourceManager.ApplyResources((object)nudSeconds, "nudSeconds"); nudSeconds.Maximum = new Decimal(new int[4] { 59, 0, 0, 0 }); nudSeconds.Name = "nudSeconds"; componentResourceManager.ApplyResources((object)nudTenth, "nudTenth"); nudTenth.Maximum = new Decimal(new int[4] { 9, 0, 0, 0 }); nudTenth.Name = "nudTenth"; componentResourceManager.ApplyResources((object)label1, "label1"); label1.Name = "label1"; componentResourceManager.ApplyResources((object)groupBox1, "groupBox1"); groupBox1.Controls.Add((Control)label1); groupBox1.Controls.Add((Control)nudMinutes); groupBox1.Controls.Add((Control)nudTenth); groupBox1.Controls.Add((Control)nudSeconds); groupBox1.Name = "groupBox1"; groupBox1.TabStop = false; componentResourceManager.ApplyResources((object)groupBox2, "groupBox2"); groupBox2.Controls.Add((Control)label3); groupBox2.Controls.Add((Control)nudShotTenth); groupBox2.Controls.Add((Control)label2); groupBox2.Controls.Add((Control)nudShotSeconds); groupBox2.Name = "groupBox2"; groupBox2.TabStop = false; componentResourceManager.ApplyResources((object)label3, "label3"); label3.Name = "label3"; componentResourceManager.ApplyResources((object)nudShotTenth, "nudShotTenth"); nudShotTenth.Maximum = new Decimal(new int[4] { 9, 0, 0, 0 }); nudShotTenth.Name = "nudShotTenth"; componentResourceManager.ApplyResources((object)label2, "label2"); label2.Name = "label2"; componentResourceManager.ApplyResources((object)nudShotSeconds, "nudShotSeconds"); nudShotSeconds.Maximum = new Decimal(new int[4] { 60, 0, 0, 0 }); nudShotSeconds.Name = "nudShotSeconds"; componentResourceManager.ApplyResources((object)this, "$this"); AutoScaleMode = AutoScaleMode.Font; Controls.Add((Control)groupBox2); Controls.Add((Control)groupBox1); FormBorderStyle = FormBorderStyle.FixedSingle; KeyPreview = true; MaximizeBox = false; MinimizeBox = false; Name = nameof(EditTime); FormClosing += new FormClosingEventHandler(EditTime_FormClosing); KeyDown += new KeyEventHandler(EditTime_KeyDown); nudMinutes.EndInit(); nudSeconds.EndInit(); nudTenth.EndInit(); groupBox1.ResumeLayout(false); groupBox1.PerformLayout(); groupBox2.ResumeLayout(false); groupBox2.PerformLayout(); nudShotTenth.EndInit(); nudShotSeconds.EndInit(); ResumeLayout(false); }
/// <summary> /// Update curent settings basing on control state. /// </summary> /// <param name="num">Source control.</param> /// <param name="section">Section name.</param> /// <param name="key">Key name.</param> public void FromControl( NumericUpDown num, String section, String key ) { AddSetting( section, key, num.Value.ToString() ); }
/// <summary> /// Set the depedency property <see cref="TypeProperty"/>. /// </summary> /// <param name="control">The numericupdown control.</param> /// <param name="inputType">The input type.</param> public static void SetType(NumericUpDown control, NumericInputType inputType) { control.SetValue(TypeProperty, inputType); }
public winEvolutionPanel() : base("winEvolutionPanel") { this.Windowed = true; this.ShowInWindowSwitcher = false; this.Size = new System.Drawing.Size(200, 230); this.Location = new System.Drawing.Point(210, WindowSwitcher.GameWindow.ActiveTeam.Y + WindowSwitcher.GameWindow.ActiveTeam.Height + 0); this.AlwaysOnTop = true; this.TitleBar.CloseButton.Visible = true; this.TitleBar.Font = Graphics.FontManager.LoadFont("tahoma", 10); this.TitleBar.Text = "Evolution Panel"; pnlEvoList = new Panel("pnlEvoList"); pnlEvoList.Size = new System.Drawing.Size(200, 230); pnlEvoList.Location = new Point(0, 0); pnlEvoList.BackColor = Color.White; pnlEvoList.Visible = true; pnlEvoEditor = new Panel("pnlEvoEditor"); pnlEvoEditor.Size = new System.Drawing.Size(360, 400); pnlEvoEditor.Location = new Point(0, 0); pnlEvoEditor.BackColor = Color.White; pnlEvoEditor.Visible = false; lbxEvoList = new ListBox("lbxEvoList"); lbxEvoList.Location = new Point(10, 10); lbxEvoList.Size = new Size(180, 140); for (int i = 0; i < 10; i++) { lbxEvoList.Items.Add(new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Evolutions.EvolutionHelper.Evolutions[i].Name)); } lbxEvoList.SelectItem(0); btnBack = new Button("btnBack"); btnBack.Location = new Point(10, 160); btnBack.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnBack.Size = new System.Drawing.Size(64, 16); btnBack.Visible = true; btnBack.Text = "<--"; btnBack.Click += new EventHandler<MouseButtonEventArgs>(btnBack_Click); btnForward = new Button("btnForward"); btnForward.Location = new Point(126, 160); btnForward.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnForward.Size = new System.Drawing.Size(64, 16); btnForward.Visible = true; btnForward.Text = "-->"; btnForward.Click += new EventHandler<MouseButtonEventArgs>(btnForward_Click); btnEdit = new Button("btnEdit"); btnEdit.Location = new Point(10, 190); btnEdit.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEdit.Size = new System.Drawing.Size(64, 16); btnEdit.Visible = true; btnEdit.Text = "Edit"; btnEdit.Click += new EventHandler<MouseButtonEventArgs>(btnEdit_Click); btnCancel = new Button("btnCancel"); btnCancel.Location = new Point(126, 190); btnCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnCancel.Size = new System.Drawing.Size(64, 16); btnCancel.Visible = true; btnCancel.Text = "Cancel"; btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click); //btnAddNew = new Button("btnAddNew"); //btnAddNew.Location = new Point(); //btnAddNew.Font = Graphics.FontManager.LoadFont("tahoma", 10); //btnAddNew.Size = new System.Drawing.Size(64, 16); //btnAddNew.Visible = true; //btnAddNew.Text = "Add New"; //btnAddNew.Click += new EventHandler<MouseButtonEventArgs>(btnAddNew_Click); btnEditorCancel = new Button("btnEditorCancel"); btnEditorCancel.Location = new Point(100, 354); btnEditorCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEditorCancel.Size = new System.Drawing.Size(64, 16); btnEditorCancel.Visible = true; btnEditorCancel.Text = "Cancel"; btnEditorCancel.Click += new EventHandler<MouseButtonEventArgs>(btnEditorCancel_Click); btnEditorOK = new Button("btnEditorOK"); btnEditorOK.Location = new Point(10, 354); btnEditorOK.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEditorOK.Size = new System.Drawing.Size(64, 16); btnEditorOK.Visible = true; btnEditorOK.Text = "OK"; btnEditorOK.Click += new EventHandler<MouseButtonEventArgs>(btnEditorOK_Click); //PictureBox picSprite; picSprite = new PictureBox("picSprite"); picSprite.Size = new Size(32, 32); picSprite.BackColor = Color.Transparent; picSprite.Image = new SdlDotNet.Graphics.Surface(32, 32); picSprite.X = 175 - picSprite.Width; picSprite.Y = 120 - picSprite.Height / 2; //PictureBox picNewSprite; picNewSprite = new PictureBox("picNewSprite"); picNewSprite.Size = new Size(32, 32); picNewSprite.BackColor = Color.Transparent; picNewSprite.Image = new SdlDotNet.Graphics.Surface(32, 32); picNewSprite.X = 185; picNewSprite.Y = 120 - picNewSprite.Height / 2; lblName = new Label("lblName"); lblName.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblName.Text = "Name:"; lblName.AutoSize = true; lblName.Location = new Point(10, 4); txtName = new TextBox("txtName"); txtName.Size = new Size(200, 16); txtName.Location = new Point(10, 16); lblSprite = new Label("lblSprite"); lblSprite.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblSprite.Text = "Species:"; lblSprite.AutoSize = true; lblSprite.Location = new Point(60, 36); nudSpecies = new NumericUpDown("nudSpecies"); nudSpecies.Minimum = 0; nudSpecies.Maximum = Int32.MaxValue; nudSpecies.Size = new Size(80, 20); nudSpecies.Location = new Point(60, 50); nudSpecies.Font = Graphics.FontManager.LoadFont("tahoma", 10); nudSpecies.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudSpecies_ValueChanged); lblMaxBranchEvos = new Label("lblMaxBranchEvos"); lblMaxBranchEvos.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblMaxBranchEvos.Text = "Max Branch Evos:"; lblMaxBranchEvos.AutoSize = true; lblMaxBranchEvos.Location = new Point(200, 36); nudMaxBranchEvos = new NumericUpDown("nudMaxBranchEvos"); nudMaxBranchEvos.Minimum = 0; nudMaxBranchEvos.Maximum = Int32.MaxValue; nudMaxBranchEvos.Size = new Size(80, 20); nudMaxBranchEvos.Location = new Point(200, 50); nudMaxBranchEvos.Font = Graphics.FontManager.LoadFont("tahoma", 10); lblEvoNum = new Label("lblEvoNum"); lblEvoNum.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblEvoNum.Text = "Evolution Branch #:"; lblEvoNum.AutoSize = true; lblEvoNum.Location = new Point(30, 170); nudEvoNum = new NumericUpDown("nudEvoNum"); nudEvoNum.Minimum = 1; nudEvoNum.Maximum = Int32.MaxValue; nudEvoNum.Size = new Size(80, 20); nudEvoNum.Location = new Point(30, 184); nudEvoNum.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEvoBranchLoad = new Button("btnEvoBranchLoad"); btnEvoBranchLoad.Location = new Point(150, 180); btnEvoBranchLoad.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEvoBranchLoad.Size = new System.Drawing.Size(80, 16); btnEvoBranchLoad.Visible = true; btnEvoBranchLoad.Text = "Load Branch"; btnEvoBranchLoad.Click += new EventHandler<MouseButtonEventArgs>(btnEvoBranchLoad_Click); btnEvoBranchSave = new Button("btnEvoBranchSave"); btnEvoBranchSave.Location = new Point(250, 180); btnEvoBranchSave.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEvoBranchSave.Size = new System.Drawing.Size(80, 16); btnEvoBranchSave.Visible = true; btnEvoBranchSave.Text = "Save Branch"; btnEvoBranchSave.Click += new EventHandler<MouseButtonEventArgs>(btnEvoBranchSave_Click); lblSaveLoadMessage = new Label("lblSaveLoadMessage"); lblSaveLoadMessage.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblSaveLoadMessage.Text = "---"; lblSaveLoadMessage.AutoSize = true; lblSaveLoadMessage.Location = new Point(70, 212); lblArrow = new Label("lblArrow"); lblArrow.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblArrow.Text = "->"; lblArrow.AutoSize = true; lblArrow.Location = new Point(176, 120); lblNewName = new Label("lblNewName"); lblNewName.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblNewName.Text = "New Name:"; lblNewName.AutoSize = true; lblNewName.Location = new Point(10, 234); txtNewName = new TextBox("txtNewName"); txtNewName.Size = new Size(200, 16); txtNewName.Location = new Point(10, 250); lblNewSprite = new Label("lblNewSprite"); lblNewSprite.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblNewSprite.Text = "New Species:"; lblNewSprite.AutoSize = true; lblNewSprite.Location = new Point(60, 270); nudNewSpecies = new NumericUpDown("nudNewSpecies"); nudNewSpecies.Minimum = 0; nudNewSpecies.Maximum = Int32.MaxValue; nudNewSpecies.Size = new Size(80, 20); nudNewSpecies.Location = new Point(60, 286); nudNewSpecies.Font = Graphics.FontManager.LoadFont("tahoma", 10); nudNewSpecies.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudNewSpecies_ValueChanged); lblReqScript = new Label("lblReqScript"); lblReqScript.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblReqScript.Text = "Requirement Script:"; lblReqScript.AutoSize = true; lblReqScript.Location = new Point(200, 270); nudReqScript = new NumericUpDown("nudReqScript"); nudReqScript.Minimum = 0; nudReqScript.Maximum = Int32.MaxValue; nudReqScript.Size = new Size(80, 20); nudReqScript.Location = new Point(200, 286); nudReqScript.Font = Graphics.FontManager.LoadFont("tahoma", 10); lblData1 = new Label("lblData1"); lblData1.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblData1.Text = "Data 1:"; lblData1.AutoSize = true; lblData1.Location = new Point(30, 306); nudData1 = new NumericUpDown("nudData1"); nudData1.Minimum = Int32.MinValue; nudData1.Maximum = Int32.MaxValue; nudData1.Size = new Size(80, 20); nudData1.Location = new Point(30, 320); nudData1.Font = Graphics.FontManager.LoadFont("tahoma", 10); lblData2 = new Label("lblData2"); lblData2.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblData2.Text = "Data 2:"; lblData2.AutoSize = true; lblData2.Location = new Point(140, 306); nudData2 = new NumericUpDown("nudData2"); nudData2.Minimum = Int32.MinValue; nudData2.Maximum = Int32.MaxValue; nudData2.Size = new Size(80, 20); nudData2.Location = new Point(140, 320); nudData2.Font = Graphics.FontManager.LoadFont("tahoma", 10); lblData3 = new Label("lblData3"); lblData3.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblData3.Text = "Data 3:"; lblData3.AutoSize = true; lblData3.Location = new Point(250, 306); nudData3 = new NumericUpDown("nudData3"); nudData3.Minimum = Int32.MinValue; nudData3.Maximum = Int32.MaxValue; nudData3.Size = new Size(80, 20); nudData3.Location = new Point(250, 320); nudData3.Font = Graphics.FontManager.LoadFont("tahoma", 10); #region AddWidget pnlEvoList.AddWidget(lbxEvoList); pnlEvoList.AddWidget(btnBack); pnlEvoList.AddWidget(btnForward); //pnlEvoList.AddWidget(btnAddNew); pnlEvoList.AddWidget(btnEdit); pnlEvoList.AddWidget(btnCancel); pnlEvoEditor.AddWidget(picSprite); pnlEvoEditor.AddWidget(picNewSprite); pnlEvoEditor.AddWidget(lblName); pnlEvoEditor.AddWidget(txtName); pnlEvoEditor.AddWidget(lblSprite); pnlEvoEditor.AddWidget(nudSpecies); pnlEvoEditor.AddWidget(lblMaxBranchEvos); pnlEvoEditor.AddWidget(nudMaxBranchEvos); // pnlEvoEditor.AddWidget(lblEvoNum); pnlEvoEditor.AddWidget(nudEvoNum); pnlEvoEditor.AddWidget(btnEvoBranchLoad); pnlEvoEditor.AddWidget(btnEvoBranchSave); pnlEvoEditor.AddWidget(lblSaveLoadMessage); pnlEvoEditor.AddWidget(lblArrow); pnlEvoEditor.AddWidget(lblNewName); pnlEvoEditor.AddWidget(txtNewName); pnlEvoEditor.AddWidget(lblNewSprite); pnlEvoEditor.AddWidget(nudNewSpecies); pnlEvoEditor.AddWidget(lblReqScript); pnlEvoEditor.AddWidget(lblData1); pnlEvoEditor.AddWidget(lblData2); pnlEvoEditor.AddWidget(lblData3); pnlEvoEditor.AddWidget(nudReqScript); pnlEvoEditor.AddWidget(nudData1); pnlEvoEditor.AddWidget(nudData2); pnlEvoEditor.AddWidget(nudData3); pnlEvoEditor.AddWidget(btnEditorCancel); pnlEvoEditor.AddWidget(btnEditorOK); this.AddWidget(pnlEvoList); this.AddWidget(pnlEvoEditor); this.LoadComplete(); #endregion }
/// <summary> /// Get the depedency property <see cref="TypeProperty"/> from the numericupdown control. /// </summary> /// <param name="control">The numericupdown control.</param> /// <returns>The attached <see cref="TypeProperty"/>.</returns> public static NumericInputType GetType(NumericUpDown control) { return((NumericInputType)control.GetValue(TypeProperty)); }
private NumericUpDown GenerateNumericUpDown(bool isEditing, DataGridCell cell) { NumericUpDown numericUpDown = (cell != null) ? (cell.Content as NumericUpDown) : null; if (numericUpDown == null) { numericUpDown = new NumericUpDown(); } ApplyStyle(isEditing, true, numericUpDown); ApplyBinding(numericUpDown, NumericUpDown.ValueProperty); numericUpDown.Minimum = Minimum; numericUpDown.Maximum = Maximum; numericUpDown.StringFormat = StringFormat; numericUpDown.Interval = Interval; numericUpDown.InterceptArrowKeys = true; numericUpDown.InterceptMouseWheel = true; numericUpDown.Speedup = true; numericUpDown.HideUpDownButtons = HideUpDownButtons; return numericUpDown; }
public string GetSettingValue(Control control) { var item = SettingsMap.First(x => x.Control == control); var path = item.IniPath; var section = path.Split('\\')[0]; string key = path.Split('\\')[1]; var padIndex = SettingName.GetPadIndex(path); string v = string.Empty; if (key == SettingName.HookMode || key.EndsWith(SettingName.GamePadType) || key.EndsWith(SettingName.ForceType) || key.EndsWith(SettingName.LeftMotorDirection) || key.EndsWith(SettingName.RightMotorDirection) || key.EndsWith(SettingName.PassThroughIndex) || key.EndsWith(SettingName.CombinedIndex)) { var v1 = ((ComboBox)control).SelectedItem; if (v1 == null) { v = "0"; } else if (v1 is KeyValuePair) { v = ((KeyValuePair)v1).Value; } else { v = System.Convert.ToInt32(v1).ToString(); } } // If DI menu strip attached. else if (control is ComboBox) { var cbx = (ComboBox)control; if (control.ContextMenuStrip == null) { v = control.Text; } else { v = SettingsConverter.ToIniValue(control.Text); // make sure that disabled button value is "0". if (SettingName.IsButton(key) && string.IsNullOrEmpty(v)) { v = "0"; } } } else if (control is TextBox) { // if setting is read-only. if (key == SettingName.InstanceGuid || key == SettingName.ProductGuid) { v = string.IsNullOrEmpty(control.Text) ? Guid.Empty.ToString("D") : control.Text; } else { v = control.Text; } } else if (control is NumericUpDown) { NumericUpDown nud = (NumericUpDown)control; v = nud.Value.ToString(); } else if (control is TrackBar) { TrackBar tc = (TrackBar)control; // convert 100% to 256 if (key == SettingName.AxisToDPadDeadZone || key == SettingName.AxisToDPadOffset || key == SettingName.LeftTriggerDeadZone || key == SettingName.RightTriggerDeadZone) { v = System.Convert.ToInt32((float)tc.Value / 100F * 256F).ToString(); } // convert 100% to 500 else if (key == SettingName.LeftMotorPeriod || key == SettingName.RightMotorPeriod) { v = System.Convert.ToInt32((float)tc.Value / 100F * 500F).ToString(); } // Convert 100% to 32767 else if (key == SettingName.LeftThumbDeadZoneX || key == SettingName.LeftThumbDeadZoneY || key == SettingName.RightThumbDeadZoneX || key == SettingName.RightThumbDeadZoneY) { v = System.Convert.ToInt32((float)tc.Value / 100F * ((float)Int16.MaxValue)).ToString(); } else { v = tc.Value.ToString(); } } else if (control is CheckBox) { CheckBox tc = (CheckBox)control; v = tc.Checked ? "1" : "0"; } else if (control is DataGridView) { var grid = (DataGridView)control; if (grid.Enabled) { var data = grid.Rows.Cast <DataGridViewRow>().Where(x => x.Visible).Select(x => x.DataBoundItem as UserSetting) // Make sure that only enabled controllers are added. .Where(x => x != null && x.IsEnabled).ToArray(); data = FilterSettings(data); var sections = data.Select(x => GetInstanceSection(x.InstanceGuid)).ToArray(); // x360ce.dll must combine devices separated by comma. //v = string.Join(",", sections); // Use backwards compatible mode (one device at the time). v = sections.FirstOrDefault() ?? ""; // Note: Must code device combine workaround. } else { v = "AUTO"; } } return(v); }
public winNPCPanel() : base("winNPCPanel") { this.Windowed = true; this.ShowInWindowSwitcher = false; this.Size = new System.Drawing.Size(200, 230); this.Location = new System.Drawing.Point(210, WindowSwitcher.GameWindow.ActiveTeam.Y + WindowSwitcher.GameWindow.ActiveTeam.Height + 0); this.AlwaysOnTop = true; this.TitleBar.CloseButton.Visible = true; this.TitleBar.Font = Graphics.FontManager.LoadFont("tahoma", 10); this.TitleBar.Text = "NPC Panel"; pnlNPCList = new Panel("pnlNPCList"); pnlNPCList.Size = new System.Drawing.Size(200, 230); pnlNPCList.Location = new Point(0, 0); pnlNPCList.BackColor = Color.White; pnlNPCList.Visible = true; pnlNPCEditor = new Panel("pnlNPCEditor"); pnlNPCEditor.Size = new System.Drawing.Size(300, 420); pnlNPCEditor.Location = new Point(0, 0); pnlNPCEditor.BackColor = Color.White; pnlNPCEditor.Visible = false; #region NPC Selector lbxNPCList = new ListBox("lbxNPCList"); lbxNPCList.Location = new Point(10, 10); lbxNPCList.Size = new Size(180, 140); for (int i = 0; i < 10; i++) { ListBoxTextItem lbiNPC = new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Npc.NpcHelper.Npcs[(i + 1) + 10 * currentTen].Name); lbxNPCList.Items.Add(lbiNPC); } btnBack = new Button("btnBack"); btnBack.Location = new Point(10, 160); btnBack.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnBack.Size = new System.Drawing.Size(64, 16); btnBack.Visible = true; btnBack.Text = "<--"; btnBack.Click += new EventHandler<MouseButtonEventArgs>(btnBack_Click); btnForward = new Button("btnForward"); btnForward.Location = new Point(126, 160); btnForward.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnForward.Size = new System.Drawing.Size(64, 16); btnForward.Visible = true; btnForward.Text = "-->"; btnForward.Click += new EventHandler<MouseButtonEventArgs>(btnForward_Click); btnEdit = new Button("btnEdit"); btnEdit.Location = new Point(10, 190); btnEdit.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEdit.Size = new System.Drawing.Size(64, 16); btnEdit.Visible = true; btnEdit.Text = "Edit"; btnEdit.Click += new EventHandler<MouseButtonEventArgs>(btnEdit_Click); btnCancel = new Button("btnCancel"); btnCancel.Location = new Point(126, 190); btnCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnCancel.Size = new System.Drawing.Size(64, 16); btnCancel.Visible = true; btnCancel.Text = "Cancel"; btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click); #endregion #region NPC Editor lblName = new Label("lblName"); lblName.Font = Graphics.FontManager.LoadFont("Tahoma", 10); lblName.Text = "NPC Name:"; lblName.AutoSize = true; lblName.Location = new Point(10, 5); txtName = new TextBox("txtName"); txtName.Size = new Size(200, 15); txtName.Location = new Point(75, 5); txtName.Font = Graphics.FontManager.LoadFont("Tahoma", 12); txtName.Text = ""; lblAttackSay = new Label("lblAttackSay"); lblAttackSay.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblAttackSay.Text = "Attack Say:"; lblAttackSay.AutoSize = true; lblAttackSay.Location = new Point(10, 25); txtAttackSay = new TextBox("txtAttackSay"); txtAttackSay.Size = new System.Drawing.Size(200, 15); txtAttackSay.Location = new Point(75, 25); txtAttackSay.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 12); lblForm = new Label("lblForm"); lblForm.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblForm.Text = "Form:"; lblForm.AutoSize = true; lblForm.Location = new Point(10, 45); nudForm = new NumericUpDown("nudForm"); nudForm.Maximum = 1000; nudForm.Location = new Point(75, 45); nudForm.Size = new System.Drawing.Size(200, 15); nudForm.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudForm_ValueChanged); lblSpecies = new Label("lblSpecies"); lblSpecies.Font = Graphics.FontManager.LoadFont("tahoma", 10); lblSpecies.Text = "Species:"; lblSpecies.AutoSize = true; lblSpecies.Location = new Point(10, 65); nudSpecies = new NumericUpDown("nudSpecies"); nudSpecies.Location = new Point(75, 65); nudSpecies.Size = new System.Drawing.Size(200, 15); nudSpecies.Minimum = -1; nudSpecies.Maximum = 649; nudForm.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudSpecies_ValueChanged); lblRange = new Label("lblRange"); lblRange.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblRange.Text = "Shiny:"; lblRange.AutoSize = true; lblRange.Location = new Point(10, 85); nudShinyChance = new NumericUpDown("nudShinyChance"); nudShinyChance.Location = new Point(75, 85); nudShinyChance.Size = new System.Drawing.Size(200, 15); nudShinyChance.Maximum = Int32.MaxValue; nudShinyChance.Minimum = 0; chkSpawnsAtDawn = new CheckBox("chkSpawnsAtDawn"); chkSpawnsAtDawn.Size = new Size(60, 17); chkSpawnsAtDawn.Location = new Point(75, 105); chkSpawnsAtDawn.Font = Graphics.FontManager.LoadFont("tahoma", 10); chkSpawnsAtDawn.Text = "Dawn"; chkSpawnsAtDay = new CheckBox("chkSpawnsAtDay"); chkSpawnsAtDay.Size = new Size(60, 17); chkSpawnsAtDay.Location = new Point(175, 105); chkSpawnsAtDay.Font = Graphics.FontManager.LoadFont("tahoma", 10); chkSpawnsAtDay.Text = "Day"; chkSpawnsAtDusk = new CheckBox("chkSpawnsAtDusk"); chkSpawnsAtDusk.Size = new Size(60, 17); chkSpawnsAtDusk.Location = new Point(75, 125); chkSpawnsAtDusk.Font = Graphics.FontManager.LoadFont("tahoma", 10); chkSpawnsAtDusk.Text = "Dusk"; chkSpawnsAtNight = new CheckBox("chkSpawnsAtNight"); chkSpawnsAtNight.Size = new Size(60, 17); chkSpawnsAtNight.Location = new Point(175, 125); chkSpawnsAtNight.Font = Graphics.FontManager.LoadFont("tahoma", 10); chkSpawnsAtNight.Text = "Night"; lblBehaviour = new Label("lblBehaviour"); lblBehaviour.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblBehaviour.Text = "Behaviour:"; lblBehaviour.AutoSize = true; lblBehaviour.Location = new Point(10, lblRange.Y + 60); cmbBehaviour = new ComboBox("cmbBehaviour"); cmbBehaviour.Location = new Point(75, lblBehaviour.Y); cmbBehaviour.Size = new System.Drawing.Size(200, 15); for (int i = 0; i < 7; i++) { cmbBehaviour.Items.Add(new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), Enum.GetName(typeof(Enums.NpcBehavior), i))); } lblRecruitRate = new Label("lblRecruitRate"); lblRecruitRate.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblRecruitRate.Text = "Recruit Rate:"; lblRecruitRate.AutoSize = true; lblRecruitRate.Location = new Point(10, lblBehaviour.Y + 20); nudRecruitRate = new NumericUpDown("nudRecruitRate"); nudRecruitRate.Location = new Point(85, lblRecruitRate.Y); nudRecruitRate.Size = new System.Drawing.Size(190, 15); nudRecruitRate.Minimum = -1000; nudRecruitRate.Maximum = 1000; lblMove = new Label[4]; lblMoveInfo = new Label[4]; nudMove = new NumericUpDown[4]; for (int i = 0; i < lblMove.Length; i++) { lblMove[i] = new Label("lblMove" + i); lblMoveInfo[i] = new Label("lblMoveInfo" + i); nudMove[i] = new NumericUpDown("nudMove" + i); nudMove[i].ValueChanged += new EventHandler<ValueChangedEventArgs>(winNPCPanel_ValueChanged); lblMove[i].Font = Graphics.FontManager.LoadFont("tahoma", 10); lblMove[i].Text = "Move " + (i + 1) + ":"; lblMove[i].AutoSize = true; lblMove[i].Location = new Point(10, (lblRecruitRate.Y + 20) + (20 * i)); nudMove[i].Location = new Point(75, (lblRecruitRate.Y + 20) + (20 * i)); nudMove[i].Size = new Size(150, 15); nudMove[i].Minimum = -1; nudMove[i].Maximum = MaxInfo.MaxMoves; lblMoveInfo[i].Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblMoveInfo[i].AutoSize = true; lblMoveInfo[i].Location = new Point(230, (lblRecruitRate.Y + 20) + (20 * i)); } lblDropSelector = new Label("lblDropSelector"); lblDropSelector.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblDropSelector.AutoSize = true; lblDropSelector.Text = "Drop #:"; lblDropSelector.Location = new Point(10, lblMove[lblMove.Length - 1].Y + 20); nudDropSelector = new NumericUpDown("nudDropSelector"); nudDropSelector.Location = new Point(75, lblDropSelector.Y); nudDropSelector.Size = new System.Drawing.Size(200, 15); nudDropSelector.Minimum = 1; nudDropSelector.Maximum = MaxInfo.MAX_NPC_DROPS; nudDropSelector.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudDropSelector_ValueChanged); lblDropItemNum = new Label("lblDropItemNum"); lblDropItemNum.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblDropItemNum.AutoSize = true; lblDropItemNum.Text = "Drop Item #:"; lblDropItemNum.Location = new Point(10, lblDropSelector.Y + 20); nudDropItemNum = new NumericUpDown("nudDropItemNum"); nudDropItemNum.Location = new Point(75, lblDropItemNum.Y); nudDropItemNum.Size = new System.Drawing.Size(200, 15); nudDropItemNum.Minimum = 0; nudDropItemNum.Maximum = MaxInfo.MaxItems; nudDropItemNum.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudDropItemNum_ValueChanged); lblDropItemAmount = new Label("lblDropItemAmount"); lblDropItemAmount.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblDropItemAmount.AutoSize = true; lblDropItemAmount.Text = "Drop Amount:"; lblDropItemAmount.Location = new Point(10, lblDropItemNum.Y + 20); nudDropItemAmount = new NumericUpDown("nudDropItemAmount"); nudDropItemAmount.Location = new Point(85, lblDropItemAmount.Y); nudDropItemAmount.Size = new System.Drawing.Size(190, 15); nudDropItemAmount.Minimum = 1; nudDropItemAmount.Maximum = Int32.MaxValue; nudDropItemAmount.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudDropItemAmount_ValueChanged); lblDropItemChance = new Label("lblDropItemChance"); lblDropItemChance.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblDropItemChance.AutoSize = true; lblDropItemChance.Text = "Drop Chance:"; lblDropItemChance.Location = new Point(10, lblDropItemAmount.Y + 20); nudDropItemChance = new NumericUpDown("nudDropItemChance"); nudDropItemChance.Location = new Point(85, lblDropItemChance.Y); nudDropItemChance.Size = new System.Drawing.Size(190, 15); nudDropItemChance.Minimum = 1; nudDropItemChance.Maximum = 100; nudDropItemChance.ValueChanged += new EventHandler<ValueChangedEventArgs>(nudDropItemChance_ValueChanged); lblDropItemTag = new Label("lblDropItemTag"); lblDropItemTag.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); lblDropItemTag.AutoSize = true; lblDropItemTag.Text = "Item Tag:"; lblDropItemTag.Location = new Point(10, lblDropItemChance.Y + 20); txtDropItemTag = new TextBox("nudDropItemTag"); txtDropItemTag.Location = new Point(85, lblDropItemTag.Y); txtDropItemTag.Size = new System.Drawing.Size(190, 15); txtDropItemTag.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 10); txtDropItemTag.TextChanged += new EventHandler(txtDropItemTag_TextChanged); #endregion btnEditorCancel = new Button("btnEditorCancel"); btnEditorCancel.Location = new Point(20, lblDropItemTag.Y + 20); btnEditorCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEditorCancel.Size = new System.Drawing.Size(64, 16); btnEditorCancel.Visible = true; btnEditorCancel.Text = "Cancel"; btnEditorCancel.Click += new EventHandler<MouseButtonEventArgs>(btnEditorCancel_Click); btnEditorOK = new Button("btnEditorOK"); btnEditorOK.Location = new Point(120, lblDropItemTag.Y + 20); btnEditorOK.Font = Graphics.FontManager.LoadFont("tahoma", 10); btnEditorOK.Size = new System.Drawing.Size(64, 16); btnEditorOK.Visible = true; btnEditorOK.Text = "OK"; btnEditorOK.Click += new EventHandler<MouseButtonEventArgs>(btnEditorOK_Click); #region NPC Selector pnlNPCList.AddWidget(lbxNPCList); pnlNPCList.AddWidget(btnBack); pnlNPCList.AddWidget(btnForward); pnlNPCList.AddWidget(btnEdit); pnlNPCList.AddWidget(btnCancel); #endregion #region NPC Editor pnlNPCEditor.AddWidget(lblName); pnlNPCEditor.AddWidget(txtName); pnlNPCEditor.AddWidget(lblAttackSay); pnlNPCEditor.AddWidget(txtAttackSay); pnlNPCEditor.AddWidget(lblForm); pnlNPCEditor.AddWidget(nudForm); pnlNPCEditor.AddWidget(lblSpecies); pnlNPCEditor.AddWidget(nudSpecies); pnlNPCEditor.AddWidget(lblRange); pnlNPCEditor.AddWidget(nudShinyChance); pnlNPCEditor.AddWidget(chkSpawnsAtDawn); pnlNPCEditor.AddWidget(chkSpawnsAtDay); pnlNPCEditor.AddWidget(chkSpawnsAtDusk); pnlNPCEditor.AddWidget(chkSpawnsAtNight); pnlNPCEditor.AddWidget(lblBehaviour); pnlNPCEditor.AddWidget(cmbBehaviour); pnlNPCEditor.AddWidget(lblRecruitRate); pnlNPCEditor.AddWidget(nudRecruitRate); for (int i = 0; i < lblMove.Length; i++) { pnlNPCEditor.AddWidget(lblMove[i]); pnlNPCEditor.AddWidget(nudMove[i]); pnlNPCEditor.AddWidget(lblMoveInfo[i]); } pnlNPCEditor.AddWidget(lblDropSelector); pnlNPCEditor.AddWidget(nudDropSelector); pnlNPCEditor.AddWidget(lblDropItemNum); pnlNPCEditor.AddWidget(nudDropItemNum); pnlNPCEditor.AddWidget(lblDropItemAmount); pnlNPCEditor.AddWidget(nudDropItemAmount); pnlNPCEditor.AddWidget(lblDropItemChance); pnlNPCEditor.AddWidget(nudDropItemChance); pnlNPCEditor.AddWidget(lblDropItemTag); pnlNPCEditor.AddWidget(txtDropItemTag); pnlNPCEditor.AddWidget(btnEditorCancel); pnlNPCEditor.AddWidget(btnEditorOK); #endregion this.AddWidget(pnlNPCList); this.AddWidget(pnlNPCEditor); RefreshNPCList(); this.LoadComplete(); }
public override void LoadWindowControls(StackPanel control, string parent, string name, Type type, object[] attributes, Color member) { LoadLabelControl(control, name); Avalonia.Controls.Grid innerPanel = getSharedRowPanel(8); TextBlock lblR = new TextBlock(); lblR.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblR.Text = "R:"; lblR.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblR.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right; innerPanel.Children.Add(lblR); innerPanel.ColumnDefinitions[0].Width = new GridLength(18); lblR.SetValue(Avalonia.Controls.Grid.ColumnProperty, 0); NumericUpDown nudValueR = new NumericUpDown(); nudValueR.Margin = new Thickness(4, 0, 0, 0); nudValueR.Minimum = byte.MinValue; nudValueR.Maximum = byte.MaxValue; nudValueR.Value = member.R; innerPanel.Children.Add(nudValueR); nudValueR.SetValue(Avalonia.Controls.Grid.ColumnProperty, 1); TextBlock lblG = new TextBlock(); lblG.Margin = new Thickness(8, 0, 0, 0); lblG.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblG.Text = "G:"; lblG.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblG.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right; innerPanel.Children.Add(lblG); innerPanel.ColumnDefinitions[2].Width = new GridLength(18); lblG.SetValue(Avalonia.Controls.Grid.ColumnProperty, 2); NumericUpDown nudValueG = new NumericUpDown(); nudValueG.Margin = new Thickness(4, 0, 0, 0); nudValueG.Minimum = byte.MinValue; nudValueG.Maximum = byte.MaxValue; nudValueG.Value = member.G; innerPanel.Children.Add(nudValueG); nudValueG.SetValue(Avalonia.Controls.Grid.ColumnProperty, 3); TextBlock lblB = new TextBlock(); lblB.Margin = new Thickness(8, 0, 0, 0); lblB.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblB.Text = "B:"; lblB.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblB.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right; innerPanel.Children.Add(lblB); innerPanel.ColumnDefinitions[4].Width = new GridLength(18); lblB.SetValue(Avalonia.Controls.Grid.ColumnProperty, 4); NumericUpDown nudValueB = new NumericUpDown(); nudValueB.Margin = new Thickness(4, 0, 0, 0); nudValueB.Minimum = byte.MinValue; nudValueB.Maximum = byte.MaxValue; nudValueB.Value = member.B; innerPanel.Children.Add(nudValueB); nudValueB.SetValue(Avalonia.Controls.Grid.ColumnProperty, 5); TextBlock lblA = new TextBlock(); lblA.Margin = new Thickness(8, 0, 0, 0); lblA.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblA.Text = "A:"; lblA.VerticalAlignment = Avalonia.Layout.VerticalAlignment.Center; lblA.HorizontalAlignment = Avalonia.Layout.HorizontalAlignment.Right; innerPanel.Children.Add(lblA); innerPanel.ColumnDefinitions[6].Width = new GridLength(18); lblA.SetValue(Avalonia.Controls.Grid.ColumnProperty, 6); NumericUpDown nudValueA = new NumericUpDown(); nudValueA.Margin = new Thickness(4, 0, 0, 0); nudValueA.Minimum = byte.MinValue; nudValueA.Maximum = byte.MaxValue; nudValueA.Value = member.A; innerPanel.Children.Add(nudValueA); nudValueA.SetValue(Avalonia.Controls.Grid.ColumnProperty, 7); control.Children.Add(innerPanel); }
public String Note; // additional text to display in status bar public UnitTest(ZGE.Components.ZComponent parent) : base(parent) { Dock = Pos.Fill; SetSize(1024, 768); m_List = new Control.CollapsibleList(this); LeftDock.TabControl.AddPage("Unit tests", m_List); LeftDock.Width = 150; m_TextOutput = new Control.ListBox(BottomDock); m_Button = BottomDock.TabControl.AddPage("Output", m_TextOutput); BottomDock.Height = 200; m_DebugCheck = new Control.LabeledCheckBox(m_List); m_DebugCheck.Text = "Debug outlines"; m_DebugCheck.CheckChanged += DebugCheckChanged; m_StatusBar = new Control.StatusBar(this); m_StatusBar.Dock = Pos.Bottom; m_StatusBar.AddControl(m_DebugCheck, true); //m_Center = new Center(this); //m_Center.Dock = Pos.Fill; GUnit test; { CollapsibleCategory cat = m_List.Add("Non-Interactive"); { test = new Label(this); RegisterUnitTest("Label", cat, test); test = new RichLabel(this); RegisterUnitTest("RichLabel", cat, test); test = new GroupBox(this); RegisterUnitTest("GroupBox", cat, test); test = new ProgressBar(this); RegisterUnitTest("ProgressBar", cat, test); test = new ImagePanel(this); RegisterUnitTest("ImagePanel", cat, test); test = new StatusBar(this); RegisterUnitTest("StatusBar", cat, test); } } { CollapsibleCategory cat = m_List.Add("Standard"); { test = new Button(this); RegisterUnitTest("Button", cat, test); test = new TextBox(this); RegisterUnitTest("TextBox", cat, test); test = new CheckBox(this); RegisterUnitTest("CheckBox", cat, test); test = new RadioButton(this); RegisterUnitTest("RadioButton", cat, test); test = new ComboBox(this); RegisterUnitTest("ComboBox", cat, test); test = new ListBox(this); RegisterUnitTest("ListBox", cat, test); test = new NumericUpDown(this); RegisterUnitTest("NumericUpDown", cat, test); test = new Slider(this); RegisterUnitTest("Slider", cat, test); test = new MenuStrip(this); RegisterUnitTest("MenuStrip", cat, test); test = new CrossSplitter(this); RegisterUnitTest("CrossSplitter", cat, test); } } { CollapsibleCategory cat = m_List.Add("Containers"); { test = new Window(this); RegisterUnitTest("Window", cat, test); test = new TreeControl(this); RegisterUnitTest("TreeControl", cat, test); test = new Properties(this); RegisterUnitTest("Properties", cat, test); test = new TabControl(this); RegisterUnitTest("TabControl", cat, test); test = new ScrollControl(this); RegisterUnitTest("ScrollControl", cat, test); test = new Docking(this); RegisterUnitTest("Docking", cat, test); } } { CollapsibleCategory cat = m_List.Add("Non-standard"); { test = new CollapsibleList(this); RegisterUnitTest("CollapsibleList", cat, test); test = new ColorPickers(this); RegisterUnitTest("Color pickers", cat, test); } } m_StatusBar.SendToBack(); PrintText("Unit Test started!"); }
private void Form1_Load(object sender, EventArgs e) { pen1 = new Pen(Color.Gainsboro); pen2 = new Pen(Color.White); brush1 = new SolidBrush(Color.White);; brush2 = new SolidBrush(pictureBox1.BackColor); tup1 = new Bitmap(301, 251); //IV曲线画布 g1 = Graphics.FromImage(tup1); g1.SmoothingMode = SmoothingMode.AntiAlias; //消除锯齿, 使绘图质量最高 g1.InterpolationMode = InterpolationMode.HighQualityBicubic; g1.CompositingQuality = CompositingQuality.HighQuality; tup2 = new Bitmap(301, 265); //RdV曲线画布 g2 = Graphics.FromImage(tup2); g2.SmoothingMode = SmoothingMode.AntiAlias; //消除锯齿, 使绘图质量最高 g2.InterpolationMode = InterpolationMode.HighQualityBicubic; g2.CompositingQuality = CompositingQuality.HighQuality; tup3 = new Bitmap(301, 251); //跟踪IV曲线临时画布 g3 = Graphics.FromImage(tup3); tup4 = new Bitmap(301, 265); //跟踪RdV曲线临时画布 g4 = Graphics.FromImage(tup4); this.listBox1.LostFocus += new System.EventHandler(this.listBox1_LostFocus); //添加失去焦点事件 //校正电阻设置panel控件 this.Controls.Add(panel1); panel1.BringToFront(); panel1.Left = 652; panel1.Top = 306; panel1.Visible = false; for (int i = 0; i < 7; i++) { numericUpDown[i] = new NumericUpDown(); numericUpDown[i].Cursor = Cursors.Hand; numericUpDown[i].Width = 57; numericUpDown[i].Height = 21; numericUpDown[i].Top = 33 + 27 * i; numericUpDown[i].Left = 102; numericUpDown[i].Minimum = 0M; if (i == 6) { numericUpDown[i].DecimalPlaces = 0; numericUpDown[i].Maximum = 20000M; numericUpDown[i].Increment = 1M; } else { numericUpDown[i].DecimalPlaces = 1; numericUpDown[i].Maximum = 10000M; numericUpDown[i].Increment = 0.1M; } this.panel1.Controls.Add(numericUpDown[i]); //添加到控件集合 numericUpDown[i].BringToFront(); } //读取注册表保存的设置 if (null == Registry.GetValue(@"HKEY_CURRENT_USER\Software\检波二极管灵敏度分析器\Settings", "R1", "")) { //第1次创建注册表子项,并将初值数据写入内存和注册表 for (Int32 i = 0; i < 7; i++) { R[i] = Convert.ToInt64(str2[i]); numericUpDown[i].Value = str2[i]; Registry.SetValue(@"HKEY_CURRENT_USER\Software\检波二极管灵敏度分析器\Settings", str1[i], str2[i]); } } else { //读取注册表保存的子项内数据,并写入界面 for (Int32 i = 0; i < 7; i++) { numericUpDown[i].Value = Convert.ToDecimal(Registry.GetValue(@"HKEY_CURRENT_USER\Software\检波二极管灵敏度分析器\Settings", str1[i], "")); } } //System.IO.Directory.CreateDirectory(Application.StartupPath + "\\Diode"); //创建保存数据的文件夹 //设置转移特性垂直刻度 for (int i = 0; i < 6; i++) { lb1[i] = new Label(); lb1[i].BackColor = this.tabPage5.BackColor; //背景颜色(取底色) lb1[i].Width = 30; lb1[i].Height = 15; lb1[i].TextAlign = ContentAlignment.MiddleRight; if (i == 5) { lb1[i].Top = 25 + (50 * i - 3); } else { lb1[i].Top = 25 + 50 * i; } lb1[i].Left = pictureBox1.Left - lb1[i].Width; lb1[i].Font = new Font("宋体", 9, FontStyle.Regular); lb1[i].Text = Convert.ToString((5 - i) * Convert.ToUInt32(numericUpDown6.Value) / 5); this.tabPage5.Controls.Add(lb1[i]); //添加到控件集合 lb1[i].BringToFront(); } for (int i = 0; i < 6; i++) { lb3[i] = new Label(); lb3[i].BackColor = this.tabPage5.BackColor; //背景颜色(取底色) lb3[i].Width = 35; lb3[i].Height = 15; lb3[i].TextAlign = ContentAlignment.MiddleCenter; lb3[i].ForeColor = Color.Teal; lb3[i].Top = 102 + 15 * i; lb3[i].Left = 6; lb3[i].Font = new Font("宋体", 9, FontStyle.Bold); if (i == 5) { lb3[i].Text = "(" + button2.Text.Substring(0, 2) + ")"; } else { lb3[i].Text = str3[i]; //正向电流IF } this.tabPage5.Controls.Add(lb3[i]); //添加到控件集合 lb3[i].BringToFront(); } //设置转移特性水平刻度 for (int i = 0; i < 8; i++) { lb2[i] = new Label(); lb2[i].BackColor = this.tabPage5.BackColor; //背景颜色(取底色) if (i != 7) { lb2[i].Width = 30; lb2[i].Height = 15; lb2[i].Top = 285; lb2[i].Left = 57 + 50 * i; lb2[i].Text = Convert.ToString(i * Convert.ToUInt32(numericUpDown7.Value) / 6); lb2[i].Font = new Font("宋体", 9, FontStyle.Regular); lb2[i].ForeColor = Color.Black; } else { lb2[i].Width = 100; lb2[i].Height = 15; lb2[i].Top = 305; lb2[i].Left = 170; lb2[i].Text = "正向电压VF(mV)"; lb2[i].Font = new Font("宋体", 9, FontStyle.Bold); lb2[i].ForeColor = Color.Teal; } lb2[i].TextAlign = ContentAlignment.MiddleCenter; this.tabPage5.Controls.Add(lb2[i]); //添加到控件集合 lb2[i].BringToFront(); } //设置灵敏度预估特性垂直刻度 for (int i = 0; i < 7; i++) { lb4[i] = new Label(); lb4[i].BackColor = this.tabPage6.BackColor; //背景颜色(取底色) lb4[i].Width = 30; lb4[i].Height = 15; lb4[i].TextAlign = ContentAlignment.MiddleRight; if (i == 6) { lb4[i].Top = 12 + (44 * i - 3); } else { lb4[i].Top = 12 + 44 * i; } lb4[i].Left = pictureBox1.Left - lb4[i].Width; lb4[i].Font = new Font("宋体", 9, FontStyle.Regular); lb4[i].Text = str5[i]; this.tabPage6.Controls.Add(lb4[i]); //添加到控件集合 lb4[i].BringToFront(); } for (int i = 0; i < 6; i++) { lb6[i] = new Label(); lb6[i].BackColor = this.tabPage6.BackColor; //背景颜色(取底色) lb6[i].Width = 35; lb6[i].Height = 15; lb6[i].TextAlign = ContentAlignment.MiddleCenter; lb6[i].ForeColor = Color.Teal; lb6[i].Top = 102 + 15 * i; lb6[i].Left = 6; lb6[i].Font = new Font("宋体", 9, FontStyle.Bold); lb6[i].Text = str4[i]; // this.tabPage6.Controls.Add(lb6[i]); //添加到控件集合 lb6[i].BringToFront(); } //设置灵敏度预估特性水平刻度 for (int i = 0; i < 8; i++) { lb5[i] = new Label(); lb5[i].BackColor = this.tabPage6.BackColor; //背景颜色(取底色) if (i != 7) { lb5[i].Width = 30; lb5[i].Height = 15; lb5[i].Top = 285; lb5[i].Left = 57 + 50 * i; lb5[i].Text = Convert.ToString(i * Convert.ToUInt32(numericUpDown8.Value) / 6); lb5[i].Font = new Font("宋体", 9, FontStyle.Regular); lb5[i].ForeColor = Color.Black; } else { lb5[i].Width = 100; lb5[i].Height = 15; lb5[i].Top = 305; lb5[i].Left = 170; lb5[i].Text = "正向电压VF(mV)"; lb5[i].Font = new Font("宋体", 9, FontStyle.Bold); lb5[i].ForeColor = Color.Teal; } lb5[i].TextAlign = ContentAlignment.MiddleCenter; this.tabPage6.Controls.Add(lb5[i]); //添加到控件集合 lb5[i].BringToFront(); } Index = 3; comboBox1.SelectedIndex = Index; label6.Text = "电阻" + str1[Index] + ":"; listBox1.SelectedIndex = 1; listBox1.Visible = false; Drawing_Transfer_Characteristic(); //绘制转移特性曲线 Drawing_Rd_V_sensibility(); //绘制灵敏度预估曲线 }
public mnuItemSelected(string name, int itemSlot) : base(name) { if ((int)Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].Type < 8 || (int)Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].Type == 15) { //cannot use item base.Size = new Size(165, 165); maxItems = 3; useable = false; } else { //can use item base.Size = new Size(165, 195); maxItems = 4; useable = true; } base.MenuDirection = Enums.MenuDirection.Horizontal; base.Location = new Point(335, 40); itemPicker = new Widgets.MenuItemPicker("itemPicker"); itemPicker.Location = new Point(18, 23); int widgetY = 8; //add choices lblHold = new Label("lblHold"); lblHold.Size = new System.Drawing.Size(120, 32); lblHold.Font = FontManager.LoadFont("PMU", 32); //lblHold.AutoSize = true; lblHold.Text = "Hold"; lblHold.Location = new Point(30, widgetY); lblHold.HoverColor = Color.Red; lblHold.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblHold_Click); lblHold.ForeColor = Color.WhiteSmoke; this.AddWidget(lblHold); widgetY += 30; if (useable) { lblUse = new Label("lblUse"); lblUse.Font = FontManager.LoadFont("PMU", 32); lblUse.AutoSize = true; lblUse.Text = "Use"; lblUse.Location = new Point(30, widgetY); lblUse.HoverColor = Color.Red; lblUse.ForeColor = Color.WhiteSmoke; lblUse.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblUse_Click); this.AddWidget(lblUse); widgetY += 30; } lblThrow = new Label("lblThrow"); lblThrow.Size = new System.Drawing.Size(120, 32); lblThrow.Location = new Point(30, widgetY); lblThrow.Font = FontManager.LoadFont("PMU", 32); lblThrow.Text = "Throw"; lblThrow.HoverColor = Color.Red; lblThrow.ForeColor = Color.WhiteSmoke; lblThrow.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblThrow_Click); widgetY += 30; lblSummary = new Label("lblSummary"); lblSummary.Size = new System.Drawing.Size(120, 32); lblSummary.Location = new Point(30, widgetY); lblSummary.Font = FontManager.LoadFont("PMU", 32); lblSummary.Text = "Summary"; lblSummary.HoverColor = Color.Red; lblSummary.ForeColor = Color.WhiteSmoke; lblSummary.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblSummary_Click); widgetY += 30; lblDrop = new Label("lblDrop"); lblDrop.Font = FontManager.LoadFont("PMU", 32); lblDrop.Size = new System.Drawing.Size(130, 32); lblDrop.AutoSize = false; //lblDrop.Text = "Drop"; lblDrop.Location = new Point(30, widgetY); lblDrop.HoverColor = Color.Red; lblDrop.ForeColor = Color.WhiteSmoke; lblDrop.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(lblDrop_Click); widgetY += 32; if (Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].Type == Enums.ItemType.Currency || Items.ItemHelper.Items[Players.PlayerManager.MyPlayer.GetInvItemNum(itemSlot)].StackCap > 0) { lblDrop.Text = "Drop Amount:"; nudAmount = new NumericUpDown("nudAmount"); nudAmount.Size = new Size(120, 24); nudAmount.Location = new Point(32, widgetY); nudAmount.Maximum = Players.PlayerManager.MyPlayer.Inventory[itemSlot].Value; nudAmount.Minimum = 1; this.AddWidget(nudAmount); } else { lblDrop.Text = "Drop"; } this.AddWidget(lblDrop); this.AddWidget(lblSummary); this.AddWidget(lblThrow); this.AddWidget(itemPicker); this.ItemSlot = itemSlot; }
static string GetNumericUpDownState(NumericUpDown numeric) { return(numeric.GetType().ToString() + ":" + numeric.Value.ToString()); }
private NumericUpDown GenerateNumericUpDown(bool isEditing, DataGridCell cell) { NumericUpDown numericUpDown = (cell != null) ? (cell.Content as NumericUpDown) : null; if (numericUpDown == null) { numericUpDown = new NumericUpDown(); // create binding to cell foreground to get changed brush from selection foregroundBinding = new Binding("Foreground") { Source = cell, Mode = BindingMode.OneWay }; } ApplyStyle(isEditing, true, numericUpDown); ApplyBinding(numericUpDown, NumericUpDown.ValueProperty); if (!isEditing) { // bind to cell foreground to get changed brush from selection ApplyBinding(foregroundBinding, numericUpDown, Control.ForegroundProperty); } else { // no foreground change for editing BindingOperations.ClearBinding(numericUpDown, Control.ForegroundProperty); } numericUpDown.Minimum = Minimum; numericUpDown.Maximum = Maximum; numericUpDown.StringFormat = StringFormat; numericUpDown.Interval = Interval; numericUpDown.InterceptArrowKeys = true; numericUpDown.InterceptMouseWheel = true; numericUpDown.Speedup = true; numericUpDown.HideUpDownButtons = HideUpDownButtons; numericUpDown.UpDownButtonsWidth = UpDownButtonsWidth; return numericUpDown; }
public SimpleIntBinding(NumericUpDown control, int defaultValue) { this.control = control; this.defaultValue = defaultValue; }
public virtual void CoercionPreservesBindings() { NumericUpDown nud = new NumericUpDown(); Binding b = new Binding { Source = 10 }; nud.SetBinding(NumericUpDown.MinimumProperty, b); BindingExpressionBase expression = nud.ReadLocalValue(NumericUpDown.MinimumProperty) as BindingExpressionBase; Assert.IsNotNull(expression, "Binding expression was not preserved!"); }
/// <summary> /// </summary> /// <param name="serverUri">ホストプロセスとの通信用URL</param> public FormBrowser(string serverUri) { CultureInfo c = CultureInfo.CurrentCulture; CultureInfo ui = CultureInfo.CurrentUICulture; if (c.Name != "en-US" && c.Name != "ja-JP" && c.Name != "ko-KR") { c = new CultureInfo("en-US"); } if (ui.Name != "en-US" && ui.Name != "ja-JP" && ui.Name != "ko-KR") { ui = new CultureInfo("en-US"); } Thread.CurrentThread.CurrentCulture = c; Thread.CurrentThread.CurrentUICulture = ui; InitializeComponent(); ServerUri = serverUri; StyleSheetApplied = false; _volumeManager = new VolumeManager((uint)Process.GetCurrentProcess().Id); // 音量設定用コントロールの追加 { var control = new NumericUpDown(); control.Name = "ToolMenu_Other_Volume_VolumeControl"; control.Maximum = 100; control.TextAlign = HorizontalAlignment.Right; control.Font = ToolMenu_Other_Volume.Font; control.ValueChanged += ToolMenu_Other_Volume_ValueChanged; control.Tag = false; var host = new ToolStripControlHost(control, "ToolMenu_Other_Volume_VolumeControlHost"); control.Size = new Size(host.Width - control.Margin.Horizontal, host.Height - control.Margin.Vertical); control.Location = new Point(control.Margin.Left, control.Margin.Top); ToolMenu_Other_Volume.DropDownItems.Add(host); } // スクリーンショットプレビューコントロールの追加 { double zoomrate = 0.5; var control = new PictureBox(); control.Name = "ToolMenu_Other_LastScreenShot_Image"; control.SizeMode = PictureBoxSizeMode.Zoom; control.Size = new Size((int)(KanColleSize.Width * zoomrate), (int)(KanColleSize.Height * zoomrate)); control.Margin = new Padding(); control.Image = new Bitmap((int)(KanColleSize.Width * zoomrate), (int)(KanColleSize.Height * zoomrate), PixelFormat.Format24bppRgb); using (var g = Graphics.FromImage(control.Image)) { g.Clear(SystemColors.Control); g.DrawString("No screenshot yet.\r\n", Font, Brushes.Black, new Point(4, 4)); } var host = new ToolStripControlHost(control, "ToolMenu_Other_LastScreenShot_ImageHost"); host.Size = new Size(control.Width + control.Margin.Horizontal, control.Height + control.Margin.Vertical); host.AutoSize = false; control.Location = new Point(control.Margin.Left, control.Margin.Top); host.Click += ToolMenu_Other_LastScreenShot_ImageHost_Click; ToolMenu_Other_LastScreenShot.DropDownItems.Insert(0, host); } }
public NumericUpDownAutomationPeer(NumericUpDown control) : base(control) { }
/// <summary> /// Changes the value of a NumericUpDown control without /// calling the value changed handler. /// </summary> /// <param name="nud"></param> /// <param name="value"></param> private void NUDValueChange(NumericUpDown nud, decimal value) { nud.ValueChanged -= _valueChangedHandler; nud.Value = value; nud.ValueChanged += _valueChangedHandler; }