Ejemplo n.º 1
0
 public void OnMouseUp(PositionMouseEventArgs e)
 {
     if (MouseUp != null)
     {
         MouseUp(this, e);
     }
 }
Ejemplo n.º 2
0
 public virtual void OnMouseDown(PositionMouseEventArgs e)
 {
     for (int i = 0; i < m_SubModels.Count; i++)
     {
         m_SubModels[i].OnMouseDown(e);
     }
 }
 /// <summary>
 /// Fires the mouse up event when the mouse button is up in a specified cell
 /// </summary>
 /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionMouseEventArgs"/> instance containing the event data.</param>
 public virtual void OnMouseUp(PositionMouseEventArgs e)
 {
     for (int i = 0; i < subModels.Count; i++)
     {
         subModels[i].OnMouseUp(e);
     }
 }
Ejemplo n.º 4
0
 public void OnMouseMove(PositionMouseEventArgs e)
 {
     if (MouseMove != null)
     {
         MouseMove(this, e);
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Raises the <see cref="E:MouseMove"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionMouseEventArgs"/> instance containing the event data.</param>
 public virtual void OnMouseMove(PositionMouseEventArgs e)
 {
     for (int i = 0; i < behaviorModels.Count; i++)
     {
         behaviorModels[i].OnMouseMove(e);
     }
 }
Ejemplo n.º 6
0
        public override void OnMouseUp(PositionMouseEventArgs e)
        {
            base.OnMouseUp(e);

            m_IsWidthResize  = false;
            m_IsHeightResize = false;
        }
        public override void OnMouseDown(PositionMouseEventArgs e)
        {
            base.OnMouseDown(e);

            isHeightResizing = false;
            isWidthResizing  = false;

            Rectangle l_CellRect   = e.Grid.PositionToDisplayRect(e.Position);
            Point     l_MousePoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);

            if (((ResizeMode & CellResizeModes.Width) == CellResizeModes.Width) &&
                IsInHorizontalResizeRegion(l_CellRect, l_MousePoint))
            {
                isWidthResizing = true;
            }
            else if (((ResizeMode & CellResizeModes.Height) == CellResizeModes.Height) &&
                     IsInVerticalResizeRegion(l_CellRect, l_MousePoint))
            {
                isHeightResizing = true;
            }

            if (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left)
            {
                isMouseLDown = true;
            }
        }
Ejemplo n.º 8
0
 public void OnMouseDown(PositionMouseEventArgs e)
 {
     if (MouseDown != null)
     {
         MouseDown(this, e);
     }
 }
        public override void OnMouseMove(PositionMouseEventArgs e)
        {
            base.OnMouseMove(e);

            Rectangle l_CellRect   = e.Grid.PositionToDisplayRect(e.Position);
            Point     l_MousePoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);

            Point l_AbsPoint = e.Grid.PointRelativeToAbsolute(l_MousePoint);

            if (e.Position.Row < e.Grid.FixedRows)
            {
                l_AbsPoint.Y = l_MousePoint.Y;
            }
            if (e.Position.Column < e.Grid.FixedColumns)
            {
                l_AbsPoint.X = l_MousePoint.X;
            }

            // Resize the column or the row
            if (e.Grid.MouseDownPosition == e.Position)
            {
                if (isWidthResizing)
                {
                    if (e.Grid.Columns[e.Position.Column].Resizable == true)
                    {
                        int l_NewWidth = l_AbsPoint.X - e.Grid.Columns[e.Position.Column].Left;

                        if (l_NewWidth > 0)
                        {
                            e.Grid.Columns[e.Position.Column].Width = l_NewWidth + MouseDelta;
                        }
                    }
                }
                else if (isHeightResizing)
                {
                    int l_NewHeight = l_AbsPoint.Y - e.Grid.Rows[e.Position.Row].Top;

                    if (l_NewHeight > 0)
                    {
                        e.Grid.Rows[e.Position.Row].Height = l_NewHeight + MouseDelta;
                    }
                }
            }

            // mis a jour avec le curseur
            if ((IsInHorizontalResizeRegion(l_CellRect, l_MousePoint) || (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left && isMouseLDown == true)) && (ResizeMode & CellResizeModes.Width) == CellResizeModes.Width)
            {
                e.Cell.Grid.GridCursor = System.Windows.Forms.Cursors.VSplit;
            }
            else if ((IsInVerticalResizeRegion(l_CellRect, l_MousePoint) || (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left && isMouseLDown == true)) && (ResizeMode & CellResizeModes.Height) == CellResizeModes.Height)
            {
                e.Cell.Grid.GridCursor = System.Windows.Forms.Cursors.HSplit;
            }
            else
            {
                e.Cell.Grid.GridCursor = null;
            }
        }
