VERSION 5.00
Object = "{EAB22AC0-30C1-11CF-A7EB-0000C05BAE0B}#1.1#0"; "shdocvw.dll"
Begin VB.Form frmWeb 
   Appearance      =   0  'Flat
   AutoRedraw      =   -1  'True
   BackColor       =   &H00C0C0C0&
   BorderStyle     =   0  'None
   ClientHeight    =   11520
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   15360
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "Arial"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   LinkTopic       =   "Web"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   Moveable        =   0   'False
   NegotiateMenus  =   0   'False
   PaletteMode     =   2  'Custom
   ScaleHeight     =   768
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   1024
   ShowInTaskbar   =   0   'False
   Begin VB.CommandButton web_QuickLink5 
      Caption         =   "QuickLink5"
      Height          =   435
      Left            =   7590
      TabIndex        =   10
      Top             =   765
      Width           =   1875
   End
   Begin VB.CommandButton web_QuickLink4 
      Caption         =   "QuickLink4"
      Height          =   435
      Left            =   5700
      TabIndex        =   9
      Top             =   765
      Width           =   1875
   End
   Begin VB.CommandButton web_QuickLink3 
      Caption         =   "QuickLink3"
      Height          =   435
      Left            =   3810
      TabIndex        =   8
      Top             =   765
      Width           =   1875
   End
   Begin VB.CommandButton web_QuickLink2 
      Caption         =   "QuickLink2"
      Height          =   435
      Left            =   1920
      TabIndex        =   7
      Top             =   765
      Width           =   1875
   End
   Begin VB.CommandButton web_QuickLink1 
      Caption         =   "QuickLink1"
      Height          =   435
      Left            =   30
      TabIndex        =   6
      Top             =   765
      Width           =   1875
   End
   Begin VB.TextBox web_URL 
      Height          =   315
      Left            =   30
      TabIndex        =   5
      Top             =   1260
      Width           =   14670
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   10
      Left            =   15
      Tag             =   "0"
      Top             =   10245
   End
   Begin VB.CommandButton web_Go 
      Caption         =   "GO"
      Height          =   300
      Left            =   14730
      TabIndex        =   3
      Top             =   1260
      Width           =   450
   End
   Begin VB.Timer Timer2 
      Interval        =   1000
      Left            =   780
      Top             =   10245
   End
   Begin VB.CommandButton web_QuickLink6 
      Caption         =   "QuickLink6"
      Height          =   435
      Left            =   9480
      TabIndex        =   2
      Top             =   765
      Width           =   1875
   End
   Begin VB.CommandButton web_QuickLink7 
      Caption         =   "QuickLink7"
      Height          =   435
      Left            =   11370
      TabIndex        =   1
      Top             =   765
      Width           =   1875
   End
   Begin VB.CommandButton web_QuickLink8 
      Caption         =   "QuickLink8"
      Height          =   435
      Left            =   13260
      TabIndex        =   0
      Top             =   765
      Width           =   1905
   End
   Begin SHDocVwCtl.WebBrowser web_window 
      Height          =   7800
      Left            =   30
      TabIndex        =   4
      Top             =   1620
      Width           =   15150
      ExtentX         =   26723
      ExtentY         =   13758
      ViewMode        =   0
      Offline         =   0
      Silent          =   0
      RegisterAsBrowser=   1
      RegisterAsDropTarget=   1
      AutoArrange     =   0   'False
      NoClientEdge    =   0   'False
      AlignLeft       =   0   'False
      NoWebView       =   0   'False
      HideFileNames   =   0   'False
      SingleClick     =   0   'False
      SingleSelection =   0   'False
      NoFolders       =   0   'False
      Transparent     =   0   'False
      ViewID          =   "{0057D0E0-3573-11CF-AE69-08002B2E1262}"
      Location        =   ""
   End
   Begin VB.Label always_lblControl 
      Alignment       =   2  'Center
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Main Control"
      BeginProperty Font 
         Name            =   "Century Gothic"
         Size            =   20.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00400000&
      Height          =   600
      Left            =   0
      TabIndex        =   13
      Top             =   0
      Width           =   2850
   End
   Begin VB.Image optLightControl 
      Height          =   1185
      Left            =   1635
      Top             =   10125
      Width           =   2685
   End
   Begin VB.Image optMP3Control 
      Height          =   1140
      Left            =   5115
      Top             =   10140
      Width           =   2595
   End
   Begin VB.Image optWebControl 
      Height          =   1170
      Left            =   8595
      Top             =   10125
      Width           =   2385
   End
   Begin VB.Image optMediaControl 
      Height          =   1155
      Left            =   11880
      Top             =   10125
      Width           =   2550
   End
   Begin VB.Image cmd_Exit 
      Appearance      =   0  'Flat
      Height          =   315
      Left            =   0
      Top             =   10980
      Width           =   1245
   End
   Begin VB.Label always_Date 
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Date"
      BeginProperty Font 
         Name            =   "Century Gothic"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0075544A&
      Height          =   375
      Left            =   15
      TabIndex        =   12
      Top             =   9540
      Width           =   7710
   End
   Begin VB.Label always_Time 
      Alignment       =   1  'Right Justify
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "Time"
      BeginProperty Font 
         Name            =   "Century Gothic"
         Size            =   15.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0075544A&
      Height          =   375
      Left            =   8040
      TabIndex        =   11
      Top             =   9540
      Width           =   7230
   End
