-
Notifications
You must be signed in to change notification settings - Fork 0
/
MyTabButtonsPanel.cs
51 lines (44 loc) · 1.5 KB
/
MyTabButtonsPanel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
using DevExpress.XtraEditors.Controls;
using DevExpress.XtraTab;
using DevExpress.XtraTab.Buttons;
using DevExpress.XtraTab.ViewInfo;
namespace CustomTabbedMdiManager
{
public class MyTabButtonsPanel : TabButtonsPanel
{
public MyTabButtonsPanel(BaseTabControlViewInfo tabViewInfo)
: base(tabViewInfo)
{
}
public override void CreateButtons(TabButtons buttons, CustomHeaderButtonCollection userButtons) {
if (this.keepButtons > 0)
return;
Buttons.Clear();
if (TabViewInfo.AddActiveFilesButton)
this.Buttons.Add(CreateButton(TabButtonType.User));
if ((buttons & TabButtons.Prev) != 0)
this.Buttons.Add(CreateButton(TabButtonType.Prev));
if ((buttons & TabButtons.Next) != 0)
this.Buttons.Add(CreateButton(TabButtonType.Next));
if ((buttons & TabButtons.Close) != 0)
this.Buttons.Add(CreateButton(TabButtonType.Close));
}
protected override TabButtonInfo CreateButton(TabButtonType button)
{
if ( button == TabButtonType.User )
{
ButtonPredefines predefine = Orientation == TabOrientation.Horizontal ? ButtonPredefines.Down : ButtonPredefines.Right;
TabButtonInfo tabBtn = new TabButtonInfo(new EditorButton(predefine), button);
return tabBtn;
}
return base.CreateButton(button);
}
public new MySkinTabControlViewInfo TabViewInfo
{
get
{
return base.TabViewInfo as MySkinTabControlViewInfo;
}
}
}
}