home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 1_2002.ISO / Data / Zips / SourceCode550432132002.psc / SCO / chameleonButton.ctl < prev   
Encoding:
Visual Basic user-defined control file  |  2002-02-13  |  39.9 KB  |  840 lines

  1. VERSION 5.00
  2. Begin VB.UserControl chameleonButton 
  3.    AutoRedraw      =   -1  'True
  4.    ClientHeight    =   3600
  5.    ClientLeft      =   0
  6.    ClientTop       =   0
  7.    ClientWidth     =   4800
  8.    DefaultCancel   =   -1  'True
  9.    ScaleHeight     =   240
  10.    ScaleMode       =   3  'Pixel
  11.    ScaleWidth      =   320
  12.    ToolboxBitmap   =   "chameleonButton.ctx":0000
  13.    Begin VB.Timer OverTimer 
  14.       Enabled         =   0   'False
  15.       Interval        =   5
  16.       Left            =   0
  17.       Top             =   0
  18.    End
  19. End
  20. Attribute VB_Name = "chameleonButton"
  21. Attribute VB_GlobalNameSpace = False
  22. Attribute VB_Creatable = True
  23. Attribute VB_PredeclaredId = False
  24. Attribute VB_Exposed = False
  25. Option Explicit
  26. Private Const Version As String = "1.1"
  27.  
  28. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  29. '%             <<< GONCHUKI SYSTEMS >>>               %
  30. '%                                                    %
  31. '%                 CHAMELEON BUTTON                   %
  32. '%         copyright ⌐2001-2002 by gonchuki           %
  33. '%                                                    %
  34. '%  this custom control will emulate the most common  %
  35. '%      command buttons that everyone knows.          %
  36. '%                                                    %
  37. '% it took me about two months to develop this control%
  38. '%  and at this time i think it's completely bug free %
  39. '%     ALL THE CODE WAS WRITTEN FROM SCRATCH!!!       %
  40. '%                                                    %
  41. '%   ever wanted to add cool buttons to your app???   %
  42. '%          this is the BEST solution!!!              %
  43. '%                                                    %
  44. '%                                                    %
  45. '%     e-mail: gonchuki@yahoo.es                      %
  46. '%                                                    %
  47. '%              Don't forget to vote!!!               %
  48. '%                                                    %
  49. '%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  50.  
  51. '######################################################
  52. '#                    UPDTATE LOG                     #
  53. '#  all times are GMT -03:00                          #
  54. '#                                                    #
  55. '# November 9  - 03:00 am                             #
  56. '#              ╖ first release                       #
  57. '#                                                    #
  58. '# November 9  - 05:00 pm                             #
  59. '#              ╖ added ShowFocusRect property        #
  60. '#              ╖ added repaint before triggering the #
  61. '#                click event                         #
  62. '#                                                    #
  63. '# November 9  - 07:20 pm                             #
  64. '#              ╖ fixed the color shifting so it will #
  65. '#                display the correct color and not a #
  66. '#                weird one.                          #
  67. '#              ╖ improved Java button drawing        #
  68. '#              ╖ added custom colors capability      #
  69. '#                now it looks better than ever COOL! #
  70. '#              ╖ improved Flat button drawing        #
  71. '#                                                    #
  72. '# November 13 - 03:40 pm                             #
  73. '#              ╖ fixed the WinXP button colors and   #
  74. '#                styles. Note that as the colors are #
  75. '#                relative to a base, and for this    #
  76. '#                button i made a color work-around,  #
  77. '#                some colors will be un-reachable    #
  78. '#              ╖ added MouseMove event as requested  #
  79. '#                                                    #
  80. '# November 18 - 10:40 am                             #
  81. '#              ╖ translated all the line methods to  #
  82. '#                API calls. It's now faster than     #
  83. '#                ever. It will also decrease the     #
  84. '#                extra size of your exe!!!           #
  85. '#              ╖ improved Win32 button drawing       #
  86. '#              ╖ moved the direct calls to SetPixel  #
  87. '#                to use less inline .hDC calls       #
  88. '#              ╖ fixed KeyDown/KeyUp events so they  #
  89. '#                now act as they should              #
  90. '#                                                    #
  91. '# November 23 - 3:55 pm  (not updating on PSC...)    #
  92. '#              ╖ upgraded version to 1.1             #
  93. '#              ╖ added FontBold, and other similar   #
  94. '#                properties as requested             #
  95. '#              ╖ greatly improved drawing speed by   #
  96. '#                replacing lots of duplicated code   #
  97. '#                with the new-brand function made by #
  98. '#                me: "DrawFrame"                     #
  99. '#              ╖ fixed MouseDown/MouseUp events so   #
  100. '#                they now act as they should         #
  101. '#              ╖ added MousePointer property         #
  102. '#                                                    #
  103. '# December 1  - 10:10 pm                             #
  104. '#              ╖ replaced the RECT types assignment  #
  105. '#                in the resize event with API calls  #
  106. '#                that take 3/4 the time of raw vb    #
  107. '#              ╖ added "use container" to the color  #
  108. '#                schemes                             #
  109. '#              ╖ button now initializes with it's    #
  110. '#                caption set as it's name            #
  111. '#                                                    #
  112. '# December 23 - 2:00 pm                              #
  113. '#              ╖ finally got all the code in API by  #
  114. '#                replacing the Usercontrol.ForeColor #
  115. '#                calls with CreatePen API            #
  116. '#              ╖ added support for wrapping captions #
  117. '#              ╖ changed a bit the XP button gradient#
  118. '#                thanks to Ghuran Kartal for this    #
  119. '#              ╖ added refresh sub to force a button #
  120. '#                redraw.                             #
  121. '#              ╖ MouseIcon property added            #
  122. '#              ╖ MouseOver/MouseOut events added and #
  123. '#                also a ForeOver property is provided#
  124. '#                to change font color on mouse over. #
  125. '#                this also fixed the WinXP button,   #
  126. '#                which design is now perfect.        #
  127. '#              ╖ added FlatHover button style that is#
  128. '#                the real toolbar button.            #
  129. '#                                                    #
  130. '# January 1  - 11:15 am                 year 2002!!! #
  131. '#              ╖ some minor fixes                    #
  132. '#              ╖ new release!!!                      #
  133. '#                                                    #
  134. '# January 5  - 10:15 am                              #
  135. '#              ╖ fixed the memory leaks (only 1% of  #
  136. '#                gdi is lost per 15-20 runs of demo) #
  137. '#              ╖ the font assignment has changed     #
  138. '#              ╖ fixed a very rare and random bug in #
  139. '#                the XP-button. Problem was in the   #
  140. '#                DrawLine sub. Thanks goes to Dennis #
  141. '#                Vanderspek                          #
  142. '#              ╖ changed Mid and LCase to the faster #
  143. '#                Mid$ and LCase$ way                 #
  144. '#                                                    #
  145. '######################################################
  146.  
  147. Private Declare Function SetPixel Lib "gdi32" Alias "SetPixelV" (ByVal hDc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
  148. Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
  149. Private Const COLOR_BTNFACE = 15
  150. Private Const COLOR_BTNSHADOW = 16
  151. Private Const COLOR_BTNTEXT = 18
  152. Private Const COLOR_BTNHIGHLIGHT = 20
  153. Private Const COLOR_BTNDKSHADOW = 21
  154. Private Const COLOR_BTNLIGHT = 22
  155.  
  156. Private Declare Function GetBkColor Lib "gdi32" (ByVal hDc As Long) As Long
  157. Private Declare Function GetTextColor Lib "gdi32" (ByVal hDc As Long) As Long
  158. Private Declare Function SetTextColor Lib "gdi32" (ByVal hDc As Long, ByVal crColor As Long) As Long
  159. Private Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hDc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
  160. Private Const DT_CALCRECT = &H400
  161. Private Const DT_WORDBREAK = &H10
  162. Private Const DT_CENTER = &H1 Or DT_WORDBREAK
  163.  
  164. Private Declare Function CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal nWidth As Long, ByVal crColor As Long) As Long
  165. Private Const PS_SOLID = 0
  166.  
  167. Private Declare Function CreateSolidBrush Lib "gdi32" (ByVal crColor As Long) As Long
  168. Private Declare Function FillRect Lib "user32" (ByVal hDc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
  169. Private Declare Function FrameRect Lib "user32" (ByVal hDc As Long, lpRect As RECT, ByVal hBrush As Long) As Long
  170. Private Declare Function DrawFocusRect Lib "user32" (ByVal hDc As Long, lpRect As RECT) As Long
  171.  
  172. Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
  173. Private Declare Function SelectObject Lib "gdi32" (ByVal hDc As Long, ByVal hObject As Long) As Long
  174.  
  175. Private Declare Function MoveToEx Lib "gdi32" (ByVal hDc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
  176. Private Declare Function LineTo Lib "gdi32" (ByVal hDc As Long, ByVal x As Long, ByVal y As Long) As Long
  177.  
  178. Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
  179. Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
  180. Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Long) As Long
  181. Private Const RGN_DIFF = 4
  182.  
  183. Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
  184. Private Declare Function InflateRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
  185. Private Declare Function OffsetRect Lib "user32" (lpRect As RECT, ByVal x As Long, ByVal y As Long) As Long
  186. Private Declare Function CopyRect Lib "user32" (lpDestRect As RECT, lpSourceRect As RECT) As Long
  187.  
  188. Private Declare Function WindowFromPoint Lib "user32" (ByVal xPoint As Long, ByVal yPoint As Long) As Long
  189. Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
  190.  
  191. Private Type RECT
  192.         left As Long
  193.         Top As Long
  194.         Right As Long
  195.         Bottom As Long
  196. End Type
  197.  
  198. Private Type POINTAPI
  199.         x As Long
  200.         y As Long
  201. End Type
  202.  
  203. Public Enum ButtonTypes
  204.     [Windows 16-bit] = 1    'the old-fashioned Win16 button
  205.     [Windows 32-bit] = 2    'the classic windows button
  206.     [Windows XP] = 3        'the new brand XP button totally owner-drawn
  207.     [Mac] = 4               'i suppose it looks exactly as a Mac button... i took the style from a GetRight skin!!!
  208.     [Java metal] = 5        'there are also other styles but not so different from windows one
  209.     [Netscape 6] = 6        'this is the button displayed in web-pages, it also appears in some java apps
  210.     [Simple Flat] = 7       'the standard flat button seen on toolbars
  211.     [Flat Highlight] = 8    'again the flat button but this one has no border until the mouse is over it
  212. End Enum
  213.  
  214. Public Enum ColorTypes
  215.     [Use Windows] = 1
  216.     [Custom] = 2
  217.     [Force Standard] = 3
  218.     [Use Container] = 4
  219. End Enum
  220.  
  221. 'events
  222. Public Event Click()
  223. Public Event MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  224. Public Event MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  225. Public Event MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  226. Public Event KeyPress(KeyAscii As Integer)
  227. Public Event KeyDown(KeyCode As Integer, Shift As Integer)
  228. Public Event KeyUp(KeyCode As Integer, Shift As Integer)
  229. Public Event MouseOver()
  230. Public Event MouseOut()
  231.  
  232. 'variables
  233. Private MyButtonType As ButtonTypes
  234. Private MyColorType As ColorTypes
  235.  
  236. Private He As Long  'the height of the button
  237. Private Wi As Long  'the width of the button
  238.  
  239. Private BackC As Long 'back color
  240. Private ForeC As Long 'fore color
  241. Private ForeO As Long 'fore color when mouse is over
  242.  
  243. Private elTex As String     'current text
  244.  
  245. Private rc As RECT, rc2 As RECT, rc3 As RECT
  246. Private rgnNorm As Long
  247.  
  248. Private LastButton As Byte, LastKeyDown As Byte
  249. Private isEnabled As Boolean
  250. Private hasFocus As Boolean, showFocusR As Boolean
  251.  
  252. Private cFace As Long, cLight As Long, cHighLight As Long, cShadow As Long, cDarkShadow As Long, cText As Long, cTextO As Long
  253.  
  254. Private lastStat As Byte, TE As String 'used to avoid unnecessary repaints
  255. Private isOver As Boolean
  256.  
  257. Private Sub OverTimer_Timer()
  258. Dim pt As POINTAPI
  259.  
  260. GetCursorPos pt
  261. If UserControl.hwnd <> WindowFromPoint(pt.x, pt.y) Then
  262.     OverTimer.Enabled = False
  263.     isOver = False
  264.     Call Redraw(0, True)
  265.     RaiseEvent MouseOut
  266. End If
  267. End Sub
  268.  
  269. Private Sub UserControl_AccessKeyPress(KeyAscii As Integer)
  270.     Call UserControl_Click
  271. End Sub
  272.  
  273. Private Sub UserControl_AmbientChanged(PropertyName As String)
  274.     If MyColorType = [Use Container] Then
  275.         Call SetColors
  276.         Call Redraw(lastStat, True)
  277.     End If
  278. End Sub
  279.  
  280. Private Sub UserControl_Click()
  281. If (LastButton = 1) And (isEnabled = True) Then
  282.     Call Redraw(0, True) 'be sure that the normal status is drawn
  283.     UserControl.Refresh
  284.     RaiseEvent Click
  285. End If
  286. End Sub
  287.  
  288. Private Sub UserControl_DblClick()
  289. If LastButton = 1 Then
  290.     Call UserControl_MouseDown(1, 1, 1, 1)
  291. End If
  292. End Sub
  293.  
  294. Private Sub UserControl_GotFocus()
  295. hasFocus = True
  296. Call Redraw(lastStat, True)
  297. End Sub
  298.  
  299. Private Sub UserControl_KeyDown(KeyCode As Integer, Shift As Integer)
  300. RaiseEvent KeyDown(KeyCode, Shift)
  301.  
  302. LastKeyDown = KeyCode
  303. If KeyCode = 32 Then 'spacebar pressed
  304.     Call UserControl_MouseDown(1, 1, 1, 1)
  305. ElseIf (KeyCode = 39) Or (KeyCode = 40) Then 'right and down arrows
  306.     SendKeys "{Tab}"
  307. ElseIf (KeyCode = 37) Or (KeyCode = 38) Then 'left and up arrows
  308.     SendKeys "+{Tab}"
  309. End If
  310. End Sub
  311.  
  312. Private Sub UserControl_KeyPress(KeyAscii As Integer)
  313. RaiseEvent KeyPress(KeyAscii)
  314. End Sub
  315.  
  316. Private Sub UserControl_KeyUp(KeyCode As Integer, Shift As Integer)
  317. RaiseEvent KeyUp(KeyCode, Shift)
  318.  
  319. If (KeyCode = 32) And (LastKeyDown = 32) Then 'spacebar pressed
  320.     Call UserControl_MouseUp(1, 1, 1, 1)
  321.     LastButton = 1
  322.     Call UserControl_Click
  323. End If
  324. End Sub
  325.  
  326. Private Sub UserControl_LostFocus()
  327. hasFocus = False
  328. Call Redraw(lastStat, True)
  329. End Sub
  330.  
  331. Private Sub UserControl_Initialize()
  332. LastButton = 1
  333. Call SetColors
  334. End Sub
  335.  
  336. Private Sub UserControl_InitProperties()
  337.     isEnabled = True
  338.     showFocusR = True
  339.     elTex = Ambient.DisplayName
  340.     Set UserControl.font = Ambient.font
  341.     MyButtonType = [Windows 32-bit]
  342.     MyColorType = [Use Windows]
  343.     BackC = GetSysColor(COLOR_BTNFACE)
  344.     ForeC = GetSysColor(COLOR_BTNTEXT)
  345. End Sub
  346.  
  347. Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
  348. RaiseEvent MouseDown(Button, Shift, x, y)
  349. LastButton = Button
  350. If Button <> 2 Then Call Redraw(2, False)
  351. End Sub
  352.  
  353. Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single)
  354. RaiseEvent MouseMove(Button, Shift, x, y)
  355. If Button < 2 Then
  356.     If x < 0 Or y < 0 Or x > Wi Or y > He Then
  357.         'we are outside the button
  358.         Call Redraw(0, False)
  359.     Else
  360.         'we are inside the button
  361.         If (Button = 0) And (isOver = False) Then
  362.             OverTimer.Enabled = True
  363.             isOver = True
  364.             RaiseEvent MouseOver
  365.             Call Redraw(0, True)
  366.         ElseIf Button = 1 Then
  367.             Call Redraw(2, False)
  368.         End If
  369.         
  370.     End If
  371. End If
  372. End Sub
  373.  
  374. Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single)
  375. RaiseEvent MouseUp(Button, Shift, x, y)
  376. If Button <> 2 Then Call Redraw(0, False)
  377. End Sub
  378.  
  379. '########## BUTTON PROPERTIES ##########
  380. Public Property Get BackColor() As OLE_COLOR
  381. BackColor = BackC
  382. End Property
  383. Public Property Let BackColor(ByVal theCol As OLE_COLOR)
  384. BackC = theCol
  385. Call SetColors
  386. Call Redraw(lastStat, True)
  387. PropertyChanged "BCOL"
  388. End Property
  389.  
  390. Public Property Get ForeColor() As OLE_COLOR
  391. ForeColor = ForeC
  392. End Property
  393. Public Property Let ForeColor(ByVal theCol As OLE_COLOR)
  394. ForeC = theCol
  395. If Ambient.UserMode = False Then ForeO = theCol
  396. Call SetColors
  397. Call Redraw(lastStat, True)
  398. PropertyChanged "FCOL"
  399. End Property
  400.  
  401. Public Property Get ForeOver() As OLE_COLOR
  402. ForeOver = ForeO
  403. End Property
  404. Public Property Let ForeOver(ByVal theCol As OLE_COLOR)
  405. ForeO = theCol
  406. Call SetColors
  407. Call Redraw(lastStat, True)
  408. PropertyChanged "FCOLO"
  409. End Property
  410.  
  411. Public Property Get ButtonType() As ButtonTypes
  412. ButtonType = MyButtonType
  413. End Property
  414.  
  415. Public Property Let ButtonType(ByVal newValue As ButtonTypes)
  416. MyButtonType = newValue
  417. If ButtonType = [Java metal] Then UserControl.FontBold = True
  418. Call UserControl_Resize
  419. PropertyChanged "BTYPE"
  420. End Property
  421.  
  422. Public Property Get Caption() As String
  423. Caption = elTex
  424. End Property
  425.  
  426. Public Property Let Caption(ByVal newValue As String)
  427. elTex = newValue
  428. Call SetAccessKeys
  429. Call CalcTextRects
  430. Call Redraw(0, True)
  431. PropertyChanged "TX"
  432. End Property
  433.  
  434. Public Property Get Enabled() As Boolean
  435. Enabled = isEnabled
  436. End Property
  437.  
  438. Public Property Let Enabled(ByVal newValue As Boolean)
  439. isEnabled = newValue
  440. Call Redraw(0, True)
  441. UserControl.Enabled = isEnabled
  442. PropertyChanged "ENAB"
  443. End Property
  444.  
  445. Public Property Get font() As font
  446. Set font = UserControl.font
  447. End Property
  448.  
  449. Public Property Set font(ByRef newFont As font)
  450. Set UserControl.font = newFont
  451. Call CalcTextRects
  452. Call Redraw(0, True)
  453. PropertyChanged "FONT"
  454. End Property
  455.  
  456. Public Property Get FontBold() As Boolean
  457. Attribute FontBold.VB_MemberFlags = "400"
  458. FontBold = UserControl.FontBold
  459. End Property
  460.  
  461. Public Property Let FontBold(ByVal newValue As Boolean)
  462. UserControl.FontBold = newValue
  463. Call CalcTextRects
  464. Call Redraw(0, True)
  465. End Property
  466.  
  467. Public Property Get FontItalic() As Boolean
  468. Attribute FontItalic.VB_MemberFlags = "400"
  469. FontItalic = UserControl.FontItalic
  470. End Property
  471.  
  472. Public Property Let FontItalic(ByVal newValue As Boolean)
  473. UserControl.FontItalic = newValue
  474. Call CalcTextRects
  475. Call Redraw(0, True)
  476. End Property
  477.  
  478. Public Property Get FontUnderline() As Boolean
  479. Attribute FontUnderline.VB_MemberFlags = "400"
  480. FontUnderline = UserControl.FontUnderline
  481. End Property
  482.  
  483. Public Property Let FontUnderline(ByVal newValue As Boolean)
  484. UserControl.FontUnderline = newValue
  485. Call CalcTextRects
  486. Call Redraw(0, True)
  487. End Property
  488.  
  489. Public Property Get FontSize() As Integer
  490. Attribute FontSize.VB_MemberFlags = "400"
  491. FontSize = UserControl.FontSize
  492. End Property
  493.  
  494. Public Property Let FontSize(ByVal newValue As Integer)
  495. UserControl.FontSize = newValue
  496. Call CalcTextRects
  497. Call Redraw(0, True)
  498. End Property
  499.  
  500. Public Property Get FontName() As String
  501. Attribute FontName.VB_MemberFlags = "400"
  502. FontName = UserControl.FontName
  503. End Property
  504.  
  505. Public Property Let FontName(ByVal newValue As String)
  506. UserControl.FontName = newValue
  507. Call CalcTextRects
  508. Call Redraw(0, True)
  509. End Property
  510.  
  511. 'it is very common that a windows user uses custom color
  512. 'schemes to view his/her desktop, and is also very
  513. 'common that this color scheme has weird colors that
  514. 'would alter the nice look of my buttons.
  515. 'So if you want to force the button to use the windows
  516. 'standard colors you may change this property to "Force Standard"
  517.  
  518. Public Property Get ColorScheme() As ColorTypes
  519. ColorScheme = MyColorType
  520. End Property
  521.  
  522. Public Property Let ColorScheme(ByVal newValue As ColorTypes)
  523. MyColorType = newValue
  524. Call SetColors
  525. Call Redraw(0, True)
  526. PropertyChanged "COLTYPE"
  527. End Property
  528.  
  529. Public Property Get ShowFocusRect() As Boolean
  530. ShowFocusRect = showFocusR
  531. End Property
  532.  
  533. Public Property Let ShowFocusRect(ByVal newValue As Boolean)
  534. showFocusR = newValue
  535. Call Redraw(lastStat, True)
  536. PropertyChanged "FOCUSR"
  537. End Property
  538.  
  539. Public Property Get MousePointer() As MousePointerConstants
  540.     MousePointer = UserControl.MousePointer
  541. End Property
  542.  
  543. Public Property Let MousePointer(ByVal newPointer As MousePointerConstants)
  544.     UserControl.MousePointer = newPointer
  545.     PropertyChanged "MPTR"
  546. End Property
  547.  
  548. Public Property Get MouseIcon() As StdPicture
  549.     Set MouseIcon = UserControl.MouseIcon
  550. End Property
  551.  
  552. Public Property Set MouseIcon(ByVal newIcon As StdPicture)
  553. On Local Error Resume Next
  554.     Set UserControl.MouseIcon = newIcon
  555.     PropertyChanged "MICON"
  556. End Property
  557.  
  558. Public Property Get hwnd() As Long
  559.     hwnd = UserControl.hwnd
  560. End Property
  561.  
  562. '########## END OF PROPERTIES ##########
  563.  
  564. Private Sub UserControl_Resize()
  565.     He = UserControl.ScaleHeight
  566.     Wi = UserControl.ScaleWidth
  567.     
  568.     GetClientRect UserControl.hwnd, rc3: InflateRect rc3, -4, -4
  569.     Call CalcTextRects
  570.     
  571.     DeleteObject rgnNorm
  572.     Call MakeRegion
  573.     SetWindowRgn UserControl.hwnd, rgnNorm, True
  574.     
  575.     If He > 0 Then Call Redraw(0, True)
  576. End Sub
  577.  
  578. Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
  579. With PropBag
  580.     MyButtonType = .ReadProperty("BTYPE", 2)
  581.     elTex = .ReadProperty("TX", "")
  582.     isEnabled = .ReadProperty("ENAB", True)
  583.     Set UserControl.font = .ReadProperty("FONT", UserControl.font)
  584.     MyColorType = .ReadProperty("COLTYPE", 1)
  585.     showFocusR = .ReadProperty("FOCUSR", True)
  586.     BackC = .ReadProperty("BCOL", GetSysColor(COLOR_BTNFACE))
  587.     ForeC = .ReadProperty("FCOL", GetSysColor(COLOR_BTNTEXT))
  588.     ForeO = .ReadProperty("FCOLO", GetSysColor(COLOR_BTNTEXT))
  589.     UserControl.MousePointer = .ReadProperty("MPTR", 0)
  590.     Set UserControl.MouseIcon = .ReadProperty("MICON", Nothing)
  591. End With
  592.  
  593.     UserControl.Enabled = isEnabled
  594.     Call SetColors
  595.     Call SetAccessKeys
  596. End Sub
  597.  
  598. Private Sub UserControl_Terminate()
  599.     DeleteObject rgnNorm
  600. End Sub
  601.  
  602. Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
  603. With PropBag
  604.     Call .WriteProperty("BTYPE", MyButtonType)
  605.     Call .WriteProperty("TX", elTex)
  606.     Call .WriteProperty("ENAB", isEnabled)
  607.     Call .WriteProperty("FONT", UserControl.font)
  608.     Call .WriteProperty("COLTYPE", MyColorType)
  609.     Call .WriteProperty("FOCUSR", showFocusR)
  610.     Call .WriteProperty("BCOL", BackC)
  611.     Call .WriteProperty("FCOL", ForeC)
  612.     Call .WriteProperty("FCOLO", ForeO)
  613.     Call .WriteProperty("MPTR", UserControl.MousePointer)
  614.     Call .WriteProperty("MICON", UserControl.MouseIcon)
  615. End With
  616. End Sub
  617.  
  618. Private Sub Redraw(ByVal curStat As Byte, ByVal Force As Boolean)
  619.  
  620. 'here is the CORE of the button, everything is drawn here
  621. 'it's not well commented but i think that everything is
  622. 'pretty self explanatory...
  623.  
  624. If Force = False Then 'check drawing redundancy
  625.     If (curStat = lastStat) And (TE = elTex)ustom coloropB Thennatory...
  626.  
  627. If Forceex)ustomRter thell .Wriu = .ReadProperty("FCOL", GetSyL orm
  628. End Sub
  629.  
  630. Private Sub UserControl_WriteProperties) As BooleaaaCAontrolperty("BTYPE", MyButtonTytroaty = .ReadPxloDitrol_Wl iteProperties) As BooleaaaCAontrolperty("BTYPE", MyButtonTytroaty = .ReadPxloDitrol( UserControl_WriteProperties) As BoBing ntrolperty("BTYPE", Mroperties) As BoBesPxlohing)
  631. EnnnnnMyButtonTytroaty = .ReadPxloDitrol( UserControl_WriteProperties) As BoBing eP .Readtrol( UsBesPxlen S8rControl_Wrisv,l  sOol(s) As BooleaaaCAontrolperBrent MouseDup, a e Property Ge, -4,b redundol_WriteProbrolperBrent MouseDup, a e Property Ge, -rolpePropKeProbrolperBrennControlh-te Wi As Long  'the width of the button< dPxlodth obFon DrawPropertirdi Caption(ByVal newValue As String)
  632. elTex(ByValtion(ByVal newValue nnnM, UserControlByVaetSysCmbien Property Get FontName(t  drawa_Wrie FontUnderlinCony...
  633.  tption(ByVal r.E = .Rea height ofPiuseDup, a e Property GeL", BackCaoper) As BoBrty Ge,lFty("Fit will #
  634. iesrol_Wrisv,l  sOol(s) As BooobrolperBrent MouseDup, ae Property GeL", BackCaoper) As BoBrt)
  635. End Property
  636.  
  637. Public Poobrolpt)
  638. ERe Pro MouseDuttonType = e Properierty Ge, -4,b redundol_WriteProbrolperBrent Mouep1 dPxlo= .ReadPxloDitrol(y22 ...Xpented but troaty =d(ByV72 ...XoWriteProbrrControlf thtHderControl_InitProperties()4adtrolContperBre bu  Wi = UserCoa..XoWriwckCaopeaal_TertpaaaCAkCaoper) Ac= tolf trierty Ge, -4,aty =d(ByV72 ...XoWriteProbrrControlf thtHderControl_ICwill #
  639. iesrol_Wrisv,l  sOol(s) As BooobrolperBrent MouseDulocWriwckCaopro MouseDuttonType =broisOol( ,b elTexOBrent MouseDulocIo= .ReadPxloDitrIc,aty =d(By, True)
  640.     SyUp(Keyk
  641. Public Poobrolpt)
  642. E3 ..s, True)
  643.     Sdng)   SyUp(Keyk
  644. kdng)  ouseDulocIo= XoWriteProbrrControlf thtHderPik()
  645. Public Event MouseDown(Button As Inte:nnM, UserControlByVaetSysCmbien Property Get FontName(t  drawa_Wrie FontUrIc,aty ng  ' 'Proprie FontUrC_Wrie FontUrIc,aty eINKdFontUrIcsrit eINKdFed b) As BoBrt)
  646. End Property
  647.  
  648. Public Poobrolpt)
  649. ERe Pro MouseDuttonType = e Properierty Ge,brrS
  650.  
  651. Public Poobrolpte ..s, True)
  652.  
  653.  Ti1ell(rty Ge,brontUrCe,brrS
  654.  
  655. PublicXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXsDControlByVaetSysCmbien Prope1m$lFontNXXXXXXXX(eUrIcsrit e$lFontNXXXXXXXX(XXXXXXXXX(eUrIcsrit e$lFondysColor(COLOR_BTNTEXT))
  656.   XXXXXXXX(eUrIcsrit e$lFontNXXXXXXXX(XXXXX Po,SsXXXXyV72 ..itePrmsCmbien Prope1m$lFontNXXXXXXXX(eUrIcsri bsXXXt.itsXXXnoDitreUrXXXXX Po,SsXXXXyV72 ..itePrmsCmbien Prope1m$lFontNXXXXXXXX(eUrIcsri bsXXXt.itsXXXnoDitreUr ien Prope1m$lFontNXXXXXXXX(eUrIcsrit e$lFeUrI hr ien Pr[nd Property
  657.  
  658. PublbsXDulocsrir FeUrI hr De9etSyivate SulFeUrI hr ien Pr[PropertniaeaXXXXXXXXXsDControlBwerty
  659.  
  660. PublbsXDulocsrir FeUrI hr Dier, Shift As Integer,>lFontBold(ByVal newVv0XXXdGet FontIttPo,Siift Asn Pr[newtublbst De9eulocSulet FontIttPo,Siift Asn Pr[newtublbst De9eulocSulet FontIttPo,Siift "y
  661.  
  662. riteProperttton, everyt1FontIttPo,Siift Asn RE of thlocSmttton, everyt1FontIttPo,SiiftT
  663.  
  664. Public Property Geulocsrir FeUrI hr Dier,hr Dier, ShHEthing isll CalcTlicner,hr DntNXXXXXXXX(Xpert
  665. PublrRCc PtdPropI hr ien Pr[Propertniaer,hr Dier, ShHEthinblrRCc PtdPropI hr ien Pr[Propertniaer,hr Dier, Sh ontrol0den0r ButlrRDitrl  sOol(s) As BooleaaaCAontrolperB0er,hr Dier, toleeeeeeeen0nt AscohOol(s) As BlTeegB0er,hrnsOol(s) As BooleaaaAscohOol(s) As BlTeegB0er,hrnsOol(saetSysCmbien Pro eeeen0ntoeIlScTlicnntrol.font)
  666. tonType = e Properierty Ge, -4,b redundol_Writb ) As el
  667. hhty Gehr Dier, toleeeehwndy Ge, -4ong, cTeAUrI hr ien Pr[nRr Dieiift           XXXXXwndy Geeeehwndy2DControCa0en Pr[nRr Dieiift          ?l)eeeehwndy2DContre>ti]yy!lties(PropBag As PropertyBag)hwndy2DContre>ti]yy! isll i]yy!lties(dfroperty Let ForeOver(ByVal theCol eGulocSulet FolPropertyBag)hwndy2DContre>ti]yy! isll i]yy!ltiesw>ti]yy! isll i]yy De9ey = .Ro trolr[ProemEF eGuloWies...............rIcsrit e$lFltrolr[PrPr =d(By, True)
  668.     SyUp(KeyhM[ProemEF eGuloWies.lTeegB"tfCtoleeeehw0tnUeiift       iteProperti e Pro= .Read9ey = .Ro t2all i]yy!1VaeEPubliegB"tfCtoltUrCe,brrS
  669.  
  670. PublicXXXXXXXXRI hr De9etSyivate SulFeUrI h0l i]yy!1VaeEPubliegB"tfCtoltUrCe,brrS
  671.  
  672. PAsn Pr[neweeeen0ntoeIlScTlicnntrol.font)
  673. true)
  674.   i]yy!1VaeEPubliegB"tfCtoltUr=d(By, !1VaeEPubliegB"tfCtob)
  675.     SyUp(KeyhM[ProemEF eGuloWies.lTeegB"tfCtoleeeeeeeeeeeeeee1VaeEPubliegB"tfCntreffAscii A!1VaeEPubliegB"tfCkll i]yy!1VaTRGe, -rolpePropKePro0RI hr De9etSy!lti]yy!1VaT Redraw(0, True)
  676. End   SeulocONT", UserControl.font)
  677.     MyColoeeeeee'csrit
  678. ro0RI hr De9etSy!lti]yy!"tfCtolta.font)c]yy! isll i]yy!ltiesw>ti]yy! isll i]yy De9ey = .RlrRDitrl  sOobntroSC
  679. ro0RI hreDup, a                in tlpePropKePro0RI hr De9etSy!lti]yy!1VaNTypeywdhn0n]yy De9eyt)c]yy!8l>ti2Cee'csrit
  680. ro0RI "tDup, a         c)kberFlags = "400en Prl>ti2Ce,3 dundol_Writb ) As el
  681. hhty Gehr DleIs el
  682. hhty GR        c dundvate SAs el
  683. hh.......rIcsrN  drawa_Wrie Foti2Ce,3 XXXXX c dundvate l>ti2Ce,3 dundoltom colcyy!1XXXXXXX        c)kberiate l>ti2Ce,3 duR2ocyy!erythUrXXXXX Po,SsXXXXyV72 ..itePrmsCmbien Prope1m$lFontNXXXXXXXX(eUrIcsri b   c)kberiate l>ti2Ce,3 duR2ocyy!ery! isll i]yy!ltiesw>ti]yylScTlicnntrol.font)
  684. true)
  685.   ItrolContfLntrfont)
  686. true)
  687.   i]yy!1ci2Ce,3 iti]yylouseDuttonType = e Properienee =eegB0er,er lmr.3OL"O2mrO2mrO2mrO2mrO2m islPCtol MouseIegB0eoHEthing is lmr.3OL"O2mrO2mrO2myneUCalcTextRects
  688. Call Redraw(0, True)
  689. End PropertyIhUrXXXXX Po,SsXXXXyV72 u l> colcyy!1b2ouseDuttonTytre>t>3OL"O2mrO2mrO2myneUCalcTe()4adtrolContperBre 
  690.  
  691. PublicXXXXXXXXXXXXXXXXXXXc
  692.    neawa_Wrie FEhr ien XXXXXXX5ift Aol0den0r Butlrien Xf  i]y ty
  693.  
  694. '####nhng isll Cal olCont plicO.Prop f  i]y ty
  695. .Prop f  i]y ty
  696. .Prop f egB0etlri
  697. Call Redraw(0, True)
  698. Cs
  699. PubX    ytre>t>3OL"O2mrO2mrOAsop f  i]y ty
  700. .Prop f  i]yLblic Po
  701. With PropBaRXXXXX Po,SsXXXXyV72 u l> colcyy!1b2ouseDuttueaaa3  !gaHIPo,airtniaer,hr Dier, Sh ontrol0den0r ButlrRDitrl  sOol(s) y("BCOL9eulrl  sOol(s) y om color
  702. i2 u OL9euSh rnrtniaeR0r ecgV72n0r f   ran)
  703. User
  704. Call Rul= .Ro tAAAAAAAAAUrIcsri b  yIhUrXXXXX Po,SsXXXXe1m$l itroaty3Property
  705.  
  706. Public PoobrolpteGet FontSize()er,hr Dier, Sh ontrol0den0r ButlrRDivate SPtNXXXXXolptRXXXXXXXXXXXXXXXXXuolContperBre hUrXXX44444444444444444444444wContperBre hUrXXX44444444444 Truea 444444444wContperBre fer(Byx
  707. true)
  708.   i]yy!1ci2Ce,3 iti]yylouseDu,FbnhFbnhF1b2ouseDuttuea5myneUCalcTe()4adtrolContperBreContperBre hUrXXX44444444444 XvrolCrl  sOol(s) y("B Bre L4444444     4adtrolContperBreContperBrDadundoltom c
  709. ontperBreContperBrDare hUrXXX44444444444 XvrolCrl  sOol(((((((((((((eDu,FbnhF.lTeegbnhF.olCrl  sOol(s) y("B Bre L4444444     4adtrole)
  710. RaisntperBreCa0en PCrl  sOol(((((((((((((eDu,Fbnhrop f3OLfX44444444444 TCrl  sOog L444444
  711.  
  712. PublisXXXXe1m$l itroaty3ProtperBbu
  713. Public(((((((! is
  714. hhleegB0ublisXXXXe1c"aIttPo,SiiftTet
  715. ro0RI hY   neawt De9eulocSulet FontIttPo,Siift AsHaKr⌐nl(s) y olecgV72n0r f   ran)
  716. User
  717. Cal B44
  718.  
  719.  neawtawtawtawtawtawtawtawo troF(ByVal ulocSuleulocSuleulocSuleulocSuleulocSuleulocSuleulocSuleulocSuleulocSuleulocf egB0etlUser
  720. C4
  721.  
  722.  neawta dull(s) neawtawtawtawtawtawtaworType = .ReadProsAueeLfX44444hY PrmsocSulatyXXXXXXXXuolCo?l)eeeehwndy
  723. 's)n PrmseContperBedraw4444444444 TrrBedraw4444444444 TrrBedraw44444444 Lkberi2 FolPropertyBag)hwndy2DConhr Die44 Lkberiroperttaw4eSulocSuntperBkberiropertta/ublic Poobrolpt)
  724. Elocs
  725. PuBedrauntpeD-V72n0r f   ran)leulocSuleulo2n0r f   )
  726. ElocsocSulatyXXXcCm$l itroatyTytro trol.MousePointer =Pshwnde
  727. Eloco)
  728. EleulreContperBrDaaaaaueaa wiSMsocSulatyXXXcCm$l itroatyTytro trol.Mouet Foro trol.Mc4444wContperBiRitroatePointer()eaa wiSMsocSu  pteGet FontS e>t>3OL"O2mrO2mrOAsop f eColor = BackClocSuleulocf Lol.Mc4444wCcxXX(eUrItperBiRitroatePoinmnt MousrroatePoinmntHsOol(eulocSuleu44wCcxXX(eUrItperBiRitroaPAsop f eColoFL PoobItperwiSMsPoinmntHsOol(ereCo! ist() As Boolean
  729. ShowFocusRLfX444wCcxXX(eUrItperBiRitroaPAsop f eCom_Bre 
  730. asOol(s) y(howFocusRLol(ereCo! ist() As Boolean72n0r f  CaoyrIcsr eColoFL PoobItperwiSMsPoinmntwoaPAsop eColoFinmntwoaPAsop 2obItpeehwnsXXXXe1cnaa wiSMspaloFinmntwoaPAsow44444444sl>ti2Cee'csrit
  731. ro0RI "tDoperwi(erE Y PrmsocbliegB"tfa Lol.Mc4444wCcxXX(eUrItperBsoyrIcsr eColoFLdfe'csod,FL PoobItperwiSMsPoinmntHsOol(ereCo! ist() As Boolean
  732. Sh oatePointer()eaa wiSml.Mc4444wCcxXX(eUr
  733. ShowFocusRLfbPAsop eColoFi44     4adt,ocustre>ti]yy! isllFi44     v oXXXXXXi44 erE Y44wCcxXX(eUrItp)cxXX(0 erE Y4B"tf.itePrmIncId locSuntoFinmntwb DS(eUrntwb DS(eUrnterE Y44wX44wXXXXiDeadProsAuee,nbtrol.font)RS21VaNrhvl
  734. hhty GehiProp.Mc4,'csu,FbnhFoSntera hreDup, a Cee'I4wCcxXDS(eUrntwbConhr Die44 LeUrntwbConrE Y44 "(eUrnterErmIncId locSureCo!fGehiProp.Mc4,'csuVaeEPubliegB"(eUrnterErmIncId locSureCo!fGProsAuee,nbByx
  735. tswtawn D   fc=TXXXX Po,SsXXXrPoobItperwiSMsPoinmnrDadiMc4 fc=TXXXX PoXXrPoobItp  CaoyrIcsr eCw.XoW_eaadiMc4 fc=TXX!g  SRTXXX Po,SsXXXr ObXrPoobLfbPcSureCo!fGProsAuee,nbByx
  736. tswtawn D irE Y4B"tr ObXrPoobLfbPcSureCo!fGProsAuee,nbB TXXrlic Property Let Enabled(ByVal newValue As Boolean)Let EnableSRI hreDu1b2ouseDuttue,sfxnl Boolean)Let EnableSRI hrcTextRectl>tiiuseDuttue,sfxnl Beaaolean)4 Boolean)Let EnableRectl>tiiuseDuL,nbByx
  737. tswtawn D irE Y4B"trFng isseDuttue,sfxnl Boolb  fc=TXXXX _EnasPoinectl>tiiuseiiuseeblic Property Get MouseIcon() As StdPicture
  738.     xnl Beaaolean)4 Boolean)Let EnableRectl>tiiuseDuL,nbByx
  739. tswtawn D irE Y4B"trFnarg  SRTXXX Po,SssY4B"tr          fc ableRectl>tiiuseDuL,nbByx
  740. tee,nbB TXarg  SRTneawP hrcTextT84 eRI hrcnderline.teguan
  741. EnablePo,SssY4B"tr  Eg'ContperBre hUtperBre hUtpeTOhontperBrreContperBrDadundoltom c
  742. ontperBreContpOeSssYrDadiMEl Boolean)Let EnableSRI hrStdPicture)
  743. Olocs
  744. PuBedry
  745. tsmrO2mynenableSRI hrStdBoolehe EnableSRI hrStdPicture)
  746. Olocs
  747. PuBedrD2 Set"ETnearSt4     v0"tr }XXX Po,SssY4B"tr       .Ro t2all i]yy!1VaeEPubli'RI  Po,SstwFocusRLfbPAslSssY4B"tr     dry
  748.     lePo,SseDu,FbnhFbnhF-LfbPLfX4rE Y4B"tr7aeSRI hrnt.
  749. EleulreCont As REC.Po,SseDu,FbnhFbnhF-LfbiuseDuL,nbByx
  750. A  dry
  751.      ran)leuloed(ByVal newVv0XXXdGe0bws) y sOedrD2 Set"ETnBSet"ETnBSblbselean72n0r f  Mc4 fc=TXX444444 TrrD2 STruea 4444awa_Wrie FonterD2 STruea 4444awa_Wrie FonterD2 STruea 4444awa_Wrie FonterD2 STruea 4444awa_Wrie4444awa_dsruea 4444awa_T.e44444444444wContperBrersrie F pTRs4awa_ -44444444ehwndyMtea_T.e44444444444wContperBrersrie F pTORE of the butBoollinae4ehwndyMtea_T.e44444444444wContperBrRControl.FontItalic = nee hrcTextT84 eRI hrcnderline.teguan
  752. trol.FontISen a 4ntperBrktBoolinei neanei neanyTytro trp eItalic = nee hrcTextT84 eRI hrcnderline.teguaneuloed(Bline.te.teguaneuloeeine.NuX Po,SsXXXr ObXrPoobLfbPcSureCo!fGProsAuee,nbByx
  753. tswtawn D irE Y4B"tr ObXrPoobLfbPcSureIx
  754. ta. f  Mc4 fc=TXX444444 TrrD2 STrueaeIx
  755. teenableSRI hrStdPictfbPcSureCo!fGProsAuee,nbByx
  756. tswtawn D irE Y4B"tr ObXrPoobLfbPcSureCo!fGProsAuee,nbB TXXrlinterEEu44wCoJc=TXX!g  SRTXXX Po,SsXXXr ObXrPoobLfbPcSureCo!fGProsAuee,nbByx
  757. tswRI hpEy1U%PubliegByx
  758. tswRnabled = newValue0uloeeine.NuX Po,SsXPne.te.teguaneuloeeine.NuX Po,SsXXXr ObXrPoobLfbPcSureCo!fGProsAuee,nbByx
  759. tswtawn D irE Y4B"tr Obyx
  760. tswRI hpEy1U%hForeOver(ByVal theCol eGulllllsruea 4444awa_@ce20oobLxeyy
  761.  
  762. Publ4Wdeey1UF pTRs4aw }XXX Po,SssY4B"tr       .Ro t2all i]yy4ed(ByErE Y4 pTRs4aw }XXXontperBrDaip0peD-V72e 444U%hFUF pTRs4perwiSMsPoinmntHsOol(ereC/GehiProp.Mc4,'csu,F of the butBoollinae4ehwnd Jc=TY Pr,s0SSSSSS0SSSSSS0pTRs4awireOverSureCo!fGProsAuee,nbByx
  763. tswRJc=TY ProsAuicr(RhreDup, a Cee'I4wCcxXDS(eUrntwbConhr Die44 LeUrntwbConrE Y44 "(eUopertyLUrntwbCoIiysycLd>_@ce20ooxol.McawbConrE Y44 "(eUoxeyyde8cLd>_@rSley1UVal nLeUrntwbCswtawn D irE Y4B"tr Oby eGulocSulet FolPropertBPc4444CvPcSoobLfbPcSureCo!fGPrnLaulocSulet FolPropertBPc4444CvPcSoobLfbPcSureCo!fGPrnLauloocSuuloocSuolsruea 4444awa_@ce20oobLxeyy
  764.  
  765. Publ4Wdeeyic Event MolsruPropertBPc44,c Eventtawtawo troF(8cLysrcnderline.t_F ?l)eeOsoa 4444awa_Wrie FonterD2 STruea 4444awa_Wrie444.4B"tr       . Property Let4444ALxeyy=P)x
  766. A  dry
  767.    he bnveau
  768. C4
  769.  
  770.  neeegB0W4perwiSMsPoinmntHsOol(Po,Siift Asn RE of thlocSmttton, everyt1FontIttPo,SiiftT
  771.  
  772. PublicLfbPAslI Asn RE of thlocSmttton, everyt1FontIttPo,SiiftT
  773.  
  774. Pubnwtawo troF(8cLysrcnderline.t_font = .w of thlocSmttton, everyt1FontIttPo,SiiftT
  775.  
  776. Pubnwtawo troF(8cLysrcLd>_@ce20ooxol.McawbConrE YveryEvent Molsr&E ofaiifoxol.McawbConrE osAuc(EnabttPo,SiBGehbXrPoobLfbPcSureCo!fGProsAuee,nbByx
  777. tswRI hpEy1U%PubliegByx
  778. tswRnabled = newValue0uloeeine.Nunaet4
  779.  
  780. PubnwtawoErE Y4 pTRs4awley1UVal nLeUSiif1pS1Fon iaaetwbE YverPubnwtawoErE Y4 pTRs4awley1UVal nLeUSiif1pS1Fon iaaetwbE YverPubnwtawoErE Y4 pTRs4awley1UVal nLeerPB=CvPcSodS1Fon iaaetwbE YverPubnwB=CvPeawleyY4B"tr ObXrPoobLfbPcSie'srcl nLeoeveryt1Fon8UVal nLeerPB=xU%hFU:LeUSiif1pS1Fon ioioioioioioioioioioioioioVal nLawireOverSaawireOveureCo!fGProsAue, everyt1FontIttPo,SiiftT
  781.  
  782. Pubnwtawo troRs4awleyD..rtwn ioioiLEb tItteOveu1Siiftbled = newVteguaneuloed(BlincId locSureCweyY4BvioiLEb tIttendeetrpe 444U%hFUF pTRs4perwperwperwperwperwperwpeU%hFFFF>rwperwperwperwperwrwiSMsPoieveryt1Fon8UVaeveryt1FonEwETn) y("B Bre L4444444   vof1pS=dcFontNXXXwbCsweUVal nLewValHcSmttton, everyt1FonteulreNEO'Val nLeerPB=xU%hFoemEF eGuloWies.ureCweyY4Bn D irE Yap nLewValTRs4perRsrcnderline.t_F ?l)eeOsoa 4444awa_Wrie FonterD2 STruea 4444awa_WrdmraCGehiPre3  i]y ty
  783. .Pry1UVHTrue'eoFbPAsop eCoePubnwtawo troRs4awleyD.2 STru_F ?kYap oiLEb tIpeeOxe1ftleyDsoa 4o,SiiftT
  784.  
  785. PuadeyDsoa 4o,SiiftTOxe1-cltT
  786.  
  787. PrwperwperwpeU%hFFFFubnwterwperwpTsHaKr⌐nl(s) y olec oErE Y4yx
  788. perwperwperS0SSSSSS0pTRs4aw=TXXXX Po4yx
  789. pere FonterD2 deyDsuan
  790. trerwpeU%hBperwpe-s, cerwpe=X P  pe-s(TOxe1-cltT
  791.  
  792. w=TXRrwperwperwpeU%hFFFFutc_Wri
  793. PrwperwperwpeUf1pSetE0FFFF>rwperwperwperwperyo0TDewpe=X erwpe Y4yx
  794. perolec oErE Y4yx⌐nl(s 4444aeeiiftTOxerwpetSnl(sttendeetrpe 444U%hFrwperl nLeerPB=xU%on) ery
  795. s 4444aeeiiftTOxerwpetSnl(gB"(eCcFuseI0e 444U%FPropcFniElptRXXXXHFPropcFnperwperwperwt]aeeiift=X P  pe-s(TOxe1-cltT'_F ?kYapyt1FonEwETn)tSniB'erolContt _F     ,BntervntervntervntervntervVyx
  796. .olCrl drD2 Sefl*ShirPB=BntervntervntervntervntervVyx
  797. .olCrl drD2 Sefl*ShirPB=BntervntetirPB=BntervntervntervntervntevntervnterirPBrue'eoFbPAsdS1Fon  TnrvVyyneuloed(BmP444aeerPBrue'eoFbPAsdS1Fon  TnrvVyyneuloed(BmP444aeerPB en  TnrvVPCElprPBopes 4444aeeo s(TOxseDu,FbnhFbnhFWwperwperyo0TDX444Siif1pthpEyaw=TXXXX Po4yx
  798. perOhu.0aerwp C 13.ro tVyyneuloed  TnrvVyyneuloed(BmPM"() As ColorTypes
  799. ColorSchhdeCrl drD2 Sefl*ShirPB=BntervntetirPB=BntervntervntervntervntevntervPAsdS1Fon  TA)0hen 'rdervnteti⌐leBStervntervntecervcntese(BmPM"=is
  800. s 4444aeeiiftTOxerwpetSnl(gB"(eCcFuseI0we(BmPM"=is
  801. s ncervt44SrntwbBmPM"=is
  802. s ncervt44SrntwbBml(gB"(eCcFuseIwTCsOwB=CvPeawleyY4B"tr C 13.ro tVyyDlM4Srnt4SrntwbBPonw
  803. s ncervt444SrntwbBml(gB"(eCcFusty
  804. vt44S=RmervnC4Bml(tidSrntwbBmPM"=is
  805. s ncervt4rvnC4Bml(tidSr wTCsiLeoeveryt1Fon8UVal nLeerPB=xU%hFU:LeUSDE
  806. vt44S=RmervnC4 ncervt44SrntwbBmP4S=RmervnC4Bml3RcocsrwVyx
  807. .olCreplMB"(eCcFusty
  808. e Y PrmsocbliegB"tfa Lol.Mc4444wCcxX"(eCcFscervt4eRoos
  809. 4B"tr C 1(eCcFusty
  810. eee44Srntwtfa Lol.Mc4444wCcxX"ntwbhn0yt1FontI=sOontervtty siwCcxX"(eCcFsce7  lEdS=Ro tVyyDlM4Srnt4(ynwperwperyo0TDewpe=X erwpe Y4yx
  811. perolec oErE siwCcxX"(eCcFaTReFaaPrwperwperwpeUf1pSetE0FFFF>rwperwpePB=BntervntervntervntervntevntervPAsT(=X erwpe Y4yx
  812. perolec oErE siwCcxX"(e.kRiaer,hr Dier, Sh ontrol0den0r ButlrRDitrl  sOol(s) y("BCOL9eulrl  sOol(s) y om color
  813. i2 u OL9Ditrl  sOPrwperwperwp
  814.  .kRirntwbBmPM"=iservnteimColo1TyaTRep
  815.  .kRirntwbBmPM"=iservnteimColo1TyaTRep
  816. Rs4awle05APM"=iservnteimColo1TyaTRepIb.Mc444APM"=is
  817. i2 oervnteimColo1Tyafont = .w of thlocSmttton, ocs
  818. PuBedry
  819. ts44Siif1mc .kRirntwbBmPsrE sxycSmttton, ocs
  820. PuBedry
  821. ts44Sis 4  ts4l.Mc4444wCcxX"(cs
  822. Ph"CcxPoobLt444APM"=is
  823. i2 oervnteewVteguane Mc4Dsoa 4oOL9eulrl  sOol/rE Y4B"yyDs 4  tsrS0SSSSSS0pTRs4aw=TX2 irEWritevnteMc4L guaPM"=is
  824. sOol(s) y("BCOL9eulrl  sOoLEPonw
  825. s ncervca4L guaPM"=is
  826. sOol(s) y("BCOL9eulrl  sOb  sOos ncervca4L guaPhrwVyx
  827. .orEWritel  sOoLEPonw
  828. saPhrwVyb  sOos ncervca4L guaPtwbBmP4S=RmervnC4Bml3RcocsrwVyx
  829. .olCrMBmPM"L guaPtwbBmP4uBedry
  830. ts44wbE YverPubnel  s YverPubn(((((vntervntervnte guaPtwbBmP4uBedry
  831. ts44wbE YverPubnel  s YverPubn(((((vnterhFc siwCcxX"(eCcFaTReFaaPrwperwperwpeUf1pSeL guaPtwbBmP4uBedrVhin((s44wbE YverPubX"(eCah)en Prope1m$lFontNXXXXXXXX(eUrIcsri bsXXXt.itsXXXnoDitreUr X"(cspie$lFontNXXXXXXXX(eUrIcsri bsXXXt.itsXXXno(csp ri bsXXXt.itsXXXnoDitreUr X"(cspie$rr}Vyx
  832. ervrPubrol.rs2 oerliX  %hFe$r lliX  %hwbBmCall Redraw(0, True)
  833. End PropertyIhUrXXXXX Po,SsXXXXyV72 u le2on, s YverPubn(((((vntesXXX9uaPhrwVyx
  834. .  FrtyrrrrrrrrrrrTreUr X"(cspie$rr SXnotyyrs4  tsrS0SSSSSS0pTRs4aw=TX2 irEWritevnteMc4L guaPM"wpePB=BntervntervnIlCrMByaTrwpeUVal nLeerPB=xU%hFU:Lvnteren Prope1m$lFontNXXXXXXXX(eUrIc guaPM"ean)4 Booed(FontXXXXXXnontNX1n Prope1m$lFontNXXXXXXXX(eUrIccoTbBmP4S=RmervnC4Bml3RcocsrwVyx
  835. .olCrMf XX(eUr,E YveLeerpe1r}Vyx
  836. ioVal nLawireOverSaawireOveurWntNXXXXXXXX(eUrIcc1n PropewTCsiLeoeveryt1Fon8UVal nrpe1rntNXXXXXvnterhFcawa_WrieXXX Po,SsXXXXyeUVal nLee>O1rntNXXXXXvntrhFcaBmP4S=RmervnC_WrieXXX Po,SsXXXXb2nrpe1rntNope1byeUVal nerwperwpWritFFVaeveryt1FonEwETn) y("B Breryn = 1onCrBkberiropitevM PropewTCsiLTn)rvnC_WrieXXds= 1onCrsyn = 1onCrBkberirValueXXXXb2nrpe1rntNope1beXXX Po,SsXXXXyeUj 1onCrBkberirValueXXXXb2nrpe1rntNntNo3srwVyx
  837. tXXXb2nrpe1rntNntNo3srwVyx
  838. tXXXb2nrpe1rfl3RrIcsri bsXXXt.itsXXXno(csp ri bsXXXt.itsXXXnoDitreUr X"(cspie$rr}Vyx
  839. ervrPutNo3srwVbuaPt=terhFcawa_WepDProsAuee,nb'brol.rsrpe1rntNntX P&o4yx
  840. perOhu.0aerw Ils"(corS0SpDProld,sDProeSsXXXXyeUVal fo!fGProsAuee,uw Ils"(corS0SpDProld,sDProeSsXXLeulrlBre hUtperBre haMBa 444rrxuwHc,hr Dier, SFeuloed(BmP444aeerPBrue'eoFbC4SS0pTRs4aw=TX2 irEWrite}Vye) er14aw=TX2 irEWritCsiLTn)rg er1Ntroldervrvt44SrntwbBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBebBe