VERSION 5.00
Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "mscomctl.ocx"
Begin VB.Form frmDVDWizard 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "AVStoDVD DVD Menu Wizard"
   ClientHeight    =   4575
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   8460
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   HelpContextID   =   70
   Icon            =   "frmDVDWizard.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   ScaleHeight     =   4575
   ScaleWidth      =   8460
   StartUpPosition =   1  'CenterOwner
   Begin MSComctlLib.ImageList HLFormatList 
      Left            =   60
      Top             =   60
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      MaskColor       =   12632256
      _Version        =   393216
   End
   Begin MSComctlLib.ImageList HLColorList 
      Left            =   300
      Top             =   60
      _ExtentX        =   1005
      _ExtentY        =   1005
      BackColor       =   -2147483643
      MaskColor       =   12632256
      _Version        =   393216
   End
   Begin MSComctlLib.StatusBar StatusBar 
      Align           =   2  'Align Bottom
      Height          =   315
      Left            =   0
      TabIndex        =   49
      Top             =   4260
      Width           =   8460
      _ExtentX        =   14923
      _ExtentY        =   556
      _Version        =   393216
      BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628} 
         NumPanels       =   2
         BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Object.Width           =   7408
            Text            =   "Titles"
            TextSave        =   "Titles"
            Key             =   "Menu_Titles"
            Object.ToolTipText     =   "DVD Menu Titles"
         EndProperty
         BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628} 
            Alignment       =   1
            AutoSize        =   1
            Object.Width           =   7408
            Text            =   "Pages"
            TextSave        =   "Pages"
            Key             =   "Menu_Pages"
            Object.ToolTipText     =   "DVD Menu Pages"
         EndProperty
      EndProperty
   End
   Begin VB.OptionButton optWizard 
      Caption         =   ">> Run Editor <<"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   4
      Left            =   6180
      Style           =   1  'Graphical
      TabIndex        =   4
      Top             =   120
      Width           =   1995
   End
   Begin VB.OptionButton optWizard 
      Caption         =   "Options"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   3
      Left            =   4200
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   120
      Width           =   1995
   End
   Begin VB.OptionButton optWizard 
      Caption         =   "Template"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   2
      Left            =   2220
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   120
      Width           =   1995
   End
   Begin VB.OptionButton optWizard 
      Caption         =   "Layout"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   435
      Index           =   1
      Left            =   240
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   120
      Width           =   1995
   End
   Begin VB.Frame frameWizard 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3435
      Index           =   2
      Left            =   180
      TabIndex        =   29
      Top             =   660
      Width           =   8115
      Begin VB.Frame corMiscStuff 
         Caption         =   "Misc Stuff"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1215
         Left            =   4500
         TabIndex        =   23
         Top             =   2100
         Width           =   3435
         Begin VB.TextBox txtMotionMenuDuration 
            Height          =   315
            Left            =   2310
            TabIndex        =   25
            Top             =   300
            Width           =   510
         End
         Begin VB.ComboBox cmbVideoBitRate 
            Height          =   315
            ItemData        =   "frmDVDWizard.frx":0E42
            Left            =   2310
            List            =   "frmDVDWizard.frx":0E44
            Style           =   2  'Dropdown List
            TabIndex        =   28
            Top             =   690
            Width           =   960
         End
         Begin VB.CommandButton plsMotionMenuDuration 
            Caption         =   "..."
            Height          =   315
            Left            =   2880
            TabIndex        =   26
            ToolTipText     =   "Pick Duration from Video file ..."
            Top             =   300
            Width           =   375
         End
         Begin VB.Label lblMotionMenuDuration 
            Caption         =   "Motion Menu Duration [s]:"
            Height          =   255
            Left            =   210
            TabIndex        =   24
            Top             =   345
            Width           =   2175
         End
         Begin VB.Label lblVideoBitRate 
            Caption         =   "Menu Video BitRate:"
            Height          =   255
            Left            =   210
            TabIndex        =   27
            Top             =   735
            Width           =   1755
         End
      End
      Begin VB.Frame corElements 
         Caption         =   "Menu Elements"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1875
         Left            =   4500
         TabIndex        =   17
         Top             =   180
         Width           =   3435
         Begin VB.CheckBox intForcePlayAllSelection 
            Alignment       =   1  'Right Justify
            Caption         =   "Force ""Play All"" Button Selection:"
            Height          =   255
            Left            =   180
            TabIndex        =   21
            Top             =   1140
            Width           =   2985
         End
         Begin VB.CheckBox intPlayAllButton 
            Alignment       =   1  'Right Justify
            Caption         =   "Enable ""Play All"" Button:"
            Height          =   255
            Left            =   180
            TabIndex        =   20
            Top             =   780
            Width           =   2985
         End
         Begin VB.ComboBox cmbMaxTitlesPage 
            Height          =   315
            ItemData        =   "frmDVDWizard.frx":0E46
            Left            =   2400
            List            =   "frmDVDWizard.frx":0E48
            Style           =   2  'Dropdown List
            TabIndex        =   19
            Top             =   360
            Width           =   795
         End
         Begin VB.CheckBox intBackgroundAudio 
            Alignment       =   1  'Right Justify
            Caption         =   "Enable Background Audio:"
            Height          =   255
            Left            =   180
            TabIndex        =   22
            Top             =   1500
            Width           =   2985
         End
         Begin VB.Label lblMaxTitlesPage 
            Caption         =   "Max Titles per Page:"
            Height          =   255
            Left            =   210
            TabIndex        =   18
            Top             =   405
            Width           =   2355
         End
      End
      Begin VB.Frame corTemplate 
         Caption         =   "Menu Template"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   3120
         Left            =   240
         TabIndex        =   14
         Top             =   180
         Width           =   4095
         Begin VB.ComboBox cmbTemplate 
            Height          =   315
            Left            =   1740
            Style           =   2  'Dropdown List
            TabIndex        =   16
            Top             =   360
            Width           =   2175
         End
         Begin VB.Label lblMoreTemplates 
            Caption         =   "More Templates at AVStoDVD SourceForge webpage"
            BeginProperty Font 
               Name            =   "Tahoma"
               Size            =   6.75
               Charset         =   0
               Weight          =   400
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   210
            Left            =   260
            TabIndex        =   54
            Top             =   2850
            Width           =   3735
         End
         Begin VB.Image Img_PlayAll 
            Height          =   255
            Left            =   3000
            Stretch         =   -1  'True
            Top             =   2400
            Width           =   675
         End
         Begin VB.Image Img_Background 
            BorderStyle     =   1  'Fixed Single
            Height          =   2040
            Left            =   240
            Stretch         =   -1  'True
            Top             =   780
            Width           =   3705
         End
         Begin VB.Label lblDVDMenuTemplate 
            Caption         =   "Select Template:"
            Height          =   255
            Left            =   300
            TabIndex        =   15
            Top             =   420
            Width           =   1515
         End
      End
   End
   Begin VB.Frame frameWizard 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3435
      Index           =   1
      Left            =   180
      TabIndex        =   0
      Top             =   660
      Width           =   8115
      Begin VB.Frame corLoadA2D 
         Caption         =   "Load Settings from a2d Project"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   240
         TabIndex        =   50
         Top             =   2160
         Width           =   7635
         Begin VB.CommandButton plsLoadA2D 
            Caption         =   "..."
            Height          =   315
            Left            =   6960
            TabIndex        =   52
            Top             =   300
            Width           =   495
         End
         Begin VB.TextBox txtLoadA2D 
            Height          =   315
            Left            =   180
            TabIndex        =   51
            Top             =   300
            Width           =   6675
         End
      End
      Begin VB.Frame corAR 
         Caption         =   "Select Aspect Ratio"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1275
         Left            =   3240
         TabIndex        =   8
         Top             =   480
         Width           =   2175
         Begin VB.OptionButton optAR 
            Caption         =   "Widescreen (16:9)"
            Height          =   315
            Index           =   1
            Left            =   180
            TabIndex        =   10
            Top             =   720
            Width           =   1695
         End
         Begin VB.OptionButton optAR 
            Caption         =   "Standard (4:3)"
            Height          =   315
            Index           =   0
            Left            =   180
            TabIndex        =   9
            Top             =   360
            Width           =   1635
         End
      End
      Begin VB.Frame corTitles 
         Caption         =   "Select Titles Format"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1275
         Left            =   5580
         TabIndex        =   11
         Top             =   480
         Width           =   2295
         Begin VB.OptionButton optTitlesFormat 
            Caption         =   "Thumbnails Titles"
            Height          =   315
            Index           =   1
            Left            =   180
            TabIndex        =   13
            Top             =   720
            Width           =   1815
         End
         Begin VB.OptionButton optTitlesFormat 
            Caption         =   "Text Based Titles"
            Height          =   315
            Index           =   0
            Left            =   180
            TabIndex        =   12
            Top             =   360
            Width           =   1875
         End
      End
      Begin VB.Frame corStyle 
         Caption         =   "Select Style"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1275
         Left            =   240
         TabIndex        =   5
         Top             =   480
         Width           =   2835
         Begin VB.OptionButton optStyle 
            Caption         =   "Motion Pictures (Motion Menu)"
            Height          =   375
            Index           =   1
            Left            =   180
            TabIndex        =   7
            Top             =   720
            Width           =   2595
         End
         Begin VB.OptionButton optStyle 
            Caption         =   "Still Pictures (Static Menu)"
            Height          =   375
            Index           =   0
            Left            =   180
            TabIndex        =   6
            Top             =   360
            Width           =   2595
         End
      End
   End
   Begin VB.Frame frameWizard 
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3435
      Index           =   3
      Left            =   180
      TabIndex        =   30
      Top             =   660
      Width           =   8115
      Begin VB.Frame corDropShadow 
         Caption         =   "Drop Shadows"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   855
         Left            =   240
         TabIndex        =   44
         Top             =   2400
         Width           =   7695
         Begin VB.ComboBox cmbDropShadow 
            Height          =   315
            ItemData        =   "frmDVDWizard.frx":0E4A
            Left            =   5820
            List            =   "frmDVDWizard.frx":0E4C
            Style           =   2  'Dropdown List
            TabIndex        =   48
            Top             =   300
            Width           =   1695
         End
         Begin VB.OptionButton optDropShadows 
            Caption         =   "Left/Right Arrows"
            Height          =   255
            Index           =   2
            Left            =   3480
            TabIndex        =   47
            Top             =   360
            Width           =   2175
         End
         Begin VB.OptionButton optDropShadows 
            Caption         =   "Play All Button"
            Height          =   255
            Index           =   1
            Left            =   1800
            TabIndex        =   46
            Top             =   360
            Width           =   1575
         End
         Begin VB.OptionButton optDropShadows 
            Caption         =   "Thumbnails"
            Height          =   255
            Index           =   0
            Left            =   240
            TabIndex        =   45
            Top             =   360
            Value           =   -1  'True
            Width           =   1215
         End
      End
      Begin VB.Frame corHL 
         Caption         =   "HighLights"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1935
         Left            =   4140
         TabIndex        =   38
         Top             =   300
         Width           =   3795
         Begin MSComctlLib.ImageCombo ImgCmb_HLFormat 
            Height          =   330
            Left            =   1680
            TabIndex        =   40
            Top             =   420
            Width           =   1935
            _ExtentX        =   3413
            _ExtentY        =   582
            _Version        =   393216
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            Locked          =   -1  'True
         End
         Begin MSComctlLib.ImageCombo ImgCmb_HLColorsSel 
            Height          =   330
            Left            =   1680
            TabIndex        =   42
            Top             =   840
            Width           =   1935
            _ExtentX        =   3413
            _ExtentY        =   582
            _Version        =   393216
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            Locked          =   -1  'True
         End
         Begin MSComctlLib.ImageCombo ImgCmb_HLColorsPlay 
            Height          =   330
            Left            =   1680
            TabIndex        =   43
            Top             =   1260
            Width           =   1935
            _ExtentX        =   3413
            _ExtentY        =   582
            _Version        =   393216
            ForeColor       =   -2147483640
            BackColor       =   -2147483643
            Locked          =   -1  'True
         End
         Begin VB.Label lblHLColorsPlay 
            Caption         =   "Play Color:"
            Height          =   255
            Left            =   240
            TabIndex        =   53
            Top             =   1320
            Width           =   1575
         End
         Begin VB.Label lblHLColorsSel 
            Caption         =   "Selection Color:"
            Height          =   255
            Left            =   240
            TabIndex        =   41
            Top             =   885
            Width           =   1575
         End
         Begin VB.Label lblHLFormat 
            Caption         =   "Frame Format:"
            Height          =   255
            Left            =   240
            TabIndex        =   39
            Top             =   465
            Width           =   1755
         End
      End
      Begin VB.Frame corThumbnails 
         Caption         =   "Thumbnails"
         BeginProperty Font 
            Name            =   "Tahoma"
            Size            =   8.25
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   1935
         Left            =   240
         TabIndex        =   31
         Top             =   300
         Width           =   3795
         Begin VB.ComboBox cmbThumbImageSource 
            Height          =   315
            ItemData        =   "frmDVDWizard.frx":0E4E
            Left            =   2040
            List            =   "frmDVDWizard.frx":0E50
            Style           =   2  'Dropdown List
            TabIndex        =   35
            Top             =   840
            Width           =   1575
         End
         Begin VB.ComboBox cmbMaxThumbsRow 
            Height          =   315
            ItemData        =   "frmDVDWizard.frx":0E52
            Left            =   2040
            List            =   "frmDVDWizard.frx":0E54
            Style           =   2  'Dropdown List
            TabIndex        =   33
            Top             =   420
            Width           =   915
         End
         Begin VB.ComboBox cmbThumbFramePos 
            Height          =   315
            ItemData        =   "frmDVDWizard.frx":0E56
            Left            =   2040
            List            =   "frmDVDWizard.frx":0E58
            Style           =   2  'Dropdown List
            TabIndex        =   37
            Top             =   1260
            Width           =   915
         End
         Begin VB.Label lblThumbImageSource 
            Caption         =   "Thumbs Image Source:"
            Height          =   255
            Left            =   180
            TabIndex        =   34
            Top             =   885
            Width           =   1875
         End
         Begin VB.Label lblMaxThumbsRow 
            Caption         =   "Max Thumbs per Row:"
            Height          =   255
            Left            =   180
            TabIndex        =   32
            Top             =   465
            Width           =   1875
         End
         Begin VB.Label lblThumbFramePos 
            Caption         =   "Thumbs Frame Position:"
            Height          =   255
            Left            =   180
            TabIndex        =   36
            Top             =   1305
            Width           =   1875
         End
      End
   End
End
Attribute VB_Name = "frmDVDWizard"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' -------------------------------------------------------------------------------
'
'   AVStoDVD - by MrC
'   File: frmDVDWizard.frm
'   Purpose: AVStoDVD DVD Menu Wizard form
'
' -------------------------------------------------------------------------------


Option Explicit
Option Compare Binary
Option Base 0

Private DefaultMenu As MenuSettings
Private MenuTemplatesPath As String
Private LinkMoreTemplates As String


Private Sub Form_Load()

    Dim jj As Integer
    Dim Templates As New Collection
    Dim HLFileList As New Collection
    Dim Str As String
    Dim Flag As Boolean
    
    On Error Resume Next
    
    ' Initialize variables
    With DefaultMenu
        .Style = StaticMenu
        .AR = Widescreen
        .TitlesFormat = Thumbs
        .Template = "Menu in Black"
        .PlayAllButton = True
        .BackgroundAudio = False
        .MaxTitlesPage = "12"
        .MaxThumbsRow = "4"
        .ThumbImageSource = SourceTitle
        .ThumbFramePos = Format(0.1, "0%")
        .ThumbShadow = Progressive
        .PlayAllShadow = Progressive
        .ArrowsShadow = None
        .HLFormat = Solid
        .HLColorsPlay = Red
        .HLColorsSel = Yellow
        .ForcePlayAllSelection = False
        .VideoBitRate = "6000"
        .MotionMenuDuration = "15"
    End With
    MenuTemplatesPath = Preferences.MenuTemplatesPath
    LinkMoreTemplates = "https://sourceforge.net/projects/avstodvd/files/avstodvd_addons/More%20Templates/"
    
    ' Load Skin Font settings
    Call modMain.Load_Skin_Font(Me)
    
    ' Load Language
    Call Populate_Form_Language

    On Error GoTo Err_Handling
    
    ' Load HighLights releated images to ImageLists
    Set HLFileList = modFS.FileList(App.Path & "\Menu\HL Formats", "*.bmp")
    With Me.HLFormatList.ListImages
        .Clear
        For jj = 1 To HLFileList.Count
            .add jj, modStr.StrTrimLeft(modStr.StrTrimRight(HLFileList(jj), "_"), "."), modMain.Load_Picture_AVStoDVD(App.Path & "\Menu\HL Formats\" & HLFileList(jj))
        Next jj
        .Remove 3
    End With
    Set HLFileList = modFS.FileList(App.Path & "\Menu\HL Colors", "*.bmp")
    With Me.HLColorList.ListImages
        .Clear
        For jj = 1 To HLFileList.Count
            .add jj, modStr.StrTrimLeft(modStr.StrTrimRight(HLFileList(jj), "_"), "."), modMain.Load_Picture_AVStoDVD(App.Path & "\Menu\HL Colors\" & HLFileList(jj))
        Next jj
    End With
    
    ' Populate Combo Boxes
    With Me.cmbTemplate
        .Clear
        Set Templates = modFS.FileList(MenuTemplatesPath, "*.*", vbDirectory)
        If Templates.Count = 0 Then
            Flag = False
            Str = "Warning! No DVD Menu Templates found in '" & MenuTemplatesPath & "'."
            If MenuTemplatesPath <> App.Path & "\Menu\Templates" Then
                If modFS.EsisteDir(App.Path & "\Menu\Templates") = True Then
                    Flag = True
                End If
            End If
            If Flag = True Then
                Str = Str & vbCrLf & vbCrLf & "Coming back to default path ('" & App.Path & "\Menu\Templates" & "')."
            Else
                Str = Str & vbCrLf & vbCrLf & "Please re-install AVStoDVD. Now exiting from DVD Menu Wizard."
            End If
            MsgBox Str, vbExclamation, App.Title
            If Flag = True Then
                MenuTemplatesPath = App.Path & "\Menu\Templates"
                Preferences.MenuTemplatesPath = MenuTemplatesPath
                Set Templates = modFS.FileList(MenuTemplatesPath, "*.*", vbDirectory)
            Else
                Exit Sub
            End If
        End If
        If Templates.Count > 0 Then
            For jj = 1 To Templates.Count
                .AddItem Templates.Item(jj)
            Next jj
        End If
        If .ListCount > 0 Then
            .AddItem "(Click to get more Templates)"
        End If
        For jj = 0 To .ListCount - 1
            If .List(jj) = DVDMenu.Template Then
                .Text = DVDMenu.Template
            End If
        Next jj
    End With
    With Me.cmbMaxTitlesPage
        .Clear
        For jj = 1 To 16
            .AddItem CStr(jj)
        Next jj
    End With
    With Me.cmbMaxThumbsRow
        .Clear
        For jj = 1 To 6
            .AddItem CStr(jj)
        Next jj
    End With
    With Me.cmbThumbImageSource
        .Clear
        .AddItem modStr.DefaultStr(Language("513121"), "Source Title"), SourceTitle
        .AddItem modStr.DefaultStr(Language("513122"), "External File"), ExternalFile
    End With
    With Me.cmbThumbFramePos
        .Clear
        .AddItem Format(0, "0%")
        .AddItem Format(0.01, "0%")
        .AddItem Format(0.05, "0%")
        .AddItem Format(0.1, "0%")
        .AddItem Format(0.25, "0%")
        .AddItem Format(0.5, "0%")
        .AddItem Format(1, "0%")
    End With
    Me.optDropShadows(0).value = True
    With Me.cmbDropShadow
        .Clear
        .AddItem modStr.DefaultStr(Language("513341"), "None")
        .AddItem modStr.DefaultStr(Language("513342"), "Simple")
        .AddItem modStr.DefaultStr(Language("513343"), "Progressive")
    End With
    With Me.cmbVideoBitRate
        .Clear
        For jj = 3000 To 9000 Step 500
            .AddItem CStr(jj)
        Next jj
        For jj = 0 To .ListCount - 1
            If .List(jj) = DVDMenu.VideoBitRate Then
                .Text = DVDMenu.VideoBitRate
            End If
        Next jj
    End With
    With Me.ImgCmb_HLFormat
        .ImageList = Me.HLFormatList
        .ComboItems.Clear
        For jj = 1 To Me.HLFormatList.ListImages.Count
            .ComboItems.add jj, Me.HLFormatList.ListImages(jj).Key, Me.HLFormatList.ListImages(jj).Key, jj
        Next jj
    End With
    With Me.ImgCmb_HLColorsSel
        .ImageList = Me.HLColorList
        .ComboItems.Clear
        For jj = 1 To Me.HLColorList.ListImages.Count
            .ComboItems.add jj, Me.HLColorList.ListImages(jj).Key, Me.HLColorList.ListImages(jj).Key, jj
        Next jj
    End With
    With Me.ImgCmb_HLColorsPlay
        .ImageList = Me.HLColorList
        .ComboItems.Clear
        For jj = 1 To Me.HLColorList.ListImages.Count
            .ComboItems.add jj, Me.HLColorList.ListImages(jj).Key, Me.HLColorList.ListImages(jj).Key, jj
        Next jj
    End With
    
    If DVDMenu.IsInit = False Then
        jj = Int(modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "Style", DefaultMenu.Style))
        If jj < 0 Or jj > 1 Then jj = DefaultMenu.Style
        Me.optStyle(jj).value = True
        'Call optStyle_Click(jj)
        jj = Int(modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "AR", DefaultMenu.AR))
        If jj < 0 Or jj > 1 Then jj = DefaultMenu.AR
        Me.optAR(jj).value = True
        jj = Int(modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "TitlesFormat", DefaultMenu.TitlesFormat))
        If jj < 0 Or jj > 1 Then jj = DefaultMenu.TitlesFormat
        Me.optTitlesFormat(jj).value = True
        With Me.cmbTemplate
            Str = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "Template", .List(0))
            Flag = False
            For jj = 0 To .ListCount - 1
                If .List(jj) = Str Then Flag = True
            Next jj
            If Flag = False Then Str = .List(0)
            .Text = Str
            Me.Img_Background.Picture = Load_Picture_AVStoDVD(MenuTemplatesPath & "\" & .Text & "\background.bmp")
            Me.Img_PlayAll.Picture = Load_Picture_AVStoDVD(MenuTemplatesPath & "\" & .Text & "\playall.bmp")
        End With
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "PlayAllButton", -CInt(DefaultMenu.PlayAllButton))
        If jj < 0 Or jj > 1 Then jj = -CInt(DefaultMenu.PlayAllButton)
        Me.intPlayAllButton.value = jj
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "BackgroundAudio", -CInt(DefaultMenu.BackgroundAudio))
        If jj < 0 Or jj > 1 Then jj = -CInt(DefaultMenu.BackgroundAudio)
        Me.intBackgroundAudio.value = jj
        Str = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "MaxTitlesPage", DefaultMenu.MaxTitlesPage)
        With Me.cmbMaxTitlesPage
            Flag = False
            For jj = 0 To .ListCount - 1
                If .List(jj) = Str Then Flag = True
            Next jj
            If Flag = False Then Str = DefaultMenu.MaxTitlesPage
            .Text = Str
        End With
        Str = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "MaxThumbsRow", DefaultMenu.MaxThumbsRow)
        With Me.cmbMaxThumbsRow
            Flag = False
            For jj = 0 To .ListCount - 1
                If .List(jj) = Str Then Flag = True
            Next jj
            If Flag = False Then Str = DefaultMenu.MaxThumbsRow
            .Text = Str
        End With
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "ThumbImageSource", DefaultMenu.ThumbImageSource)
        If jj < 0 Or jj > 1 Then jj = DefaultMenu.ThumbImageSource
        Me.cmbThumbImageSource.ListIndex = jj
        Str = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "ThumbFramePos", DefaultMenu.ThumbFramePos)
        With Me.cmbThumbFramePos
            Flag = False
            For jj = 0 To .ListCount - 1
                If .List(jj) = Str Then Flag = True
            Next jj
            If Flag = False Then Str = DefaultMenu.ThumbFramePos
            .Text = Str
        End With
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "ThumbShadow", DefaultMenu.ThumbShadow)
        If jj < 0 Or jj > 2 Then jj = DefaultMenu.ThumbShadow
        Me.optDropShadows(0).Tag = jj
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "PlayAllShadow", DefaultMenu.PlayAllShadow)
        If jj < 0 Or jj > 2 Then jj = DefaultMenu.PlayAllShadow
        Me.optDropShadows(1).Tag = jj
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "ArrowsShadow", DefaultMenu.ArrowsShadow)
        If jj < 0 Or jj > 2 Then jj = DefaultMenu.ArrowsShadow
        Me.optDropShadows(2).Tag = jj
        Me.cmbDropShadow.ListIndex = Val(Me.optDropShadows(0).Tag)
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "HLFormat", DefaultMenu.HLFormat) - 1
        If jj < 0 Or jj > Me.HLFormatList.ListImages.Count - 1 Then jj = DefaultMenu.HLFormat
        Me.ImgCmb_HLFormat.SelectedItem = Me.ImgCmb_HLFormat.ComboItems(jj + 1)
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "HLColorsPlay", DefaultMenu.HLColorsPlay) - 1
        If jj < 0 Or jj > Me.HLColorList.ListImages.Count - 1 Then jj = DefaultMenu.HLColorsPlay
        Me.ImgCmb_HLColorsPlay.SelectedItem = Me.ImgCmb_HLColorsPlay.ComboItems(jj + 1)
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "HLColorsSel", DefaultMenu.HLColorsSel) - 1
        If jj < 0 Or jj > Me.HLColorList.ListImages.Count - 1 Then jj = DefaultMenu.HLColorsSel
        Me.ImgCmb_HLColorsSel.SelectedItem = Me.ImgCmb_HLColorsSel.ComboItems(jj + 1)
        jj = modReg.EmiLeggiChiaveNumero(AVStoDVD_RegKey & "\DVDMenu", "ForcePlayAllSelection", -CInt(DefaultMenu.ForcePlayAllSelection))
        If jj < 0 Or jj > 1 Then jj = -CInt(DefaultMenu.ForcePlayAllSelection)
        Me.intForcePlayAllSelection.value = jj
        Str = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "VideoBitRate", DefaultMenu.VideoBitRate)
        With Me.cmbVideoBitRate
            Flag = False
            For jj = 0 To .ListCount - 1
                If .List(jj) = Str Then Flag = True
            Next jj
            If Flag = False Then Str = DefaultMenu.VideoBitRate
            .Text = Str
        End With
        Str = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "MotionMenuDuration", DefaultMenu.MotionMenuDuration)
        If IsNumeric(Str) = False Then Str = DefaultMenu.MotionMenuDuration
        Me.txtMotionMenuDuration.Text = Int(Val(Str))
    Else
        Call Update_DVDWizard_Settings
    End If
    
    With Me.StatusBar
        .Panels("Menu_Titles").Text = .Panels("Menu_Titles").ToolTipText & ": " & NumTitles
        .Panels("Menu_Pages").Text = .Panels("Menu_Pages").ToolTipText & ": " & modNum.RoundUp(NumTitles / Val(Me.cmbMaxTitlesPage.Text))
    End With
    
    Call intPlayAllButton_Click
    Me.optWizard(1).value = True
    
    Exit Sub
    
