home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / demo / truegrid / editing / editing.$ / EDITING.FRM (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1994-02-08  |  5.6 KB  |  165 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.       Left            =   210
  45.       LinesPerRow     =   2
  46.       MarqueeUnique   =   -1  'True
  47.       SplitPropsGlobal=   0   'False
  48.       SplitTabMode    =   1  'Tab across splits
  49.       TabCapture      =   0   'False
  50.       TabIndex        =   0
  51.       Top             =   210
  52.       UseBookmarks    =   -1  'True
  53.       Width           =   7035
  54.       WrapCellPointer =   0   'False
  55.    End
  56.    Begin Data Data1 
  57.       Caption         =   "Data1"
  58.       Connect         =   ""
  59.       DatabaseName    =   "TASKS.MDB"
  60.       Exclusive       =   0   'False
  61.       Height          =   315
  62.       Left            =   300
  63.       Options         =   0
  64.       ReadOnly        =   0   'False
  65.       RecordSource    =   "select * from Tasklist order by Priority"
  66.       Top             =   3660
  67.       Visible         =   0   'False
  68.       Width           =   1755
  69.    End
  70.    Begin Menu FileOption 
  71.       Caption         =   "E&xit!"
  72.    End
  73.    Begin Menu HelpOption 
  74.       Caption         =   "&Help"
  75.       Begin Menu mHelpOption 
  76.          Caption         =   "&Index"
  77.          Index           =   1
  78.       End
  79.       Begin Menu mHelpOption 
  80.          Caption         =   "&Using Help"
  81.          Index           =   2
  82.       End
  83.       Begin Menu mHelpOption 
  84.          Caption         =   "-"
  85.          Index           =   3
  86.       End
  87.       Begin Menu mHelpOption 
  88.          Caption         =   "&About Editing and Display Tips..."
  89.          Index           =   4
  90.       End
  91.    End
  92. Sub CenterForm (F As Form)
  93. ' Center the specified form within the screen
  94.     F.Move (Screen.Width - F.Width) \ 2, (Screen.Height - F.Height) \ 2
  95. End Sub
  96. Sub Command1_Click ()
  97.     ' Since RecordSource indicates that we order by priority,
  98.     ' a simple refresh redisplays everything in the right
  99.     ' priority order.
  100.     Data1.Refresh
  101. End Sub
  102. Sub FileOption_Click ()
  103.     Unload Form1
  104. End Sub
  105. Sub Form_Load ()
  106.     Dim dbdir As String
  107.     ' Set the databasename property of the data control
  108.     dbdir = app.Path
  109.     Data1.DatabaseName = dbdir + "\TASKS.MDB"
  110.     ' Center Form on screen
  111.     CenterForm Form1
  112.     ' Assure that the description column in the right split is
  113.     ' set so attributes will be queried as needed
  114.     Table1.SplitIndex = 2
  115.     Table1.ColumnCellAttrs(4) = True
  116.     ' Set up value list combo box for the status column
  117.     Table1.SplitIndex = 1
  118.     Table1.VlistColumn = 2
  119.     Table1.ColumnButton(2) = True
  120.     Table1.VlistStyle = GVLS_COMBO Or GVLS_SORTCOMBO
  121.     Table1.VlistData(1) = "Cancel"
  122.     Table1.VlistData(2) = "Reschedule"
  123.     Table1.VlistData(3) = "Satisfactory"
  124.     Table1.VlistData(4) = "Unacceptable"
  125.     Table1.VlistData(5) = "In Progress"
  126.     Table1.VlistData(6) = "Not Started"
  127.     Table1.VlistData(7) = "Pending"
  128.     ' Set up up value list of text and pictures for Past Due Column
  129.     Table1.SplitIndex = 2
  130.     Table1.VlistColumn = 1
  131.     Table1.VlistStyle = GVLS_TEXT Or GVLS_TRANSLATE
  132.     Table1.VlistData(1) = " 0"
  133.     Table1.VlistData(2) = "-1"
  134.     Table1.VlistText(1) = "OK"
  135.     Table1.VlistPicture(2) = LoadPicture(app.Path + "\warn.bmp")
  136. End Sub
  137. Sub mHelpOption_Click (index As Integer)
  138.     'This event calls the WinHelp EXE and a location to goto based on which selection the user has chosen
  139.     'Case 4 shows the about box for the Editing sample
  140.     Select Case index
  141.         Case 1
  142.             HelpContext Form1, HELP_EDITING
  143.         Case 2
  144.             HelpOnHelp Form1
  145.         Case 4
  146.             About.Show 1
  147.     End Select
  148. End Sub
  149. Sub Table1_Append ()
  150.     ' Add a new record if they arrow down past the bottom
  151.     If MsgBox("Add new record?", 1) = 2 Then Exit Sub
  152.     Data1.Recordset.AddNew
  153.     Data1.Recordset.Update
  154.     Data1.Recordset.MoveLast
  155. End Sub
  156. Sub Table1_FetchAttributes (Status As Integer, Split As Integer, Row As Long, Col As Integer, FgColor As Long, BgColor As Long, FontStyle As Integer)
  157.     ' Show past due items as white on red, unless the data
  158.     ' has been updated, in which case we leave it alone.
  159.     If Table1.ColumnText(1) = "-1" Then
  160.         If Status And GFS_CHANGED Then Exit Sub
  161.         FgColor = &HFFFFFF  ' white
  162.         BgColor = &H80      ' red
  163.     End If
  164. End Sub
  165.