VERSION 5.00
Begin VB.UserControl MicroFooter 
   Alignable       =   -1  'True
   ClientHeight    =   3600
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4800
   ScaleHeight     =   240
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   320
   Begin VB.Image imgLibStretch 
      Height          =   195
      Index           =   0
      Left            =   360
      Picture         =   "MicroFooter.ctx":0000
      Stretch         =   -1  'True
      Top             =   315
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.Label lblHeader 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "Mecanismos"
      BeginProperty Font 
         Name            =   "Small Fonts"
         Size            =   6.75
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   165
      Left            =   315
      TabIndex        =   0
      Top             =   15
      Width           =   825
   End
   Begin VB.Image imgLib0 
      Height          =   195
      Index           =   1
      Left            =   45
      Picture         =   "MicroFooter.ctx":0076
      Top             =   585
      Visible         =   0   'False
      Width           =   210
   End
   Begin VB.Image imgLib0 
      Height          =   195
      Index           =   0
      Left            =   45
      Picture         =   "MicroFooter.ctx":02F4
      Top             =   315
      Visible         =   0   'False
      Width           =   210
   End
   Begin VB.Image imgHeader 
      Height          =   195
      Index           =   2
      Left            =   4320
      MousePointer    =   8  'Size NW SE
      Picture         =   "MicroFooter.ctx":0572
      Top             =   0
      Width           =   210
   End
   Begin VB.Image imgHeader 
      Height          =   195
      Index           =   1
      Left            =   135
      Picture         =   "MicroFooter.ctx":07F0
      Stretch         =   -1  'True
      Top             =   0
      Width           =   4140
   End
   Begin VB.Image imgHeader 
      Height          =   195
      Index           =   0
      Left            =   0
      Picture         =   "MicroFooter.ctx":0866
      Top             =   0
      Width           =   120
   End
End
Attribute VB_Name = "MicroFooter"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Option Explicit
'Default Property Values:
Const m_def_UseIcons = True
'Property Variables:
Dim m_UseIcons As Boolean
Dim OnDrag As Boolean
'Event Declarations:
Event Click() 'MappingInfo=UserControl,UserControl,-1,Click
Attribute Click.VB_Description = "Occurs when the user presses and then releases a mouse button over an object."
Event DblClick() 'MappingInfo=UserControl,UserControl,-1,DblClick
Attribute DblClick.VB_Description = "Occurs when the user presses and releases a mouse button and then presses and releases it again over an object."
Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseDown
Attribute MouseDown.VB_Description = "Occurs when the user presses the mouse button while an object has the focus."
Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseMove
Attribute MouseMove.VB_Description = "Occurs when the user moves the mouse."
Event MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=UserControl,UserControl,-1,MouseUp
Attribute MouseUp.VB_Description = "Occurs when the user releases the mouse button while an object has the focus."
Event Resize() 'MappingInfo=UserControl,UserControl,-1,Resize
Attribute Resize.VB_Description = "Occurs when a form is first displayed or the size of an object changes."
Private Sub imgHeader_Click(Index As Integer)
    Select Case Index
    Case 2
    End Select

End Sub
Private Sub imgHeader_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim uForm As Form, u1 As POINTAPI, u2 As POINTAPI, pWidth As Long, pHeight As Long
Set uForm = UserControl.Parent
On Error Resume Next
    
    If Index = 2 Then
    Set imgHeader(2).Picture = imgLib0(1).Picture
    
        If uForm.WindowState <> 2 Then
    
        GetCursorPos u1
        pWidth = uForm.Width
        pHeight = uForm.Height
        
        OnDrag = True
        
            Do While Not OnDrag = False
            DoEvents
            GetCursorPos u2
            
            uForm.Width = pWidth - (u1.X - u2.X) * Screen.TwipsPerPixelX
            uForm.Height = pHeight - (u1.Y - u2.Y) * Screen.TwipsPerPixelY
            Loop
    
        End If
    
    End If
    
