Ejemplo n.º 1
0
 public void ValueChanged(object param)
 {
     if (Value != null)
     {
         if (param is IntegerTextBox)
         {
             IntegerTextBox textBox = param as IntegerTextBox;
             if (Value.Value > MaximumValue && !textBox.IsFocused && textBox.MaxValidation != MaxValidation.OnLostFocus)
             {
                 AddLog("Value Changed: " + MaximumValue.ToString());
             }
             else if (Value.Value < MinimumValue && !textBox.IsFocused && textBox.MinValidation != MinValidation.OnLostFocus)
             {
                 AddLog("Value Changed: " + MinimumValue.ToString());
             }
             else
             {
                 AddLog("Value Changed: " + Value.ToString());
             }
         }
         else
         {
             AddLog("Value Changed: " + Value.ToString());
         }
     }
     else
     {
         AddLog("Value Changed: NULL");
     }
 }
        public IntegerTextBoxRenderingTests()
        {
            textWriter = new Mock <TextWriter>();

            tagBuilder = new Mock <ITextBoxBaseHtmlBuilder>();
            rootTag    = new Mock <IHtmlNode>();
            rootTag.SetupGet(t => t.Children).Returns(() => new List <IHtmlNode>());

            tagBuilder.Setup(t => t.Build("t-numerictextbox")).Returns(rootTag.Object);

            input      = TextBoxBaseTestHelper.CreateIntegerTextBox(tagBuilder.Object);
            input.Name = "IntegerTextBox";
        }
        public IntegerTextBoxRenderingTests()
        {
            textWriter = new Mock<TextWriter>();

            tagBuilder = new Mock<ITextBoxBaseHtmlBuilder>();
            rootTag = new Mock<IHtmlNode>();
            rootTag.SetupGet(t => t.Children).Returns(() => new List<IHtmlNode>());

            tagBuilder.Setup(t => t.Build("t-numerictextbox")).Returns(rootTag.Object);

            input = TextBoxBaseTestHelper.CreateIntegerTextBox(tagBuilder.Object);
            input.Name = "IntegerTextBox";
        }
Ejemplo n.º 4
0
        public override void DetachEditingControl()
        {
            System.Windows.Forms.DataGridView dataGridView = this.DataGridView;
            if (dataGridView == null || dataGridView.EditingControl == null)
            {
                throw new InvalidOperationException("Cell is detached or its grid has no editing control.");
            }

            IntegerTextBox editBox = dataGridView.EditingControl as IntegerTextBox;

            if (editBox != null)
            {
                editBox.ClearUndo();  // avoid interferences between the editing sessions
            }

            base.DetachEditingControl();
        }
        /// <summary>
        /// Valida que un textBox no esté vacío y que tenga un número mayor que cero
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ValidarNoVacioMayorQueCero(object sender, EventArgs e)
        {
            IntegerTextBox tb = (IntegerTextBox)sender;

            if (tb.Text.Length == 0 || Convert.ToInt32(tb.Text) == 0)
            {
                tb.Text = _main._config.GetParametro(tb.Tag.ToString()).ToString();
            }
            else
            {
                int valor = Convert.ToInt16(tb.Text);
                _main._parametrosBase.Escalares.SetValor(tb.Tag, valor);
                tb.Text = valor.ToString();
                _main._config.ReplaceSetting(tb.Tag.ToString(), valor.ToString());
                _main._config.SaveConfiguracion();
            }
        }
Ejemplo n.º 6
0
        public override void InitializeEditingControl(int rowIndex, object initialFormattedValue, DataGridViewCellStyle dataGridViewCellStyle)
        {
            base.InitializeEditingControl(rowIndex, initialFormattedValue, dataGridViewCellStyle);
            IntegerTextBox editBox = this.DataGridView.EditingControl as IntegerTextBox;

            if (editBox != null)
            {
                editBox.BorderStyle = BorderStyle.None;

                string initialFormattedValueStr = initialFormattedValue as string;

                if (string.IsNullOrEmpty(initialFormattedValueStr))
                {
                    editBox.Text = "";
                }
                else
                {
                    editBox.Text = initialFormattedValueStr;
                }
            }
        }
Ejemplo n.º 7
0
        public static IntegerTextBox CreateIntegerTextBox(ITextBoxBaseHtmlBuilder renderer)
        {
            Mock <HttpContextBase> httpContext = TestHelper.CreateMockedHttpContext();

            httpContext.Setup(c => c.Request.Browser.CreateHtmlTextWriter(It.IsAny <TextWriter>())).Returns(new HtmlTextWriter(TextWriter.Null));

            Mock <ITextBoxBaseHtmlBuilderFactory <int> > inputRendererFactory = new Mock <ITextBoxBaseHtmlBuilderFactory <int> >();

            Mock <IClientSideObjectWriterFactory> clientSideObjectWriterFactory = new Mock <IClientSideObjectWriterFactory>();

            clientSideObjectWriter = new Mock <IClientSideObjectWriter>();

            ViewContext viewContext = TestHelper.CreateViewContext();

            clientSideObjectWriterFactory.Setup(c => c.Create(It.IsAny <string>(), It.IsAny <string>(), It.IsAny <TextWriter>())).Returns(clientSideObjectWriter.Object);

            IntegerTextBox input = new IntegerTextBox(viewContext, clientSideObjectWriterFactory.Object, inputRendererFactory.Object);

            renderer = renderer ?? new TextBoxBaseHtmlBuilder <int>(input);
            inputRendererFactory.Setup(f => f.Create(It.IsAny <IntegerTextBox>())).Returns(renderer);

            return(input);
        }
