/*
             * OnPaint
             */

            /// <summary>
            /// Raises the <see cref="System.Windows.Forms.Control.Paint"/> event.
            /// </summary>
            /// <param name="e">The <see cref="System.Windows.Forms.PaintEventArgs"/> instance containing the event data.</param>
            protected override void OnPaint(PaintEventArgs e)
            {
                NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);

                paintParams.Bounds     = this.ClientRectangle;
                paintParams.DrawBorder = true;
                paintParams.State      = NuGenControlState.Normal;

                this.Renderer.DrawBackground(paintParams);
                this.Renderer.DrawBorder(paintParams);
            }
Example #2
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);

            paintParams.Bounds     = this.ClientRectangle;
            paintParams.DrawBorder = true;
            paintParams.State      = this.StateTracker.GetControlState();

            this.PanelRenderer.DrawBackground(paintParams);
            this.PanelRenderer.DrawBorder(paintParams);

            base.OnPaint(e);
        }
        private void panel_Paint(object sender, PaintEventArgs e)
        {
            Debug.Assert(this.Renderer != null, "this.Renderer != null");
            Debug.Assert(this.StateTracker != null, "this.StateTracker != null");

            NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);

            paintParams.Bounds     = ((Control)sender).ClientRectangle;
            paintParams.DrawBorder = this.DrawBorder;
            paintParams.State      = this.StateTracker.GetControlState();

            this.Renderer.DrawPanel(paintParams);
        }
Example #4
0
        /*
         * OnPaint
         */

        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            Debug.Assert(this.Renderer != null, "this.Renderer != null");
            Debug.Assert(this.StateTracker != null, "this.StateTracker != null");

            NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);

            paintParams.Bounds     = this.ClientRectangle;
            paintParams.DrawBorder = this.DrawBorder;
            paintParams.State      = this.StateTracker.GetControlState();

            this.Renderer.DrawBorder(paintParams);
        }
		/*
		 * DrawBorder
		 */

		/// <summary>
		/// </summary>
		/// <param name="paintParams"></param>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
		/// </exception>
		public void DrawBorder(NuGenBorderPaintParams paintParams)
		{
			if (paintParams == null)
			{
				throw new ArgumentNullException("paintParams");
			}

			if (paintParams.DrawBorder)
			{
				this.DrawBorder(
					paintParams.Graphics,
					NuGenControlPaint.BorderRectangle(paintParams.Bounds),
					paintParams.State
				);
			}
		}
		/*
		 * DrawPanel
		 */

		/// <summary>
		/// </summary>
		/// <param name="paintParams"></param>
		/// <exception cref="ArgumentNullException">
		/// <para><paramref name="paintParams"/> is <see langword="null"/>.</para>
		/// </exception>
		public void DrawPanel(NuGenBorderPaintParams paintParams)
		{
			if (paintParams == null)
			{
				throw new ArgumentNullException("paintParams");
			}

			Graphics g = paintParams.Graphics;
			Rectangle bounds = paintParams.Bounds;
			NuGenControlState state = paintParams.State;

			this.DrawBackground(paintParams);

			if (paintParams.DrawBorder)
			{
				this.DrawBorder(g, NuGenControlPaint.BorderRectangle(bounds), state);
			}
		}
            /*
             * OnPaint
             */

            /// <summary>
            /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
            /// </summary>
            /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
            protected override void OnPaint(PaintEventArgs e)
            {
                Graphics          g            = e.Graphics;
                Rectangle         bounds       = this.ClientRectangle;
                NuGenControlState currentState = this.ButtonStateTracker.GetControlState();

                using (SolidBrush sb = new SolidBrush(_displayColor))
                {
                    g.FillRectangle(sb, bounds);
                }

                NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(g);

                paintParams.Bounds     = bounds;
                paintParams.DrawBorder = true;
                paintParams.State      = currentState;

                this.Renderer.DrawBorder(paintParams);
            }
Example #8
0
        /// <summary>
        /// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
        /// </summary>
        /// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
        protected override void OnPaint(PaintEventArgs e)
        {
            NuGenItemPaintParams titlePaintParams = new NuGenItemPaintParams(e.Graphics);

            titlePaintParams.Bounds = new Rectangle(
                this.ClientRectangle.Left
                , this.ClientRectangle.Top
                , this.ClientRectangle.Width
                , this.TitleHeight
                );

            titlePaintParams.ContentAlign = this.RightToLeft == RightToLeft.Yes
                                ? ContentAlignment.MiddleRight
                                : ContentAlignment.MiddleLeft
            ;
            titlePaintParams.Font      = this.Font;
            titlePaintParams.ForeColor = this.ForeColor;
            titlePaintParams.State     = this.StateTracker.GetControlState();
            titlePaintParams.Text      = this.Text;

            NuGenPaintParams bkgndPaintParams = new NuGenPaintParams(titlePaintParams);

            bkgndPaintParams.Bounds = this.DisplayRectangle;

            NuGenBorderPaintParams borderPaintParams = new NuGenBorderPaintParams(bkgndPaintParams);

            borderPaintParams.Bounds     = this.ClientRectangle;
            borderPaintParams.DrawBorder = this.DrawBorder;

            this.PanelRenderer.DrawBackground(bkgndPaintParams);
            this.PanelRenderer.DrawBorder(borderPaintParams);

            this.TitleRenderer.DrawBackground(titlePaintParams);
            this.TitleRenderer.DrawBody(titlePaintParams);
            this.TitleRenderer.DrawBorder(titlePaintParams);

            base.OnPaint(e);
        }
