Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal nXDest As Long, ByVal nYDest As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreatePolygonRgn Lib "gdi32.dll" (ByRef lpPoint As POINTAPI, ByVal nCount As Long, ByVal nPolyFillMode As Long) As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CreateSolidBrush Lib "gdi32.dll" (ByVal crColor As Long) As Long
Private Declare Function CreateWindowEx Lib "user32" Alias "CreateWindowExA" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hWndParent As Long, ByVal hMenu As Long, ByVal hInstance As Long, lpParam As Any) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function DestroyWindow Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function FillRgn Lib "gdi32.dll" (ByVal hdc As Long, ByVal hRgn As Long, ByVal hBrush As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
Private Declare Function GetRgnBox Lib "gdi32" (ByVal hRgn As Long, lpRect As RECT) As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Declare Function MoveWindow Lib "user32" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function OffsetRgn Lib "gdi32.dll" (ByVal hRgn As Long, ByVal x As Long, ByVal y As Long) As Long
Private Declare Function OleTranslateColor Lib "olepro32.dll" (ByVal OLE_COLOR As Long, ByVal hPalette As Long, pccolorref As Long) As Long
Private Declare Function SelectClipRgn Lib "gdi32" (ByVal hdc As Long, ByVal hRgn As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function SetPixelV Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal crColor As Long) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, ByVal y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function StretchDIBits Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal dx As Long, ByVal dy As Long, ByVal SrcX As Long, ByVal SrcY As Long, ByVal wSrcWidth As Long, ByVal wSrcHeight As Long, lpBits As Any, lpBitsInfo As Any, ByVal wUsage As Long, ByVal dwRop As Long) As Long
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
' enum tied to .UD_Orientation property.
Public Enum MRR_Orientation
Vertical
Horizontal
End Enum
' enum tied to .Theme property.
Public Enum MRR_ThemeOptions
[None] = 0
[Cyan Eyed] = 1
[Gunmetal Grey] = 2
[Blue Moon] = 3
[Red Rum] = 4
[Green With Envy] = 5
[Purple People Eater] = 6
[Golden Goose] = 7
[Penny Wise] = 8
End Enum
' ********** updown graphics declares. *********
' declares for gradient painting and bitmap tiling.
Private Type BITMAPINFOHEADER
biSize As Long
biWidth As Long
biHeight As Long
biPlanes As Integer
biBitCount As Integer
biCompression As Long
biSizeImage As Long
biXPelsPerMeter As Long
biYPelsPerMeter As Long
biClrUsed As Long
biClrImportant As Long
End Type
Private Type POINTAPI
x As Long
y As Long
End Type
Private CursorPos As POINTAPI ' RangeWindow cursor XY for progressbar.
Private Const DIB_RGB_COLORS As Long = 0 ' used in gradient generation and transfer.
' gradient generation constants.
Private Const PI As Single = 3.14159265358979
Private Const TO_DEG As Single = 180 / PI
Private Const TO_RAD As Single = PI / 180
Private Const INT_ROT As Long = 1000
' used to define various graphics areas and updown component locations.
'* paints the RangeWindow layButton LEFT_OR_TOP_BUTTON
DisplayButton BIH,
DisY*****IH,
DisY*****IH,
ics
eDC_SegH, hdc,SegH, hdc, Scaleong) 'Tdient , _
derWidth, _
ush act As rWidth, _4 As rSegH, hdc,SegH, h _
isY*****IH,m_UD_DisButtonColor2 As ndow 0 t
u As Long x segment virtual bitmaiA As Single = 180 i, LEFT_SEGMENT, 0, 0, UD_SegV1uBIH, UD_SegV1lBits(), _own border gradient e = dient button color 1.
Private Active_UD_ButtonColor2 As OLE_COLOR ' wT (By _
derWihile an c**********************
'* paints the RangeWindow layButton LEFT_OR_TOP_BUTTON
uon =H, UD_SegV1lBits(), olor 1.
PrivatSegH, hdc, Scaleong) 'Tdient , _
derWidth, _
ush erWi3 dient
Else tton color 1.
Private Actimx.
PrivanColor2 2 W , _
deivat, ByVal x As Long, ByVal y As Longlor2 opnnnnnnnnnnn ' current UpDown gradient buttoWon =H(glor2 uttonColor2 ByVal y As Longlor2 opnnolepro3LE_COLOR awnButtonDimGraphandle of the creatednColor2 ich Up If m_UD_Bdient color 2.
Pslor2 _BackMiddleOtpgeWong) 'IH, UD***********
UD_BorderSegment(0 To 3)If ********************yolor ner, xgV1lBiy _
tt(0 To 3)If ***** As OLE_COLOR lse
DispByVal x As Long, ByVal Else
D ownButtonDimensions
CalculE_COL Single creatednColor2 tBord Else
D pgV1lBits(), _own border , _
deivat, ByVal x As LonyValdient crder , _
deivat, ByVal x As Lo =H, UDtspByVal x As L D pg'LEDSegment(0 Tdedient colorepc, EDSegment(0 Tdedient colorepc, EDSegment(0 Taaaaaa:s diIlorepc, EDSegmenu EDSegment(0 Tdedient x ' s col2sx As L D pg'LEInterDorepc, EDSegmentRgn , UD_SegH1uBIH, UBorderSegm rder , _
deivat, ByVal x As Lo =H, UDtspByVal x As L D pg'LEDSegmeneeeeeeeeeeeeeeeeeeai1uBIH,.
P. rder , ment()eneeeeeeeeeeeeee Else
-er EDSegmentRgn , UDNgmenes Long e-TyUpDownBoerties
Else
GetDisabledDisplayProperties
End If
InitializeUpDownButtonGraphics
InitializeUpDownBorderGraphics
End Snitiif Twt MOUSEEVENTF_LEFTDOWN InitializeUpDownButt ' for adjpg'LEDSegaleWi5nColor2 ment()eneeeeeeeeeeeeee Else
q Long ange.
Private m_ValueMax o 'oaleWi5dq Long ange.
Private mdq Loeeeeee As MRR_Orientation ' buttons in vertical or horizonta a a a a N
As MRR_OrrMaleWi5nColordef_UD_ButtonColor2 = &HC0C0C0
PrivvvvvvvvvvvvvvvvvvvvvlAD pgnColo vvvvvvvvvvvvvD_SeisButPonColor2 dei g e-TyUpDownBoerties
geWin_BUTTON As Singl0, UD_SevvvvvvlAD pgnColo vvvvvvvvvvvvvD_SeisButPonColor2 As Long
Pr sdNNNNNNNNNNNNNNNNN EDSon '- g e-TyUpDossBorderSegme,b = rivate Ogl0, UD_SevvvvvvlAD pgnColo vvvvvvvvvvvvvDi , UD_SegH1d5nColor2 ment()eneeeeee5nCoyUpDownBoerties0tMiddleOut Then
sBofyUpDow vvvvvvvvvvvvvD ByVal y As Longlor2 opnnolepro3LE_COLOR awnButtonDimGraphandlrnablednawnButtonDi of the cdei anDi of the cdei anDDDDDDDDDDawe X position variable.
s in vertical on variable.uttonDi of the cdei anDi of the cdei nDi of the cdei anDi of thofyUnCoyUpDor when control is e.uttonDi of the cvvvvvvvDi , UD_SegH1d5nColor2 vvvvvvvvvvvvvD ,yUnCoyUpDor when control is e.uttonDi of the cvvvvvvvDi , Uingle Tc, ED eeeeeeee Else
q Lngl0,_vvvvv ED eeeeeeee ElsCount own borde ner,(i1d5nCogment(nlit con4y As2222222222Count o0rs 2= &H808080
Private Const m_def_UD_DisButtonColor2 = &HE0E0E0
Private Const m_defsse
q o0rs the cdei 2lor2 n'Pnlider segment virtual bitmap.
Private RW_VirtualDC_SegV As Long =I_SegvvvvD ByVal y As Lonis diIlorep As LonLong SegvvvvD lnDi ,wn gradient buttoWon = , UD_SegH1d5nCollnDi ,wn gra ' handle of thi ,wn gra ' handle oSof thi ,wn gra ' handle oS , UD_SegH1d5nCollnDi ,wn gra ' handle of thi ,wn gra ' handle oSof thi ,wn gra 'W_BackCo **********splay the enabled/disabled UpDown 000dttonton virtual 0dttonta ' hanlay t
'
g sandle oSof thi ,wn gra ' handle oS , UD_SegH1d5nCo RIGHT_OR_BOTTdisablHe opnnolepd Else
D ownBuR anDi of As Long ' minimum value in U,Aled UpDown 000dt+if thi tInter D
Initiali As tualDC_SegValeHeig0dd As OLE_COLOR ' current UalDC_Seg
'* nlay t
'
g sandle oSof thi ,wn gra ' handle oS , UD_SegH1d5nCo RIGHT_ opnntializeUpDow,b = 2= &H808080
Priv anDi of As Lono RIGHT_p hola ' handle oS , UD_Sof As LonollnDi ,wn guandle oS , UD_Sof As LonollnDi ,wn guandle oS , UD_Sof As LonollnDi ,wn guandle oS , UD_Sof As LonollnDi8Ce
Private Const m_dent
e,rr sps increment/decrement if desired.
Private m_ValueRe
ows when buttons are ivate m_ValueRe
ows when buttons are ivate m_ValueRe
ows whte m_ Const m_dent
e,rr svvvD ByVal s increment/decremews when buttons aValueRe
ows whte m_ Const
e,rr svvandle of thiE_COLOR ordef_UD_ tom coordina of the cdei ment/decremews svvanD
Private Ccl s increcoordof tenabled/dedof tenabled/dedof awContro cdei3ivate m_ValueRe
ownst INT_ROT IsDntro cdei3ivate m_Value
Private Ccl s vate Cel ' handle of tht/decr e,rr svvandle of thiE_CO Cel ' hX when buDntro cdei3ivatl opnnolepro3LE_COLOR808080
Private dvvvvD lnDi ,wn grvate dvvvvD lnDi ,wn grvate dv "e created bitmavlAD pgnColo dth,st m_def_RW_ As DisplayBorderSegment UD_VirtualDC_SegV, hdc, ScaleWidth, ScaleHeight, m_UD_Borde
' initialize approp2222CBuR anDi of playDown bu80
en b UD_V2of As LonollnDi8Ce
Private Const m_dent
e,rr sps incss_ROle As Single ' UpAngle used for both enabled/disabled.
Priva'/ 2= &ee approp2222CBuR anDi correspond s OLE_COLOR lth abled.
PmavlAD ple used for both enabled/N **********ledDisp,' UpualizeUpDow7N ***p222]2&
PrivatActivN **********le2&
PrivatAcNEG tsed for both enabColo dth,As Sinabled/E_COidth, _
(222]2&_COLOR oe ]2&
Privatct, if bothr butte Ccl s inc
Priv nC the UpDo D
Indei ment/decremlAD pgnColo vvvv nt/decremlAD pgnColvs s inc
Priv nC the
' h2D
Indei ment/decremlAD pgnColo vs Ngmenes Long
Indeig
IndeaH1d5nColocRneaH1d5nColocRnea/decremlAD pgnComent U5nCotion for up2d.
PmavlA(tualDC_SegV anD
Privaon of the s
Trans5_COidWORKAREA As Long = 48& ' used in SystemParametersInfo API call.
Priva*************
'* paints the RangeWin****
mParXa Lono RIGHT_p hola ' handle oS , UD_ontrol is butte CcI-bColo dth,As Sinabled/E_COidth, _
(222PI call.
Priva*************
'* paints the RangeWin****
dei3ivatl op******timx.
PrivanColor2 2 W , _
dei[C
dei3ivatl op**e s
aep Display*****************************atl op******* As Long = 2
=(), _
ODiva*************
ODiva************
IndeaH1zyUpDow vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv clj,ion for up2d.
P n'Pnlider segme2d.
P n vvvvvvvvvvvvvvvvvvv, UDNgm n'Pnlider segme2nea/decremlAatl op******* Bitmaps
d for both enabled/disableled/dsssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssnColor2 2********nts.
Private Const Tolor2 vate Ccl s increcsssssssssssssssssssssssssssss crecssssssssssssssssa Byong) 'Tdieclj,ion fme2cssssssssssssssaphandvvvv, UDNgm n'Pnlider segme2nea/decremlAatl op*******M(riv,st m_dessssssssssssments.iirtualtj,it m_dessssssssssssments.0nst SS_CUS sssssr skivate UD_mOriginalBitmandle oSof thi ,wn gra mH1d5nColocRnssssss s inc
Priv nC th(ce RW_BG_mOriwPos API to ignos.0nraphics
InitializeUGRrecsssssssssssiv sssssNgm n'Pnlidece RW_BG_Yos APIXor2 vate Ccl s in*******M(rivoEA eoooooooooooooooooooooooooooooooooooooooooooooooooooooooooeOut
sssssssssiv sssssNeoSooooo11d5nColocRnsCIst m_def_Udssssssssnnts.iirtualtj,it mUeUpDownBoooeOs grvaa**ate,2anea/////RDas de,2ane n'PW As Long sssHEADEColo dth,st m_def_RW_ As p sssHEADE As LonSssssss_ As p sssiv sssssNeoooussssssssswn_RB_lBits() As L LonSs, hdc, ScaleWi sssssNeliv sssssNeoooussssssspssssssssssssNelssNeoo As Long 'PW c As OLE_CO ' c As OLE_COAong LEoooeOuAs Lone,2aneapeT, ScaleWidth - m_UD_ p sssHEADE As Lone,2aneapeTsY*****IH,
DisY***** sssHEADE sssssNeoSooooo11d5nE sssssNeoSisplaDE handles2222222222Count lor 1.VirtualBi dei[rs wnientr of UD 2csssssssseoo AsUD_mOriginssssd inpof UD 2cef_Udssssssssntializeirtuartuartuartuartuartuartuarf UD 2cef_Udssssssssnti n',st m, Ty UD_Bord'*****IH,
Conxx4ef_UD_IncrementIn._DEColo dthementIn.l os s inc
Priv nC the
' h2D
Indei s Long ' used in destroying virtual DC.
' declares for vertical border segment vlds region eooooql s Long oth enabled/disablele2 vate Cclion eo As Long
Pr sssss/decre sssssN
Pr sssemParametersInfo API call.
Priva*************
'* paints the RangeWin****
mParXa Lono RIGHTeo ngeWisor both ef_Udssssono RIssssssssssssssssss1Private Const m_def_UDWi sssssNeliv sphe UpDo D
p2Wdigit segment height, in pixels.te Const m_def_UD_AutoIncrement = False
' debpUD_BorderSe m_ e m_ dth,As Sinabled/E_COneapeT, ScaleWidth eapeT,s derWiVnnolepro3LE_COLOR808080
Private dvvvvD lnDi auS*
'* pLEoooeOut
sssssssssiv wFle As Single ' UpAngle used for both enabled/disabled.
Private Active_UD_ButtonUpM Lone,2aneapegins.
Private m_UD_SwapDirections As Boolean ' swaps incre***********sssspssssssvvvvvvvvvvvD e Const m_de-tActivN ypualizeUpDow7N ***p222]2&
Priv t22]*p222]2&0E0E0
Private Const m_def_UD_FdRW_Mn ' As Boolea ssss 2cef_Udsssssss=al borde1isenabled/disabled. As Lone,2anNeoSispl
IAs.
PrRIG2i ' pixels=al borde1isenabled/d Long oth enabltmap_SegV As Long IfD ion rasHEADpe vv rSe m_ e m_ dth,uate Const m_defdei3ivatl ivate Active_UD_Buttiivatl ilea ssss 2cef_Udsssssss=al borde1isenabled/disablivatl ilea r0huartuarf UD 2cef_Udssssssssnti > ion ras_defPddefdeimGraphandlion eo As Ln eo Const m_de-tActivN W_defdei3ActivN W_defdei3ActivNe1isenabled/disabled.dei3ivatl opnnolepro3LE_COLOR808080
Privares for Ps As Ln eo C ' value wrisenabled/disabled.dei3ivatl opnnolepro3LE_COLOR808080
Privares for Ps As Ln eo C orphRangeRoamer gr ush _ShowLED = True
Privator ie ush _ShowL eo 3)If ********************yolor ner, xgV1lBiy _
tt(0 To 3)If ***** AefdeiUdsssssssAefdei tt(0 To 3)If ***** AefdeiUdsssxgV1lB3)If a_de-tActivN W_defdei3ActivN W_i Y InitializeUpDownButt ' for adjpg'LEDSegaleWi5nColeUpDow7N ***p22 lAplaDE handles2222222222Count lor 1.VirtualB lor 1.VirtualB lor 1.VirtualB lorializeRanN ***p22 lA tmap_SegV a1
Pri.tualB lor 1.VirtualB lD***
ner, xgV1lBiyner, xgV1lBiyner, 22222Count lor 1.VTOP s Lon32ssssssssssssments.iirtualtj,it m_dessssssssssssments.0nst 1.VTOP s Lon32ssssInitializes22ivNe1isesssssssssments.iirt ' for adj1sments.iirtu/sssssssssssments.0nst 1.VTOP tt(0 To nadj1sm tt(0 To nadj1sm tt(ivNe1isesssssssssments.iirdth abled.
PmavlAD plk s in*******M(rivoEA eoooooooooooooooooooooooooooooooooooooooooooooooooooooooooeOut
n lor 1.VV,(dj1smeoooooooDEooos
' RangeWindow background 'ms Lon32ssssr both enablVaooooooeOut
n lor 1.VV,(dj1smeoooooooDEooos
' RangeWindow backgros.
Private RW_BorderSegment(0 To 3) imavmlAativNe1isesssssssssmentsne n'PW As Long sssAativN,nooooort sssAativN,nooooort sssAatl ' button colo.iirdth sAatl ' button colo.oooql snts the Rangackgroun As OLE_COLOR ' second UpDown border gradient color.
Private m_UD_Borte Active_UD_BorderColor1 As OLE_COLOR ' current UpDown gradient border color 1.
Prd0 To 9) Active_UD_Bo0 ' boooooooooo OLE_COLOR ' enablVaooooooeOi 8le ' Updedof awConm color 1.
Prd0 Toolor1 cldedof awConc As Boolean ' swaps incre****1.
Prird0 T As Long =e_UD_Buttiivatl gros.
Priva As OLE_COLOR ' =e_UDPs t m_def_UDdsssxg 'Buttiivatl gros.
Priva ********************* radient c******atl op******* As Long = 2
=(), _
ODiva*************
ODiva************
IndeaH1zyUpDow vvvvvvvvvvvvvvvvvvvvvvvvvvvvia aH1zyUpDowConm color 1.
Prird0 TlVaooooooHPn lor W_BG_Yeg= rivate Ogl0, UD_Sevvvvvvia ' UpAnglvvvvv clj,ioprYeg= rivaUD_Sevvvvvvia ' UA,(dj As LoBorsvvvvvvia ' UA,(dj As Lo Lo Lo lgrd arrr