Ejemplo n.º 10
0
        public override void OnMouseMove(PositionMouseEventArgs e)
        {
            base.OnMouseMove(e);

            Rectangle l_CellRect   = e.Grid.PositionToDisplayRect(e.Position);
            Point     l_MousePoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);

            Point l_AbsPoint = e.Grid.PointRelativeToAbsolute(l_MousePoint);

            if (e.Position.Row < e.Grid.FixedRows)
            {
                l_AbsPoint.Y = l_MousePoint.Y;
            }
            if (e.Position.Column < e.Grid.FixedColumns)
            {
                l_AbsPoint.X = l_MousePoint.X;
            }

            //sono già in fase di resizing
            if (e.Grid.MouseDownPosition == e.Position)
            {
                if (m_IsWidthResize)
                {
                    int l_NewWidth = l_AbsPoint.X - e.Grid.Columns[e.Position.Column].Left;

                    if (l_NewWidth > 0)
                    {
                        e.Grid.Columns[e.Position.Column].Width = l_NewWidth + c_MouseDelta;
                    }
                }
                else if (m_IsHeightResize)
                {
                    int l_NewHeight = l_AbsPoint.Y - e.Grid.Rows[e.Position.Row].Top;

                    if (l_NewHeight > 0)
                    {
                        e.Grid.Rows[e.Position.Row].Height = l_NewHeight + c_MouseDelta;
                    }
                }
            }

            //comunque aggiorno il cursore
            if (IsInResizeHorRegion(l_CellRect, l_MousePoint) && (ResizeMode & CellResizeMode.Width) == CellResizeMode.Width)
            {
                e.Cell.Grid.GridCursor = System.Windows.Forms.Cursors.VSplit;
            }
            else if (IsInResizeVerRegion(l_CellRect, l_MousePoint) && (ResizeMode & CellResizeMode.Height) == CellResizeMode.Height)
            {
                e.Cell.Grid.GridCursor = System.Windows.Forms.Cursors.HSplit;
            }
            else
            {
                e.Cell.Grid.GridCursor = null;
            }
        }
        public override void OnMouseUp(PositionMouseEventArgs e)
        {
            base.OnMouseUp(e);

            isWidthResizing  = false;
            isHeightResizing = false;

            if (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left)
            {
                isMouseLDown = true;
            }
        }