Err_Handling:
MsgBox "Error " & Err.Number & vbCrLf & vbCrLf & Err.Description, vbCritical, App.Title
Select Case Err.Number
Case 9999
    Resume
Case 383  ''Item' property is read-only
    Resume Next
End Select

End Sub

Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

    With DVDMenu
        If .IsInit = True Then
            .AR = -CInt(Me.optAR(1).value)
            .TitlesFormat = -CInt(Me.optTitlesFormat(1).value)
            .Style = -CInt(Me.optStyle(1).value)
            .Template = Me.cmbTemplate.Text
            .MaxTitlesPage = Me.cmbMaxTitlesPage.Text
            .MaxThumbsRow = Me.cmbMaxThumbsRow.Text
            .PlayAllButton = CBool(Me.intPlayAllButton.value)
            .BackgroundAudio = CBool(Me.intBackgroundAudio.value)
            .ThumbImageSource = Me.cmbThumbImageSource.ListIndex
            .ThumbFramePos = Me.cmbThumbFramePos.Text
            .ThumbShadow = Val(Me.optDropShadows(0).Tag)        'Me.cmbDropShadow.ListIndex
            .PlayAllShadow = Val(Me.optDropShadows(1).Tag)
            .ArrowsShadow = Val(Me.optDropShadows(2).Tag)
            .HLFormat = Me.ImgCmb_HLFormat.SelectedItem.Index - 1
            .HLColorsPlay = Me.ImgCmb_HLColorsPlay.SelectedItem.Index - 1
            .HLColorsSel = Me.ImgCmb_HLColorsSel.SelectedItem.Index - 1
            .ForcePlayAllSelection = CBool(Me.intForcePlayAllSelection.value)
            .VideoBitRate = Me.cmbVideoBitRate.Text
            .MotionMenuDuration = Me.txtMotionMenuDuration.Text
            
            If .BackgroundAudio = False Then .BackgroundAudioPath = ""
            .NumMenuPages = modNum.RoundUp(NumTitles / .MaxTitlesPage)
            
            modMain.Define_BitRates_DVDSize
        End If
    End With

