Example #1
0
 private void CGFX_Layout(object sender, LayoutEventArgs e)
 {
     if (ModViewer != null)
     {
         ModViewer.Render();
     }
 }
        private void ValidateForm_Layout(object sender, LayoutEventArgs e)
        {
            switch (activeState)
            {
                case "InputFile":
                    xslRadioButton.Enabled = false;
                    break;
                case "XsdFile":
                    xslRadioButton.Enabled = false;
                    againstXSDRadioButton.Enabled = false;
                    break;
            }

            switch (selectedValidationType)
            {
                case "XSL":
                    xslRadioButton.Checked = true;
                    break;
                case "XSD":
                    againstXSDRadioButton.Checked = true;
                    break;
                default:
                    xmlRadioButton.Checked = true;
                    selectedValidationType = "Xml";
                    break;
            }
        }
Example #3
0
      protected override void OnLayout(LayoutEventArgs levent)
      {
        try
        {
          DataGridCell currentCell = Grid.CurrentCell;

          if (currentCell.ColumnNumber == Cell)
          {
            DataTable ds = Grid.DataSource as DataTable;
            if (ds != null)
            {
              foreach (string item in Items)
              {
                if (currentCell.RowNumber < ds.Rows.Count)
                {
                  DataRow row = ds.Rows[currentCell.RowNumber];
                  string currentValue = (string)row.ItemArray[Cell];
                  if (currentValue == item)
                  {
                    SelectedItem = item;
                    break;
                  }
                }
              }
            }
          }
          base.OnLayout(levent);
        }
        catch (Exception) {}
      }
Example #4
0
        private void InfoForm_Layout(object sender, LayoutEventArgs e)
        {
            textBoxInfo.Location = new Point(2, 2);
            textBoxInfo.Size = new Size(ClientRectangle.Width - 4, ClientRectangle.Height - buttonOK.Size.Height*2);
            buttonOK.Location = new Point(ClientRectangle.Width - 100, ClientRectangle.Height - buttonOK.Size.Height*3/2);

        }
Example #5
0
 private void VKAuth_Layout(object sender, LayoutEventArgs e)
 {
     webBrowser1.Url = new System.Uri(
         "https://oauth.vk.com/authorize?client_id=5159394&display=page&redirect_uri=https://oauth.vk.com/blank.html&scope=friends&response_type=token&v=5.40&scope="
         + Settings.VKscope, System.UriKind.Absolute
     );
 }
Example #6
0
 private void AddressTextBox_Layout(object sender, LayoutEventArgs e)
 {
     comboBoxHistory.Parent = this.Parent;
     comboBoxHistory.Location = this.Location;
     comboBoxHistory.Width = this.Width;
     comboBoxHistory.DropDownWidth = comboBoxHistory.Width + 15;
 }
Example #7
0
        void MarathonLayout(object sender, LayoutEventArgs e)
        {
            scorePanel.SetBounds(5, 5, Width - 10, 40);

            questionPanel.SetBounds(5, 50, (Width - 10) / 2, Height - 50);
            gamePanel.SetBounds((Width / 2)+5, 50, (Width / 2) -10, Height-100);
        }
 protected override void OnLayout(LayoutEventArgs e)
 {
     if ((this.ParentToolStrip != null) && this.ParentToolStrip.IsInDesignMode)
     {
         if (FlowLayout.GetFlowDirection(this) != FlowDirection.TopDown)
         {
             FlowLayout.SetFlowDirection(this, FlowDirection.TopDown);
         }
         if (FlowLayout.GetWrapContents(this))
         {
             FlowLayout.SetWrapContents(this, false);
         }
     }
     else
     {
         if (FlowLayout.GetFlowDirection(this) != FlowDirection.LeftToRight)
         {
             FlowLayout.SetFlowDirection(this, FlowDirection.LeftToRight);
         }
         if (!FlowLayout.GetWrapContents(this))
         {
             FlowLayout.SetWrapContents(this, true);
         }
     }
     base.OnLayout(e);
 }
        /// <summary>
        /// 布局
        /// </summary>
        /// <param name="container">容器</param>
        /// <param name="layoutEventArgs">Layout事件数据</param>
        /// <returns>是否成功 true-是 false-否</returns>
        public override bool Layout(object container, LayoutEventArgs layoutEventArgs)
        {
            Control parent = container as Control;

            Rectangle parentClientRectangle = parent.ClientRectangle;
            Point nextControlLocation = parentClientRectangle.Location;
            int parentWidth = parentClientRectangle.Width;

            foreach (Control c in parent.Controls)
            {
                if (!c.Visible)
                {
                    continue;
                }

                nextControlLocation.Offset(c.Margin.Left, 0);

                c.Location = nextControlLocation;

                if (c.Location.X + c.Width * 2 > parentWidth)
                {
                    nextControlLocation.X = parentClientRectangle.X;
                    nextControlLocation.Y += c.Height;
                }
                else
                {
                    nextControlLocation.X += c.Width;
                }
            }

            return false;
        }
