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

  1. VERSION 2.00
  2. Begin Form Form1 
  3.    BackColor       =   &H00C0C0C0&
  4.    Caption         =   "Editing and Display Tips"
  5.    ClientHeight    =   4215
  6.    ClientLeft      =   1095
  7.    ClientTop       =   1770
  8.    ClientWidth     =   7560
  9.    Height          =   4905
  10.    Icon            =   EDITING.FRX:0000
  11.    Left            =   1035
  12.    LinkTopic       =   "Form1"
  13.    ScaleHeight     =   4215
  14.    ScaleWidth      =   7560
  15.    Top             =   1140
  16.    Width           =   7680
  17.    Begin CommandButton Command1 
  18.       Caption         =   "Reprioritize"
  19.       Height          =   375
  20.       Left            =   2790
  21.       TabIndex        =   1
  22.       Top             =   3660
  23.       Width           =   1875
  24.    End
  25.    Begin TrueGrid Table1 
  26.       AllowArrows     =   -1  'True
  27.       AllowTabs       =   -1  'True
  28.       BackColor       =   &H00C0C0C0&
  29.       DataSource      =   "Data1"
  30.       Editable        =   -1  'True
  31.       EditDropDown    =   -1  'True
  32.       ExposeCellMode  =   0  'Expose upon selection
  33.       FetchMode       =   0  'By cell
  34.       FontBold        =   0   'False
  35.       FontItalic      =   0   'False
  36.       FontName        =   "MS Sans Serif"
  37.       FontSize        =   8.25
  38.       FontStrikethru  =   0   'False
  39.       FontUnderline   =   0   'False
  40.       HeadingHeight   =   1.25
  41.       Height          =   3255
  42.       HorzLines       =   2  '3D
  43.       Layout          =   EDITING.FRX:0302
  44.       LayoutIndex     =   1
  45.       Left            =   210
  46.       LinesPerRow     =   2
  47.       MarqueeUnique   =   -1  'True
  48.       SplitPropsGlobal=   0   'False
  49.       SplitTabMode    =   1  'Tab across splits
  50.       TabCapture      =   0   'False
  51.       TabIndex        =   0
  52.       Top             =   210
  53.       UseBookmarks    =   -1  'True
  54.       Width           =   7035
  55.       WrapCellPointer =   0   'False
  56.    End
  57.    Begin Data Data1 
  58.       Caption         =   "Data1"
  59.       Connect         =   ""
  60.       DatabaseName    =   "TASKS.MDB"
  61.       Exclusive       =   0   'False
  62.       Height          =   315
  63.       Left            =   300
  64.       Options         =   0
  65.       ReadOnly        =   0   'False
  66.       RecordSource    =   "select * from Tasklist order by Priority"
  67.       Top             =   3660
  68.       Visible         =   0   'False
  69.       Width           =   1755
  70.    End
  71.    Begin Menu FileOption 
  72.       Caption         =   "E&xit!"
  73.    End
  74.    Begin Menu HelpOption 
  75.       Caption         =   "&Help"
  76.       Begin Menu mHelpOption 
  77.          Caption         =   "&Index"
  78.          Index           =   1
  79.       End
  80.       Begin Menu mHelpOption 
  81.          Caption         =   "&Using Help"
  82.          Index           =   2
  83.       End
  84.       Begin Menu mHelpOption 
  85.          Caption         =   "-"
  86.          Index           =   3
  87.       End
  88.       Begin Menu mHelpOption 
  89.          Caption         =   "&About Editing and Display Tips..."
  90.          Index           =   4
  91.       End
  92.    End
  93. Sub CenterForm (F As Form)
  94. ' Center the specified form within the screen
  95.     F.Move (Screen.Width - F.Width) \ 2, (Screen.Height - F.Height) \ 2
  96. End Sub
  97. Sub Command1_Click ()
  98.     ' Since RecordSource indicates that we order by priority,
  99.     ' a simple refresh redisplays everything in the right
  100.     ' priority order.
  101.     Data1.Refresh
  102. End Sub
  103. Sub FileOption_Click ()
  104.     Unload Form1
  105. End Sub
  106. Sub Form_Load ()
  107.     Dim dbdir As String
  108.     ' Set the databasename property of the data control
  109.     dbdir = app.Path
  110.     Data1.DatabaseName = dbdir + "\TASKS.MDB"
  111.     ' Center Form on screen
  112.     CenterForm Form1
  113.     ' Assure that the description column in the right split is
  114.     ' set so attributes will be queried as needed
  115.     Table1.SplitIndex = 2
  116.     Table1.ColumnCellAttrs(4) = True
  117.     ' Set up value list combo box for the status column
  118.     Table1.SplitIndex = 1
  119.     Table1.VlistColumn = 2
  120.     Table1.ColumnButton(2) = True
  121.     Table1.VlistStyle = GVLS_COMBO Or GVLS_SORTCOMBO
  122.     Table1.VlistData(1) = "Cancel"
  123.     Table1.VlistData(2) = "Reschedule"
  124.     Table1.VlistData(3) = "Satisfactory"
  125.     Table1.VlistData(4) = "Unacceptable"
  126.     Table1.VlistData(5) = "In Progress"
  127.     Table1.VlistData(6) = "Not Started"
  128.     Table1.VlistData(7) = "Pending"
  129.     ' Set up up value list of text and pictures for Past Due Column
  130.     Table1.SplitIndex = 2
  131.     Table1.VlistColumn = 1
  132.     Table1.VlistStyle = GVLS_TEXT Or GVLS_TRANSLATE
  133.     Table1.VlistData(1) = "0"
  134.     Table1.VlistData(2) = "-1"
  135.     Table1.VlistData(3) = ""
  136.     Table1.VlistText(1) = "OK"
  137.     Table1.VlistPicture(2) = LoadPicture(app.Path + "\warn.bmp")
  138.     Table1.VlistText(3) = "N/A"
  139.     Table1.VlistDefault = 3
  140. End Sub
  141. Sub mHelpOption_Click (index As Integer)
  142.     'This event calls the WinHelp EXE and a location to goto based on which selection the user has chosen
  143.     'Case 4 shows the about box for the Editing sample
  144.     Select Case index
  145.         Case 1
  146.             HelpContext Form1, HELP_EDITING
  147.         Case 2
  148.             HelpOnHelp Form1
  149.         Case 4
  150.             About.Show 1
  151.     End Select
  152. End Sub
  153. Sub Table1_Append ()
  154.     ' Add a new record if they arrow down past the bottom
  155.     If MsgBox("Add new record?", 1) = 2 Then Exit Sub
  156.     Data1.Recordset.AddNew
  157.     Data1.Recordset.Update
  158.     Data1.Recordset.MoveLast
  159. End Sub
  160. Sub Table1_FetchAttributes (Status As Integer, Split As Integer, Row As Long, Col As Integer, FgColor As Long, BgColor As Long, FontStyle As Integer)
  161.     ' Show past due items as white on red, unless the data
  162.     ' has been updated, in which case we leave it alone.
  163.     If Table1.ColumnText(1) = "-1" Then
  164.         If Status And GFS_CHANGED Then Exit Sub
  165.         FgColor = &HFFFFFF  ' white
  166.         BgColor = &H80      ' red
  167.     End If
  168. End Sub
  169.