Exemplo n.º 1
0
 /// <summary>
 /// 初期化コンストラクタ
 /// </summary>
 /// <param name="previous">カーソルを有効とする直前の状態を特定する。それ以外のボタンからこの状態になってもカーソルを変更しない</param>
 /// <param name="buttons">表示条件となるボタンの状態</param>
 /// <param name="cursor">その条件で表示したいカーソル</param>
 /// <param name="mes">カーソルへと導くメッセージ</param>
 public Reserve(MouseState.Buttons previous, MouseState.Buttons buttons, Cursor cursor, string mes)
 {
     Buttons         = buttons;
     Cursor          = cursor;
     Message         = mes;
     PreviousButtons = previous;
 }
Exemplo n.º 2
0
        /// <summary>
        /// uMouseStateの一部を切り取りインスタンスを生成する
        /// </summary>
        /// <param name="value">マウス状態</param>
        /// <returns>新しいインスタンス</returns>

        public static KeyState FromMouseStateButtons(MouseState.Buttons value)
        {
            var ret = new KeyState
            {
                _isControl = value.IsCtrl,
                _isShift   = value.IsShift
            };

            ret._key = (ret._isControl ? Keys.Control : 0) | (ret._isShift ? Keys.Shift : 0);
            return(ret);
        }
Exemplo n.º 3
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 public FeatureToolTip()
 {
     // デフォルトでドラッグスクロールするためのキーを設定する
     _trigger = new MouseState.Buttons
     {
         IsButton       = false,
         IsButtonMiddle = false,
         IsCtrl         = false,
         IsShift        = false
     };
 }
Exemplo n.º 4
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 public FeatureDragZoom()
 {
     // デフォルトでドラッグスクロールするためのキーを設定する
     _trigger = new MouseState.Buttons
     {
         IsButton       = true,
         IsButtonMiddle = false,
         IsCtrl         = true,
         IsShift        = false
     };
     _isSameXY     = false;
     _isCenterLock = false;
 }
Exemplo n.º 5
0
 /// <summary>
 /// デフォルトコンストラクタ
 /// </summary>
 public FeatureMoveSelectedParts()
 {
     // デフォルトでドラッグスクロールするためのキーを設定する
     _trigger       = new MouseState.Buttons(true, false, false, false, false);
     _FollowTrigger = new MouseState.Buttons(true, false, false, true, false);
 }
Exemplo n.º 6
0
        /// <summary>
        /// パラメーターの初期化
        /// </summary>
        /// <param name="param"></param>
        public override void ParseParameter(string param)
        {
            string[] coms = param.Split(new char[] { ';' });
            foreach (string com in coms)
            {
                string[] od = com.Split(new char[] { '=' });
                if (od.Length < 2)
                {
                    continue;
                }

                if (od[0].ToLower() == "centerlock")
                {
                    _isCenterLock = Const.IsTrue(od[1]);
                }
                if (od[0].ToLower() == "samexy")
                {
                    _isSameXY = Const.IsTrue(od[1]);
                }
                if (od[0].ToLower() == "trigger")
                {
                    _trigger = new MouseState.Buttons();

                    string[] ts = od[1].Split(new char[] { '+' });
                    foreach (string t in ts)
                    {
                        if (t.ToLower() == "middle")
                        {
                            _trigger.IsButtonMiddle = true;
                        }
                        if (t.ToLower() == "button" || t.ToLower() == "left")
                        {
                            _trigger.IsButton = true;
                        }
                        if (t.ToLower() == "ctrl")
                        {
                            _trigger.IsCtrl = true;
                        }
                        if (t.ToLower() == "shift")
                        {
                            _trigger.IsShift = true;
                        }
                    }
                }
                else if (od[0].ToLower() == "cursor")
                {
                    if (od.Length == 3)
                    {
                        string[]           ts  = od[2].Split(new char[] { '.' });
                        string[]           trs = od[1].Split(new char[] { '+' });
                        MouseState.Buttons trg = new Tono.GuiWinForm.MouseState.Buttons();
                        foreach (string t in trs)
                        {
                            if (t.ToLower() == "middle")
                            {
                                trg.IsButtonMiddle = true;
                            }

                            if (t.ToLower() == "button" || t.ToLower() == "left")
                            {
                                trg.IsButton = true;
                            }

                            if (t.ToLower() == "ctrl")
                            {
                                trg.IsCtrl = true;
                            }

                            if (t.ToLower() == "shift")
                            {
                                trg.IsShift = true;
                            }
                        }
                        if (od[2].ToLower().IndexOf("cursors") != -1)
                        {
                            Type t = typeof(System.Windows.Forms.Cursors);
                            System.Reflection.PropertyInfo pi = t.GetProperty(ts[ts.Length - 1].ToString());
                            if (pi != null)
                            {
                                _EventCursor = (Cursor)pi.GetValue(null, Array.Empty <object>());
                            }
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
 /// <summary>
 /// トリガ(実行識別キー)を変更する
 /// </summary>
 /// <param name="value">新しいトリガー</param>
 public void SetTrigger(MouseState.Buttons value)
 {
     _trigger = value;
 }