Example #10
0
 private void Form1_Layout(object sender, LayoutEventArgs e)
 {
     Rect = ClientRectangle;
     Rect.Inflate(-10, -10);
     StrSize = string.Format("폭 = {0}, 높이 = {1}", Rect.Width, Rect.Height);
     Invalidate();
 }
Example #11
0
        protected override void OnLayout(LayoutEventArgs e)
        {
            int offset = AutoScrollPosition.Y;

            foreach (Control control in Controls)
            {
                var size = control.GetPreferredSize(new Size(ClientSize.Width, int.MaxValue));

                control.SetBounds(
                    0,
                    offset,
                    ClientSize.Width,
                    size.Height
                );

                offset += size.Height;
            }

            bool vScroll = VScroll;

            AdjustFormScrollbars(AutoScroll);

            if (vScroll != VScroll)
                BeginInvoke(new Action(PerformLayout));
        }
        protected override void OnLayout(LayoutEventArgs levent)
        {
            base.OnLayout(levent);

            // calculate the rectangle we will paint within
            _controlRectangle = new Rectangle(0, 1, Width, Height - 1);

            // calculate the image rectanagle (if we have an image)
            _imageRectangle = Rectangle.Empty;
            if (_image != null)
            {
                int IMAGE_TOP_OFFSET = 3;
                int IMAGE_LEFT_OFFSET = 2;
                _imageRectangle = new Rectangle(IMAGE_LEFT_OFFSET, IMAGE_TOP_OFFSET, _image.Width, _image.Height);
            }

            //calculate the text rectangle
            int TEXT_TOP_OFFSET = 4;
            int TEXT_LEFT_MARGIN = 2;
            int TEXT_LEFT_OFFSET = _imageRectangle.Right + TEXT_LEFT_MARGIN;

            _textRectangle = new Rectangle(TEXT_LEFT_OFFSET, TEXT_TOP_OFFSET, _controlRectangle.Width - TEXT_LEFT_OFFSET, _controlRectangle.Height - TEXT_TOP_OFFSET);

            // make sure the control is repainted
            Invalidate();
        }
Example #13
0
File: Pane.cs Project: rsdn/janus
		/// <summary>
		/// See <see cref="Control.OnLayout"/>
		/// </summary>
		protected override void OnLayout(LayoutEventArgs e)
		{
			base.OnLayout(e);
			_caption.Width = Width - 2;
			Padding = new Padding(1, _caption.Height + 2, 1, 1);
			_caption.Top = 1;
		}
Example #14
0
 private void SettingsLayout_Layout(object sender, LayoutEventArgs e)
 {
     foreach (UserControl ctrl in SettingsLayout.Controls)
     {
         ctrl.Width = SettingsLayout.Width - 25;
     }
 }
 protected override void OnLayout(LayoutEventArgs levent)
 {
     labelControl.Location = new Point(WIDTH_PADDING, 8);
     labelControl.Width = Width - WIDTH_PADDING * 2;
     labelControl.Height = Height;
     base.OnLayout(levent);
 }
