void DockWindow::ContainerDragEnd(DockCont &dc) { KillTimeCallback(TIMEID_ANIMATE_DELAY); if (!dc.IsFloating()) return; HighlightCtrl &hl = GetHighlightCtrl(); Ctrl *p = hl.GetParent(); int align = DOCK_NONE; if (p) for (int i = 0; i < 4; i++) if (p == &dockpane[i]) align = i; if (animatewnd && (p || align != DOCK_NONE)) { FloatAnimate(dc, hl.GetScreenRect()); } if (align != DOCK_NONE) { Unfloat(dc); dc.StateDocked(*this); dockpane[align].Swap(hl, dc); } else if (DockCont *target = dynamic_cast<DockCont *>(p)) { StopHighlight(false); bool nest = (GetMouseFlags() & NestedToggleKey()) ? !IsNestedTabs() : IsNestedTabs(); DockContainerAsTab(*target, dc, nest && dc.GetCount() > 1); } else StopHighlight(false); if (dc.GetParent()) dc.SetFocus(); }
void CMouse::SetCursor(const CPoint& screenPoint) { ASSERT(CursorOnWindow(screenPoint, GetWnd())); CPoint clientPoint(screenPoint); GetWnd().ScreenToClient(&clientPoint); SetCursor(GetMouseFlags(), screenPoint, clientPoint); }
void MultiButton::SyncInfo() { if((HasMouse() || info.HasMouse()) && display && (GetMouseFlags() & (K_MOUSELEFT|K_MOUSERIGHT|K_MOUSEMIDDLE)) == 0) { Point p = GetMouseViewPos(); NilDraw nw; Rect r = Paint0(nw, true); if(r.Contains(p)) { Value v = convert->Format(value); int cm = DPI(2); r.left -= cm; r.right += cm; info.Set(this, r, value, display, SColorText, SColorPaper, 0, DPI(2)); return; } } info.Cancel(); }
void DockWindow::HighlightCtrl::Paint(Draw &w) { if (!img.IsEmpty()) w.DrawImage(0, 0, img); bool nest = (GetMouseFlags() & nestedkey) ? !isnested : isnested; if (nest) { Rect r = GetSize(); Rect t = r; const TabCtrl::Style &s = TabCtrl::StyleDefault(); t.bottom -= s.tabheight + s.sel.top + 1; // Nasty bodge! See TabBar::GetStyleHeight r.top = t.bottom-1; r.right = max(min(150, r.GetWidth()/3), 20); r.left += 10; ChPaint(w, r, *highlight); ChPaint(w, t, *highlight); } else ChPaint(w, GetSize(), *highlight); }