• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# GridVirtual类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中GridVirtual的典型用法代码示例。如果您正苦于以下问题:C# GridVirtual类的具体用法?C# GridVirtual怎么用?C# GridVirtual使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



GridVirtual类属于命名空间,在下文中一共展示了GridVirtual类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: grid_MouseDown

		protected virtual void grid_MouseDown(GridVirtual sender, System.Windows.Forms.MouseEventArgs e)
		{
			//verifico che l'eventuale edit sia terminato altrimenti esco
			if (sender.Selection.ActivePosition.IsEmpty() == false)
			{
				CellContext focusCell = new CellContext(sender, sender.Selection.ActivePosition);
				if (focusCell.Cell != null && focusCell.IsEditing())
				{
					if (focusCell.EndEdit(false) == false)
						return;
				}
			}

			//scateno eventi di MouseDown
			Position position = sender.PositionAtPoint( new Point(e.X, e.Y) );
			if (position.IsEmpty() == false)
			{
				Cells.ICellVirtual cellMouseDown = sender.GetCell(position);
				if (cellMouseDown != null)
				{
					sender.ChangeMouseDownCell(position, position);

					//Cell.OnMouseDown
					CellContext cellContext = new CellContext(sender, position, cellMouseDown);
					sender.Controller.OnMouseDown(cellContext, e);
				}
			}
			else
				sender.ChangeMouseDownCell(Position.Empty, Position.Empty);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:30,代码来源:Grid.cs


示例2: grid_MouseDown

		protected virtual void grid_MouseDown(GridVirtual sender, MouseEventArgs e)
		{
#warning da fare
            //if (sender.Selection.BorderRange.IsEmpty() == false)
            //{
            //    Position mousePos = sender.PositionAtPoint(new System.Drawing.Point(e.X, e.Y));

            //    if (mousePos.IsEmpty() == false)
            //    {
            //        float distance;
            //        DevAge.Drawing.RectanglePartType partType = sender.Selection.Border.GetPointPartType(sender.Selection.GetDrawingRectangle(), 
            //            new System.Drawing.Point( e.X, e.Y) , out distance);
            //        if ( partType == DevAge.Drawing.RectanglePartType.BottomBorder || 
            //            partType == DevAge.Drawing.RectanglePartType.TopBorder || 
            //            partType == DevAge.Drawing.RectanglePartType.RightBorder || 
            //            partType == DevAge.Drawing.RectanglePartType.LeftBorder)
            //        {
            //            RangeData data = new RangeData();
            //            data.LoadData(sender, sender.Selection.BorderRange, mousePos, mCutMode);
            //            if (mCutMode == CutMode.None)
            //                sender.DoDragDrop(data, DragDropEffects.Copy);
            //            else
            //                sender.DoDragDrop(data, DragDropEffects.Move);
            //        }
            //    }
            //}
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:27,代码来源:SelectionDrag.cs


示例3: OnDetach

		protected override void OnDetach(GridVirtual grid)
		{
			grid.DragEnter -= new GridDragEventHandler(grid_DragEnter);
			grid.DragLeave -= new GridEventHandler(grid_DragLeave);
			grid.DragDrop -= new GridDragEventHandler(grid_DragDrop);
            grid.DragOver -= new GridDragEventHandler(grid_DragOver);
        }
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:7,代码来源:SelectionDrop.cs


示例4: BindToGrid

        public override void BindToGrid(GridVirtual p_grid)
        {
            base.BindToGrid(p_grid);

            mDecorator = new Decorators.DecoratorSelection(this);
            Grid.Decorators.Add(mDecorator);
        }
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:7,代码来源:RowSelection.cs


示例5: Export

        public virtual void Export(GridVirtual grid, System.Drawing.Graphics graphics, 
                                Range rangeToExport, System.Drawing.Point destinationLocation)
        {
            if (rangeToExport.IsEmpty())
                return;

            System.Drawing.Point cellPoint = destinationLocation;

            System.Drawing.Point deltaPoint = destinationLocation;

            using (DevAge.Drawing.GraphicsCache graphicsCache = new DevAge.Drawing.GraphicsCache(graphics))
            {
                for (int r = rangeToExport.Start.Row; r <= rangeToExport.End.Row; r++)
                {
                    int rowHeight = grid.Rows.GetHeight(r);

                    for (int c = rangeToExport.Start.Column; c <= rangeToExport.End.Column; c++)
                    {
                        Rectangle cellRectangle;
                        Position pos = new Position(r, c);

                        Size cellSize = new Size(grid.Columns.GetWidth(c), rowHeight);

                        Range range = grid.PositionToCellRange(pos);

                        //support for RowSpan or ColSpan
                        //Note: for now I draw only the merged cell at the first position
                        // (this can cause a problem if you export partial range that contains a partial merged cells)
                        if ( range.ColumnsCount > 1 || range.RowsCount > 1)
                        {
                            //Is the first position
                            if (range.Start == pos)
                            {
                                Size rangeSize = grid.RangeToSize(range);

                                cellRectangle = new Rectangle(cellPoint,
                                                              rangeSize);
                            }
                            else
                                cellRectangle = Rectangle.Empty;
                        }
                        else
                        {
                            cellRectangle = new Rectangle(cellPoint, cellSize);
                        }

                        if (cellRectangle.IsEmpty == false)
                        {
                            Cells.ICellVirtual cell = grid.GetCell(pos);
                            CellContext context = new CellContext(grid, pos, cell);
                            ExportCell(context, graphicsCache, cellRectangle);
                        }

                        cellPoint = new Point(cellPoint.X + cellSize.Width, cellPoint.Y);
                    }

                    cellPoint = new Point(destinationLocation.X, cellPoint.Y + rowHeight);
                }
            }
        }
开发者ID:zhuangyy,项目名称:Motion,代码行数:60,代码来源:Image.cs


示例6: Export

        public virtual System.Drawing.Bitmap Export(GridVirtual grid, Range rangeToExport)
        {
            System.Drawing.Bitmap bitmap = null;

            try
            {
                System.Drawing.Size size = grid.RangeToSize(rangeToExport);

                bitmap = new System.Drawing.Bitmap(size.Width, size.Height);

                using (System.Drawing.Graphics graphic = System.Drawing.Graphics.FromImage(bitmap))
                {
                    Export(grid, graphic, rangeToExport, new System.Drawing.Point(0, 0));
                }
            }
            catch (Exception)
            {
                if (bitmap != null)
                {
                    bitmap.Dispose();
                    bitmap = null;
                }

                throw;
            }

            return bitmap;
        }
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:28,代码来源:Image.cs


示例7: OnDetach

		protected override void OnDetach(GridVirtual grid)
		{
			grid.MouseDown -= new GridMouseEventHandler(grid_MouseDown);
			grid.MouseUp -= new GridMouseEventHandler(grid_MouseUp);
			grid.MouseMove -= new GridMouseEventHandler(grid_MouseMove);
			grid.MouseLeave -= new GridEventHandler(grid_MouseLeave);
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:7,代码来源:MouseSelection.cs


示例8: OnDetach

		protected override void OnDetach(GridVirtual grid)
		{
			grid.MouseMove -= new GridMouseEventHandler(grid_MouseMove);
			grid.MouseLeave -= new GridEventHandler(grid_MouseLeave);
			grid.MouseDown -= new GridMouseEventHandler(grid_MouseDown);
            grid.GiveFeedback -= new GridGiveFeedbackEventHandler(grid_GiveFeedback);
        }
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:7,代码来源:SelectionDrag.cs


示例9: AttachControl

		/// <summary>
		/// Add the Control to the specified grid. Consider that a Control can only be a child of one Container.
		/// </summary>
		private void AttachControl(GridVirtual grid)
		{
			mGrid = grid;
			mLinkedControl = new LinkedControlValue(Control, Position.Empty);
			Control.Hide();
			grid.LinkedControls.Add(mLinkedControl);
			Control.Validated += new EventHandler(InnerControl_Validated);
			Control.KeyPress += new KeyPressEventHandler(InnerControl_KeyPress);
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:12,代码来源:EditorControlBase.cs


示例10: GridPrintDocument

		public GridPrintDocument(GridVirtual grid)
		{
			m_Grid = grid;
			// Default to empty background
			m_CellPrintView.BackColor = Color.Empty;
			m_HeaderCellPrintView.BackColor = Color.Empty;

			m_PageHeaderFont = new Font(grid.Font, FontStyle.Regular);
			m_PageTitleFont = new Font(grid.Font, FontStyle.Bold);
			m_PageFooterFont = new Font(grid.Font, FontStyle.Regular);
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:11,代码来源:GridPrintDocument.cs


示例11: grid_MouseUp

		protected virtual void grid_MouseUp(GridVirtual sender, System.Windows.Forms.MouseEventArgs e)
		{
			if (sender.MouseDownPosition.IsEmpty() == false)
			{
				Cells.ICellVirtual l_MouseDownCell = sender.GetCell(sender.MouseDownPosition);
				if (l_MouseDownCell!=null)
					sender.Controller.OnMouseUp(new CellContext(sender, sender.MouseDownPosition, l_MouseDownCell), e );

				sender.ChangeMouseDownCell(Position.Empty, sender.PositionAtPoint(new Point(e.X, e.Y)));
			}
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:11,代码来源:Grid.cs


示例12: grid_KeyDown

		private void grid_KeyDown(GridVirtual sender, KeyEventArgs e)
		{
			if (e.Handled)
				return;

			if (sender.Selection.IsEmpty())
				return;

			if (e.KeyCode == Keys.Delete)
			{
				sender.ClearValues(sender.Selection.GetSelectionRegion());
				e.Handled = true;
			}
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:14,代码来源:SelectionDelete.cs


示例13: grid_MouseDown

		protected virtual void grid_MouseDown(GridVirtual sender, System.Windows.Forms.MouseEventArgs e)
		{
			//Check if the cell is valid
			if (sender.Selection.ActivePosition.IsEmpty() == false)
			{
				//If the cell is still active exit
				if (sender.MouseDownPosition == sender.Selection.ActivePosition)
					return;

				//If the cell is still in editing then exit and stop the multi selection
				CellContext focusCell = new CellContext(sender, sender.Selection.ActivePosition);
				if (focusCell.Cell != null && focusCell.IsEditing())
					return;
			}

#warning Da fare
            ////Select the cell
            //if (sender.MouseDownPosition.IsEmpty() == false)
            //{
            //    Cells.ICellVirtual cellMouseDown = sender.GetCell(sender.MouseDownPosition);
            //    if (cellMouseDown != null)
            //    {
            //        //Only select the cell if click inside or ourside the selection area (if click inside the border is not considered)
            //        float distance;
            //        DevAge.Drawing.RectanglePartType partType = sender.Selection.Border.GetPointPartType(sender.Selection.GetDrawingRectangle(), 
            //            new System.Drawing.Point( e.X, e.Y) , out distance);
            //        if (partType == DevAge.Drawing.RectanglePartType.ContentArea || 
            //            partType == DevAge.Drawing.RectanglePartType.None)
            //        {
            //            bool l_bShiftPress = ((Control.ModifierKeys & Keys.Shift) == Keys.Shift &&
            //                (sender.SpecialKeys & GridSpecialKeys.Shift) == GridSpecialKeys.Shift);
				
            //            if (l_bShiftPress == false || 
            //                sender.Selection.EnableMultiSelection == false || 
            //                sender.Selection.ActivePosition.IsEmpty() )
            //            {
            //                //Standard focus on the cell on MouseDown
            //                if (sender.Selection.Contains(sender.MouseDownPosition) == false || e.Button == MouseButtons.Left) //solo se non è stata ancora selezionata
            //                    sender.Selection.Focus(sender.MouseDownPosition);
            //            }
            //            else //handle shift key
            //            {
            //                sender.Selection.Clear();
            //                Range rangeToSelect = new Range(sender.Selection.ActivePosition, sender.MouseDownPosition);
            //                sender.Selection.Add(rangeToSelect);
            //            }
            //        }
            //    }
            //}
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:50,代码来源:MouseSelection.cs


示例14: grid_KeyDown

		private void grid_KeyDown(GridVirtual sender, KeyEventArgs e)
		{
			if (e.Handled)
				return;

#warning da fare

            //Range rng = sender.Selection.BorderRange;
            //if (rng.IsEmpty())
            //    return;

            ////Paste
            //if (e.Control && e.KeyCode == Keys.V && PasteEnabled)
            //{
            //    RangeData rngData = RangeData.ClipboardGetData();
			
            //    if (rngData != null)
            //    {
            //        Range destinationRange = rngData.FindDestinationRange(sender, rng.Start);
            //        if (ExpandSelection == false)
            //            destinationRange = destinationRange.Intersect(rng);

            //        rngData.WriteData(sender, destinationRange);
            //        e.Handled = true;
            //        sender.Selection.Clear();
            //        sender.Selection.Add(destinationRange);
            //    }
            //}
            ////Copy
            //else if (e.Control && e.KeyCode == Keys.C && CopyEnabled)
            //{
            //    RangeData data = new RangeData();
            //    data.LoadData(sender, rng, rng.Start, CutMode.None);
            //    RangeData.ClipboardSetData(data);

            //    e.Handled = true;
            //}
            ////Cut
            //else if (e.Control && e.KeyCode == Keys.X && CutEnabled)
            //{
            //    RangeData data = new RangeData();
            //    data.LoadData(sender, rng, rng.Start, CutMode.CutImmediately);
            //    RangeData.ClipboardSetData(data);
				
            //    e.Handled = true;
            //}
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:47,代码来源:SelectionClipboard.cs


示例15: grid_MouseMove

		protected virtual void grid_MouseMove(GridVirtual sender, MouseEventArgs e)
		{
#warning da fare
            //if (sender.Selection.BorderRange.IsEmpty() == false)
            //{
            //    float distance;
            //    DevAge.Drawing.RectanglePartType partType = sender.Selection.Border.GetPointPartType(sender.Selection.GetDrawingRectangle(), 
            //                                                                new System.Drawing.Point( e.X, e.Y) , out distance);
            //    if ( partType == DevAge.Drawing.RectanglePartType.BottomBorder || 
            //        partType == DevAge.Drawing.RectanglePartType.TopBorder || 
            //        partType == DevAge.Drawing.RectanglePartType.RightBorder || 
            //        partType == DevAge.Drawing.RectanglePartType.LeftBorder)
            //        mDragCursor.ApplyCursor(sender);
            //    else
            //        mDragCursor.ResetCursor();
            //}
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:17,代码来源:SelectionDrag.cs


示例16: Export

        public virtual void Export(GridVirtual grid, System.IO.TextWriter stream)
        {
            for (int r = 0; r < grid.Rows.Count; r++)
            {
                for (int c = 0; c < grid.Columns.Count; c++)
                {
                    if (c > 0)
                        stream.Write(mFieldSeparator);

                    Cells.ICellVirtual cell = grid.GetCell(r, c);
                    Position pos = new Position(r, c);
                    CellContext context = new CellContext(grid, pos, cell);
                    ExportCSVCell(context, stream);
                }
                stream.Write(mLineSeparator);
            }
        }
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:17,代码来源:CSV.cs


示例17: OnDetach

		protected override void OnDetach(GridVirtual grid)
		{
			grid.MouseDown -= new GridMouseEventHandler(grid_MouseDown);
			grid.MouseUp -= new GridMouseEventHandler(grid_MouseUp);
			grid.MouseMove -= new GridMouseEventHandler(grid_MouseMove);
			grid.MouseWheel -= new GridMouseEventHandler(grid_MouseWheel);
			grid.MouseLeave -= new GridEventHandler(grid_MouseLeave);
			grid.DragDrop -= new GridDragEventHandler(grid_DragDrop);
			grid.DragEnter -= new GridDragEventHandler(grid_DragEnter);
			grid.DragLeave -= new GridEventHandler(grid_DragLeave);
			grid.DragOver -= new GridDragEventHandler(grid_DragOver);
			grid.GiveFeedback -= new GridGiveFeedbackEventHandler(grid_GiveFeedback);
			grid.Click -= new GridEventHandler(grid_Click);
			grid.DoubleClick -= new GridEventHandler(grid_DoubleClick);
			grid.KeyDown -= new GridKeyEventHandler(grid_KeyDown);
			grid.KeyUp -= new GridKeyEventHandler(grid_KeyUp);
			grid.KeyPress -= new GridKeyPressEventHandler(grid_KeyPress);
		}
开发者ID:Xavinightshade,项目名称:ipsimulator,代码行数:18,代码来源:Grid.cs


示例18: grid_DragDrop

		protected virtual void grid_DragDrop(GridVirtual sender, DragEventArgs e)
		{
#warning da fare

            //if (mRangeData != null)
            //{
            //    Range destination = mHighlightedRange.Range;

            //    //Solo se il range sorgente è diverso dal range di destinazione
            //    if (mRangeData.SourceGrid != sender || mRangeData.SourceRange != destination)
            //    {
            //        mRangeData.WriteData(sender, destination);
            //        sender.Selection.Focus(destination.Start);
            //        sender.Selection.SelectRange(destination, true);
            //    }
            //}

            //ResetTempData();
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:19,代码来源:SelectionDrop.cs


示例19: grid_DragOver

		private void grid_DragOver(GridVirtual sender, DragEventArgs e)
        {
#warning da fare
            //if (e.Data.GetDataPresent(typeof(RangeData)))
            //{
            //    ResetTempData();

            //    mRangeData = (RangeData)e.Data.GetData(typeof(RangeData));
            //    if (mRangeData.CutMode == CutMode.None)
            //        e.Effect = DragDropEffects.Copy;
            //    else
            //        e.Effect = DragDropEffects.Move;

            //    System.Drawing.Point mousePoint = new System.Drawing.Point(e.X, e.Y);

            //    //Unfortunately for now I can't use this method because this event is not called if I move the mouse outside the scrollable area, and this method use the mouse external position to calculate the scroll direction
            //    ////Scroll if necessary
            //    //sender.ScrollOnPoint(mousePoint);

            //    Position mousePos = sender.PositionAtPoint(sender.PointToClient( mousePoint ));

            //    if (mousePos.IsEmpty() == false)
            //    {
            //        Range rngDest = mRangeData.FindDestinationRange(sender, mousePos);
            //        if (rngDest.IsEmpty() == false)
            //        {
            //            mHighlightedRange = new HighlightedRange(sender);
            //            mHighlightedRange.Range = rngDest;
            //            mHighlightedRange.Border = mHighlightedRange.Border.SetDashStyle(System.Drawing.Drawing2D.DashStyle.DashDotDot);
            //            sender.HighlightedRanges.Add(mHighlightedRange);
            //        }
            //    }
            //}
            //else
            //{
            //    e.Effect = DragDropEffects.None;
            //    ResetTempData();
            //}
		}
开发者ID:wsrf2009,项目名称:KnxUiEditor,代码行数:39,代码来源:SelectionDrop.cs


示例20: BeginScrollTracking

		/// <summary>
		/// Start the timer to scroll the visible area
		/// </summary>
		/// <param name="grid"></param>
		private void BeginScrollTracking(GridVirtual grid)
		{
			//grid.Capture = true;
			mCapturedGrid = grid;

			if (mScrollTimer == null)
			{
				mScrollTimer = new Timer();
				mScrollTimer.Interval = 100;
				mScrollTimer.Tick += this.mScrollTimer_Tick;
			}
			mScrollTimer.Enabled = true;
		}
开发者ID:Davincier,项目名称:openpetra,代码行数:17,代码来源:MouseSelection.cs



注:本文中的GridVirtual类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Group类代码示例发布时间:2022-05-24
下一篇:
C# GridViewUpdatedEventArgs类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap