VERSION 5.00
Object = "{F5BE8BC2-7DE6-11D0-91FE-00C04FD701A5}#2.0#0"; "agentctl.dll"
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.MDIForm MdiMenuUtama 
   BackColor       =   &H00FFFFFF&
   Caption         =   ". . : : R E N T A L   F I L M : : . . "
   ClientHeight    =   10710
   ClientLeft      =   60
   ClientTop       =   750
   ClientWidth     =   15240
   Icon            =   "MdiMenuUtama.frx":0000
   LinkTopic       =   "MDIForm1"
   Picture         =   "MdiMenuUtama.frx":2964A
   WindowState     =   2  'Maximized
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Interval        =   50
      Left            =   840
      Top             =   0
   End
   Begin VB.Timer Timer1 
      Interval        =   50
      Left            =   480
      Top             =   0
   End
   Begin MSComctlLib.StatusBar StatusBar 
      Align           =   2  'Align Bottom
      Height          =   375
      Left            =   0
      TabIndex        =   0
      Top             =   10335
      Width           =   15240
      _ExtentX        =   26882
      _ExtentY        =   661
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   3
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Object.Width           =   11880
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Object.Width           =   11880
         EndProperty
         BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Style           =   5
            TextSave        =   "7:49 PM"
         EndProperty
      EndProperty
   End
   Begin AgentObjectsCtl.Agent Agent1 
      Left            =   0
      Top             =   0
   End
   Begin VB.Menu mnMenu 
      Caption         =   "&Menu"
      Begin VB.Menu mnLogin 
         Caption         =   "&Login"
      End
      Begin VB.Menu mnLogOut 
         Caption         =   "Log &Out"
         Enabled         =   0   'False
      End
      Begin VB.Menu mnExit 
         Caption         =   "&Exit"
      End
   End
   Begin VB.Menu mnTransaksi 
      Caption         =   "&Transaksi"
      Begin VB.Menu mnPeminjaman 
         Caption         =   "&Peminjaman"
      End
      Begin VB.Menu mnPemgembalian 
         Caption         =   "P&engembalian"
      End
   End
   Begin VB.Menu mnAnggota 
      Caption         =   "&Anggota"
      Begin VB.Menu mnAnggBaru 
         Caption         =   "&Data Anggota"
      End
   End
   Begin VB.Menu mnDaftarFilm 
      Caption         =   "&Daftar Film"
      Begin VB.Menu mnDataFilm 
         Caption         =   "&Data Film"
      End
   End
   Begin VB.Menu mnLaporan 
      Caption         =   "Lap&oran"
      Begin VB.Menu mnLpTrPeminjaman 
         Caption         =   "Laporan &Transaksi Peminjaman"
      End
      Begin VB.Menu mnLpStoFilm 
         Caption         =   "Laporan T&ransaksi Pengembalian"
      End
   End
   Begin VB.Menu mnPetugas 
      Caption         =   "&Petugas"
      Begin VB.Menu mnTambahPetugas 
         Caption         =   "&Data Petugas"
      End
   End
   Begin VB.Menu mnGame 
      Caption         =   "&Game"
      Begin VB.Menu mnbrick 
         Caption         =   "&Brick"
      End
   End
End
Attribute VB_Name = "MdiMenuUtama"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim oldsize As Long
Dim mer As Boolean

Dim blnKeluar As Boolean
Dim hMenu As Long
 
Dim d As Byte
Dim f As Byte

Private Declare Function DeleteMenu _
                Lib "user32" (ByVal hMenu As Long, _
                ByVal nPosition As Long, _
                ByVal wFlags As Long) As Long

Private Declare Function GetSystemMenu _
                Lib "user32" (ByVal Hwnd As Long, _
                ByVal bRevert As Long) As Long

Private Const MF_BYPOSITION = &H400&

Private Declare Function GetWindowLong Lib "user32" _
        Alias "GetWindowLongA" (ByVal Hwnd As Long, _
        ByVal nIndex As Long) As Long

Private Declare Function SetWindowLong Lib "user32" _
        Alias "SetWindowLongA" (ByVal Hwnd As Long, _
        ByVal nIndex As Long, ByVal dwNewLong As Long) _
        As Long

Private Const GWL_STYLE = (-16)
Private Const WS_MINIMIZEBOX = &H20000
Private Const WS_MAXIMIZEBOX = &H10000

Public Sub NoMaxBox(f As MDIForm)
    Dim l As Long
    l = GetWindowLong(f.Hwnd, GWL_STYLE)
    l = l And Not (WS_MAXIMIZEBOX)
    l = SetWindowLong(f.Hwnd, GWL_STYLE, l)
End Sub

Public Sub NoMinBox(f As MDIForm)
  Dim l As Long
  l = GetWindowLong(f.Hwnd, GWL_STYLE)
  l = l And Not (WS_MINIMIZEBOX)
  l = SetWindowLong(f.Hwnd, GWL_STYLE, l)
End Sub