End Sub

Private Sub frameWizard_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.lblMoreTemplates.FontUnderline = False
    
End Sub

Private Sub optWizard_Click(Index As Integer)

    Dim jj As Integer
    Dim bFlag As Boolean
    
    With Me.frameWizard
        For jj = .LBound To .UBound
            .Item(jj).Visible = False
        Next jj
        If Index < Me.optWizard.UBound Then
            .Item(Index).Visible = True
        End If
        Select Case Index
        Case 2
            bFlag = Me.optStyle(1).value
            Me.lblMotionMenuDuration.Enabled = bFlag
            Me.txtMotionMenuDuration.Enabled = bFlag
            Me.plsMotionMenuDuration.Enabled = bFlag
        Case 3
            bFlag = Me.optTitlesFormat(1).value
            Me.lblMaxThumbsRow.Enabled = bFlag
            Me.cmbMaxThumbsRow.Enabled = bFlag
            bFlag = Me.optTitlesFormat(1).value And Me.optStyle(0).value
            Me.lblThumbImageSource.Enabled = bFlag
            Me.cmbThumbImageSource.Enabled = bFlag
            bFlag = Me.optTitlesFormat(1).value And Me.optStyle(0).value And Not CBool(Me.cmbThumbImageSource.ListIndex)
            Me.lblThumbFramePos.Enabled = bFlag
            Me.cmbThumbFramePos.Enabled = bFlag
        Case 4
            DVDMenu.IsInit = True
            modReg.CreaChiave AVStoDVD_RegKey & "\DVDMenu"
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "AR", -CInt(Me.optAR(1).value)
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "TitlesFormat", -CInt(Me.optTitlesFormat(1).value)
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "Style", -CInt(Me.optStyle(1).value)
            modReg.ScriviChiaveStringa AVStoDVD_RegKey & "\DVDMenu", "Template", Me.cmbTemplate.Text
            modReg.ScriviChiaveStringa AVStoDVD_RegKey & "\DVDMenu", "MaxTitlesPage", Me.cmbMaxTitlesPage.Text
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "PlayAllButton", Me.intPlayAllButton.value
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "BackgroundAudio", Me.intBackgroundAudio.value
            modReg.ScriviChiaveStringa AVStoDVD_RegKey & "\DVDMenu", "MaxThumbsRow", Me.cmbMaxThumbsRow.Text
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "ThumbImageSource", Me.cmbThumbImageSource.ListIndex
            modReg.ScriviChiaveStringa AVStoDVD_RegKey & "\DVDMenu", "ThumbFramePos", Me.cmbThumbFramePos.Text
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "ThumbShadow", Val(Me.optDropShadows(0).Tag)
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "PlayAllShadow", Val(Me.optDropShadows(1).Tag)
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "ArrowsShadow", Val(Me.optDropShadows(2).Tag)
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "HLFormat", Me.ImgCmb_HLFormat.SelectedItem.Index
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "HLColorsPlay", Me.ImgCmb_HLColorsPlay.SelectedItem.Index
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "HLColorsSel", Me.ImgCmb_HLColorsSel.SelectedItem.Index
            modReg.ScriviChiaveNumero AVStoDVD_RegKey & "\DVDMenu", "PlayAllSelection", Me.intForcePlayAllSelection.value
            modReg.ScriviChiaveStringa AVStoDVD_RegKey & "\DVDMenu", "VideoBitRate", Me.cmbVideoBitRate.Text
            modReg.ScriviChiaveStringa AVStoDVD_RegKey & "\DVDMenu", "MotionMenuDuration", Me.txtMotionMenuDuration.Text
            Unload frmDVDWizard
            Load frmDVDMenu
            frmDVDMenu.Show 0, frmMain
            frmMain.Hide
        End Select
    End With
    
