From 848578f257ef73d70f03a04a3f85ebab92056c8c Mon Sep 17 00:00:00 2001 From: cxl Date: Mon, 24 Mar 2014 09:08:47 +0000 Subject: [PATCH] CtrlCore: X11Top.cpp CenterRect fix #725 (thanks Klugier) git-svn-id: svn://ultimatepp.org/upp/trunk@7079 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/X11Top.cpp | 2 +- uppsrc/TextDiffCtrl/TextCtrl.cpp | 5 +++++ uppsrc/TextDiffCtrl/TextDiffCtrl.h | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/uppsrc/CtrlCore/X11Top.cpp b/uppsrc/CtrlCore/X11Top.cpp index 9cac72893..cf23aa31e 100644 --- a/uppsrc/CtrlCore/X11Top.cpp +++ b/uppsrc/CtrlCore/X11Top.cpp @@ -251,7 +251,7 @@ void TopWindow::CenterRect(Ctrl *owner) r = wr; Point p = r.CenterPos(sz); - if ((p.x + sz.cx <= wr.Width() + wr.left) && (p.y + sz.cy <= wr.Height() + wr.top)) { + if (GetVirtualScreenArea().Contains(p)) { r = RectC(p.x, p.y, sz.cx, sz.cy); wr.left += fm.left; wr.right -= fm.right; diff --git a/uppsrc/TextDiffCtrl/TextCtrl.cpp b/uppsrc/TextDiffCtrl/TextCtrl.cpp index 97bb461d0..47155110e 100644 --- a/uppsrc/TextDiffCtrl/TextCtrl.cpp +++ b/uppsrc/TextDiffCtrl/TextCtrl.cpp @@ -60,6 +60,11 @@ void TextCompareCtrl::LeftDown(Point pt, dword keyflags) SetWantFocus(); } +void TextCompareCtrl::LeftDouble(Point pt, dword keyflags) +{ + +} + void TextCompareCtrl::MouseMove(Point pt, dword flags) { if(HasCapture()) diff --git a/uppsrc/TextDiffCtrl/TextDiffCtrl.h b/uppsrc/TextDiffCtrl/TextDiffCtrl.h index a70da2619..9c7a393db 100644 --- a/uppsrc/TextDiffCtrl/TextDiffCtrl.h +++ b/uppsrc/TextDiffCtrl/TextDiffCtrl.h @@ -35,6 +35,7 @@ public: virtual void MouseWheel(Point pt, int zdelta, dword keyflags); virtual void MouseMove(Point pt, dword keyflags); virtual void LeftDown(Point pt, dword keyflags); + virtual void LeftDouble(Point pt, dword keyflags); virtual void LeftUp(Point pt, dword keyflags); virtual void RightDown(Point p, dword keyflags); virtual bool Key(dword key, int repcnt); @@ -78,6 +79,7 @@ private: public: Callback WhenScroll; + Callback WhenLeftDouble; void SetCount(int c); void AddCount(int c);