Ejemplo n.º 12
0
        public override void OnMouseDown(PositionMouseEventArgs e)
        {
            base.OnMouseDown(e);

            m_IsHeightResize = false;
            m_IsWidthResize  = false;

            Rectangle l_CellRect   = e.Grid.PositionToDisplayRect(e.Position);
            Point     l_MousePoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);

            if (((ResizeMode & CellResizeMode.Width) == CellResizeMode.Width) &&
                IsInResizeHorRegion(l_CellRect, l_MousePoint))
            {
                m_IsWidthResize = true;
            }
            else if (((ResizeMode & CellResizeMode.Height) == CellResizeMode.Height) &&
                     IsInResizeVerRegion(l_CellRect, l_MousePoint))
            {
                m_IsHeightResize = true;
            }
        }
        /// <summary>
        /// Handles the mouse up event in the current cell
        /// </summary>
        /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionMouseEventArgs"/> instance containing the event data.</param>
        public override void OnMouseUp(PositionMouseEventArgs e)
        {
            base.OnMouseUp(e);

              e.Grid.InvalidateCell(e.Position);
        }
        public override void OnMouseUp(PositionMouseEventArgs e)
        {
            base.OnMouseUp(e);

              isWidthResizing = false;
              isHeightResizing = false;

              if (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left)
              {
            isMouseLDown = true;
              }
        }
        public override void OnMouseMove(PositionMouseEventArgs e)
        {
            base.OnMouseMove(e);

              Rectangle l_CellRect = e.Grid.PositionToDisplayRect(e.Position);
              Point l_MousePoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);

              Point l_AbsPoint = e.Grid.PointRelativeToAbsolute(l_MousePoint);
              if (e.Position.Row < e.Grid.FixedRows)
              {
            l_AbsPoint.Y = l_MousePoint.Y;
              }
              if (e.Position.Column < e.Grid.FixedColumns)
              {
            l_AbsPoint.X = l_MousePoint.X;
              }

              // Resize the column or the row
              if (e.Grid.MouseDownPosition == e.Position)
              {
            if (isWidthResizing)
            {
              if (e.Grid.Columns[e.Position.Column].Resizable == true)
              {
            int l_NewWidth = l_AbsPoint.X - e.Grid.Columns[e.Position.Column].Left;

            if (l_NewWidth > 0)
            {
              e.Grid.Columns[e.Position.Column].Width = l_NewWidth + MouseDelta;
            }
              }
            }
            else if (isHeightResizing)
            {
              int l_NewHeight = l_AbsPoint.Y - e.Grid.Rows[e.Position.Row].Top;

              if (l_NewHeight > 0)
              {
            e.Grid.Rows[e.Position.Row].Height = l_NewHeight + MouseDelta;
              }
            }
              }

              // mis a jour avec le curseur
              if ((IsInHorizontalResizeRegion(l_CellRect, l_MousePoint) || (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left && isMouseLDown == true)) && (ResizeMode & CellResizeModes.Width) == CellResizeModes.Width)
              {
            e.Cell.Grid.GridCursor = System.Windows.Forms.Cursors.VSplit;
              }
              else if ((IsInVerticalResizeRegion(l_CellRect, l_MousePoint) || (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left && isMouseLDown == true)) && (ResizeMode & CellResizeModes.Height) == CellResizeModes.Height)
              {
            e.Cell.Grid.GridCursor = System.Windows.Forms.Cursors.HSplit;
              }
              else
              {
            e.Cell.Grid.GridCursor = null;
              }
        }
        public override void OnMouseDown(PositionMouseEventArgs e)
        {
            base.OnMouseDown(e);

              isHeightResizing = false;
              isWidthResizing = false;

              Rectangle l_CellRect = e.Grid.PositionToDisplayRect(e.Position);
              Point l_MousePoint = new Point(e.MouseEventArgs.X, e.MouseEventArgs.Y);

              if (((ResizeMode & CellResizeModes.Width) == CellResizeModes.Width) &&
            IsInHorizontalResizeRegion(l_CellRect, l_MousePoint))
              {
            isWidthResizing = true;
              }
              else if (((ResizeMode & CellResizeModes.Height) == CellResizeModes.Height) &&
            IsInVerticalResizeRegion(l_CellRect, l_MousePoint))
              {
            isHeightResizing = true;
              }

              if (e.MouseEventArgs.Button == System.Windows.Forms.MouseButtons.Left)
              {
            isMouseLDown = true;
              }
        }
Ejemplo n.º 17
0
 /// <summary>
 /// Raises the <see cref="E:MouseUp"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionMouseEventArgs"/> instance containing the event data.</param>
 public virtual void OnMouseUp(PositionMouseEventArgs e)
 {
     for (int i = 0; i < behaviorModels.Count; i++)
       {
     behaviorModels[i].OnMouseUp(e);
       }
 }
 /// <summary>
 /// Fires the mouse down event
 /// </summary>
 /// <param name="e">The specified cell</param>
 public void OnMouseDown(PositionMouseEventArgs e)
 {
     if (MouseDown != null)
       {
     MouseDown(this, e);
       }
 }
 /// <summary>
 /// Fires the mouse move event in a specified cell
 /// </summary>
 /// <param name="e">The specified cell</param>
 public void OnMouseMove(PositionMouseEventArgs e)
 {
     if (MouseMove != null)
       {
     MouseMove(this, e);
       }
 }
 /// <summary>
 /// Fires the mouse up event
 /// </summary>
 /// <param name="e">The specified cell</param>
 public void OnMouseUp(PositionMouseEventArgs e)
 {
     if (MouseUp != null)
       {
     MouseUp(this, e);
       }
 }
        /// <summary>
        /// Handles the mouse up event in the current cell
        /// </summary>
        /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionMouseEventArgs"/> instance containing the event data.</param>
        public override void OnMouseUp(PositionMouseEventArgs e)
        {
            base.OnMouseUp(e);

            e.Grid.InvalidateCell(e.Position);
        }
Ejemplo n.º 22
0
 /// <summary>
 /// Fires the mouse move event when the mouse moves in a specified cell
 /// </summary>
 /// <param name="e">The <see cref="Fr.Medit.MedDataGrid.PositionMouseEventArgs"/> instance containing the event data.</param>
 public virtual void OnMouseMove(PositionMouseEventArgs e)
 {
     for (int i = 0; i < subModels.Count; i++)
       {
     subModels[i].OnMouseMove(e);
       }
 }