BDG Scenario 3

LoadURL (Form2.frm)

VERSION 5.00
Begin VB.Form LoadURL 
   Caption         =   "Enter URL"
   ClientHeight    =   1185
   ClientLeft      =   60
   ClientTop       =   300
   ClientWidth     =   5640
   LinkTopic       =   "Form2"
   ScaleHeight     =   1185
   ScaleWidth      =   5640
   StartUpPosition =   3  'Windows Default
   Begin VB.CommandButton Command3 
      Caption         =   "&Clear MRU List"
      Height          =   375
      Left            =   120
      TabIndex        =   4
      Top             =   720
      Width           =   1455
   End
   Begin VB.ComboBox Combo1 
      Height          =   315
      Left            =   840
      TabIndex        =   3
      Top             =   120
      Width           =   4695
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Cancel"
      Height          =   375
      Left            =   4080
      TabIndex        =   1
      Top             =   720
      Width           =   1455
   End
   Begin VB.CommandButton Command1 
      Caption         =   "OK"
      Default         =   -1  'True
      Height          =   375
      Left            =   2520
      TabIndex        =   0
      Top             =   720
      Width           =   1455
   End
   Begin VB.Label Label1 
      Caption         =   "URL:"
      Height          =   255
      Left            =   120
      TabIndex        =   2
      Top             =   120
      Width           =   735
   End
End
Attribute VB_Name = "LoadURL"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Const NOT_FOUND = -1

Public m_bCancel As Boolean
Public m_szURL As String

Private Sub Form_Load()
   Dim i As Integer
   
   For i = 1 To g_Options.RecentURLCount
      Combo1.AddItem g_Options.GetRecentURL(i)
   Next i
   
   Combo1.text = Combo1.List(0)
   Combo1.SelStart = 0
   Combo1.SelLength = Len(Combo1.text)
End Sub

Private Sub Command1_Click()
   g_Options.AddRecentURL Combo1.text
   m_bCancel = False
   Unload Me
End Sub

Private Sub Command2_Click()
   m_bCancel = True
   Unload Me
End Sub

Private Sub Command3_Click()
   Dim i As Integer
   If vbYes = MsgBox("Clear history of converted URLs?", vbYesNo + vbQuestion, "Clear MRU List") Then
      ' Remove from end of list...
      For i = Combo1.ListCount - 1 To 0 Step -1
         Combo1.RemoveItem i
      Next i
      g_Options.RemoveRecentURLs
      g_Options.AddRecentURL "about:blank"
      Combo1.AddItem "about:blank"
      Combo1.Refresh
   End If
End Sub