VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "Comdlg32.ocx"
Object = "{0842D103-1E19-101B-9AAF-1A1626551E7C}#1.0#0"; "graph32.ocx"
Begin VB.Form Form1 
   BackColor       =   &H00E0E0E0&
   Caption         =   "DraftPlot4W"
   ClientHeight    =   14205
   ClientLeft      =   60
   ClientTop       =   390
   ClientWidth     =   23700
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   MDIChild        =   -1  'True
   ScaleHeight     =   14205
   ScaleWidth      =   23700
   Begin VB.TextBox Text7 
      Appearance      =   0  'Flat
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   8.25
         Charset         =   0
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   210
      Left            =   7065
      TabIndex        =   23
      Text            =   "(c)www.openantennas.at"
      Top             =   8250
      Width           =   2355
   End
   Begin VB.CommandButton Command4 
      Caption         =   "Help"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   9735
      TabIndex        =   18
      ToolTipText     =   "Click on to see a help message"
      Top             =   5520
      Width           =   1700
   End
   Begin VB.CommandButton Command3 
      Caption         =   "Grid: Enable/Disable"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   9735
      TabIndex        =   17
      ToolTipText     =   "Click on to toggle grid"
      Top             =   4800
      Width           =   4120
   End
   Begin VB.CommandButton Command2 
      Caption         =   "Read File"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   9735
      TabIndex        =   16
      ToolTipText     =   "Click on to read data from a file"
      Top             =   4080
      Width           =   1700
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Show Graph"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   495
      Left            =   12165
      TabIndex        =   15
      ToolTipText     =   "Click on to see the graphics plot"
      Top             =   4080
      Width           =   1700
   End
   Begin VB.Frame Frame2 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Axes"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   3500
      Left            =   9720
      TabIndex        =   6
      ToolTipText     =   "Change horizontal X-axis/vertical Y-axis info"
      Top             =   360
      Width           =   4150
      Begin VB.TextBox Text6 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2880
         TabIndex        =   22
         ToolTipText     =   "Number of ticks on +Y-axis "
         Top             =   2910
         Width           =   735
      End
      Begin VB.TextBox Text5 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2880
         TabIndex        =   21
         ToolTipText     =   "Y-axis max value"
         Top             =   2535
         Width           =   1095
      End
      Begin VB.TextBox Text4 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2880
         TabIndex        =   20
         ToolTipText     =   "Y-axis min value"
         Top             =   2160
         Width           =   1095
      End
      Begin VB.TextBox Text3 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2880
         TabIndex        =   19
         ToolTipText     =   "Number of ticks between tick labels"
         Top             =   1110
         Width           =   735
      End
      Begin VB.TextBox Text2 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2880
         TabIndex        =   8
         ToolTipText     =   "X-axis max value"
         Top             =   720
         Width           =   1095
      End
      Begin VB.TextBox Text1 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   375
         Left            =   2880
         TabIndex        =   7
         ToolTipText     =   "X-axis min value"
         Top             =   360
         Width           =   1095
      End
      Begin VB.Line Line1 
         X1              =   0
         X2              =   4200
         Y1              =   1800
         Y2              =   1800
      End
      Begin VB.Label Label6 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "Y-Axis From:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   1005
         TabIndex        =   14
         Top             =   2205
         Width           =   1800
      End
      Begin VB.Label Label7 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "To:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   2355
         TabIndex        =   13
         Top             =   2580
         Width           =   450
      End
      Begin VB.Label Label8 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "Ticks:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   1905
         TabIndex        =   12
         Top             =   2970
         Width           =   900
      End
      Begin VB.Label Label2 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "To:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   2355
         TabIndex        =   11
         ToolTipText     =   "X-axis max value"
         Top             =   780
         Width           =   450
      End
      Begin VB.Label Label1 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "X-Axis From:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   1005
         TabIndex        =   10
         ToolTipText     =   "X-axis min value"
         Top             =   405
         Width           =   1800
      End
      Begin VB.Label Label4 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "Ticks:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   1905
         TabIndex        =   9
         Top             =   1155
         Width           =   900
      End
   End
   Begin VB.Frame Frame1 
      Appearance      =   0  'Flat
      BackColor       =   &H00E0E0E0&
      Caption         =   "Titles"
      BeginProperty Font 
         Name            =   "Courier New"
         Size            =   12
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H80000008&
      Height          =   1095
      Left            =   120
      TabIndex        =   1
      ToolTipText     =   "Change top/bottom titles"
      Top             =   360
      Width           =   9375
      Begin VB.TextBox Text10 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   161
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   390
         Left            =   960
         TabIndex        =   4
         ToolTipText     =   "Change the top title"
         Top             =   480
         Width           =   3250
      End
      Begin VB.TextBox Text9 
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   161
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   390
         Left            =   5880
         TabIndex        =   3
         ToolTipText     =   "Change the bottom title"
         Top             =   480
         Width           =   3250
      End
      Begin VB.Label Label10 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "Top:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   240
         TabIndex        =   5
         Top             =   525
         Width           =   600
      End
      Begin VB.Label Label9 
         Appearance      =   0  'Flat
         AutoSize        =   -1  'True
         BackColor       =   &H00E0E0E0&
         Caption         =   "Bottom:"
         BeginProperty Font 
            Name            =   "Courier New"
            Size            =   12
            Charset         =   0
            Weight          =   700
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         ForeColor       =   &H80000008&
         Height          =   270
         Left            =   4680
         TabIndex        =   2
         Top             =   525
         Width           =   1050
      End
   End
   Begin MSComDlg.CommonDialog CMDialog1 
      Left            =   9960
      Top             =   7200
      _ExtentX        =   847
      _ExtentY        =   847
      _Version        =   393216
   End
   Begin GraphLib.Graph Graph1 
      Height          =   6855
      Left            =   120
      TabIndex        =   0
      ToolTipText     =   "Click on to refresh the graph"
      Top             =   1680
      Width           =   9375
      _Version        =   65536
      _ExtentX        =   16536
      _ExtentY        =   12091
      _StockProps     =   96
      BorderStyle     =   1
      BottomTitle     =   "Label"
      DrawStyle       =   0
      GraphCaption    =   "DraftPlot4W"
      GraphStyle      =   4
      GraphTitle      =   "Title"
      GraphType       =   6
      GridStyle       =   3
      NumPoints       =   11
      NumSets         =   2
      PatternedLines  =   1
      RandomData      =   1
      ThickLines      =   0
      ColorData       =   0
      ExtraData       =   0
      ExtraData[]     =   0
      FontFamily      =   4
      FontFamily[0]   =   2
      FontFamily[1]   =   2
      FontFamily[2]   =   2
      FontFamily[3]   =   2
      FontSize        =   4
      FontSize[0]     =   150
      FontSize[1]     =   150
      FontSize[2]     =   130
      FontSize[3]     =   100
      FontStyle       =   4
      FontStyle[0]    =   2
      FontStyle[1]    =   2
      FontStyle[2]    =   2
      FontStyle[3]    =   2
      GraphData       =   0
      GraphData[]     =   0
      LabelText       =   0
      LegendText      =   0
      PatternData     =   0
      SymbolData      =   0
      XPosData        =   0
      XPosData[]      =   0
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim xfrom As Single
Dim xto As Single
Dim m As Integer
Dim yfrom As Single
Dim yto As Single
Dim ystep As Integer
Dim btitle As String
Dim utitle As String
Dim grid As Integer

