Ejemplo n.º 1
0
        /// <summary>
        ///     項目ラベルマウスダウン時の処理
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void OnItemLabelMouseDown(object sender, MouseEventArgs e)
        {
            Label         label = sender as Label;
            TechLabelInfo info  = label?.Tag as TechLabelInfo;

            if (info == null)
            {
                return;
            }

            // ドラッグアンドドロップの開始準備
            if (AllowDragDrop)
            {
                // 左ボタンダウンでなければドラッグ状態を解除する
                if (e.Button != MouseButtons.Left)
                {
                    _dragPoint     = Point.Empty;
                    Cursor.Current = Cursors.Default;
                    return;
                }

                // ドラッグ開始位置を設定する
                _dragPoint = new Point(label.Left + e.X, label.Top + e.Y);
            }

            // イベントハンドラを呼び出す
            ItemMouseDown?.Invoke(sender, new ItemMouseEventArgs(info.Item, info.Position, e));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// The coordinates are in legend coordinates, but a LegendBox is provided to define the
 /// coordinates of the specified object.
 /// </summary>
 /// <param name="e">An ItemMouseEventArgs</param>
 protected virtual void OnItemMouseDown(ItemMouseEventArgs e)
 {
     ItemMouseDown?.Invoke(this, e);
 }