home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Begin VB.MDIForm frmMain
- BackColor = &H8000000C&
- Caption = "Sight Map"
- ClientHeight = 5115
- ClientLeft = 165
- ClientTop = 735
- ClientWidth = 7890
- Icon = "frmMain.frx":0000
- LinkTopic = "MDIForm1"
- StartUpPosition = 3 'Windows Default
- WindowState = 2 'Maximized
- Begin MSComDlg.CommonDialog cdlg
- Left = 2640
- Top = 2040
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin MSComctlLib.StatusBar sbMain
- Align = 2 'Align Bottom
- Height = 375
- Left = 0
- TabIndex = 0
- Top = 4740
- Width = 7890
- _ExtentX = 13917
- _ExtentY = 661
- Style = 1
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 1
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- EndProperty
- EndProperty
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileNew
- Caption = "&New"
- End
- Begin VB.Menu mnuFileOpen
- Caption = "&Open"
- End
- Begin VB.Menu mnuFileSave
- Caption = "&Save"
- End
- Begin VB.Menu mnuFileQuit
- Caption = "&Quit"
- End
- End
- Begin VB.Menu mnuSite
- Caption = "&Site"
- Begin VB.Menu mnuSiteShow
- Caption = "&Show Hierarchy"
- End
- End
- Begin VB.Menu mnuWindow
- Caption = "&Window"
- WindowList = -1 'True
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- 'frmMain.frm
- '--------------------------------------------------------------------------
- '<Purpose>
- ' Handles menu selections. Loads MDI child windows depending on
- ' function requested.
- '<Revision>
- ' $Revision: $
- '<Mod Log>
- ' $Log: $
- '--------------------------------------------------------------------------
- '--------------------------------------------------------------------------
- '<Purpose>
- '<Syntax>
- '<Assumptions>
- '<Returns>
- '<Author>
- ' HBW
- '--------------------------------------------------------------------------
- Private Sub MDIForm_Load()
- 'Seed the random number generator
- Randomize Now
- End Sub
- '--------------------------------------------------------------------------
- '<Purpose>
- '<Syntax>
- '<Assumptions>
- '<Returns>
- '<Author>
- ' HBW
- '--------------------------------------------------------------------------
- Private Sub mnuFileNew_Click()
- Dim frm As New frmSiteDefinition
- frm.Show
- End Sub
- '--------------------------------------------------------------------------
- '<Purpose>
- '<Syntax>
- '<Assumptions>
- '<Returns>
- '<Author>
- ' HBW
- '--------------------------------------------------------------------------
- Private Sub mnuFileOpen_Click()
- On Error GoTo mnuFileOpen_Click_Error
- cdlg.CancelError = True
- cdlg.Filter = "Site Files (*.st)|*.st"
- cdlg.ShowOpen
- gLoadingSite = True
- Dim NewSite As New Site
- NewSite.OpenSite cdlg.FileName
- gSites.Add NewSite, NewSite.SiteID
- Dim frm As New frmSiteDefinition
- Call LoadSiteForm(frm, NewSite)
- frm.fraOperations.Visible = False
- gLoadingSite = False
- frm.Show
- Exit Sub
- mnuFileOpen_Click_Error:
- If Err.Number <> cdlCancel Then
- Select Case Err.Number
- Case 457 'duplicate key
- MsgBox "You already have that one open, silly!"
- Case Else
- MsgBox "Open Failed: " & CStr(Err.Number) & " -- " & Err.Description
- End Select
- End If
- End Sub
- '--------------------------------------------------------------------------
- '<Purpose>
- '<Syntax>
- '<Assumptions>
- '<Returns>
- '<Author>
- ' HBW
- '--------------------------------------------------------------------------
- Private Sub mnuFileQuit_Click()
- Unload Me
- End Sub
- Private Sub mnuFileSave_Click()
- '--------------------------------------------------------------------------
- '<Purpose>
- '<Syntax>
- '<Assumptions>
- '<Returns>
- '<Author>
- ' HBW
- '--------------------------------------------------------------------------
- Dim strSiteID As String
- If Not Me.ActiveForm Is Nothing Then
- If Me.ActiveForm.Name = "frmSiteDefinition" Then
- strSiteID = Me.ActiveForm.mSiteID
- cdlg.Filter = "Site Files (*.st)|*.st"
- cdlg.ShowSave
- gSites(strSiteID).SaveSite cdlg.FileName
-
- Else
- MsgBox "Active window must be a site definition form."
- End If
- Else
- MsgBox "Active window must be a site definition form."
- End If
- End Sub
- Private Sub mnuSiteShow_Click()
- '--------------------------------------------------------------------------
- '<Purpose>
- '<Syntax>
- '<Assumptions>
- '<Returns>
- '<Author>
- ' HBW
- '--------------------------------------------------------------------------
- Dim strSiteID As String
- If Not Me.ActiveForm Is Nothing Then
- If Me.ActiveForm.Name = "frmSiteDefinition" Then
- strSiteID = Me.ActiveForm.mSiteID
- Dim frm As New frmMap
- frmMap.SiteHandle = Me.ActiveForm
- Call gSites(strSiteID).DrawTree(frmMap.tvMap)
- frmMap.lblRoot = gSites(strSiteID).Root
- frmMap.Show
- End If
- End If
- End Sub
-