End
Attribute VB_Name = "frmWeb"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim FontMod As Integer
Dim inifile As String, imgpath As String, LabelFont As String
Dim Skin As String, SkinPath As String
Dim SavedHeight As Integer, SavedWidth As Integer, DefaultURL As String

Private m_ButtonRegion(30) As Long
Private m_OldFont As Long
Private m_NewFont As Long

Private Sub cmd_Exit_Click()
    Unload frmMusic
    Unload frmMediaControl
    Unload frmMain
    Unload frmWeb
End Sub

Private Sub Form_Load()
    Dim temptag As String
    Screen.MousePointer = vbHourglass
    inifile = App.Path & "\HomePanel.ini"
    imgpath = App.Path & "\images\"
    fReadValue inifile, "Options", "MakeSkin", "S", "0", temptag
    If temptag = "1" Then PrintControl frmWeb, "Section3": frmMediaControl.Show: Unload frmWeb: Exit Sub
    SavedHeight = 0: SavedWidth = 0
    Me.always_Date.Caption = "": Me.always_Time.Caption = ""
    
    fReadValue inifile, "Section3", "Background", "S", "err", temptag
    If temptag <> "err" Then frmWeb.Picture = LoadPicture(imgpath & temptag)
    
    SkinMe "Section3", frmWeb
    LoadTags
    If Me.web_window.LocationURL = "http:///" Or Me.web_window.LocationURL = "" Then Me.web_window.Navigate DefaultURL
    Screen.MousePointer = vbDefault
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Set frmWeb = Nothing
End Sub

Public Sub TimerStart()
    'Timer2.Enabled = True:  Timer3.Enabled = True
End Sub

Public Sub optLightControl_Click()
    If Section2 Then
        frmMain.Show
        frmWeb.Hide
        frmMain.optLightControl_Click
        frmMain.TimerStart
    End If
End Sub

Public Sub optMP3Control_Click()
    If Section2 Then
        frmMusic.Show
        frmWeb.Hide
        frmMusic.TimerStart
    End If
End Sub

Public Sub optMediaControl_Click()
    If Section4 Then
        frmMediaControl.Show
        frmWeb.Hide
        frmMediaControl.TimerStart
    End If
End Sub

Public Function gc(n As String) As Control
    Dim tempctl As Control
    For Each tempctl In frmMain
        If tempctl.Name = n Then Set gc = tempctl: Exit For
    Next tempctl
End Function

Private Sub Timer1_Timer()
    Timer1.Tag = Timer1.Tag + 1
End Sub

Private Sub Timer2_Timer()
    If Me.always_Date.Caption <> Format(Date, "mmm-dd-yyyy") Then Me.always_Date.Caption = Format(Date, "mmm-dd-yyyy")
    Me.always_Time.Caption = Format(Now, "hh:mm:ss AM/PM")
End Sub

Private Sub web_Go_Click()
    If Me.web_URL <> "" Then Me.web_window.Navigate Me.web_URL
End Sub

Private Sub web_QuickLink1_Click()
    Me.web_URL = Me.web_QuickLink1.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink2_Click()
    Me.web_URL = Me.web_QuickLink2.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink3_Click()
    Me.web_URL = Me.web_QuickLink3.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink4_Click()
    Me.web_URL = Me.web_QuickLink4.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink5_Click()
    Me.web_URL = Me.web_QuickLink5.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink6_Click()
    Me.web_URL = Me.web_QuickLink6.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink7_Click()
    Me.web_URL = Me.web_QuickLink7.Tag
    web_Go_Click
End Sub

Private Sub web_QuickLink8_Click()
    Me.web_URL = Me.web_QuickLink8.Tag
    web_Go_Click
End Sub

Private Sub web_window_StatusTextChange(ByVal Text As String)
    Me.web_URL = Me.web_window.LocationURL
End Sub