End Sub
Private Sub imgHeader_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

    If Index = 2 Then
    Set imgHeader(2).Picture = imgLib0(0).Picture
    OnDrag = False
    End If

End Sub
Private Sub lblHeader_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Drag UserControl.Parent
End Sub
Private Sub UserControl_Click()
RaiseEvent Click
End Sub
Private Sub UserControl_DblClick()
RaiseEvent DblClick
End Sub
Public Property Get Font() As Font
Attribute Font.VB_Description = "Returns a Font object."
Attribute Font.VB_UserMemId = -512
Set Font = lblHeader.Font
End Property
Public Property Set Font(ByVal New_Font As Font)
Set lblHeader.Font = New_Font
PropertyChanged "Font"
End Property
Public Property Get ForeColor() As OLE_COLOR
Attribute ForeColor.VB_Description = "Returns/sets the foreground color used to display text and graphics in an object."
ForeColor = lblHeader.ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
lblHeader.ForeColor() = New_ForeColor
PropertyChanged "ForeColor"
End Property
Private Sub UserControl_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseDown(Button, Shift, X, Y)
End Sub
Private Sub UserControl_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseMove(Button, Shift, X, Y)
End Sub
Private Sub UserControl_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
RaiseEvent MouseUp(Button, Shift, X, Y)
End Sub
Private Sub UserControl_Resize()
RaiseEvent Resize
Call Redraw
End Sub
Private Sub UserControl_InitProperties()
m_UseIcons = m_def_UseIcons
End Sub
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)

Set lblHeader.Font = PropBag.ReadProperty("Font", Ambient.Font)
lblHeader.ForeColor = PropBag.ReadProperty("ForeColor", &HFFFFFF)
lblHeader.Caption = PropBag.ReadProperty("Caption", "Mecanismos")
m_UseIcons = PropBag.ReadProperty("UseIcons", m_def_UseIcons)

Call Redraw

End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)

Call PropBag.WriteProperty("Font", lblHeader.Font, Ambient.Font)
Call PropBag.WriteProperty("ForeColor", lblHeader.ForeColor, &HFFFFFF)
Call PropBag.WriteProperty("Caption", lblHeader.Caption, "Mecanismos")
Call PropBag.WriteProperty("UseIcons", m_UseIcons, m_def_UseIcons)

End Sub
Public Property Get Caption() As String
Attribute Caption.VB_Description = "Returns/sets the text displayed in an object's title bar or below an object's icon."
Caption = lblHeader.Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
lblHeader.Caption() = New_Caption
PropertyChanged "Caption"
End Property
Sub Redraw()
On Error Resume Next

    With UserControl
    
        If m_UseIcons Then
        .imgHeader(2).Top = 0
        .imgHeader(2).Left = .ScaleWidth - .imgHeader(2).Width
        .imgHeader(1).Top = 0
        .imgHeader(1).Left = .imgHeader(0).Width
        .imgHeader(1).Width = .imgHeader(2).Left - .imgHeader(1).Left
        .imgHeader(0).Left = 0
        .imgHeader(0).Top = 0
        
        .imgHeader(0).Visible = True
        .imgHeader(2).Visible = True
        .lblHeader.Left = .imgHeader(1).Left
        
        Else
        .imgHeader(1).Top = 0
        .imgHeader(1).Left = 0
        .imgHeader(1).Width = .ScaleWidth
        
        .imgHeader(0).Visible = False
        .imgHeader(2).Visible = False
        .lblHeader.Left = 8
    
        End If
    
    
    .Height = .imgHeader(1).Height * Screen.TwipsPerPixelY
    
    End With

End Sub
Public Property Get UseIcons() As Boolean
    UseIcons = m_UseIcons
End Property
Public Property Let UseIcons(ByVal New_UseIcons As Boolean)
    m_UseIcons = New_UseIcons
    PropertyChanged "UseIcons"
    Redraw
End Property
