Académique Documents
Professionnel Documents
Culture Documents
Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal x As
Long, ByVal y 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 CreatePen Lib "gdi32" (ByVal nPenStyle As Long, ByVal
nWidth As Long, ByVal crColor As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
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
Private Declare Function DrawEdge Lib "user32" (ByVal hdc As Long, qrc As RECT,
ByVal edge As Long, ByVal grfFlags As Long) As Long
Private Declare Function FillRect Lib "user32" (ByVal hdc As Long, lpRect As
RECT, ByVal hBrush As Long) As Long
Private Declare Function FrameRect Lib "user32" (ByVal hdc As Long, lpRect As
RECT, ByVal hBrush As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect
As RECT) As Long
Private Declare Function GetSysColor Lib "user32" (ByVal nIndex As Long) As Long
Private Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long,
ByVal y As Long) As Long
Private Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As
Long, ByVal y As Long, lpPoint As POINTAPI) As Long
Private Declare Function PatBlt Lib "gdi32" (ByVal hdc As Long, ByVal x As Long,
ByVal y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal dwRop As
Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal
hObject As Long) As Long
Private Declare Function SetBkColor Lib "gdi32" (ByVal hdc As Long, ByVal
crColor As Long) As Long
Private Declare Function SetBkMode Lib "gdi32" (ByVal hdc As Long, ByVal nBkMode
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 SetTextColor Lib "gdi32" (ByVal hdc As Long, ByVal
crColor As Long) As Long
'=====================================================
'=====================================================
'=====================================================
'=====================================================
'=====================================================
End Type
'=====================================================
'=====================================================
Top As Long
Right As Long
Bottom As Long
End Type
'=====================================================
'=====================================================
HS_HORIZONTAL = 0
HS_VERTICAL = 1
HS_FDIAGONAL = 2
HS_BDIAGONAL = 3
HS_CROSS = 4
HS_DIAGCROSS = 5
HS_SOLID = 6
End Enum
'=====================================================
'=====================================================
ccScrollingSmooth = 1
ccScrollingSearch = 2
ccScrollingOfficeXP = 3
ccScrollingPastel = 4
ccScrollingJavT = 5
ccScrollingMediaPlayer = 6
ccScrollingCustomBrush = 7
ccScrollingPicture = 8
ccScrollingMetallic = 9
End Enum
'=====================================================
'=====================================================
ccOrientationHorizontal = 0
ccOrientationVertical = 1
End Enum
'=====================================================
'----------------------------------------------------
'----------------------------------------------------
'----------------------------------------------------
Private TR As RECT
Private AT As RECT
'----------------------------------------------------
'==========================================================
'==========================================================
'==========================================================
'==========================================================
DrawMetalProgressbar
'==========================================================
'==========================================================
DrawOfficeXPProgressbar
'==========================================================
'==========================================================
ElseIf m_Scrolling = ccScrollingPastel Then
DrawPastelProgressbar
'==========================================================
'==========================================================
DrawJavTProgressbar
'==========================================================
'==========================================================
DrawMediaProgressbar
'==========================================================
'==========================================================
DrawCustomBrushProgressbar
'==========================================================
DrawPictureProgressbar
Else
'==========================================================
'==========================================================
End If
'==========================================================
'==========================================================
'/---Use the AntiFlicker DC
'==========================================================
If m_MemDC Then
With UserControl
End With
End If
End Sub
'==========================================================
'/---OFFICE XP STYLE
'==========================================================
With TBR
.Left = 1
.Top = 1
.Bottom = TR.Bottom - 1
End With
End Sub
'==========================================================
'/---JAVT XP STYLE
'==========================================================
End Sub
'==========================================================
'/---PICTURE STYLE
'==========================================================
DeleteObject Brush
End Sub
'==========================================================
'/---PASTEL XP STYLE
'==========================================================
End Sub
'==========================================================
'/---METALLIC XP STYLE
'==========================================================
TR.Left = TR.Left + 3
pDrawBorder
End Sub
'==========================================================
'==========================================================
With TBR
.Left = 2
.Top = 2
.Bottom = TR.Bottom - 2
End With
DeleteObject hBrush
End Sub
'==========================================================
'==========================================================
'==========================================================
'==========================================================
TR.Left = TR.Left + 3
LSet TBR = TR
fPercent = m_Value / 98
If m_Orientation = 0 Then
'===============================================================================
========
'-------------------------------------------------------------------------
--------------
TBR.Right = TR.Left
End If
Else
'===============================================================================
========
'-------------------------------------------------------------------------
--------------
fPercent = 1# - fPercent
End If
End Sub
'==========================================================
'==========================================================
Dim i As Long
hBR = CreateSolidBrush(vbWhite)
LSet TSR = TR
If m_Orientation = 0 Then
'===============================================================================
========
'-------------------------------------------------------------------------
--------------
TSR.Left = i + 1
TSR.Right = i + 1 + lSegmentSpacing
Next i
'-------------------------------------------------------------------------
--------------
Else
'===============================================================================
========
'-------------------------------------------------------------------------
--------------
TSR.Top = i - 2
TSR.Bottom = i - 2 + lSegmentSpacing
'------------------------------------------------------------------------
---------------
End If
DeleteObject hBR
End Sub
'==========================================================
'==========================================================
TR.Left = TR.Left - 3
Let RTemp = TR
'==========================================================
'==========================================================
If m_Orientation = 0 Then
TempRect.Left = 4
TempRect.Top = 8
TempRect.Bottom = TR.Bottom - 8
'===============================================================================
========
'---------------------------------------------------------------------------
------------
GoSub HorizontalSearch
Else
End If
Else
TempRect.Left = 9
TempRect.Right = TR.Right - 8
TempRect.Top = TBR.Top
TempRect.Bottom = TR.Bottom
'===============================================================================
========
'---------------------------------------------------------------------------
------------
GoSub VerticalSearch
Else
End If
Exit Sub
HorizontalSearch:
For ITemp = 0 To 2
With TempRect
.Right = .Left + 10
.Top = 8
.Bottom = TR.Bottom - 8
End With
Next ITemp
Return
VerticalSearch:
For ITemp = 0 To 2
With TempRect
.Left = 8
.Right = TR.Right - 8
.Bottom = .Top + 10
End With
Next ITemp
Return
End Sub
'======================================================================
Else
End If
If (m_ShowText) Then
'//--Use the Alpha Text Color Look if Progress is MediaPlayer Style, else
Normal (Gray)
'//-- If ProgressBar is already over the Text don't draw the old text,
yust draw the Alpha Text
End If
End If
End Function
'======================================================================
'======================================================================
End Sub
'======================================================================
'======================================================================
'//--Gives the Media Player Text Look (Changes Color When Progress
is over the Text)
End If
End Sub
'======================================================================
'======================================================================
'CONVERTION FUNCTION
Else
GetLngColor = Color
End If
End Function
'======================================================================
'======================================================================
Private Sub DrawRectangle(ByRef bRECT As RECT, ByVal Color As Long, ByVal hdc As
Long)
hBrush = CreateSolidBrush(Color)
DeleteObject hBrush
End Sub
'======================================================================
'======================================================================
ByVal y As Long, _
DeleteObject Pen2
DeleteObject Pen1
End Sub
'======================================================================
'======================================================================
End Function
'======================================================================
'======================================================================
Dim ni As Long
lEndColor = GetLngColor(lEndColor)
lStartcolor = GetLngColor(lStartcolor)
If bH Then
Else
End If
Next ni
End Sub
'======================================================================
'======================================================================
lCFrom = GetLngColor(oColorFrom)
lCTo = GetLngColor(oColorTo)
BlendColor = RGB( _
End Function
'======================================================================
'======================================================================
hBrush = CreateSolidBrush(GetLngColor(Color))
DeleteObject hBrush
End Sub
'======================================================================
'======================================================================
If m_ThDC = 0 Then
End If
Else
End If
End If
ThDC = m_ThDC
End Function
'======================================================================
'======================================================================
pDestroy
lhDCC = CreateDC("DISPLAY", "", "", ByVal 0&)
m_ThDC = CreateCompatibleDC(lhDCC)
m_lWidth = Width
m_lHeight = Height
DeleteDC lhDCC
Exit Sub
End If
End If
End If
DeleteDC lhDCC
pDestroy
End If
End Sub
'======================================================================
'======================================================================
BitBlt hdc, xDst, yDst, WidthSrc, HeightSrc, m_ThDC, xSrc, ySrc, vbSrcCopy
End Sub
'======================================================================
'======================================================================
m_hBmpOld = 0
End If
DeleteObject m_hBmp
m_hBmp = 0
End If
DeleteDC m_ThDC
m_ThDC = 0
End If
m_lWidth = 0
m_lHeight = 0
End Sub
'======================================================================
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'===========================================================================
'===========================================================================
With UserControl
.BackColor = vbWhite
.ScaleMode = vbPixels
End With
'----------------------------------------------------------
'Default Values
hdc = UserControl.hdc
hwnd = UserControl.hwnd
m_Max = 100
m_Min = 0
m_Value = 0
m_Orientation = ccOrientationHorizontal
m_Scrolling = ccScrollingStandard
m_Color = GetLngColor(vbHighlight)
DrawProgressBar
'----------------------------------------------------------
End Sub
DrawProgressBar
End Sub
hdc = UserControl.hdc
End Sub
End Sub
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'===========================================================================
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'===========================================================================
m_Brush = Style
PropertyChanged "BrushStyle"
End Property
Color = m_Color
End Property
m_Color = GetLngColor(lColor)
DrawProgressBar
End Property
Public Property Get Font() As IFont
End Property
Set m_fnt = fnt 'Defined By System but can change by user choice.(ADD
Property!!)
End Property
End Property
hwnd = m_hWnd
End Property
m_hWnd = chWnd
End Property
hdc = m_hDC
End Property
'=============================================
'AntiFlick...Cleaner HDC
If m_hDC = 0 Then
m_hDC = UserControl.hdc 'On Fail...Do it Normally
Else
m_MemDC = True
End If
'=============================================
End Property
End Property
PropertyChanged "Image"
DrawProgressBar
End Property
Min = m_Min
End Property
m_Min = cMin
PropertyChanged "Min"
End Property
Max = m_Max
End Property
Public Property Let Max(ByVal cMax As Long)
m_Max = cMax
PropertyChanged "Max"
End Property
Orientation = m_Orientation
End Property
m_Orientation = cOrientation
PropertyChanged "Orientation"
DrawProgressBar
End Property
Scrolling = m_Scrolling
End Property
m_Scrolling = lScrolling
PropertyChanged "Scrolling"
DrawProgressBar
End Property
ShowText = m_ShowText
End Property
PropertyChanged "ShowText"
DrawProgressBar
End Property
End Property
'PropertyChanged "Value"
DrawProgressBar
End Property
'===============================================================================
========================================
'===============================================================================
========================================
End Sub
'===============================================================================
========================================
'===============================================================================
========================================
m_Brush = PropBag.ReadProperty("BrushStyle", 4)
Min = PropBag.ReadProperty("Min", 0)
Value = PropBag.ReadProperty("Value", 0)
End Sub