本文整理汇总了C++中DockableCtrl类的典型用法代码示例。如果您正苦于以下问题:C++ DockableCtrl类的具体用法?C++ DockableCtrl怎么用?C++ DockableCtrl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DockableCtrl类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetCtrlRecordFromId
void DockBase::GroupMenuAction(String name, int command, int alignment)
{
DockableCtrl* ctrl = NULL;
Vector<int>& ids = groups.Get(name);
int ncount = ids.GetCount();
bool aligned = (alignment >= DockableCtrl::DOCK_LEFT && alignment <= DockableCtrl::DOCK_BOTTOM);
for(int i = 0; i < ncount * 2; i++)
{
if(i < ncount)
{
ctrl = GetCtrlRecordFromId(ids[i])->ctrl;
ASSERT(ctrl);
ctrl->Shut();
}
else
{
if(i == ncount) RefreshTabWindowList();
ctrl = GetCtrlRecordFromId(ids[i - ncount])->ctrl;
ASSERT(ctrl);
switch(command)
{
case 0: Dock(ctrl->DockingStyle(alignment, DockableCtrl::STATE_SHOW)); break;
case 1: Dock(ctrl->SetSizeHint(Size(0,0)).DockingStyle(alignment, DockableCtrl::STATE_AUTO)); break;
case 2: Dock(ctrl->DockFloat()); break;
case 3: if (i - ncount == 0) TabifyGroupAndDock(name, alignment); break;
case 4: if (i - ncount == 0) TabifyGroupAndAutoHide(name, alignment); break;
case 5: if (i - ncount == 0) TabifyGroupAndFloat(name); break;
}
}
}
}
示例2: ASSERT
void AutoHideBar::ComposeTab(Tab& tab, const Font &font, Color ink, int style)
{
DockableCtrl *d;
WString txt;
const Value &q = tab.value;
ink = (style == CTRL_DISABLED) ? SColorDisabled : ink;
if (IsTypeRaw<DockCont *>(q)) {
DockCont *c = ValueTo<DockCont *>(q);
d = &c->GetCurrent();
txt = c->GetTitle();
}
else {
ASSERT(IsTypeRaw<DockableCtrl *>(q));
d = ValueTo<DockableCtrl *>(q);
txt = d->GetTitle();
}
if(icons)
{
tab.AddImage((style == CTRL_DISABLED) ? DisabledImage(d->GetIcon()) : d->GetIcon());
}
if (showtext)
{
tab.AddText(txt, font, ink);
}
}
示例3: Get0
void DockCont::TabSelected()
{
int ix = tabbar.GetCursor();
if (ix >= 0) {
DockableCtrl *dc = Get0(ix);
if (!dc) return;
Ctrl *ctrl = GetCtrl(ix);
Ctrl *first = &handle;
for (Ctrl *c = first->GetNext(); c; c = c->GetNext())
if (c != ctrl) c->Hide();
ctrl->Show();
Icon(dc->GetIcon()).Title(dc->GetTitle());
handle.dc = dc;
SyncButtons(*dc);
if (IsTabbed()) {
DockCont *c = static_cast<DockCont *>(GetParent());
c->tabbar.SyncRepos();
c->TabSelected();
c->RefreshFrame();
}
else
RefreshLayout();
}
}
示例4: DockAsTab
void DockWindow::DockAsTab(DockCont &target, DockableCtrl &dc)
{
DockCont *c = GetContainer(dc);
if (c) {
if (c->GetCount() == 1)
CloseContainer(*c);
else {
Ctrl *c = dc.GetParent();
dc.Remove();
c->Layout();
}
}
target.Add(dc);
}
示例5: AddWidgettoGroup
bool DockBase::AddWidgettoGroup(String name, DockableCtrl& ctrl)
{
CtrlRecord* record = GetCtrlRecord(ctrl);
if(!record || name == t_("Default")) return false;
NewWidgetGroup(name);
Vector<int>& ids = groups.Get(name);
for(int i = 0; i < ids.GetCount(); i++)
if(ids[i] == record->id)
{
Exclamation(Format(t_("Error: Widget (%s) is already in the group '%s'"), ctrl.GetLabel(), name));
return false;
}
ids.Add(record->id);
grouptab.grouptree.Add(grouptab.grouptree.Find(name), ctrl.GetIcon(), Value(record->id), Value(ctrl.GetLabel()));
return true;
}
示例6: SyncButtons
void DockCont::SyncButtons(DockableCtrl &dc)
{
if (base) {
Ctrl::LogPos lp;
const DockableCtrl::Style &s = dc.GetStyle();
int btnsize = handle.GetHandleSize(s) - 3;
Logc &inc = s.handle_vert ? lp.y : lp.x;
lp.x = s.handle_vert ? Ctrl::Logc(ALIGN_LEFT, 1, btnsize) : Ctrl::Logc(ALIGN_RIGHT, 1, btnsize);
lp.y = Ctrl::Logc(ALIGN_TOP, 1, btnsize);
if (close.GetParent()) {
close.SetLook(s.close).SetPos(lp).Show();
inc.SetA(inc.GetA() + btnsize + 1);
}
bool ah = base->IsAutoHide();
autohide.Show(ah);
if (ah && autohide.GetParent()) {
autohide.SetLook(s.autohide).SetPos(lp);
inc.SetA(inc.GetA() + btnsize + 1);
}
if (windowpos.GetParent())
windowpos.SetLook(s.windowpos).SetPos(lp).Show();
}
else {
close.Hide();
autohide.Hide();
windowpos.Hide();
}
}
示例7: Float
void DockWindow::Float(DockableCtrl &dc, Point p)
{
if (dc.GetParent() && p.IsNullInstance())
p = GetScreenRect().TopLeft();
else
Register(dc);
FloatContainer(*GetReleasedContainer(dc), p);
}
示例8: AutoHide
void DockWindow::AutoHide(int align, DockableCtrl &dc)
{
ALIGN_ASSERT(align);
Register(dc);
DockCont *c = GetReleasedContainer(dc);
c->StateAutoHide(*this);
hideframe[align].AddCtrl(*c, dc.GetGroup());
}
示例9: NewWidgetGroup
void DockBase::NewWidgetGroup(String name, bool predefined)
{
predefined = true;
TreeCtrl& tree = grouptab.grouptree;
Vector<int> ids;
ids.Clear();
int group = groups.FindAdd(name, ids);
if(tree.Find(name) < 0) tree.Add(0, DockCtrlImages::DefaultImage(), Value(name));
if(name != t_("Default")) return;
for(int i = 0; i < ctrls.GetCount(); i++)
{
DockableCtrl * ctrl = ctrls[i]->ctrl;
int id = ctrls[i]->id;
ids.Add(ctrls[i]->id);
tree.Add(tree.Find(name), ctrl->GetIcon(), Value(id), Value(ctrl->GetLabel()));
}
groups[group] = ids;
}
示例10: ContCast
void DockCont::TabDragged(int ix)
{
if (ix >= 0) {
// Special code needed
Value v = tabbar.Get(ix);
if (IsDockCont(v)) {
DockCont *c = ContCast(v);
c->Remove();
base->FloatFromTab(*this, *c);
}
else {
DockableCtrl *c = DockCast(v);
c->Remove();
base->FloatFromTab(*this, *c);
}
if (tabbar.IsAutoHide())
RefreshLayout();
}
}
示例11: Close
void DockWindow::Close(DockableCtrl &dc)
{
DockCont *c = GetContainer(dc);
if (c && c->GetCount() > 1) {
dc.Remove();
c->Layout();
c = NULL;
}
if (c) CloseContainer(*c);
}
示例12: AddCtrlRecord
void DockBase::AddCtrlRecord(DockableCtrl& ctrl)
{
CtrlRecord* record = NULL;
if(GetCtrlRecord(ctrl) || ctrl.IsTabWindow()) return;
ctrls.Add((record = new CtrlRecord()));
if(record)
{
record->ctrl = &ctrl;
record->id = ctrls.GetCount();
ImageCtrl* imagectrl = new ImageCtrl();
panelicons.Add(imagectrl);
}
}
示例13: DoDragAndDrop
void DockBase::DoDragAndDrop(DockableCtrl& ctrl, Point p, Size sz)
{
for(int i = 0; i < 4; i++)
{
for(int j = 0; j < 4; j++)
{
if(i != j)
{
if(!GetPaneFrame(j).HasCtrlInRange(ctrl, p))
{
GetPaneFrame(j).DnDSourceoutofRange();
GetPaneFrame(j).DnDAnimate();
}
}
}
if(GetPaneFrame(i).HasCtrlInRange(ctrl, p))
{
ctrl.SetDropTarget(i, ctrl.GetDropState());
break;
}
}
}
示例14: IsDockAllowed
bool DockWindow::IsDockAllowed(int align, DockableCtrl &dc)
{
ALIGN_ASSERT(align);
return dockable[align] && dc.IsDockAllowed(align);
}
示例15: OnClose
void AutoHideBar::OnClose(int id, DockableCtrl& ctrl)
{
ctrl.Shut();
}