Ejemplo n.º 8
0
 /// <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();
     this.trackBar1            = new System.Windows.Forms.TrackBar();
     this.comboBox1            = new Syncfusion.Windows.Forms.Tools.ComboBoxAdv();
     this.checkBox1            = new Syncfusion.Windows.Forms.Tools.CheckBoxAdv();
     this.gridGroupingControl1 = new Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl();
     this.groupBox1            = new System.Windows.Forms.GroupBox();
     this.groupBox3            = new System.Windows.Forms.GroupBox();
     this.zoomFactorText       = new DoubleTextBox();
     this.label2             = new System.Windows.Forms.Label();
     this.colorPickerButton1 = new Syncfusion.Windows.Forms.ColorPickerButton();
     this.borderThickness    = new Syncfusion.Windows.Forms.Tools.IntegerTextBox();
     this.label1             = new System.Windows.Forms.Label();
     this.zoomDisplaySize    = new System.Windows.Forms.Label();
     this.trackBar2          = new System.Windows.Forms.TrackBar();
     this.zoomSize           = new System.Windows.Forms.Label();
     this.groupBox2          = new System.Windows.Forms.GroupBox();
     this.label4             = new System.Windows.Forms.Label();
     this.label3             = new System.Windows.Forms.Label();
     this.panel2             = new System.Windows.Forms.Panel();
     this.tipDesc            = new System.Windows.Forms.ToolTip(this.components);
     this.radioButton1       = new System.Windows.Forms.RadioButton();
     this.radioButton2       = new System.Windows.Forms.RadioButton();
     ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBox1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.checkBox1)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).BeginInit();
     this.groupBox1.SuspendLayout();
     this.groupBox3.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.zoomFactorText)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.borderThickness)).BeginInit();
     ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).BeginInit();
     this.groupBox2.SuspendLayout();
     this.panel2.SuspendLayout();
     this.SuspendLayout();
     //
     // trackBar1
     //
     this.trackBar1.Anchor        = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.trackBar1.AutoSize      = false;
     this.trackBar1.BackColor     = System.Drawing.Color.White;
     this.trackBar1.Location      = new System.Drawing.Point(22, 112);
     this.trackBar1.Maximum       = 400;
     this.trackBar1.Minimum       = 50;
     this.trackBar1.Name          = "trackBar1";
     this.trackBar1.RightToLeft   = System.Windows.Forms.RightToLeft.No;
     this.trackBar1.Size          = new System.Drawing.Size(195, 28);
     this.trackBar1.TabIndex      = 2;
     this.trackBar1.TickStyle     = System.Windows.Forms.TickStyle.None;
     this.trackBar1.Value         = 100;
     this.trackBar1.ValueChanged += new System.EventHandler(this.trackBar1_ValueChanged);
     //
     // comboBox1
     //
     this.comboBox1.BackColor       = System.Drawing.Color.White;
     this.comboBox1.BeforeTouchSize = new System.Drawing.Size(104, 21);
     this.comboBox1.Font            = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.comboBox1.Items.AddRange(new object[] {
         "50",
         "75",
         "100",
         "150",
         "200",
         "300",
         "400"
     });
     this.comboBox1.ItemsImageIndexes.Add(new Syncfusion.Windows.Forms.Tools.ComboBoxAdv.ImageIndexItem(this.comboBox1, "50"));
     this.comboBox1.ItemsImageIndexes.Add(new Syncfusion.Windows.Forms.Tools.ComboBoxAdv.ImageIndexItem(this.comboBox1, "75"));
     this.comboBox1.ItemsImageIndexes.Add(new Syncfusion.Windows.Forms.Tools.ComboBoxAdv.ImageIndexItem(this.comboBox1, "100"));
     this.comboBox1.ItemsImageIndexes.Add(new Syncfusion.Windows.Forms.Tools.ComboBoxAdv.ImageIndexItem(this.comboBox1, "125"));
     this.comboBox1.Location              = new System.Drawing.Point(113, 40);
     this.comboBox1.Name                  = "comboBox1";
     this.comboBox1.Size                  = new System.Drawing.Size(104, 21);
     this.comboBox1.SelectedValue         = "100";
     this.comboBox1.Text                  = "100";
     this.comboBox1.Style                 = Syncfusion.Windows.Forms.VisualStyle.Metro;
     this.comboBox1.TabIndex              = 1;
     this.comboBox1.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
     //
     // checkBox1
     //
     this.checkBox1.BeforeTouchSize    = new System.Drawing.Size(115, 24);
     this.checkBox1.Checked            = true;
     this.checkBox1.CheckState         = System.Windows.Forms.CheckState.Checked;
     this.checkBox1.Font               = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.checkBox1.ForeColor          = System.Drawing.Color.Black;
     this.checkBox1.Location           = new System.Drawing.Point(27, 28);
     this.checkBox1.MetroColor         = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
     this.checkBox1.Name               = "checkBox1";
     this.checkBox1.Size               = new System.Drawing.Size(115, 24);
     this.checkBox1.Style              = Syncfusion.Windows.Forms.Tools.CheckBoxAdvStyle.Metro;
     this.checkBox1.DrawFocusRectangle = true;
     this.checkBox1.TabIndex           = 4;
     this.checkBox1.Text               = "Zoom Cell";
     this.checkBox1.ThemesEnabled      = false;
     this.checkBox1.CheckStateChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
     //
     // gridGroupingControl1
     //
     this.gridGroupingControl1.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.gridGroupingControl1.BackColor                        = System.Drawing.SystemColors.Window;
     this.gridGroupingControl1.Font                             = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.gridGroupingControl1.FreezeCaption                    = false;
     this.gridGroupingControl1.GridOfficeScrollBars             = Syncfusion.Windows.Forms.OfficeScrollBars.Office2010;
     this.gridGroupingControl1.Location                         = new System.Drawing.Point(20, 20);
     this.gridGroupingControl1.Name                             = "gridGroupingControl1";
     this.gridGroupingControl1.Size                             = new System.Drawing.Size(710, 616);
     this.gridGroupingControl1.TabIndex                         = 0;
     this.gridGroupingControl1.Text                             = "gridGroupingControl1";
     this.gridGroupingControl1.ThemesEnabled                    = false;
     this.gridGroupingControl1.TopLevelGroupOptions.ShowCaption = false;
     this.gridGroupingControl1.VersionInfo                      = "10.104.0.44";
     //
     // groupBox1
     //
     this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     this.groupBox1.Controls.Add(this.groupBox3);
     this.groupBox1.Controls.Add(this.groupBox2);
     this.groupBox1.Font     = new System.Drawing.Font("Segoe UI", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.groupBox1.Location = new System.Drawing.Point(752, 20);
     this.groupBox1.Name     = "groupBox1";
     this.groupBox1.Size     = new System.Drawing.Size(243, 570);
     this.groupBox1.TabIndex = 17;
     this.groupBox1.TabStop  = false;
     this.groupBox1.Text     = "Zooming Options";
     //
     // groupBox3
     //
     this.groupBox3.Controls.Add(this.radioButton2);
     this.groupBox3.Controls.Add(this.radioButton1);
     this.groupBox3.Controls.Add(this.zoomFactorText);
     this.groupBox3.Controls.Add(this.label2);
     this.groupBox3.Controls.Add(this.colorPickerButton1);
     this.groupBox3.Controls.Add(this.borderThickness);
     this.groupBox3.Controls.Add(this.label1);
     this.groupBox3.Controls.Add(this.zoomDisplaySize);
     this.groupBox3.Controls.Add(this.trackBar2);
     this.groupBox3.Controls.Add(this.zoomSize);
     this.groupBox3.Controls.Add(this.checkBox1);
     this.groupBox3.Location = new System.Drawing.Point(9, 193);
     this.groupBox3.Name     = "groupBox3";
     this.groupBox3.Size     = new System.Drawing.Size(223, 371);
     this.groupBox3.TabIndex = 3;
     this.groupBox3.TabStop  = false;
     this.groupBox3.Text     = "Cell Level";
     //
     // zoomFactorText
     //
     this.zoomFactorText.Location            = new System.Drawing.Point(158, 243);
     this.zoomFactorText.Name                = "zoomFactorText";
     this.zoomFactorText.NumberDecimalDigits = 1;
     this.zoomFactorText.Size                = new System.Drawing.Size(53, 29);
     this.zoomFactorText.TabIndex            = 8;
     this.zoomFactorText.DoubleValue         = 1.5D;
     this.zoomFactorText.TextChanged        += new System.EventHandler(this.zoomFactorText_TextChanged);
     //
     // label2
     //
     this.label2.AutoSize = true;
     this.label2.Location = new System.Drawing.Point(23, 246);
     this.label2.Name     = "label2";
     this.label2.Size     = new System.Drawing.Size(101, 21);
     this.label2.TabIndex = 22;
     this.label2.Text     = "Zoom Factor:";
     //
     // colorPickerButton1
     //
     this.colorPickerButton1.Appearance                 = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.colorPickerButton1.BeforeTouchSize            = new System.Drawing.Size(119, 24);
     this.colorPickerButton1.ColorUISize                = new System.Drawing.Size(208, 230);
     this.colorPickerButton1.FlatAppearance.BorderColor = System.Drawing.Color.Black;
     this.colorPickerButton1.FlatStyle               = System.Windows.Forms.FlatStyle.Flat;
     this.colorPickerButton1.Font                    = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.colorPickerButton1.ForeColor               = System.Drawing.Color.Black;
     this.colorPickerButton1.IsBackStageButton       = false;
     this.colorPickerButton1.Location                = new System.Drawing.Point(46, 331);
     this.colorPickerButton1.Name                    = "colorPickerButton1";
     this.colorPickerButton1.SelectedAsBackcolor     = true;
     this.colorPickerButton1.Size                    = new System.Drawing.Size(119, 24);
     this.colorPickerButton1.TabIndex                = 10;
     this.colorPickerButton1.Text                    = "Border Color";
     this.colorPickerButton1.UseVisualStyleBackColor = false;
     this.colorPickerButton1.ColorSelected          += new System.EventHandler(this.colorPickerButton1_ColorSelected);
     //
     // borderThickness
     //
     this.borderThickness.Location     = new System.Drawing.Point(158, 283);
     this.borderThickness.Name         = "borderThickness";
     this.borderThickness.Size         = new System.Drawing.Size(53, 29);
     this.borderThickness.TabIndex     = 9;
     this.borderThickness.Text         = "15";
     this.borderThickness.TextChanged += new System.EventHandler(this.borderThickness_TextChanged);
     //
     // label1
     //
     this.label1.AutoSize = true;
     this.label1.Location = new System.Drawing.Point(23, 286);
     this.label1.Name     = "label1";
     this.label1.Size     = new System.Drawing.Size(131, 21);
     this.label1.TabIndex = 20;
     this.label1.Text     = "Border Thickness:";
     //
     // zoomDisplaySize
     //
     this.zoomDisplaySize.AutoSize = true;
     this.zoomDisplaySize.Location = new System.Drawing.Point(66, 205);
     this.zoomDisplaySize.Name     = "zoomDisplaySize";
     this.zoomDisplaySize.Size     = new System.Drawing.Size(85, 21);
     this.zoomDisplaySize.TabIndex = 19;
     this.zoomDisplaySize.Text     = "( 150,150 )";
     //
     // trackBar2
     //
     this.trackBar2.Anchor        = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
     this.trackBar2.AutoSize      = false;
     this.trackBar2.BackColor     = System.Drawing.Color.White;
     this.trackBar2.LargeChange   = 50;
     this.trackBar2.Location      = new System.Drawing.Point(16, 170);
     this.trackBar2.Maximum       = 400;
     this.trackBar2.Minimum       = 100;
     this.trackBar2.Name          = "trackBar2";
     this.trackBar2.RightToLeft   = System.Windows.Forms.RightToLeft.No;
     this.trackBar2.Size          = new System.Drawing.Size(195, 28);
     this.trackBar2.SmallChange   = 50;
     this.trackBar2.TabIndex      = 7;
     this.trackBar2.TickStyle     = System.Windows.Forms.TickStyle.None;
     this.trackBar2.Value         = 150;
     this.trackBar2.ValueChanged += new System.EventHandler(this.trackBar2_ValueChanged);
     //
     // zoomSize
     //
     this.zoomSize.AutoSize = true;
     this.zoomSize.Location = new System.Drawing.Point(12, 135);
     this.zoomSize.Name     = "zoomSize";
     this.zoomSize.Size     = new System.Drawing.Size(86, 21);
     this.zoomSize.TabIndex = 17;
     this.zoomSize.Text     = "Zoom Size:";
     //
     // groupBox2
     //
     this.groupBox2.Controls.Add(this.label4);
     this.groupBox2.Controls.Add(this.label3);
     this.groupBox2.Controls.Add(this.comboBox1);
     this.groupBox2.Controls.Add(this.trackBar1);
     this.groupBox2.Location = new System.Drawing.Point(9, 39);
     this.groupBox2.Name     = "groupBox2";
     this.groupBox2.Size     = new System.Drawing.Size(226, 148);
     this.groupBox2.TabIndex = 1;
     this.groupBox2.TabStop  = false;
     this.groupBox2.Text     = "Grid Level";
     //
     // label4
     //
     this.label4.AutoSize = true;
     this.label4.Location = new System.Drawing.Point(12, 76);
     this.label4.Name     = "label4";
     this.label4.Size     = new System.Drawing.Size(130, 21);
     this.label4.TabIndex = 16;
     this.label4.Text     = "Zoom Frequency:";
     //
     // label3
     //
     this.label3.AutoSize = true;
     this.label3.Location = new System.Drawing.Point(12, 40);
     this.label3.Name     = "label3";
     this.label3.Size     = new System.Drawing.Size(91, 21);
     this.label3.TabIndex = 15;
     this.label3.Text     = "Zoom Level";
     //
     // panel2
     //
     this.panel2.BackColor = System.Drawing.Color.White;
     this.panel2.Controls.Add(this.groupBox1);
     this.panel2.Controls.Add(this.gridGroupingControl1);
     this.panel2.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.panel2.Location = new System.Drawing.Point(0, 0);
     this.panel2.Margin   = new System.Windows.Forms.Padding(0);
     this.panel2.Name     = "panel2";
     this.panel2.Size     = new System.Drawing.Size(1012, 654);
     this.panel2.TabIndex = 19;
     //
     // tipDesc
     //
     this.tipDesc.BackColor       = System.Drawing.Color.White;
     this.tipDesc.IsBalloon       = true;
     this.tipDesc.OwnerDraw       = true;
     this.tipDesc.ShowAlways      = true;
     this.tipDesc.StripAmpersands = true;
     this.tipDesc.UseFading       = false;
     //
     // radioButton1
     //
     this.radioButton1.AutoSize = true;
     this.radioButton1.Checked  = true;
     this.radioButton1.Location = new System.Drawing.Point(46, 59);
     this.radioButton1.Name     = "radioButton1";
     this.radioButton1.Size     = new System.Drawing.Size(116, 25);
     this.radioButton1.TabIndex = 6;
     this.radioButton1.TabStop  = true;
     this.radioButton1.Text     = "Ellipse Mode";
     this.radioButton1.UseVisualStyleBackColor = true;
     this.radioButton1.CheckedChanged         += new System.EventHandler(this.mode_Changed);
     //
     // radioButton2
     //
     this.radioButton2.AutoSize = true;
     this.radioButton2.Location = new System.Drawing.Point(46, 90);
     this.radioButton2.Name     = "radioButton2";
     this.radioButton2.Size     = new System.Drawing.Size(140, 25);
     this.radioButton2.TabIndex = 5;
     this.radioButton2.Text     = "Rectangle Mode";
     this.radioButton2.UseVisualStyleBackColor = true;
     this.radioButton2.CheckedChanged         += new System.EventHandler(this.mode_Changed);
     //
     // Form1
     //
     this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     this.ClientSize          = new System.Drawing.Size(1012, 654);
     this.Controls.Add(this.panel2);
     this.MinimumSize = new System.Drawing.Size(800, 500);
     this.Name        = "Form1";
     this.Text        = "Zooming Grid";
     ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.comboBox1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.checkBox1)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.gridGroupingControl1)).EndInit();
     this.groupBox1.ResumeLayout(false);
     this.groupBox3.ResumeLayout(false);
     this.groupBox3.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.zoomFactorText)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.borderThickness)).EndInit();
     ((System.ComponentModel.ISupportInitialize)(this.trackBar2)).EndInit();
     this.groupBox2.ResumeLayout(false);
     this.groupBox2.PerformLayout();
     this.panel2.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 9
