コード例 #1
0
ファイル: DrawableCell.cs プロジェクト: zzlvff/Eto
 /// <summary>
 /// Raises the <see cref="Paint"/> event.
 /// </summary>
 /// <param name="e">Event arguments.</param>
 protected virtual void OnPaint(CellPaintEventArgs e)
 {
                 #pragma warning disable 618
     if (Paint != null)
     {
         Paint(this, (DrawableCellPaintEventArgs)e);
     }
                 #pragma warning restore 618
 }
コード例 #2
0
ファイル: PropertyCell.cs プロジェクト: zzlvff/Eto
        /// <summary>
        /// Raises the <see cref="PropertyCellType.OnPaint"/> event.
        /// </summary>
        /// <param name="args">Cell paint arguments.</param>
        protected override void OnPaint(CellPaintEventArgs args)
        {
            var type = GetType(args.Item);

            if (type != null)
            {
                type.OnPaint(args);
            }
            base.OnPaint(args);
        }
コード例 #3
0
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);

            args.DrawCenteredText(Convert.ToString(value));
        }
コード例 #4
0
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);

            args.DrawCenteredText(string.Format("{0:d}", value));
        }
コード例 #5
0
ファイル: PropertyCell.cs プロジェクト: zzlvff/Eto
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);
            var color = args.IsSelected ? SystemColors.HighlightText : SystemColors.ControlText;

            args.Graphics.DrawText(SystemFonts.Default(), color, args.ClipRectangle.Location, Convert.ToString(value));
        }
コード例 #6
0
ファイル: PropertyCell.cs プロジェクト: zzlvff/Eto
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);
            var color = args.IsSelected ? SystemColors.HighlightText : SystemColors.ControlText;

            args.Graphics.DrawText(SystemFonts.Default(), color, args.ClipRectangle.Location, value.ToHex(ShowAlpha));
            var rect = args.ClipRectangle;

            rect.Left = rect.Right - 35;
            args.Graphics.FillRectangle(value, rect);
        }
コード例 #7
0
        /// <summary>
        /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
        /// </summary>
        /// <remarks>
        /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
        /// to paint the content of the cell when it is not in edit mode.
        /// </remarks>
        /// <param name="args">Cell paint arguments.</param>
        public override void OnPaint(CellPaintEventArgs args)
        {
            if (ItemBinding == null)
            {
                return;
            }
            var value = ItemBinding.GetValue(args.Item);

            const int size = 35;
            var       rect = args.ClipRectangle;

            rect.Right -= size;
            args.DrawCenteredText(value.ToHex(ShowAlpha), rect: rect);

            rect      = args.ClipRectangle;
            rect.Left = rect.Right - size;
            args.Graphics.FillRectangle(value, rect);
        }
コード例 #8
0
ファイル: PropertyCell.cs プロジェクト: zzlvff/Eto
 /// <summary>
 /// Paints the cell when <see cref="CustomCell.SupportsControlView"/> is false.
 /// </summary>
 /// <remarks>
 /// For platforms like GTK and WinForms which don't support using a custom control per cell, this will be called
 /// to paint the content of the cell when it is not in edit mode.
 /// </remarks>
 /// <param name="args">Cell paint arguments.</param>
 public abstract void OnPaint(CellPaintEventArgs args);
コード例 #9
0
 /// <summary>
 /// Paints the cell when viewing for platforms that don't support custom controls for non-editing cells (E.g. Gtk, WinForms).
 /// </summary>
 /// <param name="args">Arguments to paint the cell</param>
 public abstract void PaintCell(CellPaintEventArgs args);
コード例 #10
0
ファイル: GridViewSection.cs プロジェクト: mhusen/Eto
			protected override void OnPaint(CellPaintEventArgs args)
			{
				var item = (MyGridItem)args.Item;
				if (!args.IsEditing)
					args.Graphics.DrawText(SystemFonts.Default(), Colors.Black, args.ClipRectangle.Location, item.Text);
				//args.Graphics.DrawLine(Colors.Blue, args.ClipRectangle.TopLeft, args.ClipRectangle.BottomRight);
			}
コード例 #11
0
 /// <summary>
 /// Raises the paint event.
 /// </summary>
 public void OnPaint(CustomCell widget, CellPaintEventArgs args)
 {
     using (widget.Platform.Context)
         widget.OnPaint(args);
 }
コード例 #12
0
 /// <summary>
 /// Raises the <see cref="Paint"/> event.
 /// </summary>
 /// <param name="args">Cell paint arguments.</param>
 protected virtual void OnPaint(CellPaintEventArgs args)
 {
     Properties.TriggerEvent(PaintEvent, this, args);
 }
コード例 #13
0
 /// <summary>
 /// Raises the paint event.
 /// </summary>
 public void OnPaint(CustomCell widget, CellPaintEventArgs args)
 {
     widget.Platform.Invoke(() => widget.OnPaint(args));
 }
コード例 #14
0
ファイル: DrawableCell.cs プロジェクト: mhusen/Eto
		/// <summary>
		/// Raises the <see cref="Paint"/> event.
		/// </summary>
		/// <param name="e">Event arguments.</param>
		protected virtual void OnPaint(CellPaintEventArgs e)
		{
			#pragma warning disable 618
			if (Paint != null)
				Paint(this, (DrawableCellPaintEventArgs)e);
			#pragma warning restore 618
		}