This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SimpleGroupObjectPainter.cs
45 lines (39 loc) · 2.01 KB
/
SimpleGroupObjectPainter.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
using System.Drawing;
using DevExpress.Skins;
using DevExpress.Utils.Drawing;
using DevExpress.Utils;
using DevExpress.XtraEditors.Controls;
namespace DxSample.Editors {
public class SimpleGroupObjectPainter :SkinGroupObjectPainter {
public SimpleGroupObjectPainter(IPanelControlOwner owner, ISkinProvider provider) : base(owner, provider) { }
public SimpleGroupObjectPainter(IPanelControlOwner owner, ISkinProvider provider, string groupPanelSkinElementName) : base(owner, provider, groupPanelSkinElementName) { }
protected override Rectangle GetBorderBounds(GroupObjectInfoArgs info) {
Rectangle result = info.Bounds;
if (info.CaptionBounds.IsEmpty) return result;
if (this.IsVerticalCaption(info)) {
int width = info.CaptionBounds.Width / 2;
if (this.GetCaptionLocation(info) == Locations.Left) result.X += width;
result.Width -= width;
} else {
int height = info.CaptionBounds.Height / 2;
if (this.GetCaptionLocation(info) == Locations.Top) result.Y += height;
result.Height -= height;
}
return result;
}
protected override void DrawCaptionSkinElement(GroupObjectInfoArgs info) { }
protected override ObjectPainter GetBorderPainter(ObjectInfoArgs e) {
GroupObjectInfoArgs args = (GroupObjectInfoArgs)e;
if (args.BorderStyle == BorderStyles.NoBorder && !args.ShowCaption)
return new SkinGroupEmptyBorderPainter(this.Provider);
return new SimpleGroupBorderPainter(this, this.Provider);
}
protected override void DrawCaptionText(GroupObjectInfoArgs info) {
base.DrawCaptionText(info);
}
protected override Color GetActualCaptionTextBackColor(GroupObjectInfoArgs info) {
Color result = base.GetActualCaptionTextBackColor(info);
return result.IsEmpty ? info.Appearance.BackColor : result;
}
}
}