SoulZeh

Pheno Theme

Jun 17th, 2012
167
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.08 KB | None | 0 0
  1. Imports System.Drawing.Drawing2D
  2.  
  3. '------------------
  4. 'Creator: SoulZeh
  5. 'Created: 23/11/2011
  6. 'Credits xZ3ROxPROJ3CTx, oVERT3Xo
  7. 'I Love him <3
  8. '------------------
  9. Class PhenoTheme1
  10.  
  11. Inherits ThemeContainer153
  12.  
  13. Sub New()
  14. TransparencyKey = Color.Fuchsia
  15. SetColor("Border 1", Color.FromArgb(101, 101, 101))
  16. SetColor("Border 2", Color.FromArgb(110, 110, 110))
  17. Font = New Font("Calibri", 9)
  18. BackColor = Color.FromArgb(24, 24, 24)
  19. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  20. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  21. End Sub
  22. Protected Overrides Sub ColorHook()
  23. C1 = GetColor("Border 1")
  24. C2 = GetColor("Border 2")
  25. C3 = GetColor("TopGloss")
  26. C4 = GetColor("BottomGloss")
  27. End Sub
  28. Private C1, C2, C3, C4 As Color
  29. Private RT1 As Rectangle
  30. Protected Overrides Sub PaintHook()
  31.  
  32. DrawGradient(C1, C2, 0, 0, Width, Height)
  33. RT1 = New Rectangle(11, 25, Width - 22, Height - 35)
  34. G.FillRectangle(Brushes.White, RT1)
  35.  
  36. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, 13), 90S)
  37. DrawBorders(Pens.Black)
  38. DrawCorners(Color.Fuchsia)
  39. DrawText(Brushes.LimeGreen, HorizontalAlignment.Left, 7, 0)
  40.  
  41.  
  42. G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), New Rectangle(11, 25, Width - 22, Height - 35))
  43. Dim shadowLGB As New LinearGradientBrush(New Rectangle(11, 25, Width - 22, 20), Color.FromArgb(23, 23, 22), Color.FromArgb(38, 38, 38), 90S)
  44. G.FillRectangle(shadowLGB, New Rectangle(11, 25, Width - 22, 20))
  45. G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(24, 24, 24))), 11, 26, Width - 11, 26)
  46. G.DrawRectangle(Pens.Black, New Rectangle(11, 25, Width - 22, Height - 35))
  47. G.DrawLine(New Pen(New SolidBrush(Color.FromArgb(151, 150, 146))), 1, 1, Width - 2, 1)
  48. G.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(42, 41, 37))), 10, 24, Width - 20, Height - 33)
  49. DrawCorners(Color.FromArgb(38, 38, 38), New Rectangle(11, 25, Width - 21, Height - 34))
  50. DrawCorners(Color.FromArgb(55, 55, 55), New Rectangle(9, 23, Width - 21, Height - 34))
  51. End Sub
  52. End Class
  53. Class PhenoSeparator
  54. Inherits ThemeControl153
  55.  
  56. Protected Overrides Sub ColorHook()
  57.  
  58. End Sub
  59.  
  60. Protected Overrides Sub PaintHook()
  61. G.FillRectangle(New SolidBrush(Color.FromArgb(38, 38, 38)), ClientRectangle)
  62. DrawGradient(Color.FromArgb(55, 55, 55), Color.FromArgb(58, 58, 58), New Rectangle(0, Height / 2, Width, 2), 45S)
  63. End Sub
  64. End Class
  65. Class PhenoButton
  66. Inherits ThemeControl153
  67.  
  68. Sub New()
  69. BackColor = Color.FromArgb(33, 33, 33)
  70.  
  71. SetColor("ButtonFillColor", Color.FromArgb(24, 24, 24))
  72. SetColor("ButtonClickColor", Color.FromArgb(40, 40, 40))
  73. SetColor("InsetBorderColor", Color.Black)
  74. SetColor("TopGloss", Color.FromArgb(62, Color.White))
  75. SetColor("BottomGloss", Color.FromArgb(30, Color.White))
  76. SetColor("TopInset", Color.FromArgb(45, 45, 45))
  77. SetColor("BottomInset", Color.FromArgb(95, 70, 70, 70))
  78. SetColor("BorderColor", Color.Black)
  79. SetColor("TextColor", Color.Orange)
  80. End Sub
  81. Dim C1, C2, C3, C4, C5, C6, C7, C8, C9 As Color
  82. Protected Overrides Sub ColorHook()
  83. C1 = GetColor("ButtonFillColor")
  84. C2 = GetColor("InsetBorderColor")
  85. C3 = GetColor("TopGloss")
  86. C4 = GetColor("BottomGloss")
  87. C5 = GetColor("TopInset")
  88. C6 = GetColor("BottomInset")
  89. C7 = GetColor("BorderColor")
  90. C8 = GetColor("TextColor")
  91. C9 = GetColor("ButtonClickColor")
  92. End Sub
  93.  
  94. Protected Overrides Sub PaintHook()
  95. G.Clear(BackColor)
  96. Select Case State
  97. Case 0
  98. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  99. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  100. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  101. Case 1
  102. G.FillRectangle(New SolidBrush(C1), New Rectangle(1, 1, Width - 2, Height - 2))
  103. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  104. DrawGradient(C3, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  105. Case 2
  106. G.FillRectangle(New SolidBrush(C9), New Rectangle(1, 1, Width - 2, Height - 2))
  107. DrawBorders(New Pen(New SolidBrush(C2)), 2)
  108. DrawGradient(C4, C4, New Rectangle(1, 1, Width - 2, Height / 2 - 2), 90S)
  109. End Select
  110.  
  111.  
  112. DrawBorders(New Pen(New SolidBrush(C7)), 1)
  113. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, Width, 0)
  114. G.DrawLine(New Pen(New SolidBrush(C5)), 0, 0, 0, Height)
  115. G.DrawLine(New Pen(New SolidBrush(C5)), Width - 1, 0, Width - 1, Height)
  116. G.DrawLine(New Pen(New SolidBrush(C6)), 0, Height - 1, Width, Height - 1)
  117. DrawCorners(BackColor)
  118. DrawCorners(BackColor, New Rectangle(1, 1, Width - 2, Height - 2))
  119. DrawText(New SolidBrush(C8), HorizontalAlignment.Center, 0, 0)
  120. End Sub
  121. End Class
  122. Class PhenoTabControl
  123. Inherits TabControl
  124. Private LightBlack As Color = Color.FromArgb(24, 24, 24)
  125. Private LighterBlack As Color = Color.FromArgb(24, 24, 24)
  126. Private DrawGradientBrush, DrawGradientBrush2 As LinearGradientBrush
  127. Private _ControlBColor As Color
  128. Public Property TabTextColor() As Color
  129. Get
  130. Return _ControlBColor
  131. End Get
  132. Set(ByVal v As Color)
  133. _ControlBColor = v
  134. Invalidate()
  135. End Set
  136. End Property
  137.  
  138. Sub New()
  139. MyBase.New()
  140. SetStyle(ControlStyles.AllPaintingInWmPaint Or _
  141. ControlStyles.ResizeRedraw Or _
  142. ControlStyles.UserPaint Or _
  143. ControlStyles.DoubleBuffer, True)
  144. TabTextColor = Color.White
  145. End Sub
  146. Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  147. MyBase.OnPaint(e)
  148. Dim r2 As New Rectangle(2, 0, Width - 1, 11)
  149. Dim r3 As New Rectangle(2, 0, Width - 1, 11)
  150. e.Graphics.Clear(Color.FromArgb(24, 24, 24))
  151. Dim ItemBounds As Rectangle
  152. Dim TextBrush As New SolidBrush(Color.Empty)
  153. Dim TabBrush As New SolidBrush(Color.Lime)
  154. e.Graphics.FillRectangle(New SolidBrush(Color.FromArgb(24, 24, 24)), New Rectangle(1, 1, Width - 2, Height - 2))
  155. DrawGradientBrush2 = New LinearGradientBrush(r3, Color.FromArgb(62, Color.White), Color.FromArgb(30, Color.White), 90S)
  156. e.Graphics.FillRectangle(DrawGradientBrush2, r2)
  157. For TabItemIndex As Integer = 0 To Me.TabCount - 1
  158. ItemBounds = Me.GetTabRect(TabItemIndex)
  159.  
  160. If CBool(TabItemIndex And 1) Then
  161. TabBrush.Color = Color.Transparent
  162. Else
  163. TabBrush.Color = Color.Transparent
  164. End If
  165. e.Graphics.FillRectangle(TabBrush, ItemBounds)
  166. Dim BorderPen As Pen
  167. If TabItemIndex = SelectedIndex Then
  168. BorderPen = New Pen(Color.Transparent, 1)
  169. Else
  170. BorderPen = New Pen(Color.Transparent, 1)
  171. End If
  172. e.Graphics.DrawRectangle(BorderPen, New Rectangle(ItemBounds.Location.X + 3, ItemBounds.Location.Y + 1, ItemBounds.Width - 8, ItemBounds.Height - 4))
  173. BorderPen.Dispose()
  174. Dim sf As New StringFormat
  175. sf.LineAlignment = StringAlignment.Center
  176. sf.Alignment = StringAlignment.Center
  177.  
  178. If Me.SelectedIndex = TabItemIndex Then
  179. TextBrush.Color = TabTextColor
  180. Else
  181. TextBrush.Color = Color.Gray
  182. End If
  183. e.Graphics.DrawString( _
  184. Me.TabPages(TabItemIndex).Text, _
  185. Me.Font, TextBrush, _
  186. RectangleF.op_Implicit(Me.GetTabRect(TabItemIndex)), sf)
  187. Try
  188. Me.TabPages(TabItemIndex).BackColor = Color.FromArgb(34, 34, 34)
  189. Catch
  190. End Try
  191. Next
  192. Try
  193. For Each tabpg As TabPage In Me.TabPages
  194. tabpg.BorderStyle = BorderStyle.None
  195. Next
  196. Catch
  197. End Try
  198. e.Graphics.DrawRectangle(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 0, Width - 3, Height - 3)
  199. e.Graphics.DrawRectangle(New Pen(New SolidBrush(LighterBlack)), New Rectangle(3, 24, Width - 5, Height - 28))
  200. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(255, Color.Black))), 2, 23, Width - 2, 23)
  201. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(35, 35, 35))), 0, 0, 1, 1)
  202. e.Graphics.DrawLine(New Pen(New SolidBrush(Color.FromArgb(70, 70, 70))), 2, Height - 2, Width + 1, Height - 2)
  203.  
  204. End Sub
  205. End Class
  206. Class PhenoProgressBar
  207. Inherits ThemeControl153
  208. Private _Maximum As Integer = 100
  209. Private OFS As Integer = 0
  210. Protected Overrides Sub CreateHandle()
  211. MyBase.CreateHandle()
  212. Dim Derp As New Timer
  213. Derp.Interval = 50
  214. 'Add the animate() sub to the Timer via AddHandler <----- that one
  215. AddHandler Derp.Tick, AddressOf animate
  216. Derp.Start()
  217.  
  218. End Sub
  219. Sub animate()
  220. 'Modify the OFS offset so that it goes up to the control width.
  221. 'When it reaches control width, set it back to 0
  222. If OFS <= Width Then : OFS += 1
  223. Else : OFS = 0
  224. End If
  225. Invalidate()
  226.  
  227. End Sub
  228.  
  229. Public Property Maximum() As Integer
  230. Get
  231. Return _Maximum
  232. End Get
  233. Set(ByVal value As Integer)
  234. If value < 1 Then value = 1
  235. If value < _Value Then _Value = value
  236. _Maximum = value
  237. Invalidate()
  238. End Set
  239. End Property
  240.  
  241. Private _Value As Integer = 50
  242. Public Property Value() As Integer
  243. Get
  244. Return _Value
  245. End Get
  246. Set(ByVal value As Integer)
  247. If value > _Maximum Then value = _Maximum
  248. _Value = value
  249. Invalidate()
  250. End Set
  251. End Property
  252.  
  253. Private C1 As Color 'G.Clear
  254. Private C2, C3 As Color 'Lime Gradient
  255. Private P1 As Pen 'DrawRectangle
  256. Private B1 As Brush 'Gloss
  257. Sub New()
  258. Size = New Size(75, 18)
  259. End Sub
  260. Protected Overrides Sub ColorHook()
  261. C1 = Color.FromArgb(28, 28, 28)
  262. C2 = Color.FromArgb(102, 200, 7)
  263. C3 = Color.FromArgb(28, 28, 28)
  264. P1 = Pens.Black
  265. B1 = New SolidBrush(Color.FromArgb(50, Color.White))
  266. End Sub
  267.  
  268. Protected Overrides Sub PaintHook()
  269. G.Clear(C1)
  270. If (_Value > 0) Then
  271. G.RenderingOrigin = New Point(OFS, 0)
  272. DrawGradient(C2, C3, 0, 0, CInt((_Value / _Maximum) * Width), Height, 90S)
  273. Dim T As New HatchBrush(HatchStyle.DarkDownwardDiagonal, Color.FromArgb(65, 3, 35, 58), Color.Empty)
  274. G.FillRectangle(T, New Rectangle(0, 0, CInt((_Value / _Maximum) * Width), Height))
  275.  
  276. End If
  277. G.FillRectangle(B1, 0, 0, Width, CInt(Height / 2))
  278. DrawBorders(P1, 0, 0, Width, Height)
  279. End Sub
  280. End Class
  281. Class PhenoCheckBox
  282. Inherits ThemeControl153
  283. Private C1 As Color 'G.Clear
  284. Private C2, C3 As Color 'Lime Gradient
  285. Private P1 As Pen 'DrawRectangle
  286. Private B1 As Brush 'Gloss
  287. Private B2 As Brush 'DrawText
  288. Private B3 As Brush 'Fill
  289.  
  290. Private _Checked As Boolean = False
  291. Public Property Checked() As Boolean
  292. Get
  293. Return _Checked
  294. End Get
  295. Set(ByVal checked As Boolean)
  296. _Checked = checked
  297. Invalidate()
  298. End Set
  299. End Property
  300. Sub New()
  301. Size = New Size(136, 20)
  302. End Sub
  303. Sub changeChecked() Handles Me.Click
  304. Select Case _Checked
  305. Case False
  306. _Checked = True
  307. Case True
  308. _Checked = False
  309. End Select
  310. End Sub
  311. Protected Overrides Sub ColorHook()
  312. C1 = Color.FromArgb(38, 38, 38)
  313. C2 = Color.Black
  314. C3 = Color.Lime
  315. P1 = Pens.Black
  316. B1 = New SolidBrush(Color.FromArgb(15, Color.Lime))
  317. B2 = New SolidBrush(Color.White)
  318. B3 = New SolidBrush(Color.FromArgb(24, 24, 24))
  319.  
  320. End Sub
  321.  
  322. Protected Overrides Sub PaintHook()
  323. G.Clear(C1)
  324.  
  325. G.FillRectangle(B3, 0, 0, 15, 15)
  326. G.DrawRectangle(P1, 0, 0, 15, 15)
  327.  
  328. If (_Checked = False) Then
  329. If (State = MouseState.Over) Then
  330. DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(15, 15, 15), 2, 2, 11, 11, 90S)
  331. Else
  332. DrawGradient(Color.FromArgb(15, 15, 15), Color.FromArgb(50, 50, 50), 2, 2, 11, 11, 90S)
  333. End If
  334. Else
  335. If (State = MouseState.Over) Then
  336. DrawGradient(C3, C2, 2, 2, 11, 11, 90S)
  337. Else
  338. DrawGradient(C2, C3, 2, 2, 11, 11, 90S)
  339. End If
  340.  
  341. End If
  342. G.FillRectangle(B1, 2, 2, 11, 11)
  343. G.DrawRectangle(P1, 2, 2, 11, 11)
  344. DrawText(B2, HorizontalAlignment.Left, 15, 0)
  345. End Sub
  346. End Class
Advertisement
Add Comment
Please, Sign In to add comment