Exemple #1
0
void FileTabs::ComposeStackedTab(Tab& tab, const Tab& stacked_tab, const Font &font, Color ink, int style)
{
	tab.AddImage(TabBarImg::STSEP);

	if (stackedicons && tab.HasIcon()) {
		tab.AddImage(style == CTRL_HOT ? stacked_tab.img : (greyedicons ? DisabledImage(stacked_tab.img) : stacked_tab.img))
			.Clickable();
	}
	else {
		WString txt = IsString(stacked_tab.value) ? stacked_tab.value : StdConvert().Format(stacked_tab.value);
		int extpos = txt.ReverseFind('.');
	
		Color c = (style == CTRL_HOT) ? extcolor : SColorDisabled();
		if (extpos >= 0) {
			tab.AddText(
				txt.Mid(extpos + 1),
				font,
				c
			).Clickable();
		}
		else {
			tab.AddText("-", font, c).Clickable();
		}
	}
}
Exemple #2
0
void FileTabs::ComposeTab(Tab& tab, const Font &font, Color ink, int style)
{
	if(PaintIcons() && tab.HasIcon())
	{
		tab.AddImage(tab.img);
		tab.AddSpace(TB_SPACEICON);
	}

	WString txt = IsString(tab.value) ? tab.value : StdConvert().Format(tab.value);
	int extpos = txt.ReverseFind('.');
	tab.AddText(extpos >= 0 ? txt.Left(extpos) : txt, font, filecolor);

	if (extpos >= 0) {
		tab.AddText(txt.Right(txt.GetLength() - extpos), font, extcolor);
	}
}
Exemple #3
0
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);
	}
}