Example #16
0
 private void FolderBrowser_Layout(object sender, LayoutEventArgs e)
 {
     textBoxFolderPath.Left = labelCaption.Right;
     buttonBrowse.Left = this.Width - buttonBrowse.Width - 2;
     int width = buttonBrowse.Left - labelCaption.Right - 2;
     textBoxFolderPath.Width = width > 0 ? width : 0;
 }
		public override bool Layout(object container, LayoutEventArgs layoutEventArgs)
		{
			Panel parent = container as Panel;

			// Use DisplayRectangle so that parent.Padding is honored.
			Rectangle parentDisplayRectangle = parent.DisplayRectangle;
			Point nextControlLocation = parentDisplayRectangle.Location;

			foreach (Control c in parent.Controls)
			{
				// Only apply layout to visible controls.
				if (!c.Visible)
				{
					continue;
				}

				// Respect the margin of the control:
				// shift over the left and the top.
				nextControlLocation.Offset(c.Margin.Left, c.Margin.Top);

				// Set the location of the control.
				c.Location = nextControlLocation;

				// Set the autosized controls to their 
				// autosized heights.
				Size preferredSize;
				if (c.AutoSize)
				{
					preferredSize = c.GetPreferredSize(parentDisplayRectangle.Size);
				}
				else
				{
					preferredSize = c.Size;
				}

				//if (parent.ClientRectangle.Width > preferredSize.Width)
				preferredSize = new Size(parent.ClientRectangle.Width, preferredSize.Height);
				c.Size = preferredSize;

				// Move X back to the display rectangle origin.
				nextControlLocation.X = parentDisplayRectangle.X;

				// Increment Y by the height of the control 
				// and the bottom margin.
				nextControlLocation.Y += c.Height + c.Margin.Bottom;
			}

			if (!parent.AutoScroll)
			{
				parent.Height = nextControlLocation.Y;
			}

			// Optional: Return whether or not the container's 
			// parent should perform layout as a result of this 
			// layout. Some layout engines return the value of 
			// the container's AutoSize property.

			return true;
		}
        private void OnLayout(object sender, LayoutEventArgs e)
        {
            for (int i = 0; i < flpListBox.Controls.Count; i++)
            {
                flpListBox.Controls[i].Width = flpListBox.Size.Width - SystemInformation.VerticalScrollBarWidth;

            }
        }
Example #19
0
        protected override void OnLayout(LayoutEventArgs e)
        {
            base.OnLayout(e);

            int lineHeight = TextRenderer.MeasureText("W", Font).Height;

            _moreInformationLink.Top = (lineHeight + LineSpacing) * _lines.Count + TextPadding.Vertical;
        }
Example #20
0
        protected override void OnLayout(LayoutEventArgs levent)
        {
            textBox.Location = new Point(2, ((Height - 1) / 2) - (textBox.Height / 2));
            textBox.Size = new Size(Width - 4, textBox.Height);
            Refresh();

            base.OnLayout(levent);
        }
        protected override void OnLayout(LayoutEventArgs levent)
        {
            base.OnLayout(levent);

            this.labelStatus.Location = new Point(
                (this.ClientSize.Width - this.labelStatus.Width) / 2,
                (this.ClientSize.Height - this.labelStatus.Height) / 2);
        }
Example #22
0
        protected override void OnLayout(LayoutEventArgs levent)
        {
            base.OnLayout(levent);

            // Repaint when the layout has changed.

            Refresh();
        }
Example #23
0
 protected override void OnLayout(LayoutEventArgs levent)
 {
     base.OnLayout(levent);
     foreach (TabPage tp in this.TabPages)
     {
         tp.BackColor = Color.FromKnownColor(System.Drawing.KnownColor.Control);
     }
 }
Example #24
0
 protected override void OnLayout(LayoutEventArgs levent)
 {
     int num = (this.Font.Height * 150) / 100;
     if (base.Width != num)
     {
         base.Width = num;
     }
     base.OnLayout(levent);
 }
