diff --git a/uppsrc/CtrlCore/CtrlMouse.cpp b/uppsrc/CtrlCore/CtrlMouse.cpp index 9a35a6c3d..c3db123e1 100644 --- a/uppsrc/CtrlCore/CtrlMouse.cpp +++ b/uppsrc/CtrlCore/CtrlMouse.cpp @@ -315,7 +315,7 @@ Ctrl *Ctrl::ChildFromPoint(Point& pt) const } } } - return NULL; + return nullptr; } for(q = GetLastChild(); q; q = q->GetPrev()) { if(q->InFrame()) { @@ -335,7 +335,7 @@ Ctrl *Ctrl::ChildFromPoint(Point& pt) const } } } - return NULL; + return nullptr; } Image Ctrl::MEvent0(int e, Point p, int zd) @@ -650,7 +650,8 @@ Image Ctrl::DispatchMouseEvent(int e, Point p, int zd) { if(!IsEnabled()) return Image::Arrow(); Ctrl *top = this; - if(findarg(e, MOUSEWHEEL, MOUSEHWHEEL) >= 0 && !GetParent()) { + bool wheel = findarg(e, MOUSEWHEEL, MOUSEHWHEEL) >= 0; + if(wheel && !GetParent()) { Ctrl *w = GetFocusCtrl(); if(w) { top = w->GetTopCtrl(); @@ -658,10 +659,11 @@ Image Ctrl::DispatchMouseEvent(int e, Point p, int zd) { } } Top *t = top->GetTop(); - if(t) + if(!wheel && t) for(Ptr popup : ReverseRange(t->virtual_popups)) { if(popup) { DLOG("+++++ Mouse Event"); + DDUMP(Name(this)); DDUMP(Name(popup)); Rect r = popup->GetVirtualPopUpRect(popup->GetScreenRect().GetSize()); DDUMP(p); @@ -686,7 +688,10 @@ Ctrl *Ctrl::GetTopCaptureCtrl() const bool Ctrl::SetCapture() { GuiLock __; ReleaseCtrlCapture(); - if(!GetTopCaptureCtrl()->SetWndCapture()) return false; + Ctrl *q = GetTopCaptureCtrl(); + if(q->IsVirtualPopUp()) + q = q->GetOwner(); + if(!q->SetWndCapture()) return false; captureCtrl = mouseCtrl = this; return true; } diff --git a/uppsrc/CtrlCore/VirtualPopup.cpp b/uppsrc/CtrlCore/VirtualPopup.cpp index 747b4296a..c8d04b1ac 100644 --- a/uppsrc/CtrlCore/VirtualPopup.cpp +++ b/uppsrc/CtrlCore/VirtualPopup.cpp @@ -9,15 +9,11 @@ void Ctrl::VirtualPopUp(Ctrl *owner, bool activate) { ASSERT(!IsOpen()); TopWindow *win = owner->GetTopWindow(); + ASSERT(owner && win); Top *top = win->GetTop(); - if(!win || !top) { -// Popup(owner); // Fix this for splash screens - return; - } + ASSERT(top); top->virtual_popups.Add(this); -// _DBG_ win->Refresh(); - Top *vtop = new Top; SetTop(vtop); diff --git a/uppsrc/CtrlLib/ScrollBar.cpp b/uppsrc/CtrlLib/ScrollBar.cpp index 2e325994a..e1fce8ff6 100644 --- a/uppsrc/CtrlLib/ScrollBar.cpp +++ b/uppsrc/CtrlLib/ScrollBar.cpp @@ -207,10 +207,13 @@ Rect ScrollBar::GetPartRect(int p) const { void ScrollBar::Paint(Draw& w) { + DLOG("+++ ScrollBar::Paint"); w.DrawRect(GetSize(), style->bgcolor); int cc; Size sz = style->through ? GetSize() : Slider(cc).GetSize(); light = GetMousePart(); + DDUMP(HasMouseIn()); + DDUMP((int)light); int p = push; if(!HasCapture() || buttons_capture) p = -1; @@ -329,11 +332,18 @@ void ScrollBar::LeftDown(Point p, dword) { } void ScrollBar::MouseMove(Point p, dword) { + DLOG("----- ScrollBar::MouseMove"); + DDUMP(HasMouseIn()); + DDUMP(GetMousePart()); + DDUMP((int)light); + DDUMP(HasCapture()); if(HasCapture() && push == 2) Drag(p); else - if(light != GetMousePart()) + if(light != GetMousePart()) { + DLOG("ScrollBar Refresh"); Refresh(); + } } void ScrollBar::MouseEnter(Point p, dword)