Sub activetooltip()
If MDIForm1.tooltip.Checked = True Then
Form1.Frame1.ToolTipText = "Change top/bottom titles"
Form1.Frame2.ToolTipText = "Change horizontal X-axis/vertical Y-axis info"
Form1.Label1.ToolTipText = "X-axis min value"
Form1.Label2.ToolTipText = "X-axis max value"
Form1.Text3.ToolTipText = "Number of ticks between tick labels"
Form1.Text4.ToolTipText = "Y-axis min value"
Form1.Text5.ToolTipText = "Y-axis max value"
Form1.Text6.ToolTipText = "Number of ticks on +Y-axis "
Form1.Text9.ToolTipText = "Change the bottom title"
Form1.Text10.ToolTipText = "Change the top title"
Form1.Command1.ToolTipText = "Click on to see the graphics plot"
Form1.Command2.ToolTipText = "Click on to read data from a file"
Form1.Command3.ToolTipText = "Click on to toggle grid"
Form1.Command4.ToolTipText = "Click on to see a help message"
Form1.Graph1.ToolTipText = "Click on to refresh the graph"
Else
Form1.Frame1.ToolTipText = ""
Form1.Frame2.ToolTipText = ""
Form1.Label1.ToolTipText = ""
Form1.Label2.ToolTipText = ""
Form1.Text3.ToolTipText = ""
Form1.Text4.ToolTipText = ""
Form1.Text5.ToolTipText = ""
Form1.Text6.ToolTipText = ""
Form1.Text9.ToolTipText = ""
Form1.Text10.ToolTipText = ""
Form1.Command1.ToolTipText = ""
Form1.Command2.ToolTipText = ""
Form1.Command3.ToolTipText = ""
Form1.Command4.ToolTipText = ""
Form1.Graph1.ToolTipText = ""
End If
End Sub