Example #25
0
 protected override void OnLayout(LayoutEventArgs levent)
 {
     if (!DesignMode)
     {
         BackColor = App.CurrentConfig.GetThemeBackColor();
         ForeColor = App.CurrentConfig.ThemeColor;
     }
     base.OnLayout(levent);
 }
Example #26
0
		/// <summary> make Width always match parent Width </summary>
		protected override void OnLayout(LayoutEventArgs levent)
		{
			if (Parent != null && Width != Parent.Width)
			{
				Width = Parent.Width;
			}

			base.OnLayout (levent);
		}
Example #27
0
        protected override void OnLayout(LayoutEventArgs levent) {
            base.OnLayout(levent);
            Rectangle cr = this.ClientRectangle;

            browseButton.SetBounds(cr.Right - browseButton.Width, cr.Y, browseButton.Width, cr.Height);

            int x0 = 0;
            int x1 = browseButton.Left - ControlMargin;
            pathComboBox.SetBounds(x0, (cr.Height - pathComboBox.Height) / 2, x1 - x0, pathComboBox.Height);
        }
Example #28
0
        public void LayoutHandler(object sender, LayoutEventArgs e)
        {
            this.SuspendLayout();
            int lineSzForCalc = 23;

            SortedList lineList = new SortedList();
            foreach(ToolBarDockHolder holder in this.Controls)
            {
                if(holder.Visible)
                {
                    int prefLine = GetPreferredLine(lineSzForCalc, holder);
                    int prefPos = GetPreferredPosition(holder);
                    LineHolder line = (LineHolder)lineList[prefLine];
                    if(line == null)
                    {
                        line = new LineHolder(prefLine);
                        lineList.Add(prefLine, line);
                    }
                    int csize = GetHolderWidth(holder);
                    int lsize = GetHolderLineSize(holder);
                    line.AddColumn(new ColumnHolder(prefPos, holder, csize+1));
                    if(line.Size-1 < lsize)
                        line.Size = lsize+1;
                }
            }

            int pos = 0;
            _lastLineCount = lineList.Count;
            if(_lastLineCount == 0)
                _lastLineCount = 1;
            for(int ndx = 0; ndx < lineList.Count; ndx++)
            {
                LineHolder line = (LineHolder)lineList.GetByIndex(ndx);
                if(line != null)
                {
                    line.Distribute();
                    foreach(ColumnHolder col in line.Columns)
                    {
                        if(Horizontal)
                        {
                            col.Holder.Location = new Point(col.Position, pos);
                            col.Holder.PreferredDockedLocation = new Point(col.Holder.PreferredDockedLocation.X, pos + col.Holder.Height/2);
                        }
                        else
                        {
                            col.Holder.Location = new Point(pos, col.Position);
                            col.Holder.PreferredDockedLocation = new Point(pos + col.Holder.Width/2, col.Holder.PreferredDockedLocation.Y);
                        }
                    }
                    pos += line.Size+1;
                }
            }
            FitHolders();
            this.ResumeLayout();
        }
Example #29
0
        protected override void OnLayout(LayoutEventArgs levent)
        {
            base.OnLayout(levent);

            // resize the textbox to fill the form
            if (richError != null)
            {
                richError.Width = ClientRectangle.Width - 2 * richError.Left;
                richError.Height = ClientRectangle.Height - richError.Top - richError.Left - (ClientRectangle.Height - btnOK.Top);
            }
        }
        protected override void OnLayout(LayoutEventArgs levent)
        {
            base.OnLayout(levent);

            if (this.EnumerationValueMapping == null)
                this.EnumerationValueMapping = new EnumerationValueMapping();

            nameTextBox.Text = this.EnumerationValueMapping.Name;
            databaseValueTextBox.Text = this.EnumerationValueMapping.DatabaseValue;
            descriptionTextBox.Text = this.EnumerationValueMapping.Description;
        }