Private Sub RemoveMenus(frm As Form, _
             remove_restore As Boolean, _
             remove_move As Boolean, _
             remove_size As Boolean, _
             remove_minimize As Boolean, _
             remove_maximize As Boolean, _
             remove_seperator As Boolean, _
             remove_close As Boolean)

    hMenu = GetSystemMenu(Hwnd, False)
    If remove_close Then DeleteMenu hMenu, 6, MF_BYPOSITION
    If remove_seperator Then DeleteMenu hMenu, 5, MF_BYPOSITION
    If remove_maximize Then DeleteMenu hMenu, 4, MF_BYPOSITION
    If remove_minimize Then DeleteMenu hMenu, 3, MF_BYPOSITION
    If remove_size Then DeleteMenu hMenu, 2, MF_BYPOSITION
    If remove_move Then DeleteMenu hMenu, 1, MF_BYPOSITION
    If remove_restore Then DeleteMenu hMenu, 0, MF_BYPOSITION
End Sub

'Function agent(mer As Boolean)
'If mer = False Then
'Agent1.Characters.Load "merlin.acs", DATAPATH
'                Set merlin = Agent1.Characters("merlin.acs")
'                    merlin.LanguageID = &H409
'Else
'    'merlin.Show
'End If
'End Function

Private Sub MDIForm_Activate()
    NoMaxBox Me
    NoMinBox Me
End Sub

'Private Sub MDIForm_DblClick()
'    If StatusBar.Panels(2) = "No Connections To Database" Then
'        frmLogin.Show 1
'        If StatusBar.Panels(2) = "No Connections To Database" Then
'
'        Else
'
'            agent (True)
'                merlin.Show
'                merlin.MoveTo 870, 590
'                merlin.Speak "Hallo.....!!!!!!!"
'            mer = True
'        End If
'    End If
'End Sub

Private Sub MDIForm_Load()
d = 0
f = 255
   
    TranslucentForm Me, 0
    StatusBar.Panels(1) = Format(Date, "DD -- MMMM -- YYYY")
    StatusBar.Panels(2) = "No Connections To Database"
    mnTransaksi.Enabled = False
    mnAnggota.Enabled = False
    mnDaftarFilm.Enabled = False
    mnLaporan.Enabled = False
    mnPetugas.Enabled = False
    bukaDb
    
    RemoveMenus Me, False, False, _
    False, False, False, True, True
    blnKeluar = False
            
    CenterC Me
    oldsize = Me.Width
    
    mer = True
End Sub

Private Sub mnAnggBaru_Click()
    frmAnggota.Show
    
End Sub

Private Sub mnbrick_Click()
On Error Resume Next
    frmGameBrick.Show
    
End Sub

Private Sub mnDataFilm_Click()
    frmFilm.Show
    
End Sub

Private Sub mnExit_Click()
On Error Resume Next
    If mer = False Then

    Else
        
    End If
    mer = False
    blnKeluar = True
    Timer2.Enabled = True
End Sub

Private Sub mnLihatPetugas_Click()
    frmViewDataPetugas.Show
End Sub

Private Sub mnLogin_Click()

     If StatusBar.Panels(2) = "No Connections To Database" Then
        frmLogin.Show 1
        If StatusBar.Panels(2) = "No Connections To Database" Then
        
        Else
            If mer = False Then
                
            Else
'                agent (True)
Agent1.Characters.Load "merlin.acs", DATAPATH
            End If
        End If
    End If
End Sub

Private Sub mnLogOut_Click()
    
    mer = False
    mnLogin.Enabled = True
    mnLogOut.Enabled = False
    mnTransaksi.Enabled = False
    mnAnggota.Enabled = False
    mnDaftarFilm.Enabled = False
    mnLaporan.Enabled = False
    mnPetugas.Enabled = False
    StatusBar.Panels(2) = ""
    StatusBar.Panels(2) = "No Connections To Database"
End Sub

Private Sub mnLpStoFilm_Click()
On Error Resume Next
reportPengembalian.Show
End Sub

Private Sub mnLpTrPeminjaman_Click()
On Error Resume Next
reportPeminjaman.Show
End Sub

Private Sub mnPemgembalian_Click()
    frmPengembalian.Show
    
End Sub

Private Sub mnPeminjaman_Click()
    frmPeminjaman.Show
    
End Sub

Private Sub mnTambahPetugas_Click()
    
    frmPetugas.Show
End Sub

Public Function TranslucentForm(frm As Form, TranslucenceLevel As Byte) As Boolean
    SetWindowLong frm.Hwnd, GWL_EXSTYLE, WS_EX_LAYERED
    SetLayeredWindowAttributes frm.Hwnd, 0, TranslucenceLevel, LWA_ALPHA
    TranslucentForm = Err.LastDllError = 0
End Function

Private Sub Timer1_Timer()
    If d < 255 Then
        TranslucentForm MdiMenuUtama, d
    Else
        If d = 255 Then
            TranslucentForm MdiMenuUtama, 255
            d = 5
            Timer1.Enabled = False
        End If
    End If
    d = d + 5
End Sub

Private Sub Timer2_Timer()
    If f > 0 Then
        TranslucentForm MdiMenuUtama, f
    Else
        If f = 0 Then
            TranslucentForm MdiMenuUtama, 0
            f = 5
            Timer2.Enabled = False
            End
        End If
    End If
    f = f - 5
End Sub

Private Sub Form_Resize()
    If Me.Width = oldsize Then
       Exit Sub
    Else
        CenterC Me
        oldsize = Me.Width
    End If
End Sub
  
