ultimatepp/bazaar/QuickTabs/QuickTabs.cpp
mrjt 11592adacb Added QuickTabs package (TabBar version)
Removed redundant TabBarTest
Added missing file from previous update
TaBar bug fixes

git-svn-id: svn://ultimatepp.org/upp/trunk@1280 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2009-06-05 09:02:58 +00:00

55 lines
1.3 KiB
C++

#include "QuickTabs.h"
QuickTabs::QuickTabs()
{
Stacking(true);
GroupSort(true);
GroupSeparators(true);
FileTabs::FileIcons(false, false, true);
FileTabs::WhenCloseAll <<= THISBACK(OnCloseAll);
}
void QuickTabs::ContextMenu(Bar& bar)
{
bar.Add("Settings", THISBACK(OnSettingsMenu));
FileTabs::ContextMenu(bar);
}
void QuickTabs::SettingsMenu(Bar &bar)
{
bar.Add("Stacking", IsStacking() ? TabBarImg::CHK() : Image(), THISBACK1(ToggleStacking));
bar.Add("Sort by group", IsGroupSort() ? TabBarImg::CHK() : Image(), THISBACK1(ToggleGroupSort));
bar.Add("Group separators", HasGroupSeparators() ? TabBarImg::CHK() : Image(), THISBACK1(ToggleGroupSeparators));
bar.Add("Show inactive", IsShowInactive ? TabBarImg::CHK() : Image(), THISBACK1(ToggleInactive));
}
void QuickTabs::Add(const char *name, bool make_active)
{
FileTabs::AddFile(name, make_active);
}
bool QuickTabs::FindSetFile(const String& fn)
{
int n = FindKey(fn.ToWString())
if (n >= 0) SetCursor(n);
return n >= 0;
}
void QuickTabs::SetAddFile(const String& fn)
{
if (IsNull(fn)) return;
if (!FindSetFile(fn))
FileTabs::AddFile(tn.ToWString());
}
void QuickTabs::RenameFile(const String& fn, const String& nn)
{
FileTabs::RenameFile(fn.ToWString(), nn.ToWString());
}
void QuickTabs::Set(const QuickTabs& t)
{
*this << t;
}