Example #9
0
		/*
		 * OnPaint
		 */

		/// <summary>
		/// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
		/// </summary>
		/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
		protected override void OnPaint(PaintEventArgs e)
		{
			Debug.Assert(this.StateTracker != null, "this.StateTracker != null");

			NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);
			paintParams.Bounds = this.ClientRectangle;
			paintParams.DrawBorder = this.DrawBorder;
			paintParams.State = this.StateTracker.GetControlState();

			if (this.ExtendedBackground)
			{
				this.Renderer.DrawExtendedBackground(paintParams);
			}
			else
			{
				this.Renderer.DrawBackground(paintParams);
			}

			this.Renderer.DrawBorder(paintParams);
		}
		/// <summary>
		/// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
		/// </summary>
		/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
		protected override void OnPaint(PaintEventArgs e)
		{
			NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);
			paintParams.Bounds = this.ClientRectangle;
			paintParams.DrawBorder = true;
			paintParams.State = this.StateTracker.GetControlState();

			this.Renderer.DrawBackground(paintParams);
			this.Renderer.DrawBorder(paintParams);
		}
			/*
			 * OnPaint
			 */

			/// <summary>
			/// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
			/// </summary>
			/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
			protected override void OnPaint(PaintEventArgs e)
			{
				Graphics g = e.Graphics;
				Rectangle bounds = this.ClientRectangle;
				NuGenControlState currentState = this.ButtonStateTracker.GetControlState();

				using (SolidBrush sb = new SolidBrush(_displayColor))
				{
					g.FillRectangle(sb, bounds);
				}

				NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(g);
				paintParams.Bounds = bounds;
				paintParams.DrawBorder = true;
				paintParams.State = currentState;

				this.Renderer.DrawBorder(paintParams);
			}
		/// <summary>
		/// Raises the <see cref="E:System.Windows.Forms.Control.Paint"></see> event.
		/// </summary>
		/// <param name="e">A <see cref="T:System.Windows.Forms.PaintEventArgs"></see> that contains the event data.</param>
		protected override void OnPaint(PaintEventArgs e)
		{
			NuGenItemPaintParams titlePaintParams = new NuGenItemPaintParams(e.Graphics);
			titlePaintParams.Bounds = new Rectangle(
				this.ClientRectangle.Left
				, this.ClientRectangle.Top
				, this.ClientRectangle.Width
				, this.TitleHeight
			);

			titlePaintParams.ContentAlign = this.RightToLeft == RightToLeft.Yes
				? ContentAlignment.MiddleRight
				: ContentAlignment.MiddleLeft
				;
			titlePaintParams.Font = this.Font;
			titlePaintParams.ForeColor = this.ForeColor;
			titlePaintParams.State = this.StateTracker.GetControlState();
			titlePaintParams.Text = this.Text;

			NuGenPaintParams bkgndPaintParams = new NuGenPaintParams(titlePaintParams);
			bkgndPaintParams.Bounds = this.DisplayRectangle;

			NuGenBorderPaintParams borderPaintParams = new NuGenBorderPaintParams(bkgndPaintParams);
			borderPaintParams.Bounds = this.ClientRectangle;
			borderPaintParams.DrawBorder = this.DrawBorder;

			this.PanelRenderer.DrawBackground(bkgndPaintParams);
			this.PanelRenderer.DrawBorder(borderPaintParams);

			this.TitleRenderer.DrawBackground(titlePaintParams);
			this.TitleRenderer.DrawBody(titlePaintParams);
			this.TitleRenderer.DrawBorder(titlePaintParams);

			base.OnPaint(e);
		}
		private void panel_Paint(object sender, PaintEventArgs e)
		{
			Debug.Assert(this.Renderer != null, "this.Renderer != null");
			Debug.Assert(this.StateTracker != null, "this.StateTracker != null");

			NuGenBorderPaintParams paintParams = new NuGenBorderPaintParams(e.Graphics);
			paintParams.Bounds = ((Control)sender).ClientRectangle;
			paintParams.DrawBorder = this.DrawBorder;
			paintParams.State = this.StateTracker.GetControlState();

			this.Renderer.DrawPanel(paintParams);
		}