0
 /// <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(Form1));
     this.htmluiControl1  = new Syncfusion.Windows.Forms.HTMLUI.HTMLUIControl();
     this.panel1          = new System.Windows.Forms.Panel();
     this.panel3          = new System.Windows.Forms.Panel();
     this.button1         = new Syncfusion.Windows.Forms.ButtonAdv();
     this.button2         = new Syncfusion.Windows.Forms.ButtonAdv();
     this.button3         = new Syncfusion.Windows.Forms.ButtonAdv();
     this.panel2          = new System.Windows.Forms.Panel();
     this.textBox1        = new IntegerTextBox();
     this.label2          = new System.Windows.Forms.Label();
     this.label1          = new System.Windows.Forms.Label();
     this.scrollersFrame1 = new Syncfusion.Windows.Forms.ScrollersFrame(this.components);
     this.gradientPanel1  = new Syncfusion.Windows.Forms.Tools.GradientPanel();
     ((System.ComponentModel.ISupportInitialize)(this.htmluiControl1)).BeginInit();
     this.panel1.SuspendLayout();
     this.panel3.SuspendLayout();
     this.panel2.SuspendLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).BeginInit();
     this.gradientPanel1.SuspendLayout();
     this.SuspendLayout();
     //
     // htmluiControl1
     //
     this.htmluiControl1.AutoRunScripts                = true;
     this.htmluiControl1.AutoScroll                    = true;
     this.htmluiControl1.AutoScrollMinSize             = new System.Drawing.Size(361, 337);
     this.htmluiControl1.BackColor                     = System.Drawing.Color.White;
     this.htmluiControl1.DefaultFormat.BackgroundColor = System.Drawing.SystemColors.Control;
     this.htmluiControl1.DefaultFormat.ForeColor       = System.Drawing.SystemColors.ControlText;
     this.htmluiControl1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.htmluiControl1.Location = new System.Drawing.Point(0, 0);
     this.htmluiControl1.Name     = "htmluiControl1";
     this.htmluiControl1.Size     = new System.Drawing.Size(378, 352);
     this.htmluiControl1.TabIndex = 0;
     this.htmluiControl1.Text     = "htmluiControl1";
     //
     // panel1
     //
     this.panel1.BackColor   = System.Drawing.Color.White;
     this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.panel1.Controls.Add(this.panel3);
     this.panel1.Controls.Add(this.panel2);
     this.panel1.Dock     = System.Windows.Forms.DockStyle.Left;
     this.panel1.Location = new System.Drawing.Point(10, 10);
     this.panel1.Name     = "panel1";
     this.panel1.Size     = new System.Drawing.Size(152, 354);
     this.panel1.TabIndex = 1;
     //
     // panel3
     //
     this.panel3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.panel3.BackColor = System.Drawing.Color.White;
     this.panel3.Controls.Add(this.button1);
     this.panel3.Controls.Add(this.button2);
     this.panel3.Controls.Add(this.button3);
     this.panel3.Location = new System.Drawing.Point(8, 144);
     this.panel3.Name     = "panel3";
     this.panel3.Size     = new System.Drawing.Size(126, 128);
     this.panel3.TabIndex = 6;
     //
     // button1
     //
     this.button1.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.button1.BackColor  = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
     this.button1.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.button1.Font       = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button1.ForeColor  = System.Drawing.Color.Black;
     this.button1.Location   = new System.Drawing.Point(16, 17);
     this.button1.Name       = "button1";
     this.button1.Size       = new System.Drawing.Size(96, 24);
     this.button1.TabIndex   = 4;
     this.button1.Text       = "Start";
     this.button1.Click     += new System.EventHandler(this.button1_Click);
     //
     // button2
     //
     this.button2.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.button2.BackColor  = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
     this.button2.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.button2.Font       = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button2.ForeColor  = System.Drawing.Color.Black;
     this.button2.Location   = new System.Drawing.Point(16, 50);
     this.button2.Name       = "button2";
     this.button2.Size       = new System.Drawing.Size(96, 24);
     this.button2.TabIndex   = 5;
     this.button2.Text       = "Stop";
     this.button2.Click     += new System.EventHandler(this.button2_Click);
     //
     // button3
     //
     this.button3.Appearance = Syncfusion.Windows.Forms.ButtonAppearance.Metro;
     this.button3.BackColor  = System.Drawing.Color.FromArgb(((int)(((byte)(17)))), ((int)(((byte)(158)))), ((int)(((byte)(218)))));
     this.button3.FlatStyle  = System.Windows.Forms.FlatStyle.Flat;
     this.button3.Font       = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.button3.ForeColor  = System.Drawing.Color.Black;
     this.button3.Location   = new System.Drawing.Point(16, 86);
     this.button3.Name       = "button3";
     this.button3.Size       = new System.Drawing.Size(96, 24);
     this.button3.TabIndex   = 6;
     this.button3.Text       = "Reset";
     this.button3.Click     += new System.EventHandler(this.button3_Click);
     //
     // panel2
     //
     this.panel2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
                                                                | System.Windows.Forms.AnchorStyles.Right)));
     this.panel2.BackColor = System.Drawing.Color.White;
     this.panel2.Controls.Add(this.textBox1);
     this.panel2.Controls.Add(this.label2);
     this.panel2.Controls.Add(this.label1);
     this.panel2.Location = new System.Drawing.Point(8, 24);
     this.panel2.Name     = "panel2";
     this.panel2.Size     = new System.Drawing.Size(126, 88);
     this.panel2.TabIndex = 5;
     //
     // textBox1
     //
     this.textBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.textBox1.ForeColor   = System.Drawing.Color.Black;
     this.textBox1.Location    = new System.Drawing.Point(8, 61);
     this.textBox1.Name        = "textBox1";
     this.textBox1.Size        = new System.Drawing.Size(48, 20);
     this.textBox1.TabIndex    = 10;
     this.textBox1.Text        = "1";
     this.textBox1.TextAlign   = System.Windows.Forms.HorizontalAlignment.Center;
     //
     // label2
     //
     this.label2.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.label2.Font      = new System.Drawing.Font("Tahoma", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label2.ForeColor = System.Drawing.Color.Black;
     this.label2.Location  = new System.Drawing.Point(64, 61);
     this.label2.Name      = "label2";
     this.label2.Size      = new System.Drawing.Size(56, 16);
     this.label2.TabIndex  = 9;
     this.label2.Text      = "second(s)";
     //
     // label1
     //
     this.label1.FlatStyle = System.Windows.Forms.FlatStyle.System;
     this.label1.Font      = new System.Drawing.Font("Arial", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.label1.ForeColor = System.Drawing.Color.Black;
     this.label1.Location  = new System.Drawing.Point(8, 13);
     this.label1.Name      = "label1";
     this.label1.Size      = new System.Drawing.Size(112, 32);
     this.label1.TabIndex  = 8;
     this.label1.Text      = "Set the time delay for the slide show";
     //
     // scrollersFrame1
     //
     this.scrollersFrame1.AttachedTo            = this.htmluiControl1;
     this.scrollersFrame1.CustomRender          = null;
     this.scrollersFrame1.MetroColorScheme      = Syncfusion.Windows.Forms.MetroColorScheme.Managed;
     this.scrollersFrame1.SizeGripperVisibility = Syncfusion.Windows.Forms.SizeGripperVisibility.Auto;
     this.scrollersFrame1.VisualStyle           = Syncfusion.Windows.Forms.ScrollBarCustomDrawStyles.Metro;
     //
     // gradientPanel1
     //
     this.gradientPanel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
     this.gradientPanel1.Controls.Add(this.htmluiControl1);
     this.gradientPanel1.Dock     = System.Windows.Forms.DockStyle.Fill;
     this.gradientPanel1.Location = new System.Drawing.Point(162, 10);
     this.gradientPanel1.Name     = "gradientPanel1";
     this.gradientPanel1.Size     = new System.Drawing.Size(380, 354);
     this.gradientPanel1.TabIndex = 2;
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.BorderColor       = System.Drawing.Color.FromArgb(((int)(((byte)(27)))), ((int)(((byte)(161)))), ((int)(((byte)(226)))));
     this.CaptionAlign      = System.Windows.Forms.HorizontalAlignment.Center;
     this.ClientSize        = new System.Drawing.Size(609, 398);
     this.Controls.Add(this.gradientPanel1);
     this.Controls.Add(this.panel1);
     this.DropShadow       = true;
     this.Font             = new System.Drawing.Font("Segoe UI", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
     this.Icon             = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
     this.IconAlign        = System.Windows.Forms.HorizontalAlignment.Left;
     this.IconTextRelation = System.Windows.Forms.LeftRightAlignment.Left;
     this.MetroColor       = System.Drawing.Color.White;
     this.MinimumSize      = new System.Drawing.Size(621, 434);
     this.Name             = "Form1";
     this.Padding          = new System.Windows.Forms.Padding(10);
     this.StartPosition    = System.Windows.Forms.FormStartPosition.CenterScreen;
     this.Text             = "Slide Show";
     this.WindowState      = System.Windows.Forms.FormWindowState.Maximized;
     this.Load            += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.htmluiControl1)).EndInit();
     this.panel1.ResumeLayout(false);
     this.panel3.ResumeLayout(false);
     this.panel2.ResumeLayout(false);
     this.panel2.PerformLayout();
     ((System.ComponentModel.ISupportInitialize)(this.gradientPanel1)).EndInit();
     this.gradientPanel1.ResumeLayout(false);
     this.ResumeLayout(false);
 }
