예제 #1
0
        public void OnMouseDown(MouseState e)
        {
            var pr = getPaneRect();

            if (_lp != null && Math.Abs(e.Pos.Y - (pr.RB.Y - _lp.Rect.Height)) < 4 && pr.LR.IsIn(e.Pos))    // ログパネルサイズ変更
            {
                _sizingHeightOrg    = e.Pos.Clone() as ScreenPos;
                Pane.Control.Cursor = Cursors.SizeNS;
            }
            else
            {
                foreach (var kv in _clickArea)
                {
                    var re = ScreenRect.FromLTWH(kv.Value.X, kv.Value.Y, 20, 20);
                    if (re.IsIn(e.Pos))
                    {
                        LOG.ChangeDispLevel(kv.Key);
                        if (kv.Key == 0)    // クローズボタン
                        {
                            triggerCloseButtonProc();
                        }
                    }
                }
            }
        }
예제 #2
0
        public void OnMouseMove(MouseState e)
        {
            var pr = getPaneRect();

            if (_sizingHeightOrg != null)
            {
                if (e.Attr.IsButton)
                {
                    var adp = e.Pos.Clone() as ScreenPos;
                    if (adp.Y < pr.LT.Y)
                    {
                        adp.Y = pr.LT.Y;
                    }

                    if (pr.RB.Y - adp.Y < foldingHeight)
                    {
                        adp.Y = pr.RB.Y - foldingHeight;
                    }

                    Pane.Control.Cursor = Cursors.SizeNS;
                    _lp.Rect.RB.Y       = pr.RB.Y - adp.Y;
                    _tarPane.Invalidate(null);
                }
                else
                {
                    Pane.Control.Cursor = Cursors.Arrow;
                    _sizingHeightOrg    = null;
                    savePanelHeight();
                }
            }
            else
            {
                if (_lp != null && Math.Abs(e.Pos.Y - (pr.RB.Y - _lp.Rect.Height)) < 4 && pr.LR.IsIn(e.Pos))    // ログパネルサイズ変更
                {
                    Pane.Control.Cursor = Cursors.SizeNS;
                }
                else
                {
                    var isCur = false;
                    foreach (var kv in _clickArea)
                    {
                        var re = ScreenRect.FromLTWH(kv.Value.X, kv.Value.Y, 20, 20);
                        if (re.IsIn(e.Pos))
                        {
                            isCur = true;
                        }
                    }
                    if (isCur)
                    {
                        Pane.Control.Cursor = Cursors.Hand;
                    }
                    else
                    {
                        Pane.Control.Cursor = Cursors.Arrow;
                    }
                }
            }
        }
예제 #3
0
        public void OnMouseDown(MouseState e)
        {
            if (_bar.MouseNow == null)
            {
                return;
            }

            // 一度だけ、クリック不感帯を登録
            if (_skipzone == null)
            {
                var pr = _tarPane.GetPaneRect();
                _skipzone = ScreenRect.FromLTWH(pr.RB.X - PartsScrollbarV.Width, pr.LT.Y, PartsScrollbarV.Width, pr.Height);
                Parts.AddSkipZone(_skipzone);
            }

            // クリック操作
            _bar.SetOn(true, true);
            _bar.SetHighlight(false);
            _downPos    = (ScreenPos)e.Pos.Clone();
            _downScroll = (ScreenPos)Pane.Scroll.Clone();

            _bar.Acc = 1;
            if (e.Attr.IsShift && !e.Attr.IsCtrl)
            {
                _bar.Acc = 4;
            }

            if (!e.Attr.IsShift && e.Attr.IsCtrl)
            {
                _bar.Acc = 0.5f;
            }

            if (e.Attr.IsShift && e.Attr.IsCtrl)
            {
                _bar.Acc = 16;
            }

            Pane.Invalidate(null);
        }
예제 #4
0
        /// <summary>
        /// 指定座標が描画クリップ内かどうか識別する
        /// </summary>
        /// <param name="rp">ペーン</param>
        /// <param name="rect">調査範囲</param>
        /// <returns>true = 調査範囲が描画クリップ内 / false = そうでない</returns>
        //[DebuggerStepThrough]
        protected bool isInClip(IRichPane rp, ScreenRect rect0)
        {
            var rect = (ScreenRect)rect0.Clone();

            if (rect.Width < 1)
            {
                rect.RB.X = rect0.LT.X + 1;
            }
            var r = rect & rp.GetPaintClipRect();

            if (r == null)
            {
                return(false);
            }

            r = rect & rp.GetPaneRect();
            if (r == null)
            {
                return(false);
            }

            return(true);
        }
예제 #5
0
 protected virtual Brush createLogPanelBG(ScreenRect sr)
 {
     return(new System.Drawing.Drawing2D.LinearGradientBrush(sr.LT, sr.RT,
                                                             Color.FromArgb(224, 96, 64, 48), Color.FromArgb(128, 48, 48, 0)));
 }
예제 #6
0
 /// <summary>
 /// マージンをセットする
 /// </summary>
 /// <param name="margin"></param>
 public void SetMargin(ScreenRect margin)
 {
     _margin = margin;
 }
예제 #7
0
 /// <summary>
 /// 不感地帯
 /// </summary>
 /// <param name="zone"></param>
 /// <returns></returns>
 public void AddSkipZone(ScreenRect zone)
 {
     _skipzones.Add(zone);
 }