Imports System.Drawing.Drawing2D
Imports System.Reflection
Imports System.Text
Module Globals
Public MustInherit Class GraphicItem
Public MustOverride Sub Draw(ByVal G As Graphics)
End Class
Public MustInherit Class ExtendedItem
Inherits GraphicItem
Private _Location As Point
Private _Size As Size
Private _Color As Color
Public Property Location() As Point
Get
Return _Location
End Get
Set(ByVal value As Point)
_Location = value
End Set
End Property
Public Property Size() As Size
Get
Return _Size
End Get
Set(ByVal value As Size)
_Size = value
End Set
End Property
Public Property Color() As Color
Get
Return _Color
End Get
Set(ByVal value As Color)
_Color = value
End Set
End Property
Sub New(ByVal P As Point, ByVal S As Size, ByVal C As Color)
Me.Location = P
Me.Size = S
Me.Color = C
End Sub
Sub New()
End Sub
Public Overrides Sub Draw(ByVal G As Graphics)
End Sub
End Class
Public Class Header
Inherits ExtendedItem
Public Overrides Sub Draw(ByVal G As System.Drawing.Graphics)
Dim Path As New GraphicsPath
Path.AddArc(Me.Location.X, Me.Location.Y, 40, 40, 180, 90)
Path.AddLine(Me.Location.X + 40, Me.Location.Y, Me.Location.X + Me.Size.Width - 40, Me.Location.Y)
Path.AddArc(Me.Location.X + Me.Size.Width - 40, Me.Location.Y, 40, 40, 270, 90)
Path.AddLine(Me.Location.X + Me.Size.Width, Me.Location.Y + Me.Size.Height, Me.Location.X, Me.Location.Y + Me.Size.Height)
Path.AddLine(Me.Location.X, Me.Location.Y + Me.Size.Height, Me.Location.X, Me.Location.Y + Me.Size.Height)
'Path.AddLine(Me.Location.X, Me.Location.Y + Me.Size.Height, Me.Location.X, Me.Location.Y + Me.Size.Height - 40)
Path.CloseFigure()
Dim LBrush As New Drawing2D.LinearGradientBrush( _
New Point(Me.Location.X, Me.Location.Y + Me.Size.Height), _
New Point(Me.Location.X, Me.Location.Y), Me.Color, Drawing.Color.Transparent)
Dim Blend As New Drawing2D.ColorBlend(2)
Blend.Colors = New Color() {Me.Color, Drawing.Color.Transparent}
Blend.Positions = New Single() {0, 1}
LBrush.InterpolationColors = Blend
G.FillPath(LBrush, Path)
G.DrawPath(New Pen(Me.Color), Path)
End Sub
End Class
Public Class Footer
Inherits Header
Public Overrides Sub Draw(ByVal G As System.Drawing.Graphics)
Dim Path As New GraphicsPath
Path.AddLine(Me.Location.X + Me.Size.Width, Me.Location.Y, Me.Location.X + Me.Size.Width, Me.Location.Y + Me.Size.Height - 40)
Path.AddArc(Me.Location.X + Me.Size.Width - 40, Me.Location.Y + Me.Size.Height - 40, 40, 40, 0, 90)
Path.AddLine(Me.Location.X + Me.Size.Width - 40, Me.Location.Y + Me.Size.Height, Me.Location.X + 40, Me.Location.Y + Me.Size.Height)
Path.AddArc(Me.Location.X, Me.Location.Y + Me.Size.Height - 40, 40, 40, 90, 90)
Path.AddLine(Me.Location.X, Me.Location.Y + Me.Size.Height - 40, Me.Location.X, Me.Location.Y)
Dim LBrush As New Drawing2D.LinearGradientBrush( _
New Point(Me.Location.X, Me.Location.Y + Me.Size.Height), _
New Point(Me.Location.X, Me.Location.Y), Drawing.Color.Transparent, Me.Color)
Dim Blend As New Drawing2D.ColorBlend(2)
Blend.Colors = New Color() {Drawing.Color.Transparent, Me.Color}
Blend.Positions = New Single() {0, 1}
LBrush.InterpolationColors = Blend
G.FillPath(LBrush, Path)
G.DrawPath(New Pen(Me.Color), Path)
End Sub
End Class
Public Class Block
Inherits ExtendedItem
Public Overrides Sub Draw(ByVal G As Graphics)
G.FillRectangle(New SolidBrush(Me.Color), Me.Location.X, Me.Location.Y, Me.Size.Width, Me.Size.Height)
End Sub
End Class
Public Class MenuItem
Inherits ExtendedItem
Public Overrides Sub Draw(ByVal G As Graphics)
Dim Path As New GraphicsPath
Dim H As Int32 = Me.Size.Height / 2
Path.AddArc(Me.Location.X, Me.Location.Y, 10, 10, 180, 90)
Path.AddLine(Me.Location.X + 10, Me.Location.Y, Me.Location.X + Me.Size.Width - 10, Me.Location.Y)
Path.AddArc(Me.Location.X + Me.Size.Width - 10, Me.Location.Y, 10, 10, 270, 90)
Path.AddLine(Me.Location.X + Me.Size.Width, Me.Location.Y + 10, Me.Location.X + Me.Size.Width, Me.Location.Y + Me.Size.Height - 20)
Path.AddArc(Me.Location.X + Me.Size.Width - 10, Me.Location.Y + Me.Size.Height - 20, 10, 10, 0, 90)
Path.AddLine(Me.Location.X + Me.Size.Width - 10, Me.Location.Y + Me.Size.Height - 10, Me.Location.X + 10, Me.Location.Y + Me.Size.Height - 10)
Path.AddArc(Me.Location.X, Me.Location.Y + Me.Size.Height - 20, 10, 10, 90, 90)
Path.CloseFigure()
Dim LBrush As New Drawing2D.LinearGradientBrush( _
New Point(Me.Location.X, Me.Location.Y + Me.Size.Height), _
New Point(Me.Location.X, Me.Location.Y), Me.Color, Drawing.Color.White)
Dim Blend As New Drawing2D.ColorBlend(3)
Blend.Colors = New Color() {Me.Color, Drawing.Color.White, Me.Color}
Blend.Positions = New Single() {0, 0.5, 1}
LBrush.InterpolationColors = Blend
G.FillPath(LBrush, Path)
G.DrawPath(New Pen(Drawing.Color.White), Path)
End Sub
End Class
Public Class InheritanceRelation
Private _Base, _Derived As ClassBox
Private _Color As Color
Public Property Color() As Color
Get
Return _Color
End Get
Set(ByVal value As Color)
_Color = value
End Set
End Property
Public Property Base() As ClassBox
Get
Return _Base
End Get
Set(ByVal value As ClassBox)
_Base = value
End Set
End Property
Public Property Derived() As ClassBox
Get
Return _Derived
End Get
Set(ByVal value As ClassBox)
_Derived = value
End Set
End Property
Sub New(ByVal Base As ClassBox, ByVal Derived As ClassBox)
Me.Base = Base
Me.Derived = Derived
End Sub
End Class
End Module