Guest User

Somnium Theme - Perplexity

a guest
Sep 17th, 2011
669
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 9.33 KB | None | 0 0
  1. #Region "Credits" 'Leave this here!
  2. 'This theme was created by Perplexity from HackForums.
  3. 'You DO NOT have the right to give this to anyone without permission. This is the sole property of Perplexity.
  4. #End Region
  5. Imports System.Drawing.Drawing2D
  6. Class SomniumThemeA
  7.     Inherits ThemeContainer151
  8.     Private C1 As Color 'G.Clear
  9.     Private C2, C3, C4, C5 As Color 'Gradients
  10.     Private P1 As Pen 'DrawRectangle
  11.     Private B1 As Brush 'FillRectangle
  12.     Private B2 As Brush 'Top Gloss
  13.     Private B3 As Brush 'Gray Text
  14.     Private B4 As Brush 'Bottom Gloss
  15.     Private HB1 As HatchBrush 'Background
  16.     Sub New()
  17.         MoveHeight = 15
  18.     End Sub
  19.     Protected Overrides Sub ColorHook()
  20.         C1 = Color.White
  21.         C2 = Color.FromArgb(50, 50, 50)
  22.         C3 = Color.FromArgb(0, 0, 0)
  23.         C4 = Color.White
  24.         C5 = Color.LightGray
  25.         P1 = Pens.Black
  26.         B1 = New SolidBrush(Color.FromArgb(15, 15, 15))
  27.         B2 = New SolidBrush(Color.FromArgb(50, Color.White))
  28.         B3 = New SolidBrush(Color.White)
  29.         B4 = New SolidBrush(Color.FromArgb(30, Color.White))
  30.         HB1 = New HatchBrush(HatchStyle.Trellis, Color.FromArgb(15, 15, 15))
  31.     End Sub
  32.  
  33.     Protected Overrides Sub PaintHook()
  34.         G.Clear(C1)
  35.         'BackGround'
  36.         G.FillRectangle(HB1, 0, 0, Width, Height)
  37.  
  38.         'Top'
  39.         DrawGradient(C2, C3, 0, 0, Width, 15, 90S)
  40.         G.DrawRectangle(P1, 0, 0, Width, 15)
  41.  
  42.         'Bottom'
  43.         G.FillRectangle(B1, 0, CInt(Height - 11), Width, 10)
  44.         G.DrawRectangle(P1, 0, CInt(Height - 11), Width, 10)
  45.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 30, 30))), 14, CInt(Height - 10), CInt(Width - 29), 8)
  46.         'Left Side'
  47.         'Left'
  48.         G.FillRectangle(B1, 0, 0, 5, CInt(Height - 1))
  49.         G.DrawRectangle(P1, 0, 0, 5, CInt(Height - 1))
  50.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 30, 30))), 1, 1, 3, CInt(Height - 3))
  51.         'Middle'
  52.         DrawGradient(C4, C5, 5, 15, 3, CInt(Height - 16), 180S)
  53.         G.DrawRectangle(P1, 5, 15, 3, CInt(Height - 16))
  54.         'Right'
  55.         G.FillRectangle(B1, 8, 15, 5, CInt(Height - 16))
  56.         G.DrawRectangle(P1, 8, 15, 5, CInt(Height - 16))
  57.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 30, 30))), 9, 16, 3, CInt(Height - 18))
  58.  
  59.         'Right Side'
  60.         'Right'
  61.         G.FillRectangle(B1, CInt(Width - 6), 0, 5, CInt(Height - 1))
  62.         G.DrawRectangle(P1, CInt(Width - 6), 0, 5, CInt(Height - 1))
  63.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 30, 30))), CInt(Width - 5), 1, 3, CInt(Height - 3))
  64.         'Middle'
  65.         DrawGradient(C4, C5, CInt(Width - 9), 15, 3, CInt(Height - 16), 180S)
  66.         G.DrawRectangle(P1, CInt(Width - 9), 15, 3, CInt(Height - 16))
  67.         'Left'
  68.         G.FillRectangle(B1, CInt(Width - 14), 15, 5, CInt(Height - 16))
  69.         G.DrawRectangle(P1, CInt(Width - 14), 15, 5, CInt(Height - 16))
  70.         G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(30, 30, 30))), CInt(Width - 13), 16, 3, CInt(Height - 18))
  71.         'Top Gloss'
  72.         G.FillRectangle(B2, 0, 0, Width, 5)
  73.  
  74.         'Bottom Gloss'
  75.         G.FillRectangle(B4, 0, CInt(Height - 3), Width, 3)
  76.  
  77.         DrawText(B3, HorizontalAlignment.Center, 0, 3)
  78.  
  79.     End Sub
  80. End Class
  81. Class SomniumButtonA
  82.     Inherits ThemeControl151
  83.     Private C1 As Color 'G.Clear
  84.     Private C2, C3 As Color 'Lime Gradient
  85.     Private B1 As Brush 'Gloss
  86.     Private B2 As Brush 'Grey Text
  87.     Private P1 As Pen 'DrawRectangle
  88.     Protected Overrides Sub ColorHook()
  89.         C1 = Color.White
  90.         C2 = Color.FromArgb(50, 50, 50)
  91.         C3 = Color.FromArgb(0, 0, 0)
  92.         B1 = New SolidBrush(Color.FromArgb(60, Color.White))
  93.         B2 = New SolidBrush(Color.White)
  94.         P1 = Pens.White
  95.     End Sub
  96.     Sub New()
  97.         Size = New Size(115, 20)
  98.     End Sub
  99.     Protected Overrides Sub PaintHook()
  100.         G.Clear(C1)
  101.         DrawGradient(C2, C3, 0, 0, Width, Height, 90S)
  102.         'Gloss'
  103.         If (State = MouseState.Over) Then
  104.             G.FillRectangle(B1, 0, CInt(Height / 2), Width, CInt(Height / 2))
  105.         ElseIf (State = MouseState.Down) Then
  106.             G.FillRectangle(B1, 0, 0, Width, CInt(Height / 2))
  107.         Else
  108.             G.FillRectangle(B1, 0, 0, Width, CInt(Height / 2))
  109.         End If
  110.         DrawBorders(P1, 0, 0, Width, Height)
  111.         DrawText(B2, HorizontalAlignment.Center, 0, 0)
  112.     End Sub
  113. End Class
  114. Class SomniumGroupBox
  115.     Inherits ThemeContainer151
  116.     Private C1 As Color 'G.Clear
  117.     Private C2, C3 As Color 'Lime Gradient
  118.     Private P1 As Pen 'DrawRectangle
  119.     Private B1 As Brush 'Gloss
  120.     Private B2 As Brush 'Grey Text
  121.     Private HB1 As Brush 'BackGround
  122.     Sub New()
  123.         ControlMode = True
  124.         Size = New Size(205, 95)
  125.     End Sub
  126.     Protected Overrides Sub ColorHook()
  127.         C1 = Color.FromArgb(15, 15, 15)
  128.         C2 = Color.FromArgb(50, 50, 50)
  129.         C3 = Color.FromArgb(0, 0, 0)
  130.         P1 = Pens.White
  131.         B1 = New SolidBrush(Color.FromArgb(60, Color.White))
  132.         B2 = New SolidBrush(Color.White)
  133.         HB1 = New HatchBrush(HatchStyle.Trellis, Color.FromArgb(15, 15, 15))
  134.     End Sub
  135.  
  136.     Protected Overrides Sub PaintHook()
  137.         G.Clear(C1)
  138.         G.FillRectangle(HB1, 0, 0, Width, Height)
  139.         'BackGround'
  140.         G.FillRectangle(HB1, 0, 0, Width, 15)
  141.         'Outside'
  142.         G.DrawRectangle(P1, 0, 15, Width - 1, CInt(Height - 16))
  143.         'Green'
  144.         DrawGradient(C2, C3, 5, 5, Width - 15, 20, 90S)
  145.         'Gloss
  146.         G.FillRectangle(B1, 5, 5, Width - 15, 10)
  147.         G.DrawRectangle(P1, 5, 5, Width - 15, 20)
  148.         DrawText(B2, HorizontalAlignment.Center, 0, 3)
  149.     End Sub
  150. End Class
  151. Class SomniumCheckBox
  152.     Inherits ThemeControl151
  153.     Private C1 As Color 'G.Clear
  154.     Private C2, C3 As Color 'Lime Gradient
  155.     Private P1 As Pen 'DrawRectangle
  156.     Private B1 As Brush 'Gloss
  157.     Private B2 As Brush 'DrawText
  158.     Private B3 As Brush 'Fill
  159.     Private HB1 As HatchBrush 'BackGround
  160.     Private _Checked As Boolean = False
  161.     Public Property Checked() As Boolean
  162.         Get
  163.             Return _Checked
  164.         End Get
  165.         Set(ByVal checked As Boolean)
  166.             _Checked = checked
  167.             Invalidate()
  168.         End Set
  169.     End Property
  170.     Sub New()
  171.         Size = New Size(136, 16)
  172.     End Sub
  173.     Sub changeChecked() Handles Me.Click
  174.         Select Case _Checked
  175.             Case False
  176.                 _Checked = True
  177.             Case True
  178.                 _Checked = False
  179.         End Select
  180.     End Sub
  181.     Protected Overrides Sub ColorHook()
  182.         C1 = Color.FromArgb(15, 15, 15)
  183.         C2 = Color.White
  184.         C3 = Color.LightGray
  185.         P1 = Pens.Black
  186.         B1 = New SolidBrush(Color.FromArgb(15, Color.White))
  187.         B2 = New SolidBrush(Color.White)
  188.         B3 = New SolidBrush(Color.FromArgb(15, 15, 15))
  189.         HB1 = New HatchBrush(HatchStyle.Trellis, Color.FromArgb(15, 15, 15))
  190.     End Sub
  191.  
  192.     Protected Overrides Sub PaintHook()
  193.         G.Clear(C1)
  194.         G.FillRectangle(HB1, 0, 0, Width, Height)
  195.         G.FillRectangle(B3, 0, 0, 15, 15)
  196.         G.DrawRectangle(P1, 0, 0, 15, 15)
  197.  
  198.         If (_Checked = False) Then
  199.             If (State = MouseState.Over) Then
  200.                 DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(15, 15, 15), 2, 2, 11, 11, 90S)
  201.             Else
  202.                 DrawGradient(Color.FromArgb(15, 15, 15), Color.FromArgb(50, 50, 50), 2, 2, 11, 11, 90S)
  203.             End If
  204.         Else
  205.             If (State = MouseState.Over) Then
  206.                 DrawGradient(C3, C2, 2, 2, 11, 11, 90S)
  207.             Else
  208.                 DrawGradient(C2, C3, 2, 2, 11, 11, 90S)
  209.             End If
  210.  
  211.         End If
  212.         G.FillRectangle(B1, 2, 2, 11, 11)
  213.         G.DrawRectangle(P1, 2, 2, 11, 11)
  214.         DrawText(B2, HorizontalAlignment.Left, 15, 0)
  215.     End Sub
  216. End Class
  217. Class SomniumProgressBar
  218.     Inherits ThemeControl151
  219.     Private _Maximum As Integer = 100
  220.     Public Property Maximum() As Integer
  221.         Get
  222.             Return _Maximum
  223.         End Get
  224.         Set(ByVal value As Integer)
  225.             If value < 1 Then value = 1
  226.             If value < _Value Then _Value = value
  227.             _Maximum = value
  228.             Invalidate()
  229.         End Set
  230.     End Property
  231.  
  232.     Private _Value As Integer = 50
  233.     Public Property Value() As Integer
  234.         Get
  235.             Return _Value
  236.         End Get
  237.         Set(ByVal value As Integer)
  238.             If value > _Maximum Then value = _Maximum
  239.             _Value = value
  240.             Invalidate()
  241.         End Set
  242.     End Property
  243.  
  244.     Private C1 As Color 'G.Clear
  245.     Private C2, C3 As Color 'Lime Gradient
  246.     Private P1 As Pen 'DrawRectangle
  247.     Private B1 As Brush 'Gloss
  248.     Sub New()
  249.         Size = New Size(75, 18)
  250.     End Sub
  251.     Protected Overrides Sub ColorHook()
  252.         C1 = Color.FromArgb(15, 15, 15)
  253.         C2 = Color.FromArgb(50, 50, 50)
  254.         C3 = Color.FromArgb(0, 0, 0)
  255.         P1 = Pens.Black
  256.         B1 = New SolidBrush(Color.FromArgb(50, Color.White))
  257.     End Sub
  258.  
  259.     Protected Overrides Sub PaintHook()
  260.         G.Clear(C1)
  261.         If (_Value > 0) Then
  262.             DrawGradient(C2, C3, 0, 0, CInt((_Value / _Maximum) * Width), Height, 90S)
  263.         End If
  264.         G.FillRectangle(B1, 0, 0, Width, CInt(Height / 2))
  265.         DrawBorders(P1, 0, 0, Width, Height)
  266.     End Sub
  267. End Class
Advertisement
Add Comment
Please, Sign In to add comment