Ejemplo n.º 10
0
        public CoursePanel(Course course)
        {
            CheckBox enabledCheckBox = new CheckBox();
            ComboBox groupComboBox = course.HasGroups ? new ComboBox() : null;
            ComboBox levelComboBox = course.HasLevels ? new ComboBox() : null;
            IntegerTextBox scoreTextBox = new IntegerTextBox();
            CoursePanel panel = new CoursePanel(course, enabledCheckBox, groupComboBox, levelComboBox, scoreTextBox);

            panel.SuspendLayout();
            panel.Location = new Point(3, 3);
            panel.Size = new Size(346, 27);

            enabledCheckBox.AutoSize = true;
            enabledCheckBox.Location = new Point(3, 3);
            enabledCheckBox.TabStop = false;
            enabledCheckBox.UseVisualStyleBackColor = true;
            panel.Controls.Add(enabledCheckBox);

            if (groupComboBox != null)
            {
                groupComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                groupComboBox.Location = new Point(106, 3);
                groupComboBox.Size = new Size(100, 21);
                groupComboBox.TabStop = false;
                panel.Controls.Add(groupComboBox);
            }

            if (levelComboBox != null)
            {
                levelComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                levelComboBox.Location = new Point(212, 3);
                levelComboBox.Size = new Size(100, 21);
                levelComboBox.TabStop = false;
                panel.Controls.Add(levelComboBox);
            }

            scoreTextBox.Location = new Point(318, 3);
            scoreTextBox.Size = new Size(25, 20);
            scoreTextBox.TabStop = true;
            scoreTextBox.TextAlign = HorizontalAlignment.Center;
            scoreTextBox.AutoClear = true;
            scoreTextBox.MinValue = 0;
            scoreTextBox.MaxValue = 100;
            panel.Controls.Add(scoreTextBox);

            panel.ResumeLayout(false);
            panel.PerformLayout();

            _course = new CourseWrapper(course);
            _nameControl = enabledCheckBox;
            _groupComboBox = groupComboBox;
            _levelComboBox = levelComboBox;
            _scoreTextBox = scoreTextBox;

            // ReSharper disable once CoVariantArrayConversion
            if (course.HasGroups) _groupComboBox.Items.AddRange(_course.Groups);

            enabledCheckBox.CheckedChanged += OnEnabledUpdated;
            if (groupComboBox != null) groupComboBox.SelectedIndexChanged += OnGroupUpdated;
            if (levelComboBox != null) levelComboBox.SelectedIndexChanged += OnLevelUpdated;
            scoreTextBox.TextChanged += OnScoreUpdated;

            //Now we can load the dataz!
            _suppressUpdate = true;

            enabledCheckBox.Checked = _course.Enabled;
            scoreTextBox.Text = _course.Score.ToString();

            if (groupComboBox != null)
            {
                if (_course.SelectedGroup == null)
                {
                    //Default to first group if there is no group selected 
                    //and there are groups available
                    _course.SelectedGroup = _course.Groups[0];
                }
                groupComboBox.SelectedItem = _course.SelectedGroup;
            }
            else if (levelComboBox != null)
            {
                _course.SelectedGroup = _course.Groups[0];
            }

            if (levelComboBox != null)
            {
                _levelComboBox.Items.Clear();
                // ReSharper disable once CoVariantArrayConversion
                _levelComboBox.Items.AddRange(_course.SelectedGroup.Levels);
                if (_course.SelectedLevel == null)
                {
                    _course.SelectedLevel = _course.SelectedGroup.Levels[0];
                }
                levelComboBox.SelectedItem = _course.SelectedLevel;
            }

            _suppressUpdate = false;
        }
Ejemplo n.º 11
0
        public CoursePanel(Course course)
        {
            CheckBox       enabledCheckBox = new CheckBox();
            ComboBox       groupComboBox   = course.HasGroups ? new ComboBox() : null;
            ComboBox       levelComboBox   = course.HasLevels ? new ComboBox() : null;
            IntegerTextBox scoreTextBox    = new IntegerTextBox();
            CoursePanel    panel           = new CoursePanel(course, enabledCheckBox, groupComboBox, levelComboBox, scoreTextBox);

            panel.SuspendLayout();
            panel.Location = new Point(3, 3);
            panel.Size     = new Size(346, 27);

            enabledCheckBox.AutoSize = true;
            enabledCheckBox.Location = new Point(3, 3);
            enabledCheckBox.TabStop  = false;
            enabledCheckBox.UseVisualStyleBackColor = true;
            panel.Controls.Add(enabledCheckBox);

            if (groupComboBox != null)
            {
                groupComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                groupComboBox.Location      = new Point(106, 3);
                groupComboBox.Size          = new Size(100, 21);
                groupComboBox.TabStop       = false;
                panel.Controls.Add(groupComboBox);
            }

            if (levelComboBox != null)
            {
                levelComboBox.DropDownStyle = ComboBoxStyle.DropDownList;
                levelComboBox.Location      = new Point(212, 3);
                levelComboBox.Size          = new Size(100, 21);
                levelComboBox.TabStop       = false;
                panel.Controls.Add(levelComboBox);
            }

            scoreTextBox.Location  = new Point(318, 3);
            scoreTextBox.Size      = new Size(25, 20);
            scoreTextBox.TabStop   = true;
            scoreTextBox.TextAlign = HorizontalAlignment.Center;
            scoreTextBox.AutoClear = true;
            scoreTextBox.MinValue  = 0;
            scoreTextBox.MaxValue  = 100;
            panel.Controls.Add(scoreTextBox);

            panel.ResumeLayout(false);
            panel.PerformLayout();

            _course        = new CourseWrapper(course);
            _nameControl   = enabledCheckBox;
            _groupComboBox = groupComboBox;
            _levelComboBox = levelComboBox;
            _scoreTextBox  = scoreTextBox;

            // ReSharper disable once CoVariantArrayConversion
            if (course.HasGroups)
            {
                _groupComboBox.Items.AddRange(_course.Groups);
            }

            enabledCheckBox.CheckedChanged += OnEnabledUpdated;
            if (groupComboBox != null)
            {
                groupComboBox.SelectedIndexChanged += OnGroupUpdated;
            }
            if (levelComboBox != null)
            {
                levelComboBox.SelectedIndexChanged += OnLevelUpdated;
            }
            scoreTextBox.TextChanged += OnScoreUpdated;

            //Now we can load the dataz!
            _suppressUpdate = true;

            enabledCheckBox.Checked = _course.Enabled;
            scoreTextBox.Text       = _course.Score.ToString();

            if (groupComboBox != null)
            {
                if (_course.SelectedGroup == null)
                {
                    //Default to first group if there is no group selected
                    //and there are groups available
                    _course.SelectedGroup = _course.Groups[0];
                }
                groupComboBox.SelectedItem = _course.SelectedGroup;
            }
            else if (levelComboBox != null)
            {
                _course.SelectedGroup = _course.Groups[0];
            }

            if (levelComboBox != null)
            {
                _levelComboBox.Items.Clear();
                // ReSharper disable once CoVariantArrayConversion
                _levelComboBox.Items.AddRange(_course.SelectedGroup.Levels);
                if (_course.SelectedLevel == null)
                {
                    _course.SelectedLevel = _course.SelectedGroup.Levels[0];
                }
                levelComboBox.SelectedItem = _course.SelectedLevel;
            }

            _suppressUpdate = false;
        }