Public Sub LoadTags()
    Dim temptag As String
    fReadValue inifile, "Section3", "MainLabel", "S", "Section 3", temptag: Me.always_lblControl.Caption = temptag
    fReadValue inifile, "Section3", "DefaultURL", "S", "", DefaultURL
    fReadValue inifile, "Section3", "QuickLink1URL", "S", "err", temptag: Me.web_QuickLink1.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink1Label", "S", "QuickLink1", temptag: Me.web_QuickLink1.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink2URL", "S", "err", temptag: Me.web_QuickLink2.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink2Label", "S", "QuickLink2", temptag: Me.web_QuickLink2.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink3URL", "S", "err", temptag: Me.web_QuickLink3.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink3Label", "S", "QuickLink3", temptag: Me.web_QuickLink3.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink4URL", "S", "err", temptag: Me.web_QuickLink4.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink4Label", "S", "QuickLink4", temptag: Me.web_QuickLink4.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink5URL", "S", "err", temptag: Me.web_QuickLink5.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink5Label", "S", "QuickLink5", temptag: Me.web_QuickLink5.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink6URL", "S", "err", temptag: Me.web_QuickLink6.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink6Label", "S", "QuickLink6", temptag: Me.web_QuickLink6.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink7URL", "S", "err", temptag: Me.web_QuickLink7.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink7Label", "S", "QuickLink7", temptag: Me.web_QuickLink7.Caption = temptag
    fReadValue inifile, "Section3", "QuickLink8URL", "S", "err", temptag: Me.web_QuickLink8.Tag = temptag
    fReadValue inifile, "Section3", "QuickLink8Label", "S", "QuickLink8", temptag: Me.web_QuickLink8.Caption = temptag
End Sub

Private Sub SizeForm()
    Dim x As Integer, y As Integer
    If Me.WindowState <> vbMinimized Then
        If Me.Width < 12050 Then Me.Width = 12050
        If Me.Height < 9350 Then Me.Height = 9350
        x = frmWeb.ScaleWidth
        y = frmWeb.ScaleHeight
        If x = SavedWidth And y = SavedHeight Then Exit Sub
        SavedWidth = x: SavedHeight = y
        Me.web_window.Width = 777 'X - 2 * Me.web_window.Left
        Me.web_window.Height = 523 'Y - Me.web_window.Top - 28
        Me.web_URL.Width = Me.web_window.Width - 30
        Me.web_Go.Left = Me.web_URL.Left + Me.web_URL.Width + 2
        Me.web_QuickLink1.Width = 155 '(X - 2 * (Me.web_QuickLink1.Left)) / 5
        Me.web_QuickLink2.Width = Me.web_QuickLink1.Width: Me.web_QuickLink2.Top = Me.web_QuickLink1.Top
        Me.web_QuickLink3.Width = Me.web_QuickLink1.Width: Me.web_QuickLink3.Top = Me.web_QuickLink1.Top
        Me.web_QuickLink4.Width = Me.web_QuickLink1.Width: Me.web_QuickLink4.Top = Me.web_QuickLink1.Top
        Me.web_QuickLink5.Width = Me.web_QuickLink1.Width: Me.web_QuickLink5.Top = Me.web_QuickLink1.Top
        Me.web_QuickLink2.Left = Me.web_QuickLink1.Left + Me.web_QuickLink1.Width + 1
        Me.web_QuickLink3.Left = Me.web_QuickLink2.Left + Me.web_QuickLink2.Width + 1
        Me.web_QuickLink4.Left = Me.web_QuickLink3.Left + Me.web_QuickLink3.Width + 1
        Me.web_QuickLink5.Left = Me.web_QuickLink4.Left + Me.web_QuickLink4.Width + 1
    End If
End Sub

