本文整理汇总了C++中DockCont::GetScreenRect方法的典型用法代码示例。如果您正苦于以下问题:C++ DockCont::GetScreenRect方法的具体用法?C++ DockCont::GetScreenRect怎么用?C++ DockCont::GetScreenRect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DockCont
的用法示例。
在下文中一共展示了DockCont::GetScreenRect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ContainerDragStart
void DockWindow::ContainerDragStart(DockCont &dc)
{
if (!dc.IsFloating()) {
// Reposition if not under the mouse
Rect r = dc.GetScreenRect();
Point pt = GetMousePos();
Point tl = r.TopLeft();
bool move = false;
if (r.left > pt.x || r.right < pt.x) {
tl.x += pt.x - r.left - r.Width()/2;
move = true;
}
if (r.top < pt.y) {
tl.y += pt.y - r.top + DOCKCONT_WND_OFFSET;
move = true;
}
// Note: Due to different bugfix, at this point a dragged tab will have docked state but
// no parent and should not be animatehld
dc.SyncUserSize(true, true);
if (IsAnimatedHighlight() && dc.IsDocked() && dc.GetParent()) {
Undock0(dc, true);
dc.StateNotDocked();
}
FloatContainer(dc, move ? tl : Null);
dc.StartMouseDrag(pt);
}
}
示例2: FloatFromTab
void DockWindow::FloatFromTab(DockCont &c, DockCont &tab)
{
Rect r = c.GetScreenRect();
tab.SetRect(r);
tab.StateDocked(*this);
c.RefreshLayout();
tab.MoveBegin();
}
示例3: if
DockCont *DockWindow::FindDockTarget(DockCont &dc, int &dock)
{
Point p = GetMousePos();
Rect r = GetScreenView();
DockCont *target = NULL;
int align = DOCK_NONE;
dock = DOCK_NONE;
if (r.Contains(p)) {
dock = GetPointAlign(p, r, true, true, true);
if (dock != DOCK_NONE && dockpane[dock].IsVisible())
dock = DOCK_NONE;
}
else {
target = GetMouseDockTarget();
if (target) {
r = target->GetScreenRect();
dock = GetDockAlign(*target);
align = GetPointAlign(p, r, IsTabbing(), IsTB(dock), !IsTB(dock));
}
else
return NULL;
}
if (dock != DOCK_NONE && (!dc.IsDockAllowed(dock)
|| IsPaneAnimating(dock) || IsFrameAnimating(dock))
|| (dock == DOCK_NONE && !target)) {
dock = DOCK_NONE;
return NULL;
}
// Prepare for highlight
if (target) {
GetHighlightCtrl().bounds = GetAlignBounds(align, r, IsTabbing(), IsTB(dock), !IsTB(dock));
if (align == DOCK_NONE)
dock = DOCK_NONE; // Tabbing
// The following code handles the case of an insertion between two docked controls. In this case we must set
// the highlight bounds to be a union of the bounds from each control. Very ugly.
if (dock != DOCK_NONE) {
Ctrl *c = IsTL(align) ? target->GetPrev() : target->GetNext();
if (c) {
int opal = align > 1 ? align-2 : align+2;
GetHighlightCtrl().bounds.Union(GetAlignBounds(opal, c->GetScreenRect(), IsTabbing()));
}
target = IsTL(align) ? target : dynamic_cast<DockCont*>(target->GetNext());
}
}
else if (dock != DOCK_NONE)
GetHighlightCtrl().bounds = GetAlignBounds(dock, r, true);
return target;
}