VERSION 5.00
Begin VB.Form frmTextBox 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "AVStoDVD TextBox"
   ClientHeight    =   4215
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   8100
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmTextBox.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4215
   ScaleWidth      =   8100
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  'CenterScreen
   Begin VB.TextBox txtText 
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3315
      Left            =   120
      MultiLine       =   -1  'True
      ScrollBars      =   3  'Both
      TabIndex        =   1
      Top             =   780
      Width           =   7875
   End
   Begin VB.Label lblTitle 
      Alignment       =   2  'Center
      Caption         =   "Title"
      BeginProperty Font 
         Name            =   "Tahoma"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   120
      TabIndex        =   0
      Top             =   180
      Width           =   7875
   End
End
Attribute VB_Name = "frmTextBox"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' -------------------------------------------------------------------------------
'
'   AVStoDVD - by MrC
'   File: frmTextBox.frm
'   Purpose: AVStoDVD general purpose TextBox (InputBox) form
'
' -------------------------------------------------------------------------------


Option Explicit
Option Compare Binary
Option Base 0

Private sText As String
Private sTextOrig As String

Private Sub Form_Load()

    ' Load Skin Font settings
    Call modMain.Load_Skin_Font(Me)
    
    ' Intialize form controls
    Me.txtText.Text = ""
    Me.lblTitle.Caption = ""

End Sub

Private Sub Form_Activate()

    Call modUtil.SetFormTop(Me)

End Sub

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

    Select Case UnloadMode
    Case 0
        sText = Me.txtText.Text
    End Select
    
End Sub

Private Sub txtText_Change()

    Me.txtText.ForeColor = RGB(0, 0, 0)
    If Me.Visible = True Then
        If Me.txtText.Text <> sTextOrig Then
            Me.txtText.ForeColor = RGB(255, 0, 0)
        End If
    End If
        
End Sub

Public Function Display(frmOwner As Form, frmCaption As String, frmTitle As String, frmText As String, Optional bTextIsLocked As Boolean, Optional bAskSaveChanges As Boolean = True) As String

    Dim bFlagVisible As Boolean
    Dim MBR As VbMsgBoxResult
    
    On Error GoTo Err_Handling
    
    bFlagVisible = frmOwner.Visible
    With frmTextBox
        .Caption = frmCaption
        .lblTitle = frmTitle
        .txtText.Text = frmText
        sTextOrig = frmText
        .txtText.locked = bTextIsLocked
        frmOwner.Visible = True
        .Show 1, frmOwner
        If sText <> sTextOrig Then
            MBR = vbYes
            If bAskSaveChanges = True Then
                MBR = MsgBox("Do you want to save your changes?", vbYesNo + vbQuestion, App.Title)
            End If
            If MBR <> vbYes Then
                sText = sTextOrig
            End If
        End If
        frmOwner.Visible = bFlagVisible
        Display = sText
        If Display = "" Then Display = frmText
    End With
    Unload frmTextBox
    
    Exit Function
    
Err_Handling:
Display = frmText

End Function