Private Sub SkinMe(Section As String, frm As Form)
    Dim ctl As Control, temptag As String
    Dim LightButtonW As Integer, LightButtonH As Integer
    Dim pos As Variant, size As Variant, c As Variant
    Skin = "": SkinPath = ""
    fReadValue inifile, "Options", "Skin", "S", "", Skin
    If Skin = "" Then Exit Sub
    SkinPath = App.Path & "\skin\" & Skin & "\"
    Skin = SkinPath & "skin.ini"
    fReadValue Skin, Section, "FontSizeMod", "S", "0", temptag
    FontMod = Val(temptag)
    fReadValue Skin, Section, "LightButtonWidth", "S", 80, LightButtonW
    fReadValue Skin, Section, "LightButtonHeight", "S", 60, LightButtonH
    For Each ctl In frm
        On Error Resume Next
        Err.Clear
        fReadValue Skin, Section, "Image_" & ctl.Name, "S", "", temptag
        If LCase(temptag) = "none" Then ctl.Picture = LoadPicture(): temptag = ""
        If temptag <> "" Then ctl.Picture = LoadPicture(SkinPath & temptag)
        If Err.Number <> 0 Then Err.Clear
        ctl.FontSize = ctl.FontSize + FontMod
        If Err.Number <> 0 Then Err.Clear
        fReadValue Skin, Section, "PosXY_" & ctl.Name, "S", "", temptag
        If temptag <> "" Then
            pos = Split(temptag, ",", 2)
            If Err.Number <> 0 Then Err.Clear
            ctl.Move pos(0), pos(1)
            If Err.Number <> 0 Then Err.Clear
        End If
        
        fReadValue Skin, Section, "FontName_" & ctl.Name, "S", "", temptag
        If temptag <> "" Then ctl.Font = temptag
        If Err.Number <> 0 Then Err.Clear
        
        fReadValue Skin, Section, "FontColorRGB_" & ctl.Name, "S", "", temptag
        c = Split(temptag, ",")
        If Err.Number <> 0 Then Err.Clear: temptag = ""
        If temptag <> "" Then
            ctl.ForeColor = RGB(c(0), c(1), c(2))
            If Err.Number <> 0 Then Err.Clear
        End If
        
        fReadValue Skin, Section, "FontSize_" & ctl.Name, "S", "", temptag
        If temptag <> "" Then ctl.FontSize = Val(temptag)
        If Err.Number <> 0 Then Err.Clear
        
        fReadValue Skin, Section, "BorderColorRGB_" & ctl.Name, "S", "", temptag
        c = Split(temptag, ",")
        If Err.Number <> 0 Then Err.Clear: temptag = ""
        If temptag <> "" Then
            ctl.BorderColor = RGB(c(0), c(1), c(2))
            If Err.Number <> 0 Then Err.Clear
        End If
        
        fReadValue Skin, Section, "BackColorRGB_" & ctl.Name, "S", "", temptag
        If LCase(temptag) = "none" Then
            ctl.BackStyle = 0
            If Err.Number <> 0 Then Err.Clear
        Else
            If temptag <> "" Then ctl.BackStyle = 1
            If Err.Number <> 0 Then Err.Clear
        End If
        c = Split(temptag, ",")
        If Err.Number <> 0 Then Err.Clear: temptag = ""
        If temptag <> "" Then
            ctl.BackColor = RGB(c(0), c(1), c(2))
            If Err.Number <> 0 Then Err.Clear
        End If
        
        fReadValue Skin, Section, "SizeWH_" & ctl.Name, "S", "", temptag
        If temptag = "" And Left(ctl.Name, 7) = "light_B" Then
            temptag = LightButtonW & "," & LightButtonH
        Else
            
        End If
        If temptag <> "" Then
            size = Split(temptag, ",", 2)
            If Err.Number <> 0 Then Err.Clear
            ctl.Move ctl.Left, ctl.Top, size(0), size(1)
            If Err.Number <> 0 Then Err.Clear
            
            If Left(ctl.Name, 5) = "line_" Then
                ctl.X1 = pos(0): ctl.X2 = pos(0) + size(0)
                ctl.Y1 = pos(1): ctl.Y2 = pos(1)
            End If
        End If
    Next ctl
    fReadValue Skin, Section, "Background", "S", "", temptag
    If temptag <> "" Then frm.Picture = LoadPicture(SkinPath & temptag)
    
End Sub

Private Sub PrintControl(frm As Form, sect As String)
    Dim c As Control, x As String, temptag As String
    Skin = "": SkinPath = ""
    fReadValue inifile, "Options", "Skin", "S", "", Skin
    If Skin = "" Then Exit Sub
    SkinPath = App.Path & "\skin\" & Skin & "\"
    Skin = SkinPath & "skin.ini"
    For Each c In frm
        x = c.Name
        If LCase(Left(x, 5)) <> "timer" And LCase(Left(x, 5)) <> "winso" And LCase(Left(x, 5)) <> "line_" Then
            x = "PosXY_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then fWriteValue Skin, sect, x, "S", c.Left & "," & c.Top
            x = "SizeWH_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then fWriteValue Skin, sect, x, "S", c.Width & "," & c.Height
            x = "FontSize_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then fWriteValue Skin, sect, x, "S", c.FontSize
            x = "FontColorRGB_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then
                fWriteValue Skin, sect, x, "S", RGBS(c.ForeColor)
            End If
            x = "BorderColorRGB_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then
                fWriteValue Skin, sect, x, "S", RGBS(c.BorderColor)
            End If
            x = "BackColorRGB_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then
                fWriteValue Skin, sect, x, "S", RGBS(c.BackColor)
            End If
            Debug.Print "Sent Main - " & c.Name
        End If
        If LCase(Left(x, 5)) = "line_" Then
            x = "PosXY_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then fWriteValue Skin, sect, x, "S", c.X1 & "," & c.Y1
            x = "SizeWH_" & c.Name
            fReadValue Skin, sect, x, "S", "err", temptag
            If temptag <> "err" Then fWriteValue Skin, sect, x, "S", (c.X2 - c.X1) & "," & (c.Y2 - c.Y1)
            Debug.Print "Sent Music - " & c.Name
        End If
    Next c
End Sub


