本文整理汇总了C++中DockableCtrl::GetIcon方法的典型用法代码示例。如果您正苦于以下问题:C++ DockableCtrl::GetIcon方法的具体用法?C++ DockableCtrl::GetIcon怎么用?C++ DockableCtrl::GetIcon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DockableCtrl
的用法示例。
在下文中一共展示了DockableCtrl::GetIcon方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ComposeTab
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);
}
}
示例2: TabSelected
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();
}
}
示例3: GetStdSize
Size DockTabBar::GetStdSize(const Tab &t)
{
DockableCtrl *d;
const Value &q = t.key;
Value v;
if (IsTypeRaw<DockCont *>(q)) {
DockCont *c = ValueTo<DockCont *>(q);
d = &c->GetCurrent();
v = c->GetTitle();
}
else {
ASSERT(IsTypeRaw<DockableCtrl *>(q));
d = ValueTo<DockableCtrl *>(q);
v = d->GetTitle();
}
int isz = (IsVert() ? d->GetIcon().GetHeight() : d->GetIcon().GetWidth());
return showtext ? (TabBar::GetStdSize(v) + Size(isz+2, 0)) : Size(isz, isz);
}
示例4: 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;
}
示例5: 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;
}
示例6: RefreshPanel
void DockBase::RefreshPanel()
{
if(!controlpanel.IsOpen() || !controlpanel.IsVisible()) return;
listtab.list.Clear();
for(int i = 0; i < GetCtrlRecords().GetCount(); i++)
{
int alignment = 0;
bool tabbed = false;
bool floating = false;
DockableCtrl* ctrl = GetCtrlRecordFromIndex(i)->ctrl;
if(ctrl->IsTabbed())
{
TabWindow* tabwindow = dynamic_cast<DockWindow*>(ctrl)->GetOwnerTab();
if(tabwindow)
{
alignment = tabwindow->GetBaseTab()->Alignment();
floating = tabwindow->GetBaseTab()->IsAutoHidden();
tabbed = true;
}
}
else alignment = ctrl->Alignment();
String a, s;
switch(alignment)
{
case DockableCtrl::DOCK_LEFT:
a = t_("LEFT");
break;
case DockableCtrl::DOCK_TOP:
a = t_("TOP");
break;
case DockableCtrl::DOCK_RIGHT:
a = t_("RIGHT");
break;
case DockableCtrl::DOCK_BOTTOM:
a = t_("BOTTOM");
break;
case DockableCtrl::DOCK_NONE:
if(ctrl->IsFloating() || tabbed)
a = t_("FLOATING");
else
a = t_("NONE");
break;
}
switch(ctrl->State())
{
case DockableCtrl::STATE_SHOW:
s = t_("SHOWN");
break;
case DockableCtrl::STATE_HIDE:
s = t_("HIDDEN");
break;
case DockableCtrl::STATE_AUTO:
s = t_("AUTO HIDDEN");
break;
case DockableCtrl::STATE_SHUT:
s = t_("SHUT");
break;
case DockableCtrl::STATE_TABBED:
floating ?
s = t_("AUTO HIDDEN")
:
s = t_("TABBED");
break;
}
listtab.list.Add(0, Format("%s",ctrl->GetLabel()), a, s, ctrl->Position());
listtab.list.SetCtrl(i, 0, (panelicons.At(i))->SetImage(ctrl->GetIcon().IsNullInstance() ?
DockCtrlImages::DefaultImage : ctrl->GetIcon()));
}
controlpanel.Refresh();
}