Ejemplo n.º 12
0
        //public ICommand ToggleAllCommand
        //{
        //    get { return _toggleAll ?? (_toggleAll = new RelayCommand(p => { ToggleAllCollectors(); })); }
        //}

        //public void ToggleAllCollectors()
        //{
        //    _toggleCollectors = !_toggleCollectors;
        //    foreach (CheckBox cb in _collectorCheckBoxes)
        //    {
        //        cb.IsChecked = _toggleCollectors;

        //        CollectorInfo ci = cb.Tag as CollectorInfo;
        //        if(ci != null)
        //            ci.isEnabled = _toggleCollectors;
        //    }

        //    foreach (TextBox tb in _collectorTextBoxes)
        //        tb.IsEnabled = _toggleCollectors;
        //}

        public CollectorsUserControl Initialize(DeviceInfo di)
        {
            // The system device shouldn't have the ability to choose any drives
            if (di.type == EDeviceType.System)
            {
                MonitoredDrives.Visibility = Visibility.Collapsed;
            }

            /*
             * foreach (var i in collector_infos)
             * {
             *  CollectorInfos.Add(i);
             * }
             */
            var row_id = 1;

            foreach (var info in di.collectors)
            {
                if (info.SkipConfiguration)
                {
                    continue;
                }

                try
                {
                    var row = new RowDefinition {
                        Height = new GridLength(0, GridUnitType.Auto)
                    };

                    var enabled = new CheckBox
                    {
                        IsChecked           = info.isEnabled,
                        HorizontalAlignment = HorizontalAlignment.Center,
                        VerticalAlignment   = VerticalAlignment.Center,
                        Tag = info
                    };
                    enabled.Click += OnEnabledClick;
                    Grid.SetRow(enabled, row_id);
                    Grid.SetColumn(enabled, 0);

                    var namestr = info.collectorType.CollectorName();
                    var name    = new Label
                    {
                        Content             = namestr,
                        HorizontalAlignment = HorizontalAlignment.Right,
                        VerticalAlignment   = VerticalAlignment.Center
                    };
                    Grid.SetRow(name, row_id);
                    Grid.SetColumn(name, 1);

                    var frequency = new IntegerTextBox
                    {
                        Text                = info.frequencyInMinutes.ToString(),
                        MinWidth            = 100,
                        HorizontalAlignment = HorizontalAlignment.Left,
                        VerticalAlignment   = VerticalAlignment.Center,
                        Tag = info
                    };
                    frequency.TextChanged += OnFrequencyChanged;
                    Grid.SetRow(frequency, row_id);
                    Grid.SetColumn(frequency, 2);

                    // Do all these at the bottom so if an exception was thrown
                    // in the middle someplace things won't be so confused.
                    _collectorCheckBoxes.Add(enabled);
                    _collectorTextBoxes.Add(frequency);
                    collectorsGrid.RowDefinitions.Add(row);
                    collectorsGrid.Children.Add(enabled);
                    collectorsGrid.Children.Add(name);
                    collectorsGrid.Children.Add(frequency);

                    ++row_id;
                }
                catch (Exception e)
                {
                    MessageBox.Show(e.Message, "CollectorsUserControl.Initialize", MessageBoxButton.OK, MessageBoxImage.Error);
                }
            }

            DataContext = di;
            UpdateDriveList();

            return(this);
        }