Sub graphrefresh()

On Error GoTo ehandler
Graph1.DrawMode = 1
Graph1.NumPoints = np%
Graph1.GraphStyle = 4
Graph1.DrawStyle = 0
Graph1.GraphType = 6
Graph1.IndexStyle = 1
Graph1.Background = 15
Graph1.GridStyle = grid%
Graph1.Labels = 1
Graph1.BottomTitle = btitle
Graph1.GraphTitle = utitle
Graph1.PatternedLines = 1

Graph1.YAxisStyle = 2
Graph1.YAxisMax = yto
Graph1.YAxisMin = yfrom
Graph1.YAxisTicks = ystep

Graph1.ThisSet = 1
Graph1.PatternData = 2
For i% = 1 To Graph1.NumPoints
Graph1.ThisPoint = i%
Graph1.GraphData = rij(i%)
Next
Graph1.ThisSet = 2
Graph1.PatternData = 0
For i% = 1 To Graph1.NumPoints
Graph1.ThisPoint = i%
Graph1.GraphData = xij(i%)
Next

Graph1.LabelEvery = m%
For i% = 1 To np% Step m%
Graph1.ThisPoint = i%
Graph1.LabelText = Format(Str(l(i%)), "0.0")
Next
'
Graph1.DrawMode = 3
ehandler:

End Sub

Private Sub Command1_Click()

On Error GoTo ehandler
Call graphrefresh
Command1.Enabled = False
ehandler:

End Sub

Private Sub Command2_Click()

On Error GoTo ehandler
CMDialog1.InitDir = mtem$
CMDialog1.CancelError = True
CMDialog1.Filter = "All Files (*.*)|*.*|Text Files (*.txt)"
CMDialog1.FilterIndex = 2
CMDialog1.Action = 1
fnum = FreeFile
Open CMDialog1.FileName For Input As #fnum
n = Loc(fnum)
If n = 0 Then
msg = "Your file contains no data"
MsgBox msg
Close #fnum
Exit Sub
End If

fln1$ = CMDialog1.FileName
fln2$ = CMDialog1.FileTitle
le1% = Len(fln1$): le2% = Len(fln2$)
filna0$ = Left$(fln1$, le1% - le2%)
MDIForm1.MousePointer = 11
Line Input #fnum, temp$
np% = Val(temp$)

ReDim l(np%): ReDim rij(np%): ReDim xij(np%)

For i% = 1 To np%
Input #fnum, l(i%), rij(i%), xij(i%)
Next

Close #fnum
MDIForm1.MousePointer = 1

Text1.Text = Format(l(1), "0.0")
Text2.Text = Format(l(np%), "0.0")

Command1.Enabled = True
ehandler:

End Sub

Private Sub Command3_Click()
If grid = 3 Then
grid = 0
Else
grid = 3
End If
Call graphrefresh
End Sub

Private Sub Command4_Click()
Load Form4
centerform Form4
End Sub

Private Sub Form_Load()

Width = 14200
Height = 10000
Command1.Enabled = False
activetooltip
f = 1
xto = 1#
xfrom = 0
yto = 50
yfrom = -50#
ystep% = 2
m% = 2
np% = 11
grid% = 3

ReDim rij(np%): ReDim xij(np%): ReDim l(np%)
For i% = 1 To np%
rij(i%) = 0: xij(i%) = 0: l(i%) = (i% - 1) / 10
Next
''
Text1.Text = Format(xfrom, "0.0")
Text2.Text = Format(xto, "0.0")
Text1.Enabled = False
Text2.Enabled = False
Text3.Text = m%

Text4.Text = Format(yfrom, "0.0")
Text5.Text = Format(yto, "0.0")
Text6.Text = ystep%

Call graphrefresh

Text9.Text = "Label"
Text10.Text = "Title"
utitle = "Title"
btitle = "Label"
''
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
activetooltip
End Sub

Private Sub Graph1_Click()
Call graphrefresh
End Sub

Private Sub Text10_Change()
utitle = Text10.Text
Call graphrefresh
End Sub

Private Sub Text3_Change()
m% = Val(Text3.Text)
Call graphrefresh
End Sub

Private Sub text6_Change()
ystep = Val(Text6.Text)
Call graphrefresh
End Sub

Private Sub text4_Change()
yfrom = Val(Text4.Text)
Call graphrefresh
End Sub

Private Sub text5_Change()
yto = Val(Text5.Text)
Call graphrefresh
End Sub

Private Sub Text9_Change()
btitle = Text9.Text
Call graphrefresh
End Sub
