doing stuff

This commit is contained in:
Mirek Fidler 2026-06-14 13:25:25 +02:00
parent 61e8041000
commit b7d2ca42ea
3 changed files with 23 additions and 12 deletions

View file

@ -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<Ctrl> 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;
}

View file

@ -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);

View file

@ -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)