home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 4_2005-2006.ISO / data / Zips / XML_Parser19555112102005.psc / forms / mdiMain.frm < prev   
Text File  |  2005-12-06  |  3KB  |  110 lines

  1. VERSION 5.00
  2. Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
  3. Begin VB.MDIForm mdiMain 
  4.    BackColor       =   &H8000000C&
  5.    Caption         =   "Code Collector"
  6.    ClientHeight    =   6105
  7.    ClientLeft      =   165
  8.    ClientTop       =   855
  9.    ClientWidth     =   9990
  10.    Icon            =   "mdiMain.frx":0000
  11.    LinkTopic       =   "MDIForm1"
  12.    StartUpPosition =   3  'Windows Default
  13.    Begin MSComDlg.CommonDialog cd 
  14.       Left            =   4800
  15.       Top             =   2760
  16.       _ExtentX        =   847
  17.       _ExtentY        =   847
  18.       _Version        =   393216
  19.       CancelError     =   -1  'True
  20.       Filter          =   "XML Files (*.xml)|*.xml"
  21.    End
  22.    Begin VB.Menu mnuFile 
  23.       Caption         =   "&File"
  24.       Begin VB.Menu mnuFileNew 
  25.          Caption         =   "&New XML"
  26.          Shortcut        =   ^N
  27.       End
  28.       Begin VB.Menu mnuFileOpen 
  29.          Caption         =   "&Open XML..."
  30.          Shortcut        =   ^O
  31.       End
  32.       Begin VB.Menu sep1 
  33.          Caption         =   "-"
  34.       End
  35.       Begin VB.Menu mnuFileExit 
  36.          Caption         =   "E&xit"
  37.       End
  38.    End
  39.    Begin VB.Menu mnuHelp 
  40.       Caption         =   "&Help"
  41.       Begin VB.Menu mnuHelpAbout 
  42.          Caption         =   "&About..."
  43.       End
  44.    End
  45. End
  46. Attribute VB_Name = "mdiMain"
  47. Attribute VB_GlobalNameSpace = False
  48. Attribute VB_Creatable = False
  49. Attribute VB_PredeclaredId = True
  50. Attribute VB_Exposed = False
  51. Option Explicit
  52.  
  53. Private Sub MDIForm_Load()
  54. Dim sStr As String
  55. Dim doc As New frmMain
  56.  
  57.     Me.Top = GetSetting(App.Title, "MainWindow", "Top", 0)
  58.     Me.Left = GetSetting(App.Title, "MainWindow", "Left", 0)
  59.     Me.Width = GetSetting(App.Title, "MainWindow", "Width", 600)
  60.     Me.Height = GetSetting(App.Title, "MainWindow", "Height", 400)
  61.     cd.Flags = cdlOFNFileMustExist
  62.     
  63.     'get commandline parameters. it should only be a file name
  64.     sStr = Command$
  65.     'trim quote marks
  66.     If Left$(sStr, 1) = Chr$(34) Then sStr = Right$(sStr, Len(sStr) - 1)
  67.     If Right$(sStr, 1) = Chr$(34) Then sStr = Left$(sStr, Len(sStr) - 1)
  68.  
  69.     If sStr <> "" And Dir(sStr) <> "" Then
  70.         doc.OpenXML sStr
  71.     End If
  72.     doc.Show
  73. End Sub
  74.  
  75. Private Sub MDIForm_Unload(Cancel As Integer)
  76.     SaveSetting App.Title, "MainWindow", "Top", Me.Top
  77.     SaveSetting App.Title, "MainWindow", "Left", Me.Left
  78.     SaveSetting App.Title, "MainWindow", "Width", Me.Width
  79.     SaveSetting App.Title, "MainWindow", "Height", Me.Height
  80. End Sub
  81.  
  82. Public Sub mnuFileExit_Click()
  83.     Unload Me
  84.     'End
  85. End Sub
  86.  
  87. Private Sub mnuFileNew_Click()
  88.     NewFile
  89. End Sub
  90.  
  91. Public Sub NewFile()
  92. Dim doc As New frmMain
  93.     doc.Show
  94. End Sub
  95.  
  96. Private Sub mnuFileOpen_Click()
  97.     OpenFile
  98. End Sub
  99.  
  100. Public Sub OpenFile()
  101. Dim doc As New frmMain
  102.  
  103.     On Error GoTo ErrExit
  104.     cd.ShowOpen
  105.     doc.OpenXML cd.F&n
  106.    e
  107. E
  108. Publicmote Sub mnuFileOpen_Click()
  109.   (ust(F6teOpalU8e r9DTi
  110. Pubrbe-t0een_t0een_t0een_t0een_