Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Imports System.Drawing, System.Drawing.Drawing2D
- Imports System.Text
- Module ConversionFunctions ' By Tedd
- Function ConvertToBrush(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Brush
- Return New SolidBrush(Color.FromArgb(R, G, B))
- End Function
- Function ConvertToBrush(ByVal Pen As Pen) As Brush
- Return New SolidBrush(Pen.Color)
- End Function
- Function ConvertToBrush(ByVal Color As Color) As Brush
- Return New SolidBrush(Color)
- End Function
- Function ConvertToPen(ByVal R As Integer, ByVal G As Integer, ByVal B As Integer) As Pen
- Return New Pen(New SolidBrush(Color.FromArgb(R, G, B)))
- End Function
- Function ConvertToPen(ByVal Brush As SolidBrush) As Pen
- Return New Pen(Brush)
- End Function
- Function ConvertToPen(ByVal Color As Color) As Pen
- Return New Pen(New SolidBrush(Color))
- End Function
- End Module
- Class AdobeTheme
- Inherits ThemeContainer152
- Enum Alignment As Integer
- Left = 0
- Center = 1
- Right = 2
- End Enum
- #Region "Properties"
- Private textAlign As Alignment
- Public Property TextAlignment() As Alignment
- Get
- Return textAlign
- End Get
- Set(ByVal value As Alignment)
- textAlign = value
- Invalidate()
- End Set
- End Property
- Private textColor As Color
- Public Overrides Property Forecolor() As Color
- Get
- Return textColor
- End Get
- Set(ByVal value As Color)
- textColor = value
- Invalidate()
- End Set
- End Property
- #End Region
- Sub New()
- MoveHeight = 19
- TransparencyKey = Color.Fuchsia
- BackColor = Color.FromArgb(68, 68, 68)
- Me.Font = New Font("Microsoft Sans Serif", 9, FontStyle.Bold)
- Forecolor = Color.White
- End Sub
- Protected Overrides Sub ColorHook()
- 'Void
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(BackColor)
- 'Top bar
- G.FillRectangle(ConvertToBrush(51, 51, 51), 0, 0, Width, 37)
- G.DrawLine(ConvertToPen(31, 31, 31), 0, 37, Width, 37)
- G.DrawLine(ConvertToPen(60, 60, 60), 0, 38, Width, 38)
- 'Middle
- G.FillRectangle(ConvertToBrush(68, 68, 68), 1, 39, Width - 2, Height - 41)
- 'Bottom bar
- G.FillRectangle(ConvertToBrush(51, 51, 51), 1, Height - 37, Width, 37)
- G.DrawLine(ConvertToPen(31, 31, 31), 0, Height - 37, Width, Height - 37)
- G.DrawLine(ConvertToPen(60, 60, 60), 0, Height - 38, Width, Height - 38)
- 'Title
- Select Case textAlign
- Case 0 'Left
- DrawText(Brushes.Black, Text, HorizontalAlignment.Left, 10, 20)
- DrawText(ConvertToBrush(Forecolor), Text, HorizontalAlignment.Left, 8, 18)
- Case 1 'Center
- DrawText(Brushes.Black, Text, HorizontalAlignment.Center, 2, 20)
- DrawText(ConvertToBrush(Forecolor), Text, HorizontalAlignment.Center, 0, 18)
- Case 2 'Right
- DrawText(Brushes.Black, Text, HorizontalAlignment.Right, 10, 20)
- DrawText(ConvertToBrush(Forecolor), Text, HorizontalAlignment.Right, 8, 18)
- End Select
- 'Border
- DrawBorders(Pens.Black)
- DrawBorders(Pens.Gray, 1)
- 'Rounding
- Select Case Parent.FindForm.FormBorderStyle
- Case FormBorderStyle.None
- DrawCorners(Color.Fuchsia)
- Case Else
- DrawCorners(Color.Black)
- End Select
- End Sub
- End Class
- Class AdobeButton
- Inherits ThemeControl152
- #Region " Properties "
- Private alt As Boolean
- Public Property Alternate() As Boolean
- Get
- Return alt
- End Get
- Set(ByVal value As Boolean)
- alt = value
- End Set
- End Property
- #End Region
- Sub New()
- BackColor = Color.FromArgb(51, 51, 51)
- End Sub
- Protected Overrides Sub ColorHook()
- 'Void
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(Color.FromArgb(102, 102, 102))
- Dim gC As Integer = 15
- Dim _text As Color = Color.White
- Dim C1, C2, C3, C4 As Color
- Select Case Alternate
- Case True
- C1 = Color.FromArgb(255, 209, 51)
- C2 = Color.FromArgb(255, 165, 13)
- C3 = Color.FromArgb(255, 195, 13)
- C4 = Color.FromArgb(255, 163, 0)
- Case False
- C1 = Color.FromArgb(105, 105, 105)
- C2 = Color.FromArgb(56, 56, 56)
- C3 = Color.FromArgb(73, 73, 73)
- C4 = Color.FromArgb(48, 48, 48)
- End Select
- DrawGradient(C1, C2, 0, 0, Width, Height, 90S)
- DrawGradient(C3, C4, 1, 1, Width - 2, Height - 2, 90S)
- Select Case State
- Case MouseState.None
- 'NULL
- Case MouseState.Over
- Select Case Alternate
- Case True
- _text = Color.Black
- End Select
- gC = 5
- Case MouseState.Down
- Select Case Alternate
- Case True
- _text = Color.White
- End Select
- gC = 10
- End Select
- For i = 1 To 5
- G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(Int(255 / (i * gC)), Color.White))), New Rectangle(i, i, Width - 2 - (i * 2), Height - 2 - (i * 2)))
- Next
- DrawBorders(Pens.Black)
- DrawText(ConvertToBrush(Color.FromArgb(180, Color.Black)), HorizontalAlignment.Center, 0, 2)
- DrawText(ConvertToBrush(_text), HorizontalAlignment.Center, -1, 1)
- End Sub
- End Class
- Class AdobeProgressBar
- Inherits ThemeControl152
- #Region " Properties "
- Private Max As Integer
- Public Property Maximum() As Integer
- Get
- Return Max
- End Get
- Set(ByVal value As Integer)
- If Max > 0 Then Max = value Else Max = 1
- If value > Max Then value = Max
- Invalidate()
- End Set
- End Property
- Private Val As Integer
- Public Property Value() As Integer
- Get
- Return Val
- End Get
- Set(ByVal value As Integer)
- If Val > -1 Then
- Select Case value
- Case Is > Max
- Val = Max
- Case Else
- Val = value
- End Select
- Else
- Val = 0
- End If
- Invalidate()
- End Set
- End Property
- #End Region
- Sub New()
- Maximum = 100
- Size = New Size(150, 16)
- End Sub
- Protected Overrides Sub ColorHook()
- 'Void
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(Color.FromArgb(68, 68, 68))
- 'Fill
- Select Case Val
- Case Is > 0
- DrawGradient(Color.FromArgb(132, 192, 240), Color.FromArgb(78, 123, 168), 3, 3, CInt((Val / Max) * Width - 8) + 2, Height - 6, 90S)
- DrawGradient(Color.FromArgb(98, 159, 220), Color.FromArgb(62, 102, 147), 4, 4, CInt((Val / Max) * Width - 8), Height - 8, 90S)
- End Select
- DrawBorders(Pens.Black)
- DrawBorders(Pens.Gray, 1)
- End Sub
- End Class
- Class AdobeSeperator
- Inherits ThemeControl152
- #Region " Properties "
- Private vert As Boolean
- Public Property Vertical() As Boolean
- Get
- Return vert
- End Get
- Set(ByVal value As Boolean)
- vert = value
- Invalidate()
- End Set
- End Property
- #End Region
- Sub New()
- Vertical = False
- Size = New Size(100, 15)
- BackColor = Color.FromArgb(68, 68, 68)
- End Sub
- Protected Overrides Sub ColorHook()
- 'Void
- End Sub
- Protected Overrides Sub PaintHook()
- G.Clear(BackColor)
- Dim P1 As Pen = ConvertToPen(Color.FromArgb(40, Color.White))
- Dim P2 As Pen = ConvertToPen(Color.FromArgb(170, Color.Black))
- Select Case vert
- Case True
- G.DrawLine(P1, CInt(Me.Width / 2) - 1, 0, CInt(Me.Width / 2) - 1, Height)
- G.DrawLine(P2, CInt(Me.Width / 2), 0, CInt(Me.Width / 2), Height)
- G.DrawLine(P1, CInt(Me.Width / 2) + 1, 0, CInt(Me.Width / 2) + 1, Height)
- Case False
- G.DrawLine(P1, 0, CInt(Me.Height / 2) - 1, Width, CInt(Me.Height / 2) - 1)
- G.DrawLine(P2, 0, CInt(Me.Height / 2), Width, CInt(Me.Height / 2))
- G.DrawLine(P1, 0, CInt(Me.Height / 2) + 1, Width, CInt(Me.Height / 2) + 1)
- Case False
- End Select
- End Sub
- End Class
- Class AdobeBox
- Inherits ThemeContainer152
- #Region " Properties "
- Private fc As Color
- Public Overrides Property Forecolor() As Color
- Get
- Return fc
- End Get
- Set(ByVal value As Color)
- fc = value
- Invalidate()
- End Set
- End Property
- #End Region
- Sub New()
- ControlMode = True
- Forecolor = Color.White
- End Sub
- Protected Overrides Sub ColorHook()
- End Sub
- Protected Overrides Sub PaintHook()
- Dim P1, P2 As Pen
- P1 = New Pen(New SolidBrush(Color.FromArgb(31, 31, 31)))
- P2 = New Pen(New SolidBrush(Color.FromArgb(131, 131, 131)))
- G.Clear(BackColor)
- DrawBorders(P1, New Rectangle(0, 10, Width, Height - 10))
- DrawBorders(P2, New Rectangle(0, 10, Width, Height - 10), 1)
- DrawBorders(P1, New Rectangle(10, 0, G.MeasureString(Text, Font).Width + 10, 20))
- DrawBorders(P2, New Rectangle(10, 0, G.MeasureString(Text, Font).Width + 10, 20), 1)
- G.FillRectangle(New SolidBrush(BackColor), New Rectangle(12, 2, G.MeasureString(Text, Font).Width + 6, 20))
- G.DrawString(Text, Font, New SolidBrush(Forecolor), 14, 4)
- G.DrawString(Text, Font, ConvertToBrush(Color.FromArgb(50, Color.Black)), 16, 6)
- End Sub
- End Class
- Class AdobeTitleBox
- Inherits ThemeContainer152
- #Region " Properties "
- Private fc As Color
- Public Overrides Property Forecolor() As Color
- Get
- Return fc
- End Get
- Set(ByVal value As Color)
- fc = value
- Invalidate()
- End Set
- End Property
- #End Region
- Sub New()
- ControlMode = True
- Forecolor = Color.White
- End Sub
- Protected Overrides Sub ColorHook()
- End Sub
- Protected Overrides Sub PaintHook()
- Dim P1, P2 As Pen
- P1 = New Pen(New SolidBrush(Color.FromArgb(31, 31, 31)))
- P2 = New Pen(New SolidBrush(Color.FromArgb(131, 131, 131)))
- Dim tH As Integer = G.MeasureString(Text, Font).Height
- Dim tW As Integer = G.MeasureString(Text, Font).Width
- G.Clear(BackColor)
- DrawBorders(P1, New Rectangle(10, 10, Width - 20, Height - 10))
- DrawBorders(P2, New Rectangle(10, 10, Width - 20, Height - 10), 1)
- G.FillRectangle(Brushes.Black, New Rectangle(0, 0, Width, tH + 10))
- DrawBorders(P1, New Rectangle(0, 0, Width, tH + 10))
- DrawBorders(P2, New Rectangle(0, 0, Width, tH + 10), 1)
- G.FillPolygon(Brushes.Black, {New Point(1, tH + 9), New Point(10, tH + 9), New Point(10, tH + 15), New Point(1, tH + 9)})
- G.FillPolygon(Brushes.Black, {New Point(Width - 1, tH + 9), New Point(Width - 10, tH + 9), New Point(Width - 10, tH + 15), New Point(Width - 1, tH + 9)})
- G.DrawString(Text, Font, Brushes.White, New Point(CInt((Me.Width / 2) - (G.MeasureString(Text, Font).Width / 2)), 4))
- End Sub
- End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement