本文整理汇总了C++中DockCont::GetParent方法的典型用法代码示例。如果您正苦于以下问题:C++ DockCont::GetParent方法的具体用法?C++ DockCont::GetParent怎么用?C++ DockCont::GetParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DockCont
的用法示例。
在下文中一共展示了DockCont::GetParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ContainerDragEnd
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();
}
示例2: 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);
}
}