home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / truegrid / disk1 / callback / callback.$ / CALLBACK.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-02-17  |  4.5 KB  |  137 lines

  1. VERSION 2.00
  2. Begin Form CallForm 
  3.    BackColor       =   &H00808080&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Callback Sample"
  6.    ClientHeight    =   2535
  7.    ClientLeft      =   1095
  8.    ClientTop       =   1770
  9.    ClientWidth     =   5430
  10.    Height          =   3225
  11.    Icon            =   CALLBACK.FRX:0000
  12.    Left            =   1035
  13.    LinkTopic       =   "Form1"
  14.    ScaleHeight     =   2535
  15.    ScaleWidth      =   5430
  16.    Top             =   1140
  17.    Width           =   5550
  18.    Begin TrueGrid Table1 
  19.       AllowArrows     =   -1  'True
  20.       AllowTabs       =   -1  'True
  21.       BackColor       =   &H00C0C0C0&
  22.       Editable        =   -1  'True
  23.       EditDropDown    =   -1  'True
  24.       ExposeCellMode  =   0  'Expose upon selection
  25.       FetchMode       =   0  'By cell
  26.       HeadingHeight   =   1
  27.       Height          =   2265
  28.       HorzLines       =   1  'Single
  29.       Layout          =   CALLBACK.FRX:0302
  30.       LayoutIndex     =   1
  31.       Left            =   120
  32.       LinesPerRow     =   1
  33.       MarqueeUnique   =   -1  'True
  34.       SplitPropsGlobal=   -1  'True
  35.       SplitTabMode    =   0  'Don't tab across splits
  36.       TabCapture      =   0   'False
  37.       TabIndex        =   0
  38.       Top             =   120
  39.       UseBookmarks    =   -1  'True
  40.       Width           =   5175
  41.       WrapCellPointer =   0   'False
  42.    End
  43.    Begin Menu ExitMenuOption 
  44.       Caption         =   "E&xit!"
  45.    End
  46.    Begin Menu HelpMenuOption 
  47.       Caption         =   "&Help"
  48.       Begin Menu HelpMenu 
  49.          Caption         =   "&Index"
  50.          Index           =   0
  51.       End
  52.       Begin Menu HelpMenu 
  53.          Caption         =   "&Using Help"
  54.          Index           =   1
  55.       End
  56.       Begin Menu HelpMenu 
  57.          Caption         =   "-"
  58.          Index           =   2
  59.       End
  60.       Begin Menu HelpMenu 
  61.          Caption         =   "&About Callback..."
  62.          Index           =   3
  63.       End
  64.    End
  65. ' ---------------------------------------------------------
  66. '       Copyright (C) 1994 Apex Software Corporation
  67. ' You have a royalty-free right to use, modify, reproduce,
  68. ' and distribute the TrueGrid sample application files
  69. ' (and/or any modified version) in any way you find useful,
  70. ' provided that you agree that Apex Software Corporation
  71. ' has no warranty, obligations, or liability for any sample
  72. ' application files.
  73. ' ---------------------------------------------------------
  74. 'Global constants that determine the size
  75. 'of the grid and its underlying array
  76. Const MAXROW = 10
  77. Const MAXCOL = 5
  78. 'This array is used to hold the data
  79. 'that the grid will display
  80. Dim GridData(1 To MAXROW, 1 To MAXCOL) As String
  81. Sub CenterForm (F As Form)
  82. ' Center the specified form within the screen
  83.     F.Move (Screen.Width - F.Width) \ 2, (Screen.Height - F.Height) \ 2
  84. End Sub
  85. Sub ExitMenuOption_Click ()
  86.     Unload CallForm
  87.     End
  88. End Sub
  89. Sub Form_Load ()
  90.     'Centers the Form on the Screen
  91.     CenterForm CallForm
  92.     'Set the number of rows and columns to be displayed
  93.     Table1.Rows = MAXROW
  94.     Table1.Columns = MAXCOL
  95.     'Sets some of the Column properties for the Grids columns
  96.     For Ct = 1 To Table1.Columns
  97.         
  98.         'Heading name to be displayed
  99.         Table1.ColumnName(Ct) = "Column " & Str$(Ct)
  100.         
  101.         'Display size of column
  102.         Table1.ColumnWidth(Ct) = 10
  103.         
  104.         'Data entry size of column
  105.         Table1.ColumnSize(Ct) = 10
  106.     Next Ct
  107.     'Initialize array with values
  108.     For Ct = 1 To MAXROW
  109.         For Ct2 = 1 To MAXCOL
  110.             GridData(Ct, Ct2) = "(" & Str$(Ct) & "," & Str$(Ct2) & ")"
  111.         Next Ct2
  112.     Next Ct
  113. End Sub
  114. Sub HelpMenu_Click (Index As Integer)
  115.     'This event calls the WinHelp EXE and a location to goto based on which selection the user has chosen
  116.     'Case 4 shows the about box for the Callback sample
  117.     Select Case Index
  118.         Case 0
  119.             HelpContext CallForm, HELP_CALLBACK
  120.         Case 1
  121.             HelpOnHelp CallForm
  122.         Case 3
  123.             About.Show 1
  124.     End Select
  125. End Sub
  126. Sub Table1_Fetch (Row As Long, Col As Integer, Value As String)
  127.     'Set the display of the grid to the
  128.     'contents of the GridData array
  129.     Value = GridData(Row, Col)
  130. End Sub
  131. Sub Table1_Update (Row As Long, Col As Integer, Value As String)
  132.     'Updates the GridData array with the new value
  133.     'passed in by the Value parameter, usually
  134.     'upon completion of data entry
  135.     GridData(Row, Col) = Value
  136. End Sub
  137.