End Sub

Private Sub optStyle_Click(Index As Integer)

    If Me.frameWizard(1).Visible And DVDMenu.IsFinal And Me.optStyle(DVDMenu.Style).value = False Then
        If MsgBox("Warning! Changing DVD Menu 'Style' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.optStyle(DVDMenu.Style).value = True
        End If
    End If
    
End Sub

Private Sub optAR_Click(Index As Integer)

    If Me.frameWizard(1).Visible And DVDMenu.IsFinal And Me.optAR(DVDMenu.AR).value = False Then
        If MsgBox("Warning! Changing DVD Menu 'Aspect Ratio' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.optAR(DVDMenu.AR).value = True
        End If
    End If

End Sub

Private Sub optTitlesFormat_Click(Index As Integer)

    If Me.frameWizard(1).Visible And DVDMenu.IsFinal And Me.optTitlesFormat(DVDMenu.TitlesFormat).value = False Then
        If MsgBox("Warning! Changing DVD Menu 'Titles Format' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.optTitlesFormat(DVDMenu.TitlesFormat).value = True
        End If
    End If

End Sub

Private Sub plsLoadA2D_Click()

    Dim NumFile As Integer
    Dim StrOpen As String
    Dim jj As Integer
    
    Me.txtLoadA2D.Text = modDialog.OpenFile(Me.hwnd, "Select a AVStoDVD Project file", "AVStoDVD Project file (*.a2d)|*.a2d|All files (*.*)|*.*", Preferences.InputPath, "", cdlOFNFileMustExist Or cdlOFNExplorer Or cdlOFNLongNames)
    If Me.txtLoadA2D.Text <> "" Then
        modMain.Save_Preferences_InputPath Me.txtLoadA2D.Text
        NumFile = FreeFile
        Open Me.txtLoadA2D.Text For Input As #NumFile
            Screen.MousePointer = vbHourglass
            Do
                StrOpen = StrOpen & Input(1, #NumFile)
            Loop Until Right(StrOpen, 9) = " - by MrC"
            Screen.MousePointer = vbDefault
        Close #NumFile
        If InStr(1, StrOpen, frmMain.StatusBar.Panels("Release").Text) = 0 Then
            If MsgBox("AVStoDVD Project '" & Me.txtLoadA2D.Text & "' has been created with a different AVStoDVD Release." & vbCrLf & vbCrLf & "100% compatibility is NOT guaranteed." & vbCrLf & vbCrLf & "Do you want to continue?", vbQuestion + vbYesNo, App.Title) = vbNo Then
                Me.txtLoadA2D.Text = ""
                Exit Sub
            End If
        End If
        modMain.Load_AVStoDVD_DVDMenu StrOpen
        Call Update_DVDWizard_Settings
        With DVDMenu
            .TitleText = frmMain.Txt_DVD_Label.Text
            For jj = 1 To NumTitles
                .ThumbLabelText(jj) = Title(jj).TitleName
            Next jj
        End With
    End If

End Sub

Private Sub cmbTemplate_Click()

    On Error Resume Next
    
    With Me.cmbTemplate
        If Me.frameWizard(2).Visible = True Then
            If InStr(1, LCase(.Text), "click to get") <> 0 Then
                Call lblMoreTemplates_Click
                .Text = modReg.EmiLeggiChiaveStringa(AVStoDVD_RegKey & "\DVDMenu", "Template", .List(0))
            Else
                If DVDMenu.IsFinal And .Text <> DVDMenu.Template Then
                    If MsgBox("Warning! Changing DVD Menu 'Template' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
                        DVDMenu.IsFinal = False
                    Else
                        .Text = DVDMenu.Template
                    End If
                End If
            End If
        End If
        Me.Img_Background.Picture = Load_Picture_AVStoDVD(MenuTemplatesPath & "\" & .Text & "\background.bmp")
        Me.Img_PlayAll.Picture = Load_Picture_AVStoDVD(MenuTemplatesPath & "\" & .Text & "\playall.bmp")
    End With

End Sub

Private Sub corTemplate_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.lblMoreTemplates.FontUnderline = False

End Sub

Private Sub Img_Background_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.lblMoreTemplates.FontUnderline = False

End Sub

Private Sub lblMoreTemplates_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    Me.lblMoreTemplates.FontUnderline = True

End Sub

Private Sub lblMoreTemplates_Click()

    modShellEx.Execute PathNames.WebBrowser, LinkMoreTemplates, SW_DEFAULT, False

End Sub

Private Sub cmbMaxTitlesPage_Click()

    If Me.frameWizard(2).Visible And DVDMenu.IsFinal And Me.cmbMaxTitlesPage.Text <> DVDMenu.MaxTitlesPage Then
        If MsgBox("Warning! Changing DVD Menu 'Max Titles per Page' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.cmbMaxTitlesPage.Text = DVDMenu.MaxTitlesPage
        End If
    End If
    Me.StatusBar.Panels("Menu_Pages").Text = Me.StatusBar.Panels("Menu_Pages").ToolTipText & ": " & modNum.RoundUp(NumTitles / Val(Me.cmbMaxTitlesPage.Text))

End Sub

Private Sub intPlayAllButton_Click()
    
    Dim Flag_PlayAll As Boolean
    
    Flag_PlayAll = CBool(Me.intPlayAllButton.value)
    Me.Img_PlayAll.Visible = Flag_PlayAll
    Me.intForcePlayAllSelection.Enabled = Flag_PlayAll
    If Flag_PlayAll = False And Me.intForcePlayAllSelection.value = 1 Then
        MsgBox "Warning! 'Force PlayAll Selection' option will be toggled off.", vbInformation, App.Title
        Me.intForcePlayAllSelection.value = 0
    End If

End Sub

Private Sub txtMotionMenuDuration_Validate(Cancel As Boolean)

    With Me.txtMotionMenuDuration
        If .Text = "" Or IsNumeric(.Text) = False Then
            If Me.Visible = True Then
                MsgBox "Warning! Value or format is not valid." & vbCrLf & vbCrLf & "Coming back to default value.", vbExclamation, App.Title
            End If
            .Text = 15
        ElseIf .Text > 300 Then
            If Me.Visible = True Then
                MsgBox "Warning! Max duration is 300 seconds.", vbExclamation, App.Title
            End If
            .Text = 300
        ElseIf .Text < 1 Then
            If Me.Visible = True Then
                MsgBox "Warning! Min duration is 1 second.", vbExclamation, App.Title
            End If
            .Text = 1
        End If
        .Text = Round(.Text, 0)
    End With
    If Me.frameWizard(3).Visible And DVDMenu.IsFinal And Me.txtMotionMenuDuration.Text <> DVDMenu.MotionMenuDuration Then
        If MsgBox("Warning! Changing DVD Menu 'Motion Menu Duration' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.txtMotionMenuDuration.Text = DVDMenu.MotionMenuDuration
        End If
    End If

End Sub

Private Sub plsMotionMenuDuration_Click()

    Dim PathName As String
    Dim MInfo As New clsMediaInfo
    Dim ReadInfo As Boolean
    Dim GenerealInfo As New clsTitleGeneralInfo
    Dim VideoInfo As New clsTitleVideoInfo
    Dim AudioInfo As New clsTitleAudioInfo
    Dim MsgStr As String
    
    PathName = modDialog.OpenFile(Me.hwnd, "Select a Media file", FilterList.AudioFiles, Preferences.InputPath, "", cdlOFNFileMustExist Or cdlOFNExplorer Or cdlOFNLongNames)
    If PathName <> "" And modFS.EsisteFile(PathName) = True Then
        modMain.Save_Preferences_InputPath PathName
        ' Read Video Source info
        With MInfo
            Select Case LCase(modFS.ExtOf(PathName))
            Case "avs", "d2v"
                ReadInfo = .ReadAVSInfoF(PathName, Preferences.TempPath)
            Case Else
                ReadInfo = .ReadMediaInfo(PathName, , False, True, True, False)
            End Select
        End With
        If ReadInfo = True Then
            GenerealInfo.Initialize MInfo
            VideoInfo.Initialize MInfo
            AudioInfo.Initialize MInfo
            MsgStr = "Selected file Video properties:" & vbCrLf & vbCrLf & _
                     VideoInfo.SummaryLong & vbCrLf & vbCrLf & vbCrLf & _
                     "Selected file Audio properties:" & vbCrLf & vbCrLf & _
                     AudioInfo.SummaryLong & vbCrLf & vbCrLf
            MsgBox MsgStr, vbInformation, App.Title
            Me.txtMotionMenuDuration.Text = Int(Val(GenerealInfo.Time) / 1000)
        Else
            MsgBox "Warning! Selected Media file is invalid.", vbExclamation, App.Title
        End If
        Set AudioInfo = Nothing
        Set VideoInfo = Nothing
        Set GenerealInfo = Nothing
        Set MInfo = Nothing
    End If

End Sub

Private Sub cmbMaxThumbsRow_Click()

    If Me.frameWizard(3).Visible And DVDMenu.IsFinal And Me.cmbMaxThumbsRow.Text <> DVDMenu.MaxThumbsRow And NumTitles > Val(Me.cmbMaxThumbsRow.Text) Then
        If MsgBox("Warning! Changing DVD Menu 'Max Thumbs per Row' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.cmbMaxThumbsRow.Text = DVDMenu.MaxThumbsRow
        End If
    End If

End Sub

Private Sub cmbThumbImageSource_Click()

    Dim bFlag As Boolean
    
    If Me.frameWizard(3).Visible Then
        If Me.cmbThumbImageSource.ListIndex = ExternalFile And Me.optStyle(1).value = True Then
            MsgBox "Warning! 'External File' source cannot be choosen with 'Motion Pictures' Menu style!" & vbCrLf & vbCrLf & "'Source Title' option will be restored.", vbInformation, App.Title
            Me.cmbThumbImageSource.ListIndex = DefaultMenu.ThumbImageSource   'SourceTitle
        End If
        If DVDMenu.IsFinal And Me.cmbThumbImageSource.ListIndex <> DVDMenu.ThumbImageSource Then
            If MsgBox("Warning! Changing DVD Menu 'Thumb Image Source' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
                DVDMenu.IsFinal = False
            Else
                Me.cmbThumbImageSource.ListIndex = DefaultMenu.ThumbImageSource
            End If
        End If
    End If
    bFlag = Me.optStyle(0).value And Not CBool(Me.cmbThumbImageSource.ListIndex)
    Me.lblThumbFramePos.Enabled = bFlag
    Me.cmbThumbFramePos.Enabled = bFlag

End Sub

Private Sub cmbThumbFramePos_Click()

    If Me.frameWizard(3).Visible And DVDMenu.IsFinal And Me.cmbThumbFramePos.Text <> DVDMenu.ThumbFramePos Then
        If MsgBox("Warning! Changing DVD Menu 'Thumb Frame Position' will cause DVD Menu Settings reset!" & vbCrLf & vbCrLf & "Do you want to continue?", vbExclamation + vbOKCancel, App.Title) = vbOK Then
            DVDMenu.IsFinal = False
        Else
            Me.cmbThumbFramePos.Text = DVDMenu.ThumbFramePos
        End If
    End If

End Sub

Private Sub optDropShadows_Click(Index As Integer)

    Me.cmbDropShadow.ListIndex = Val(Me.optDropShadows(Index).Tag)
    
End Sub

Private Sub cmbDropShadow_Click()

    Dim jj As Integer
    
    For jj = 0 To Me.optDropShadows.Count - 1
        If Me.optDropShadows(jj).value = True Then Exit For
    Next jj
    Me.optDropShadows(jj).Tag = Me.cmbDropShadow.ListIndex

End Sub

Private Sub Update_DVDWizard_Settings()

    Dim jj As Integer
    
    With DVDMenu
        
        Me.optAR(.AR).value = True
        Me.optTitlesFormat(.TitlesFormat).value = True
        Me.optStyle(.Style).value = True
        For jj = 0 To Me.cmbTemplate.ListCount - 1
            If Me.cmbTemplate.List(jj) = .Template Then
                Me.cmbTemplate.Text = .Template
            End If
        Next jj
        If Me.cmbTemplate.Text = "" Then Me.cmbTemplate.Text = DefaultMenu.Template
        For jj = 0 To Me.cmbMaxTitlesPage.ListCount - 1
            If Val(Me.cmbMaxTitlesPage.List(jj)) = Val(.MaxThumbsRow) Then
                Me.cmbMaxTitlesPage.Text = .MaxTitlesPage
            End If
        Next jj
        If Me.cmbMaxTitlesPage.Text = "" Then Me.cmbMaxTitlesPage.Text = DefaultMenu.MaxTitlesPage
        Me.intPlayAllButton.value = -CInt(.PlayAllButton)
        Me.intBackgroundAudio.value = -CInt(.BackgroundAudio)
        For jj = 0 To Me.cmbMaxThumbsRow.ListCount - 1
            If Val(Me.cmbMaxThumbsRow.List(jj)) = Val(.MaxThumbsRow) Then
                Me.cmbMaxThumbsRow.Text = .MaxThumbsRow
            End If
        Next jj
        If Me.cmbMaxThumbsRow.Text = "" Then Me.cmbMaxThumbsRow.Text = DefaultMenu.MaxThumbsRow
        Me.cmbThumbImageSource.ListIndex = .ThumbImageSource
        For jj = 0 To Me.cmbThumbFramePos.ListCount - 1
            If Me.cmbThumbFramePos.List(jj) = Format(.ThumbFramePos, "0%") Then
                Me.cmbThumbFramePos.Text = Format(.ThumbFramePos, "0%")
            End If
        Next jj
        If Me.cmbThumbFramePos.Text = "" Then Me.cmbThumbFramePos.Text = DefaultMenu.ThumbFramePos
        Me.optDropShadows(0).Tag = .ThumbShadow
        Me.optDropShadows(1).Tag = .PlayAllShadow
        Me.optDropShadows(2).Tag = .ArrowsShadow
        Me.cmbDropShadow.ListIndex = Val(Me.optDropShadows(0).Tag)
        Me.ImgCmb_HLFormat.SelectedItem = Me.ImgCmb_HLFormat.ComboItems(.HLFormat + 1)
        Me.ImgCmb_HLColorsPlay.SelectedItem = Me.ImgCmb_HLColorsPlay.ComboItems(.HLColorsPlay + 1)
        Me.ImgCmb_HLColorsSel.SelectedItem = Me.ImgCmb_HLColorsSel.ComboItems(.HLColorsSel + 1)
        Me.intForcePlayAllSelection.value = -CInt(.ForcePlayAllSelection)
        For jj = 0 To Me.cmbVideoBitRate.ListCount - 1
            If Me.cmbVideoBitRate.List(jj) = .VideoBitRate Then
                Me.cmbVideoBitRate.Text = .VideoBitRate
            End If
        Next jj
        If Me.cmbVideoBitRate.Text = "" Then Me.cmbVideoBitRate.Text = DefaultMenu.VideoBitRate
        Me.txtMotionMenuDuration.Text = .MotionMenuDuration
    End With

End Sub

Private Sub Populate_Form_Language()

    On Error Resume Next
    
    If Language.Count > 0 Then
        With Me
            ' Form
            .Caption = modStr.DefaultStr(Language("510000"), .Caption)
            ' Layout
            .optWizard(1).Caption = modStr.DefaultStr(Language("511000"), .optWizard(1).Caption)
            .corStyle.Caption = modStr.DefaultStr(Language("511100"), .corStyle.Caption)
            .optStyle(0).Caption = modStr.DefaultStr(Language("511110"), .optStyle(0).Caption)
            .optStyle(1).Caption = modStr.DefaultStr(Language("511120"), .optStyle(1).Caption)
            .corAR.Caption = modStr.DefaultStr(Language("511200"), .corAR.Caption)
            .optAR(0).Caption = modStr.DefaultStr(Language("511210"), .optAR(0).Caption)
            .optAR(1).Caption = modStr.DefaultStr(Language("511220"), .optAR(1).Caption)
            .corTitles.Caption = modStr.DefaultStr(Language("511300"), .corTitles.Caption)
            .optTitlesFormat(0).Caption = modStr.DefaultStr(Language("511310"), .optTitlesFormat(0).Caption)
            .optTitlesFormat(1).Caption = modStr.DefaultStr(Language("511320"), .optTitlesFormat(1).Caption)
            .corLoadA2D.Caption = modStr.DefaultStr(Language("511400"), .corLoadA2D.Caption)
            ' Template
            .optWizard(2).Caption = modStr.DefaultStr(Language("512000"), .optWizard(2).Caption)
            .corTemplate.Caption = modStr.DefaultStr(Language("512100"), .corTemplate.Caption)
            .lblDVDMenuTemplate.Caption = modStr.DefaultStr(Language("512110"), .lblDVDMenuTemplate.Caption)
            .lblMoreTemplates.Caption = modStr.DefaultStr(Language("512120"), .lblMoreTemplates.Caption)
            .corElements.Caption = modStr.DefaultStr(Language("512200"), .corElements.Caption)
            .lblMaxTitlesPage.Caption = modStr.DefaultStr(Language("512210"), .lblMaxTitlesPage.Caption)
            .intPlayAllButton.Caption = modStr.DefaultStr(Language("512220"), .intPlayAllButton.Caption)
            .intForcePlayAllSelection.Caption = modStr.DefaultStr(Language("512230"), .intForcePlayAllSelection.Caption)
            .intBackgroundAudio.Caption = modStr.DefaultStr(Language("512240"), .intBackgroundAudio.Caption)
            .corMiscStuff.Caption = modStr.DefaultStr(Language("512300"), .corMiscStuff.Caption)
            .lblMotionMenuDuration.Caption = modStr.DefaultStr(Language("512310"), .lblMotionMenuDuration.Caption)
            .lblVideoBitRate.Caption = modStr.DefaultStr(Language("512320"), .lblVideoBitRate.Caption)
            ' Options
            .optWizard(3).Caption = modStr.DefaultStr(Language("513000"), .optWizard(3).Caption)
            .corThumbnails.Caption = modStr.DefaultStr(Language("513100"), .corThumbnails.Caption)
            .lblMaxThumbsRow.Caption = modStr.DefaultStr(Language("513110"), .lblMaxThumbsRow.Caption)
            .lblThumbImageSource.Caption = modStr.DefaultStr(Language("513120"), .lblThumbImageSource.Caption)
            .lblThumbFramePos.Caption = modStr.DefaultStr(Language("513130"), .lblThumbFramePos.Caption)
            .corHL.Caption = modStr.DefaultStr(Language("513200"), .corHL.Caption)
            .lblHLFormat.Caption = modStr.DefaultStr(Language("513210"), .lblHLFormat.Caption)
            .lblHLColorsSel.Caption = modStr.DefaultStr(Language("513220"), .lblHLColorsSel.Caption)
            .lblHLColorsPlay.Caption = modStr.DefaultStr(Language("513230"), .lblHLColorsPlay.Caption)
            .corDropShadow.Caption = modStr.DefaultStr(Language("513300"), .corDropShadow.Caption)
            .optDropShadows(0).Caption = modStr.DefaultStr(Language("513310"), .optDropShadows(0).Caption)
            .optDropShadows(1).Caption = modStr.DefaultStr(Language("513320"), .optDropShadows(1).Caption)
            .optDropShadows(2).Caption = modStr.DefaultStr(Language("513330"), .optDropShadows(2).Caption)
            ' Run
            .optWizard(4).Caption = modStr.DefaultStr(Language("514000"), .optWizard(4).Caption)
            ' End of Form
            With .StatusBar
                .Panels("Menu_Titles").ToolTipText = modStr.DefaultStr(Language("515001"), .Panels("Menu_Titles").ToolTipText)
                .Panels("Menu_Pages").ToolTipText = modStr.DefaultStr(Language("515002"), .Panels("Menu_Pages").ToolTipText)
            End With
        End With
    End If
 
 End Sub


