VERSION 5.00
Begin VB.Form frmQuestion 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "AVStoDVD Question"
   ClientHeight    =   2040
   ClientLeft      =   45
   ClientTop       =   375
   ClientWidth     =   6720
   ControlBox      =   0   'False
   BeginProperty Font 
      Name            =   "Tahoma"
      Size            =   8.25
      Charset         =   0
      Weight          =   400
      Underline       =   0   'False
      Italic          =   0   'False
      Strikethrough   =   0   'False
   EndProperty
   Icon            =   "frmQuestion.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   2040
   ScaleWidth      =   6720
   ShowInTaskbar   =   0   'False
   StartUpPosition =   1  'CenterOwner
   Begin VB.TextBox txtQuestion 
      BackColor       =   &H8000000F&
      BorderStyle     =   0  'None
      Height          =   1125
      Left            =   960
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   0
      Text            =   "frmQuestion.frx":000C
      Top             =   240
      Width           =   5655
   End
   Begin VB.Timer tmrQuestion 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   120
      Top             =   1560
   End
   Begin VB.Frame fraLine 
      Height          =   75
      Left            =   0
      TabIndex        =   1
      Top             =   1440
      Width           =   6720
   End
   Begin VB.CommandButton plsYes 
      Caption         =   "YES"
      Height          =   315
      Left            =   3720
      Picture         =   "frmQuestion.frx":0018
      TabIndex        =   2
      Top             =   1620
      Width           =   1395
   End
   Begin VB.CommandButton plsNo 
      Caption         =   "NO"
      Height          =   315
      Left            =   5220
      Picture         =   "frmQuestion.frx":08E2
      TabIndex        =   3
      Top             =   1620
      Width           =   1395
   End
   Begin VB.Image imgQuestion 
      Height          =   480
      Left            =   240
      Top             =   360
      Width           =   480
   End
End
Attribute VB_Name = "frmQuestion"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
' -------------------------------------------------------------------------------
'
'   AVStoDVD - by MrC
'   File: frmQuestion.frm
'   Purpose: AVStoDVD general purpose Question Box form
'
' -------------------------------------------------------------------------------


Option Explicit
Option Compare Binary
Option Base 0

Private Result As VbMsgBoxResult
Private SecondsPassed As Long


Private Sub Form_Load()

    ' Load Skin Font settings
    Call modMain.Load_Skin_Font(Me)
    
    ' Initialize variable and controls
    SecondsPassed = 0
    Me.Tag = Me.Caption
    Me.imgQuestion.Picture = frmMain.ImageList32.ListImages(8).Picture
    Me.txtQuestion.Text = ""
    
End Sub

Private Sub Form_Activate()

    Call modUtil.SetFormTop(Me)

End Sub

Private Sub plsYes_Click()
    
    Result = vbYes
    Me.Hide

End Sub

Private Sub plsNo_Click()

    Result = vbNo
    Me.Hide

End Sub

Private Sub tmrQuestion_Timer()

    SecondsPassed = SecondsPassed + 1
    If SecondsPassed > Val(Me.tmrQuestion.Tag) Then
        Me.Hide
    Else
        Me.Caption = Me.Tag & " (" & Val(Me.tmrQuestion.Tag) - SecondsPassed & " seconds left to reply)"
    End If

End Sub

Public Function Display(frmOwner As Form, frmQuestion As String, Optional frmDefaultResult As VbMsgBoxResult = vbYes, Optional frmCountDown As Integer = 0, Optional bDoubleSize As Boolean = False) As VbMsgBoxResult

    ' vbYes = 6
    ' vbNo  = 7
    
    Dim bVisible As Boolean
    Dim lOffset As Long
    
    On Error GoTo Err_Handling
    
    bVisible = frmOwner.Visible
    With Me
        .txtQuestion = frmQuestion
        Result = frmDefaultResult
        Me.plsYes.TabIndex = frmDefaultResult - 6
        Me.plsNo.TabIndex = 7 - frmDefaultResult
        .tmrQuestion.Enabled = CBool(frmCountDown)
        .tmrQuestion.Tag = frmCountDown
        If bDoubleSize = True Then
            lOffset = Me.txtQuestion.Height
            'Height
            Me.Height = Me.Height + lOffset
            Me.fraLine.Top = Me.fraLine.Top + lOffset
            Me.plsYes.Top = Me.plsYes.Top + lOffset
            Me.plsNo.Top = Me.plsNo.Top + lOffset
            Me.txtQuestion.Height = Me.txtQuestion.Height + lOffset
            'Width
            Me.Width = Me.Width + lOffset
            Me.fraLine.Width = Me.fraLine.Width + lOffset
            Me.plsYes.Left = Me.plsYes.Left + lOffset
            Me.plsNo.Left = Me.plsNo.Left + lOffset
            Me.txtQuestion.Width = Me.txtQuestion.Width + lOffset
        End If
        frmOwner.Visible = True
        .Show 1, frmOwner
        DoEvents
        frmOwner.Visible = bVisible
        Display = Result
    End With
    Unload Me
    
    Exit Function
    
Err_Handling:
Display = frmDefaultResult

End Function

