Controller

[LEAK] Recon Theme [Aeonhack]

Dec 5th, 2012
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.61 KB | None | 0 0
  1. [LEAK] Recon Theme [Aeonhack]
  2.  
  3. -----------------------------------------------------------------------------
  4.  
  5. Imports System.Drawing.Drawing2D
  6. Imports System.ComponentModel
  7. Imports System.Runtime.InteropServices
  8. '.::Tweety Theme::.
  9. 'Author: UnReLaTeDScript
  10. 'Credits: Aeonhack [Themebase], Aeonhack (Menustrip Code)
  11. 'Version: 1.0
  12. MustInherit Class Theme
  13. Inherits ContainerControl
  14.  
  15. #Region " Initialization "
  16.  
  17. Protected G As Graphics
  18. Sub New()
  19. SetStyle(DirectCast(139270, ControlStyles), True)
  20. End Sub
  21.  
  22. Private ParentIsForm As Boolean
  23. Protected Overrides Sub OnHandleCreated(ByVal e As EventArgs)
  24. Dock = DockStyle.Fill
  25. ParentIsForm = TypeOf Parent Is Form
  26. If ParentIsForm Then
  27. If Not _TransparencyKey = Color.Empty Then ParentForm.TransparencyKey = _TransparencyKey
  28. ParentForm.FormBorderStyle = FormBorderStyle.None
  29. End If
  30. MyBase.OnHandleCreated(e)
  31. End Sub
  32.  
  33. Overrides Property Text() As String
  34. Get
  35. Return MyBase.Text
  36. End Get
  37. Set(ByVal v As String)
  38. MyBase.Text = v
  39. Invalidate()
  40. End Set
  41. End Property
  42. #End Region
  43.  
  44. #Region " Sizing and Movement "
  45.  
  46. Private _Resizable As Boolean = True
  47. Property Resizable() As Boolean
  48. Get
  49. Return _Resizable
  50. End Get
  51. Set(ByVal value As Boolean)
  52. _Resizable = value
  53. End Set
  54. End Property
  55.  
  56. Private _MoveHeight As Integer = 24
  57. Property MoveHeight() As Integer
  58. Get
  59. Return _MoveHeight
  60. End Get
  61. Set(ByVal v As Integer)
  62. _MoveHeight = v
  63. Header = New Rectangle(7, 7, Width - 14, _MoveHeight - 7)
  64. End Set
  65. End Property
  66.  
  67. Private Flag As IntPtr
  68. Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  69. If Not e.Button = MouseButtons.Left Then Return
  70. If ParentIsForm Then If ParentForm.WindowState = FormWindowState.Maximized Then Return
  71.  
  72. If Header.Contains(e.Location) Then
  73. Flag = New IntPtr(2)
  74. ElseIf Current.Position = 0 Or Not _Resizable Then
  75. Return
  76. Else
  77. Flag = New IntPtr(Current.Position)
  78. End If
  79.  
  80. Capture = False
  81. DefWndProc(Message.Create(Parent.Handle, 161, Flag, Nothing))
  82.  
  83. MyBase.OnMouseDown(e)
  84. End Sub
  85.  
  86. Private Structure Pointer
  87. ReadOnly Cursor As Cursor, Position As Byte
  88. Sub New(ByVal c As Cursor, ByVal p As Byte)
  89. Cursor = c
  90. Position = p
  91. End Sub
  92. End Structure
  93.  
  94. Private F1, F2, F3, F4 As Boolean, PTC As Point
  95. Private Function GetPointer() As Pointer
  96. PTC = PointToClient(MousePosition)
  97. F1 = PTC.X < 7
  98. F2 = PTC.X > Width - 7
  99. F3 = PTC.Y < 7
  100. F4 = PTC.Y > Height - 7
  101.  
  102. If F1 And F3 Then Return New Pointer(Cursors.SizeNWSE, 13)
  103. If F1 And F4 Then Return New Pointer(Cursors.SizeNESW, 16)
  104. If F2 And F3 Then Return New Pointer(Cursors.SizeNESW, 14)
  105. If F2 And F4 Then Return New Pointer(Cursors.SizeNWSE, 17)
  106. If F1 Then Return New Pointer(Cursors.SizeWE, 10)
  107. If F2 Then Return New Pointer(Cursors.SizeWE, 11)
  108. If F3 Then Return New Pointer(Cursors.SizeNS, 12)
  109. If F4 Then Return New Pointer(Cursors.SizeNS, 15)
  110. Return New Pointer(Cursors.Default, 0)
  111. End Function
  112.  
  113. Private Current, Pending As Pointer
  114. Private Sub SetCurrent()
  115. Pending = GetPointer()
  116. If Current.Position = Pending.Position Then Return
  117. Current = GetPointer()
  118. Cursor = Current.Cursor
  119. End Sub
  120.  
  121. Protected Overrides Sub OnMouseMove(ByVal e As MouseEventArgs)
  122. If _Resizable Then SetCurrent()
  123. MyBase.OnMouseMove(e)
  124. End Sub
  125.  
  126. Protected Header As Rectangle
  127. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  128. If Width = 0 OrElse Height = 0 Then Return
  129. Header = New Rectangle(7, 7, Width - 14, _MoveHeight - 7)
  130. Invalidate()
  131. MyBase.OnSizeChanged(e)
  132. End Sub
  133.  
  134. #End Region
  135.  
  136. #Region " Convienence "
  137.  
  138. MustOverride Sub PaintHook()
  139. Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  140. If Width = 0 OrElse Height = 0 Then Return
  141. G = e.Graphics
  142. PaintHook()
  143. End Sub
  144.  
  145. Private _TransparencyKey As Color
  146. Property TransparencyKey() As Color
  147. Get
  148. Return _TransparencyKey
  149. End Get
  150. Set(ByVal v As Color)
  151. _TransparencyKey = v
  152. Invalidate()
  153. End Set
  154. End Property
  155.  
  156. Private _Image As Image
  157. Property Image() As Image
  158. Get
  159. Return _Image
  160. End Get
  161. Set(ByVal value As Image)
  162. _Image = value
  163. Invalidate()
  164. End Set
  165. End Property
  166. ReadOnly Property ImageWidth() As Integer
  167. Get
  168. If _Image Is Nothing Then Return 0
  169. Return _Image.Width
  170. End Get
  171. End Property
  172.  
  173. Private _Size As Size
  174. Private _Rectangle As Rectangle
  175. Private _Gradient As LinearGradientBrush
  176. Private _Brush As SolidBrush
  177.  
  178. Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  179. _Brush = New SolidBrush(c)
  180. G.FillRectangle(_Brush, rect.X, rect.Y, 1, 1)
  181. G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y, 1, 1)
  182. G.FillRectangle(_Brush, rect.X, rect.Y + (rect.Height - 1), 1, 1)
  183. G.FillRectangle(_Brush, rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), 1, 1)
  184. End Sub
  185.  
  186. Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  187. G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  188. G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  189. End Sub
  190.  
  191. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer)
  192. DrawText(a, c, x, 0)
  193. End Sub
  194. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer, ByVal y As Integer)
  195. If String.IsNullOrEmpty(Text) Then Return
  196. _Size = G.MeasureString(Text, Font).ToSize
  197. _Brush = New SolidBrush(c)
  198.  
  199. Select Case a
  200. Case HorizontalAlignment.Left
  201. G.DrawString(Text, Font, _Brush, x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  202. Case HorizontalAlignment.Right
  203. G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  204. Case HorizontalAlignment.Center
  205. G.DrawString(Text, Font, _Brush, Width \ 2 - _Size.Width \ 2 + x, _MoveHeight \ 2 - _Size.Height \ 2 + y)
  206. End Select
  207. End Sub
  208.  
  209. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer)
  210. DrawIcon(a, x, 0)
  211. End Sub
  212. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer, ByVal y As Integer)
  213. If _Image Is Nothing Then Return
  214. Select Case a
  215. Case HorizontalAlignment.Left
  216. G.DrawImage(_Image, x, _MoveHeight \ 2 - _Image.Height \ 2 + y)
  217. Case HorizontalAlignment.Right
  218. G.DrawImage(_Image, Width - _Image.Width - x, _MoveHeight \ 2 - _Image.Height \ 2 + y)
  219. Case HorizontalAlignment.Center
  220. G.DrawImage(_Image, Width \ 2 - _Image.Width \ 2, _MoveHeight \ 2 - _Image.Height \ 2)
  221. End Select
  222. End Sub
  223.  
  224. Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  225. _Rectangle = New Rectangle(x, y, width, height)
  226. _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  227. G.FillRectangle(_Gradient, _Rectangle)
  228. End Sub
  229.  
  230. #End Region
  231.  
  232. End Class
  233. MustInherit Class ThemeControl
  234. Inherits Control
  235.  
  236. #Region " Initialization "
  237.  
  238. Protected G As Graphics, B As Bitmap
  239. Sub New()
  240. SetStyle(DirectCast(139270, ControlStyles), True)
  241. B = New Bitmap(1, 1)
  242. G = Graphics.FromImage(B)
  243. End Sub
  244.  
  245. Sub AllowTransparent()
  246. SetStyle(ControlStyles.Opaque, False)
  247. SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  248. End Sub
  249.  
  250. Overrides Property Text() As String
  251. Get
  252. Return MyBase.Text
  253. End Get
  254. Set(ByVal v As String)
  255. MyBase.Text = v
  256. Invalidate()
  257. End Set
  258. End Property
  259. #End Region
  260.  
  261. #Region " Mouse Handling "
  262.  
  263. Protected Enum State As Byte
  264. MouseNone = 0
  265. MouseOver = 1
  266. MouseDown = 2
  267. End Enum
  268.  
  269. Protected MouseState As State
  270. Protected Overrides Sub OnMouseLeave(ByVal e As EventArgs)
  271. ChangeMouseState(State.MouseNone)
  272. MyBase.OnMouseLeave(e)
  273. End Sub
  274. Protected Overrides Sub OnMouseEnter(ByVal e As EventArgs)
  275. ChangeMouseState(State.MouseOver)
  276. MyBase.OnMouseEnter(e)
  277. End Sub
  278. Protected Overrides Sub OnMouseUp(ByVal e As MouseEventArgs)
  279. ChangeMouseState(State.MouseOver)
  280. MyBase.OnMouseUp(e)
  281. End Sub
  282. Protected Overrides Sub OnMouseDown(ByVal e As MouseEventArgs)
  283. If e.Button = MouseButtons.Left Then ChangeMouseState(State.MouseDown)
  284. MyBase.OnMouseDown(e)
  285. End Sub
  286.  
  287. Private Sub ChangeMouseState(ByVal e As State)
  288. MouseState = e
  289. Invalidate()
  290. End Sub
  291.  
  292. #End Region
  293.  
  294. #Region " Convienence "
  295.  
  296. MustOverride Sub PaintHook()
  297. Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  298. If Width = 0 OrElse Height = 0 Then Return
  299. PaintHook()
  300. e.Graphics.DrawImage(B, 0, 0)
  301. End Sub
  302.  
  303. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  304. If Not Width = 0 AndAlso Not Height = 0 Then
  305. B = New Bitmap(Width, Height)
  306. G = Graphics.FromImage(B)
  307. Invalidate()
  308. End If
  309. MyBase.OnSizeChanged(e)
  310. End Sub
  311.  
  312. Private _NoRounding As Boolean
  313. Property NoRounding() As Boolean
  314. Get
  315. Return _NoRounding
  316. End Get
  317. Set(ByVal v As Boolean)
  318. _NoRounding = v
  319. Invalidate()
  320. End Set
  321. End Property
  322.  
  323. Private _Image As Image
  324. Property Image() As Image
  325. Get
  326. Return _Image
  327. End Get
  328. Set(ByVal value As Image)
  329. _Image = value
  330. Invalidate()
  331. End Set
  332. End Property
  333. ReadOnly Property ImageWidth() As Integer
  334. Get
  335. If _Image Is Nothing Then Return 0
  336. Return _Image.Width
  337. End Get
  338. End Property
  339. ReadOnly Property ImageTop() As Integer
  340. Get
  341. If _Image Is Nothing Then Return 0
  342. Return Height \ 2 - _Image.Height \ 2
  343. End Get
  344. End Property
  345.  
  346. Private _Size As Size
  347. Private _Rectangle As Rectangle
  348. Private _Gradient As LinearGradientBrush
  349. Private _Brush As SolidBrush
  350.  
  351. Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  352. If _NoRounding Then Return
  353.  
  354. B.SetPixel(rect.X, rect.Y, c)
  355. B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c)
  356. B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c)
  357. B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c)
  358. End Sub
  359.  
  360. Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  361. G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  362. G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  363. End Sub
  364.  
  365. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer)
  366. DrawText(a, c, x, 0)
  367. End Sub
  368. Protected Sub DrawText(ByVal a As HorizontalAlignment, ByVal c As Color, ByVal x As Integer, ByVal y As Integer)
  369. If String.IsNullOrEmpty(Text) Then Return
  370. _Size = G.MeasureString(Text, Font).ToSize
  371. _Brush = New SolidBrush(c)
  372.  
  373. Select Case a
  374. Case HorizontalAlignment.Left
  375. G.DrawString(Text, Font, _Brush, x, Height \ 2 - _Size.Height \ 2 + y)
  376. Case HorizontalAlignment.Right
  377. G.DrawString(Text, Font, _Brush, Width - _Size.Width - x, Height \ 2 - _Size.Height \ 2 + y)
  378. Case HorizontalAlignment.Center
  379. G.DrawString(Text, Font, _Brush, Width \ 2 - _Size.Width \ 2 + x, Height \ 2 - _Size.Height \ 2 + y)
  380. End Select
  381. End Sub
  382.  
  383. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer)
  384. DrawIcon(a, x, 0)
  385. End Sub
  386. Protected Sub DrawIcon(ByVal a As HorizontalAlignment, ByVal x As Integer, ByVal y As Integer)
  387. If _Image Is Nothing Then Return
  388. Select Case a
  389. Case HorizontalAlignment.Left
  390. G.DrawImage(_Image, x, Height \ 2 - _Image.Height \ 2 + y)
  391. Case HorizontalAlignment.Right
  392. G.DrawImage(_Image, Width - _Image.Width - x, Height \ 2 - _Image.Height \ 2 + y)
  393. Case HorizontalAlignment.Center
  394. G.DrawImage(_Image, Width \ 2 - _Image.Width \ 2, Height \ 2 - _Image.Height \ 2)
  395. End Select
  396. End Sub
  397.  
  398. Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  399. _Rectangle = New Rectangle(x, y, width, height)
  400. _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  401. G.FillRectangle(_Gradient, _Rectangle)
  402. End Sub
  403. #End Region
  404.  
  405. End Class
  406. MustInherit Class ThemeContainerControl
  407. Inherits ContainerControl
  408.  
  409. #Region " Initialization "
  410.  
  411. Protected G As Graphics, B As Bitmap
  412. Sub New()
  413. SetStyle(DirectCast(139270, ControlStyles), True)
  414. B = New Bitmap(1, 1)
  415. G = Graphics.FromImage(B)
  416. End Sub
  417.  
  418. Sub AllowTransparent()
  419. SetStyle(ControlStyles.Opaque, False)
  420. SetStyle(ControlStyles.SupportsTransparentBackColor, True)
  421. End Sub
  422.  
  423. #End Region
  424. #Region " Convienence "
  425.  
  426. MustOverride Sub PaintHook()
  427. Protected NotOverridable Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  428. If Width = 0 OrElse Height = 0 Then Return
  429. PaintHook()
  430. e.Graphics.DrawImage(B, 0, 0)
  431. End Sub
  432.  
  433. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  434. If Not Width = 0 AndAlso Not Height = 0 Then
  435. B = New Bitmap(Width, Height)
  436. G = Graphics.FromImage(B)
  437. Invalidate()
  438. End If
  439. MyBase.OnSizeChanged(e)
  440. End Sub
  441.  
  442. Private _NoRounding As Boolean
  443. Property NoRounding() As Boolean
  444. Get
  445. Return _NoRounding
  446. End Get
  447. Set(ByVal v As Boolean)
  448. _NoRounding = v
  449. Invalidate()
  450. End Set
  451. End Property
  452.  
  453. Private _Rectangle As Rectangle
  454. Private _Gradient As LinearGradientBrush
  455.  
  456. Protected Sub DrawCorners(ByVal c As Color, ByVal rect As Rectangle)
  457. If _NoRounding Then Return
  458. B.SetPixel(rect.X, rect.Y, c)
  459. B.SetPixel(rect.X + (rect.Width - 1), rect.Y, c)
  460. B.SetPixel(rect.X, rect.Y + (rect.Height - 1), c)
  461. B.SetPixel(rect.X + (rect.Width - 1), rect.Y + (rect.Height - 1), c)
  462. End Sub
  463.  
  464. Protected Sub DrawBorders(ByVal p1 As Pen, ByVal p2 As Pen, ByVal rect As Rectangle)
  465. G.DrawRectangle(p1, rect.X, rect.Y, rect.Width - 1, rect.Height - 1)
  466. G.DrawRectangle(p2, rect.X + 1, rect.Y + 1, rect.Width - 3, rect.Height - 3)
  467. End Sub
  468.  
  469. Protected Sub DrawGradient(ByVal c1 As Color, ByVal c2 As Color, ByVal x As Integer, ByVal y As Integer, ByVal width As Integer, ByVal height As Integer, ByVal angle As Single)
  470. _Rectangle = New Rectangle(x, y, width, height)
  471. _Gradient = New LinearGradientBrush(_Rectangle, c1, c2, angle)
  472. G.FillRectangle(_Gradient, _Rectangle)
  473. End Sub
  474. #End Region
  475.  
  476. End Class
  477.  
  478.  
  479.  
  480. Class ReconForm
  481. Inherits Theme
  482. Private _ShowIcon As Boolean
  483. Private TA As TextAlign
  484. Enum TextAlign As Integer
  485. Left = 0
  486. Center = 1
  487. Right = 2
  488. End Enum
  489. Public Property TextAlignment() As TextAlign
  490. Get
  491. Return TA
  492. End Get
  493. Set(ByVal value As TextAlign)
  494. TA = value
  495. Invalidate()
  496. End Set
  497. End Property
  498. Public Property ShowIcon As Boolean
  499. Get
  500. Return _ShowIcon
  501. End Get
  502. Set(ByVal value As Boolean)
  503. _ShowIcon = value
  504. Invalidate()
  505. End Set
  506. End Property
  507. Sub New()
  508. Color.FromArgb(45, 45, 45)
  509. MoveHeight = 30
  510. Me.ForeColor = Color.Olive
  511. TransparencyKey = Color.Fuchsia
  512. Me.BackColor = Color.FromArgb(41, 41, 41)
  513. End Sub
  514. Overrides Sub PaintHook()
  515. G.Clear(Color.FromArgb(41, 41, 41))
  516. DrawGradient(Color.FromArgb(11, 11, 11), Color.FromArgb(26, 26, 26), 1, 1, ClientRectangle.Width, ClientRectangle.Height, 270S)
  517. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), ClientRectangle)
  518. DrawGradient(Color.FromArgb(42, 42, 42), Color.FromArgb(40, 40, 40), 5, 30, Width - 10, Height - 35, 90S)
  519. G.DrawRectangle(New Pen(Color.FromArgb(18, 18, 18)), 5, 30, Width - 10, Height - 35)
  520.  
  521. 'Icon
  522. If _ShowIcon = False Then
  523.  
  524. Select Case TA
  525. Case 0
  526. DrawText(HorizontalAlignment.Left, Me.ForeColor, 6)
  527. Case 1
  528. DrawText(HorizontalAlignment.Center, Me.ForeColor, 0)
  529. Case 2
  530. MsgBox("Invalid Alignment, will not show text.")
  531. End Select
  532. Else
  533.  
  534. Select Case TA
  535. Case 0
  536. DrawText(HorizontalAlignment.Left, Me.ForeColor, 35)
  537. Case 1
  538. DrawText(HorizontalAlignment.Center, Me.ForeColor, 0)
  539. Case 2
  540. MsgBox("Invalid Alignment, will not show text.")
  541. End Select
  542. G.DrawIcon(Me.ParentForm.Icon, New Rectangle(New Point(6, 2), New Size(29, 29)))
  543. End If
  544.  
  545. DrawCorners(Color.Fuchsia, ClientRectangle)
  546. End Sub
  547. End Class
  548. Class ReconButton
  549. Inherits ThemeControl
  550. Sub New()
  551. Me.ForeColor = Color.DarkOliveGreen
  552. End Sub
  553. Overrides Sub PaintHook()
  554. Select Case MouseState
  555. Case State.MouseNone
  556. G.Clear(Color.FromArgb(49, 49, 49))
  557. DrawGradient(Color.FromArgb(22, 22, 22), Color.FromArgb(34, 34, 34), 1, 1, ClientRectangle.Width, ClientRectangle.Height, 270S)
  558. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), ClientRectangle)
  559. DrawText(HorizontalAlignment.Center, Me.ForeColor, 0)
  560. DrawCorners(Me.BackColor, ClientRectangle)
  561. Case State.MouseDown
  562. G.Clear(Color.FromArgb(49, 49, 49))
  563. DrawGradient(Color.FromArgb(28, 28, 28), Color.FromArgb(38, 38, 38), 1, 1, ClientRectangle.Width, ClientRectangle.Height, 270S)
  564. DrawGradient(Color.FromArgb(100, 0, 0, 0), Color.Transparent, 1, 1, ClientRectangle.Width, ClientRectangle.Height / 2, 90S)
  565. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), ClientRectangle)
  566. DrawText(HorizontalAlignment.Center, Me.ForeColor, 1)
  567. DrawCorners(Me.BackColor, ClientRectangle)
  568. Case State.MouseOver
  569. G.Clear(Color.FromArgb(49, 49, 49))
  570. DrawGradient(Color.FromArgb(28, 28, 28), Color.FromArgb(38, 38, 38), 1, 1, ClientRectangle.Width, ClientRectangle.Height, 270S)
  571. DrawGradient(Color.FromArgb(100, 50, 50, 50), Color.Transparent, 1, 1, ClientRectangle.Width, ClientRectangle.Height / 2, 90S)
  572. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), ClientRectangle)
  573. DrawText(HorizontalAlignment.Center, Me.ForeColor, -1)
  574. DrawCorners(Me.BackColor, ClientRectangle)
  575. End Select
  576. Me.Cursor = Cursors.Hand
  577.  
  578. End Sub
  579. End Class
  580.  
  581. Class TxtBox
  582. Inherits TextBox
  583.  
  584. Protected Overrides Sub WndProc(ByRef m As Message)
  585. Select Case m.Msg
  586. Case 15
  587. Invalidate()
  588. MyBase.WndProc(m)
  589. Me.CustomPaint()
  590. Exit Select
  591. Case Else
  592. MyBase.WndProc(m)
  593. Exit Select
  594. End Select
  595. End Sub
  596.  
  597. Sub New()
  598. Font = New Font("Microsoft Sans Serif", 8)
  599. ForeColor = Color.Black
  600. BackColor = Color.FromArgb(28, 28, 28)
  601. BorderStyle = Windows.Forms.BorderStyle.FixedSingle
  602. End Sub
  603.  
  604. Private Sub CustomPaint()
  605. Dim p As New Pen(Color.Black)
  606. Dim o As New Pen(Color.FromArgb(45, 45, 45))
  607. CreateGraphics.DrawLine(p, 0, 0, Width, 0)
  608. CreateGraphics.DrawLine(p, 0, Height - 1, Width, Height - 1)
  609. CreateGraphics.DrawLine(p, 0, 0, 0, Height - 1)
  610. CreateGraphics.DrawLine(p, Width - 1, 0, Width - 1, Height - 1)
  611.  
  612. CreateGraphics.DrawLine(o, 1, 1, Width - 2, 1)
  613. CreateGraphics.DrawLine(o, 1, Height - 2, Width - 2, Height - 2)
  614. CreateGraphics.DrawLine(o, 1, 1, 1, Height - 2)
  615. CreateGraphics.DrawLine(o, Width - 2, 1, Width - 2, Height - 2)
  616. End Sub
  617. End Class
  618.  
  619. Class ReconBar
  620. Inherits ThemeControl
  621. Private _Maximum As Integer
  622. Public Property Maximum() As Integer
  623. Get
  624. Return _Maximum
  625. End Get
  626. Set(ByVal v As Integer)
  627. Select Case v
  628. Case Is < _Value
  629. _Value = v
  630. End Select
  631. _Maximum = v
  632. Invalidate()
  633. End Set
  634. End Property
  635. Private _Value As Integer
  636. Public Property Value() As Integer
  637. Get
  638. Return _Value
  639. End Get
  640. Set(ByVal v As Integer)
  641. Select Case v
  642. Case Is > _Maximum
  643. v = _Maximum
  644. End Select
  645. _Value = v
  646. Invalidate()
  647. End Set
  648. End Property
  649. Overrides Sub PaintHook()
  650.  
  651. G.Clear(Color.FromArgb(49, 49, 49))
  652. DrawGradient(Color.FromArgb(18, 18, 18), Color.FromArgb(28, 28, 28), 1, 1, ClientRectangle.Width, ClientRectangle.Height, 90S)
  653.  
  654. 'Fill
  655. Select Case _Value
  656. Case Is > 6
  657. Dim x As Integer = CInt(_Value / _Maximum * Width)
  658. Dim z As Integer = ClientRectangle.Height - 7
  659.  
  660. DrawGradient(Color.FromArgb(28, 28, 28), Color.FromArgb(38, 38, 38), 1, 1, CInt(_Value / _Maximum * Width), ClientRectangle.Height, 270S)
  661. DrawGradient(Color.FromArgb(100, 50, 50, 50), Color.Transparent, 1, 1, CInt(_Value / _Maximum * Width), ClientRectangle.Height / 2, 90S)
  662.  
  663. DrawGradient(Color.FromArgb(5, Me.ForeColor), Color.Transparent, 1, 1, CInt(_Value / _Maximum * Width), ClientRectangle.Height / 4, 90S)
  664. DrawGradient(Color.FromArgb(9, Me.ForeColor), Color.Transparent, 1, CInt(_Value / _Maximum * Width) / 2, ClientRectangle.Width, ClientRectangle.Height / 2, 270S)
  665.  
  666.  
  667. G.DrawRectangle(New Pen(Color.FromArgb(50, 50, 50)), 1, 1, x, z + 4)
  668.  
  669. G.DrawRectangle(Pens.Black, 2, 2, x, z + 2)
  670.  
  671. Case Is > 1
  672. DrawGradient(Color.FromArgb(109, 183, 255), Color.FromArgb(40, 154, 255), 3, 3, CInt(_Value / _Maximum * Width), Height / 2 - 3, 90S)
  673. DrawGradient(Color.FromArgb(30, 130, 245), Color.FromArgb(15, 100, 170), 3, Height / 2 - 1, CInt(_Value / _Maximum * Width), Height / 2 - 2, 90S)
  674. End Select
  675.  
  676. 'Borders
  677. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), ClientRectangle)
  678.  
  679. End Sub
  680. Public Sub Increment(ByVal Amount As Integer)
  681. If Me.Value + Amount > Maximum Then
  682. Me.Value = Maximum
  683. Else
  684. Me.Value += Amount
  685. End If
  686. End Sub
  687. End Class
  688.  
  689. Class ReconGroupBox
  690. Inherits ThemeContainerControl
  691. Sub New()
  692. AllowTransparent()
  693. End Sub
  694. Overrides Sub PaintHook()
  695. G.Clear(Color.FromArgb(25, 25, 25))
  696. Me.BackColor = Color.FromArgb(25, 25, 25)
  697. DrawGradient(Color.FromArgb(11, 11, 11), Color.FromArgb(26, 26, 26), 1, 1, ClientRectangle.Width, ClientRectangle.Height, 270S)
  698. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), ClientRectangle)
  699.  
  700. DrawGradient(Color.FromArgb(150, 32, 32, 32), Color.FromArgb(150, 31, 31, 31), 5, 23, Width - 10, Height - 28, 90S)
  701. G.DrawRectangle(New Pen(Color.FromArgb(130, 13, 13, 13)), 5, 23, Width - 10, Height - 28)
  702.  
  703. G.DrawString(Text, Font, New SolidBrush(Me.ForeColor), 4, 6)
  704.  
  705. DrawCorners(Color.Transparent, ClientRectangle)
  706. End Sub
  707. End Class
  708. Class ReconCheck
  709. Inherits ThemeControl
  710.  
  711. #Region " Properties "
  712. Private _CheckedState As Boolean
  713. Public Property CheckedState() As Boolean
  714. Get
  715. Return _CheckedState
  716. End Get
  717. Set(ByVal v As Boolean)
  718. _CheckedState = v
  719. Invalidate()
  720. End Set
  721. End Property
  722. #End Region
  723.  
  724. Sub New()
  725. Size = New Size(90, 15)
  726. MinimumSize = New Size(16, 16)
  727. MaximumSize = New Size(600, 16)
  728. CheckedState = False
  729. End Sub
  730.  
  731. Public Overrides Sub PaintHook()
  732. G.Clear(BackColor)
  733. DrawGradient(Color.FromArgb(18, 18, 18), Color.FromArgb(28, 28, 28), 0, 0, 15, 15, 90S)
  734.  
  735. Select Case CheckedState
  736. Case True
  737.  
  738. DrawGradient(Color.FromArgb(18, 18, 18), Color.FromArgb(28, 28, 28), 0, 0, 15, 15, 270S)
  739. DrawGradient(Color.FromArgb(100, 40, 40, 40), Color.Transparent, 0, 0, 15, 15, 90S)
  740.  
  741. DrawGradient(Color.FromArgb(5, Me.ForeColor), Color.Transparent, 0, 0, 15, 15, 90S)
  742. DrawGradient(Color.FromArgb(9, Me.ForeColor), Color.Transparent, 0, 0, 15, 15, 270S)
  743.  
  744. G.DrawRectangle(New Pen(Color.FromArgb(10, 10, 10)), 3, 3, 11, 11)
  745. DrawGradient(Color.FromArgb(50, 50, 50), Color.FromArgb(30, 30, 30), 0, 0, 15, 15, 90S)
  746. End Select
  747.  
  748. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), New Rectangle(0, 0, 15, 15))
  749. DrawText(HorizontalAlignment.Left, Me.ForeColor, 17, 0)
  750. End Sub
  751.  
  752. Sub changeCheck() Handles Me.MouseDown
  753. Select Case CheckedState
  754. Case True
  755. CheckedState = False
  756. Case False
  757. CheckedState = True
  758. End Select
  759. End Sub
  760. End Class
  761. Class ReconCheckBox
  762. Inherits ThemeControl
  763.  
  764. #Region " Properties "
  765. Private _CheckedState As Boolean
  766. Public Property CheckedState() As Boolean
  767. Get
  768. Return _CheckedState
  769. End Get
  770. Set(ByVal v As Boolean)
  771. _CheckedState = v
  772. Invalidate()
  773. End Set
  774. End Property
  775. #End Region
  776.  
  777. Sub New()
  778. Size = New Size(90, 15)
  779. MinimumSize = New Size(16, 16)
  780. MaximumSize = New Size(600, 16)
  781. CheckedState = False
  782. End Sub
  783.  
  784. Public Overrides Sub PaintHook()
  785. G.Clear(Me.Parent.BackColor)
  786. DrawGradient(Color.FromArgb(22, 22, 22), Color.FromArgb(32, 32, 32), 0, 0, 15, 15, 90S)
  787. Select Case CheckedState
  788. Case True
  789. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), New Rectangle(0, 0, 15, 15))
  790. G.DrawString("a", New Font("Marlett", 12), Brushes.Black, New Point(-3, -1))
  791. Case False
  792. DrawBorders(Pens.Black, New Pen(Color.FromArgb(52, 52, 52)), New Rectangle(0, 0, 15, 15))
  793. End Select
  794.  
  795. DrawText(HorizontalAlignment.Left, Me.ForeColor, 17, 0)
  796. End Sub
  797.  
  798. Sub changeCheck() Handles Me.MouseDown
  799. Select Case CheckedState
  800. Case True
  801. CheckedState = False
  802. Case False
  803. CheckedState = True
  804. End Select
  805. End Sub
  806. End Class
  807.  
  808. Class ReconSeperator
  809. Inherits Control
  810.  
  811. Private _Orientation As Orientation
  812. Public Property Orientation() As Orientation
  813. Get
  814. Return _Orientation
  815. End Get
  816. Set(ByVal v As Orientation)
  817. _Orientation = v
  818. UpdateOffset()
  819. Invalidate()
  820. End Set
  821. End Property
  822.  
  823. Dim G As Graphics, B As Bitmap, I As Integer
  824. Dim C1 As Color, P1, P2 As Pen
  825. Sub New()
  826. SetStyle(ControlStyles.AllPaintingInWmPaint Or ControlStyles.UserPaint, True)
  827. C1 = Me.BackColor
  828. P1 = New Pen(Color.FromArgb(22, 22, 22))
  829. P2 = New Pen(Color.FromArgb(49, 49, 49))
  830. MinimumSize = New Size(5, 2)
  831. MaximumSize = New Size(10000, 2)
  832. End Sub
  833.  
  834. Protected Overrides Sub OnSizeChanged(ByVal e As EventArgs)
  835. UpdateOffset()
  836. MyBase.OnSizeChanged(e)
  837. End Sub
  838.  
  839. Sub UpdateOffset()
  840. I = Convert.ToInt32(If(_Orientation = 0, Height / 2 - 1, Width / 2 - 1))
  841. End Sub
  842.  
  843. Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)
  844. B = New Bitmap(Width, Height)
  845. G = Graphics.FromImage(B)
  846.  
  847. G.Clear(C1)
  848.  
  849. If _Orientation = 0 Then
  850. G.DrawLine(P1, 0, I, Width, I)
  851. G.DrawLine(P2, 0, I + 1, Width, I + 1)
  852. Else
  853. G.DrawLine(P2, I, 0, I, Height)
  854. G.DrawLine(P1, I + 1, 0, I + 1, Height)
  855. End If
  856.  
  857. e.Graphics.DrawImage(B, 0, 0)
  858. G.Dispose()
  859. B.Dispose()
  860. End Sub
  861.  
  862. Protected Overrides Sub OnPaintBackground(ByVal pevent As PaintEventArgs)
  863. End Sub
  864.  
  865. End Class
Add Comment
Please, Sign In to add comment