ultimatepp/uppsrc/ide/EditorTabBar.cpp
unodgs cccfd8a61a ide: removed second tab bar
git-svn-id: svn://ultimatepp.org/upp/trunk@3063 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2011-01-22 19:19:01 +00:00

59 lines
915 B
C++

#include "ide.h"
EditorTabBar::EditorTabBar()
{
Stacking();
AutoScrollHide(false);
FileIcons(false);
SetBorder(1);
}
String EditorTabBar::GetFile(int n) const
{
return tabs[n].key;
}
bool EditorTabBar::FindSetFile(const String& fn)
{
int n = FindKey(fn);
if(n >= 0)
{
SetCursor(n);
return true;
}
return false;
}
void EditorTabBar::SetAddFile(const String& fn)
{
if(IsNull(fn))
return;
if(FindSetFile(fn))
return;
AddFile(WString(fn), true);
}
void EditorTabBar::RenameFile(const String& fn, const String& nn)
{
FileTabs::RenameFile(WString(fn), WString(nn));
}
void EditorTabBar::SetSplitColor(const String& fn, const Color& c)
{
for(int i = 0; i < tabs.GetCount(); i++)
{
Tab& t = tabs[i];
t.col = t.key == fn ? c : Null;
}
Refresh();
}
void EditorTabBar::ClearSplitColor()
{
for(int i = 0; i < tabs.GetCount(); i++)
{
Tab& t = tabs[i];
t.col = Null;
}
Refresh();
}