home *** CD-ROM | disk | FTP | other *** search
/ CICA 1994 September / CICA_Shareware_for_Windows_Walnut_Creek_September_1994.iso / win3 / winsock / gcp_24.exe / MAIN.FR_ / MAIN.FR
Text File  |  1994-03-06  |  4KB  |  124 lines

  1. VERSION 2.00
  2. Begin MDIForm frmMDI 
  3.    Caption         =   "VT-220 for Workgroups"
  4.    ClientHeight    =   4665
  5.    ClientLeft      =   1380
  6.    ClientTop       =   2595
  7.    ClientWidth     =   8010
  8.    Height          =   5325
  9.    Icon            =   MAIN.FRX:0000
  10.    Left            =   1335
  11.    LinkTopic       =   "MDIForm1"
  12.    Top             =   1980
  13.    Width           =   8100
  14.    Begin Menu mnuFile 
  15.       Caption         =   "&File"
  16.       Begin Menu mnuFNew 
  17.          Caption         =   "&New..."
  18.       End
  19.       Begin Menu mnuFOpen 
  20.          Caption         =   "&Open..."
  21.       End
  22.       Begin Menu mnuBlank1 
  23.          Caption         =   "-"
  24.       End
  25.       Begin Menu mnuFExit 
  26.          Caption         =   "E&xit"
  27.       End
  28.    End
  29.    Begin Menu mnuHelp 
  30.       Caption         =   "&Help"
  31.       Begin Menu mnuHContents 
  32.          Caption         =   "&Contents..."
  33.       End
  34.       Begin Menu mnuHAbout 
  35.          Caption         =   "&About..."
  36.       End
  37.    End
  38. End
  39. Declare Function WritePrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lplFileName As String) As Integer
  40. Declare Function GetPrivateProfileString Lib "Kernel" (ByVal lpApplicationName As String, lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Integer, ByVal lpFileName As String) As Integer
  41. Declare Function GetPrivateProfileInt Lib "Kernel" (ByVal lpApplicationName As String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer
  42.  
  43. Sub MDIForm_Load ()
  44.  
  45. '*********************************************************************************************
  46. '* Variables for messaging - DNW
  47. '*********************************************************************************************
  48. Const MB_OK = 0, MB_OKCANCEL = 1  ' Define buttons.
  49. Const MB_ICONEXCLAMATION = 48, MB_ICONINFORMATION = 64
  50. Const MB_DEFBUTTON2 = 256, IDYES = 6, IDNO = 7  ' Define other.
  51. Dim DgDef, msg, Response, title ' Declare variables.
  52. Dim intRunningApp%              ' Stores true or false depending on whether the app is already running - DNW
  53.  
  54. Dim FNum, FormLeft, FormTop, FormWidth, FormHeight
  55. On Error GoTo mdiform_load_error
  56.  
  57. App.HelpFile = "vt220wfg.hlp"
  58.     ' Application starts here (Load event of Startup form).
  59.     ' Always set working directory to directory containing the application.
  60.     ChDir App.Path
  61.     ' Icon shows us closed
  62.     Icon = LoadPicture("net09b.ico")
  63.     'Initialize document form arrays, and show first document.
  64.     ReDim Document(1)
  65.     ReDim FState(1)
  66.     FState(1).Deleted = True
  67.     Left = GetPrivateProfileInt(AppName, "Left", 1000, IniFile)
  68.     Width = GetPrivateProfileInt(AppName, "Width", 10000, IniFile)
  69.     Top = GetPrivateProfileInt(AppName, "Top", 1000, IniFile)
  70.     Height = GetPrivateProfileInt(AppName, "Height", 8000, IniFile)
  71.     Show
  72.  
  73.     CenterForm frmMDI, OpenSession
  74.     OpenSession.Show 1
  75.  
  76.     Exit Sub
  77.  
  78.  
  79. '*********************************************************************************************
  80. '* Error handling routine for the mdi form load
  81. '*********************************************************************************************
  82. mdiform_load_error:
  83.   title = "Err"
  84.   msg = "An error occurred starting.  The error is: " & Error(Err) & "."
  85.   DgDef = MB_OK + MB_ICONEXCLAMATION  ' Describe dialog.
  86.   Response = MsgBox(msg, DgDef, title)  ' Get user response.
  87. End Sub
  88.  
  89. Sub MDIForm_QueryUnload (Cancel As Integer, UnloadMode As Integer)
  90.     Unload frmMDI
  91. End Sub
  92.  
  93. Sub MDIForm_Unload (Cancel As Integer)
  94.     success = WritePrivateProfileString(AppName, "Left", Str$(Left), IniFile)
  95.     success = WritePrivateProfileString(AppName, "Top", Str$(Top), IniFile)
  96.     success = WritePrivateProfileString(AppName, "Width", Str$(Width), IniFile)
  97.     success = WritePrivateProfileString(AppName, "Height", Str$(Height), IniFile)
  98.     Unload ConnectDlg
  99.     End
  100. End Sub
  101.  
  102. Sub mnuFExit_Click ()
  103.     Unload Me
  104. End Sub
  105.  
  106. Sub mnuFNew_Click ()
  107.     CenterForm frmMDI, NewSession
  108.     NewSession.Show 1
  109. End Sub
  110.  
  111. Sub mnuFOpen_Click ()
  112.     CenterForm frmMDI, OpenSession
  113.     OpenSession.Show 1
  114. End Sub
  115.  
  116. Sub mnuHAbout_Click ()
  117.     frmAbout.Show 1
  118. End Sub
  119.  
  120. Sub mnuHContents_Click ()
  121.     r = Shell("WinHelp.exe vt220fwg.hlp")
  122. End Sub
  123.  
  124.