VERSION 5.00
Begin VB.Form Console 
   Caption         =   "Script Processor Console"
   ClientHeight    =   5775
   ClientLeft      =   4185
   ClientTop       =   3075
   ClientWidth     =   6135
   Icon            =   "console.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   5775
   ScaleWidth      =   6135
   Begin VB.CommandButton Command5 
      Caption         =   "Pause Script"
      Height          =   255
      Left            =   1680
      TabIndex        =   9
      ToolTipText     =   "Pause currently running script"
      Top             =   5400
      Width           =   1335
   End
   Begin VB.CheckBox Check1 
      Caption         =   "Autoscroll"
      Height          =   255
      Left            =   4440
      TabIndex        =   8
      Top             =   4440
      Value           =   1  'Checked
      Width           =   1455
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Stop Session"
      Height          =   255
      Left            =   4680
      TabIndex        =   7
      ToolTipText     =   "Stop VH session"
      Top             =   5400
      Width           =   1335
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Cancel Script"
      Height          =   255
      Left            =   3240
      TabIndex        =   6
      ToolTipText     =   "Cancel currently running script"
      Top             =   5400
      Width           =   1215
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Clear Screen"
      Height          =   255
      Left            =   240
      TabIndex        =   5
      ToolTipText     =   "Clear above text box"
      Top             =   5400
      Width           =   1215
   End
   Begin VB.Timer Timer2 
      Interval        =   100
      Left            =   0
      Top             =   480
   End
   Begin VB.Timer Timer1 
      Interval        =   50
      Left            =   0
      Top             =   0
   End
   Begin VB.OptionButton Option2 
      Caption         =   "Script Mode"
      Height          =   255
      Left            =   2640
      TabIndex        =   4
      ToolTipText     =   "Change to script mode"
      Top             =   4440
      Value           =   -1  'True
      Width           =   1335
   End
   Begin VB.OptionButton Option1 
      Caption         =   "Interactive Mode"
      Height          =   255
      Left            =   840
      TabIndex        =   3
      ToolTipText     =   "Change to interactive mode"
      Top             =   4440
      Width           =   1575
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Send"
      Default         =   -1  'True
      Height          =   375
      Left            =   5160
      TabIndex        =   1
      ToolTipText     =   "Send command to the script processor"
      Top             =   4800
      Width           =   855
   End
   Begin VB.TextBox Text2 
      Height          =   405
      Left            =   120
      ScrollBars      =   1  'Horizontal
      TabIndex        =   0
      ToolTipText     =   "Type in a command to send to the script processor"
      Top             =   4800
      Width           =   4935
   End
   Begin VB.TextBox Text1 
      BackColor       =   &H00000000&
      BeginProperty Font 
         Name            =   "Terminal"
         Size            =   9
         Charset         =   255
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00E0E0E0&
      Height          =   4215
      Left            =   120
      Locked          =   -1  'True
      MultiLine       =   -1  'True
      ScrollBars      =   2  'Vertical
      TabIndex        =   2
      Top             =   120
      Width           =   5895
   End
End
Attribute VB_Name = "Console"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Virtual Hypnotist
'©2003-2008 FollowTheWatch Software
'http://vhypno.sourceforge.net
'http://sourceforge.net/projects/vhypno
'Contact - followthewatch55@yahoo.com

'This program is free software; you can redistribute it and/or
'modify it under the terms of the GNU General Public License
'as published by the Free Software Foundation; either version 2
'of the License, or (at your option) any later version.

'This program is distributed in the hope that it will be useful,
'but WITHOUT ANY WARRANTY; without even the implied warranty of
'MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
'GNU General Public License for more details.

'You should have received a copy of the GNU General Public License
'along with this program; if not, write to the Free Software
'Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

Private PrevLen As Long
Option Explicit

Private Sub Command1_Click()
EnqueueCommand (Text2.Text)
Text2.Text = ""
End Sub

Private Sub Command2_Click()
Text1.Text = ""
End Sub

Private Sub Command3_Click()
CancelScript = True
End Sub

Private Sub Command4_Click()
Option2.value = True
Quit = True
End Sub

Private Sub Command5_Click()
If PauseRunningScript = False Then
    PauseRunningScript = True
    Command5.Caption = "Resume Script"
Else
    PauseRunningScript = False
    Command5.Caption = "Pause Script"
End If
End Sub

Private Sub Form_Activate()
ConsoleOn = True
End Sub

Private Sub Form_Load()
Me.Left = (ScreenX / 2) - (Me.Width / 2)
Me.top = (ScreenY / 2) - (Me.Height / 2)
End Sub

Private Sub Form_Resize()
If Me.Width < 6255 Then Me.Width = 6255
If Me.Height < 6180 Then Me.Height = 6180
Text1.Width = Me.Width - 360
Text1.Height = Me.Height - 1965
Command1.top = Me.Height - 1380
Command1.Left = Me.Width - 1095
Text2.top = Command1.top
Text2.Width = Me.Width - 1320
Option1.top = Me.Height - 1740
Option2.top = Option1.top
Check1.top = Option1.top
Option1.Left = (Me.Width / 2) - 2287.5
Option2.Left = (Me.Width / 2) - 487.5
Check1.Left = (Me.Width / 2) + 1312.5
Command2.top = Me.Height - 780
Command3.top = Command2.top
Command4.top = Command3.top
Command5.top = Command4.top
Command3.Left = (Me.Width / 2) + 112.5
Command5.Left = (Me.Width / 2) - 1447.5
Command2.Left = Command5.Left - 1440
Command4.Left = Command3.Left + 1440
End Sub

Private Sub Form_Unload(Cancel As Integer)
ConsoleOn = False
If ProcessorOn = True And SessionRunning = False Then
    Option2.value = True
    Quit = True
End If
Cancel = 1
Me.Hide
End Sub

Private Sub Option2_Click()
If Me.Visible = True Then Text1.SetFocus
End Sub

Private Sub Text1_Change()
If Check1.value = 1 Then
    Text1.SelStart = PrevLen
    Text1.SelLength = 0
End If
PrevLen = Len(Text1)
End Sub

Private Sub Timer1_Timer()
If Option1.value = True Then
    Text2.Enabled = True
    Command1.Enabled = True
    Command3.Enabled = False
    Command5.Enabled = False
Else
    Text2.Enabled = False
    Command1.Enabled = False
    Command3.Enabled = True
    Command5.Enabled = True
End If
End Sub

Private Sub Timer2_Timer()
If Option1.value = True Then
    Preview = True
    Call Process(7, False, 0)
End If
End Sub
