This repository has been archived by the owner on Sep 11, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CaptionBar.cs
74 lines (60 loc) · 2.68 KB
/
CaptionBar.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
using System;
using DevExpress.Skins;
using DevExpress.LookAndFeel;
using DevExpress.XtraEditors;
using DevExpress.Utils.Drawing;
namespace S134179 {
public class CaptionBar:GroupControl {
public CaptionBar() : base() { }
protected override ObjectPainter CreatePainter() {
switch (LookAndFeel.ActiveStyle) {
case ActiveLookAndFeelStyle.Office2003: return new CaptionBarObjectPainter(this);
case ActiveLookAndFeelStyle.WindowsXP: return new WindowsXPCaptionBarObjectPainter(this);
case ActiveLookAndFeelStyle.Skin:
return new SkinCaptionBarObjectPainter(this, LookAndFeel);
}
return new FlatCaptionBarObjectPainter(this);
}
}
public class SkinCaptionBarObjectPainter :SkinGroupObjectPainter {
public SkinCaptionBarObjectPainter(IPanelControlOwner owner, ISkinProvider provider)
: base(owner, provider) { }
protected override int CalcCaptionContentHeight(GroupObjectInfoArgs info) {
return info.Bounds.Height;
}
protected override void CalcCaptionNew(GroupObjectInfoArgs info) {
info.CaptionBounds = info.Bounds;
CalcCaptionElements(info, info.Bounds);
}
}
public class CaptionBarObjectPainter :GroupObjectPainter {
public CaptionBarObjectPainter(IPanelControlOwner owner) : base(owner) { }
protected override int CalcCaptionContentHeight(GroupObjectInfoArgs info) {
return info.Bounds.Height;
}
protected override void CalcCaptionNew(GroupObjectInfoArgs info) {
info.CaptionBounds = info.Bounds;
CalcCaptionElements(info, info.Bounds);
}
}
public class WindowsXPCaptionBarObjectPainter :WindowsXPGroupObjectPainter {
public WindowsXPCaptionBarObjectPainter(IPanelControlOwner owner) : base(owner) { }
protected override int CalcCaptionContentHeight(GroupObjectInfoArgs info) {
return info.Bounds.Height;
}
protected override void CalcCaptionNew(GroupObjectInfoArgs info) {
info.CaptionBounds = info.Bounds;
CalcCaptionElements(info, info.Bounds);
}
}
public class FlatCaptionBarObjectPainter :FlatGroupObjectPainter {
public FlatCaptionBarObjectPainter(IPanelControlOwner owner) : base(owner) { }
protected override int CalcCaptionContentHeight(GroupObjectInfoArgs info) {
return info.Bounds.Height;
}
protected override void CalcCaptionNew(GroupObjectInfoArgs info) {
info.CaptionBounds = info.Bounds;
CalcCaptionElements(info, info.Bounds);
}
}
}