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.vb
59 lines (52 loc) · 2.04 KB
/
SimpleGroupObjectPainter.vb
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
Imports System.Drawing
Imports DevExpress.Skins
Imports DevExpress.Utils.Drawing
Imports DevExpress.Utils
Imports DevExpress.XtraEditors.Controls
Namespace DxSample.Editors
Public Class SimpleGroupObjectPainter
Inherits SkinGroupObjectPainter
Public Sub New(ByVal owner As IPanelControlOwner, ByVal provider As ISkinProvider)
MyBase.New(owner, provider)
End Sub
Public Sub New(ByVal owner As IPanelControlOwner, ByVal provider As ISkinProvider, ByVal groupPanelSkinElementName As String)
MyBase.New(owner, provider, groupPanelSkinElementName)
End Sub
Protected Overrides Function GetBorderBounds(ByVal info As GroupObjectInfoArgs) As Rectangle
Dim result As Rectangle = info.Bounds
If info.CaptionBounds.IsEmpty Then
Return result
End If
If Me.IsVerticalCaption(info) Then
Dim width As Integer = info.CaptionBounds.Width \ 2
If Me.GetCaptionLocation(info) = Locations.Left Then
result.X += width
End If
result.Width -= width
Else
Dim height As Integer = info.CaptionBounds.Height \ 2
If Me.GetCaptionLocation(info) = Locations.Top Then
result.Y += height
End If
result.Height -= height
End If
Return result
End Function
Protected Overrides Sub DrawCaptionSkinElement(ByVal info As GroupObjectInfoArgs)
End Sub
Protected Overrides Function GetBorderPainter(ByVal e As ObjectInfoArgs) As ObjectPainter
Dim args As GroupObjectInfoArgs = CType(e, GroupObjectInfoArgs)
If args.BorderStyle = BorderStyles.NoBorder AndAlso (Not args.ShowCaption) Then
Return New SkinGroupEmptyBorderPainter(Me.Provider)
End If
Return New SimpleGroupBorderPainter(Me, Me.Provider)
End Function
Protected Overrides Sub DrawCaptionText(ByVal info As GroupObjectInfoArgs)
MyBase.DrawCaptionText(info)
End Sub
Protected Overrides Function GetActualCaptionTextBackColor(ByVal info As GroupObjectInfoArgs) As Color
Dim result As Color = MyBase.GetActualCaptionTextBackColor(info)
Return If(result.IsEmpty, info.Appearance.BackColor, result)
End Function
End Class
End Namespace