home *** CD-ROM | disk | FTP | other *** search
/ Program Metropolis - Software Boutique 95 / SOFTWARECD.iso / project4 / disk6 / options.fr_ / options.bin (.txt)
Encoding:
Visual Basic Form  |  1994-04-14  |  8.5 KB  |  253 lines

  1. VERSION 2.00
  2. Begin Form frmOptions 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "frmOptions"
  6.    ClientHeight    =   3660
  7.    ClientLeft      =   840
  8.    ClientTop       =   1245
  9.    ClientWidth     =   4455
  10.    Height          =   4065
  11.    Icon            =   OPTIONS.FRX:0000
  12.    Left            =   780
  13.    LinkTopic       =   "Form1"
  14.    MaxButton       =   0   'False
  15.    MinButton       =   0   'False
  16.    ScaleHeight     =   3660
  17.    ScaleWidth      =   4455
  18.    Top             =   900
  19.    Width           =   4575
  20.    Begin SSPanel pnlMain 
  21.       AutoSize        =   3  'AutoSize Child To Panel
  22.       BackColor       =   &H00C0C0C0&
  23.       Font3D          =   0  'None
  24.       ForeColor       =   &H00000000&
  25.       Height          =   3660
  26.       Left            =   0
  27.       TabIndex        =   9
  28.       Top             =   0
  29.       Width           =   4455
  30.       Begin CommandButton cmdOK 
  31.          BackColor       =   &H00C0C0C0&
  32.          Caption         =   "OK"
  33.          Default         =   -1  'True
  34.          Enabled         =   0   'False
  35.          Height          =   330
  36.          Left            =   3195
  37.          TabIndex        =   7
  38.          Top             =   300
  39.          Width           =   1050
  40.       End
  41.       Begin CommandButton cmdCancel 
  42.          BackColor       =   &H00C0C0C0&
  43.          Cancel          =   -1  'True
  44.          Caption         =   "Cancel"
  45.          Height          =   330
  46.          Left            =   3195
  47.          TabIndex        =   8
  48.          Top             =   705
  49.          Width           =   1050
  50.       End
  51.       Begin SSFrame fraResource 
  52.          Caption         =   "Update Work for"
  53.          Font3D          =   0  'None
  54.          Height          =   1410
  55.          Left            =   180
  56.          TabIndex        =   13
  57.          Top             =   210
  58.          Width           =   2805
  59.          Begin SSOption optAllResources 
  60.             Caption         =   "&All Resources"
  61.             Font3D          =   0  'None
  62.             Height          =   240
  63.             Left            =   180
  64.             TabIndex        =   0
  65.             Top             =   315
  66.             Value           =   -1  'True
  67.             Width           =   1635
  68.          End
  69.          Begin SSOption optOneResource 
  70.             Caption         =   "&One Resource"
  71.             Font3D          =   0  'None
  72.             Height          =   240
  73.             Left            =   180
  74.             TabIndex        =   1
  75.             TabStop         =   0   'False
  76.             Top             =   585
  77.             Width           =   1635
  78.          End
  79.          Begin SSPanel pnlResources 
  80.             AutoSize        =   3  'AutoSize Child To Panel
  81.             BackColor       =   &H00C0C0C0&
  82.             BevelOuter      =   1  'Inset
  83.             Font3D          =   0  'None
  84.             ForeColor       =   &H00000000&
  85.             Height          =   330
  86.             Left            =   165
  87.             TabIndex        =   14
  88.             Top             =   945
  89.             Width           =   2520
  90.             Begin ComboBox cboResources 
  91.                Enabled         =   0   'False
  92.                Height          =   300
  93.                Left            =   15
  94.                Style           =   2  'Dropdown List
  95.                TabIndex        =   2
  96.                Top             =   15
  97.                Width           =   2490
  98.             End
  99.          End
  100.       End
  101.       Begin SSFrame fraDateRange 
  102.          Caption         =   "Update Tasks within Date Range"
  103.          Font3D          =   0  'None
  104.          Height          =   1590
  105.          Left            =   180
  106.          TabIndex        =   10
  107.          Top             =   1830
  108.          Width           =   4065
  109.          Begin SSPanel pnlFrom 
  110.             AutoSize        =   3  'AutoSize Child To Panel
  111.             BackColor       =   &H00C0C0C0&
  112.             BevelOuter      =   1  'Inset
  113.             Caption         =   "Panel3D1"
  114.             Font3D          =   0  'None
  115.             ForeColor       =   &H00000000&
  116.             Height          =   335
  117.             Left            =   315
  118.             TabIndex        =   12
  119.             Top             =   495
  120.             Width           =   3110
  121.             Begin TextBox txtFrom 
  122.                Height          =   300
  123.                Left            =   15
  124.                TabIndex        =   4
  125.                Top             =   15
  126.                Width           =   3075
  127.             End
  128.          End
  129.          Begin SSPanel pnlTo 
  130.             AutoSize        =   3  'AutoSize Child To Panel
  131.             BackColor       =   &H00C0C0C0&
  132.             BevelOuter      =   1  'Inset
  133.             Caption         =   "Panel3D2"
  134.             Font3D          =   0  'None
  135.             ForeColor       =   &H00000000&
  136.             Height          =   335
  137.             Left            =   315
  138.             TabIndex        =   11
  139.             Top             =   1125
  140.             Width           =   3110
  141.             Begin TextBox txtTo 
  142.                Height          =   300
  143.                Left            =   15
  144.                TabIndex        =   6
  145.                Top             =   15
  146.                Width           =   3075
  147.             End
  148.          End
  149.          Begin Label lblFrom 
  150.             BackColor       =   &H00C0C0C0&
  151.             Caption         =   "&From:"
  152.             Height          =   240
  153.             Left            =   315
  154.             TabIndex        =   3
  155.             Top             =   270
  156.             Width           =   1455
  157.          End
  158.          Begin Label lblTo 
  159.             BackColor       =   &H00C0C0C0&
  160.             Caption         =   "&To:"
  161.             Height          =   195
  162.             Left            =   315
  163.             TabIndex        =   5
  164.             Top             =   900
  165.             Width           =   1410
  166.          End
  167.       End
  168.    End
  169. Option Explicit      ' Require variable declaration.
  170. Sub cmdCancel_Click ()
  171.    TerminateApplication
  172. End Sub
  173. Sub cmdOK_Click ()
  174.    Dim iResSelection As Integer, sFrom As String, sTo As String
  175.    If optAllResources.Value = True Then
  176.       iResSelection = ALL_RESOURCES
  177.    ElseIf optOneResource.Value = True Then
  178.       If cboResources.Enabled = True Then
  179.          iResSelection = cboResources.ListIndex
  180.       End If
  181.    End If
  182.    sFrom = txtFrom.Text
  183.    sTo = txtTo.Text
  184.    On Error GoTo cmdOk_ClickError
  185.    SetParameters iResSelection, sFrom, sTo
  186.    gbDTIF = False
  187.    DisplayTInfoForm
  188.    Exit Sub
  189. cmdOk_ClickError:
  190.    Select Case Err
  191.       Case ERR_NO_RES_SELECTION
  192.          Beep
  193.          MsgBox MB_NO_RES_SELECTION, MB_ICONEXCLAMATION, MB_TIMESHEET
  194.       Case ERR_FROMDATE
  195.          Beep
  196.          MsgBox MB_FROMDATE, MB_ICONEXCLAMATION, MB_TIMESHEET
  197.          txtFrom.SelStart = 0
  198.          txtFrom.SelLength = 32000
  199.          txtFrom.SetFocus
  200.       Case ERR_TODATE
  201.          Beep
  202.          MsgBox MB_TODATE, MB_ICONEXCLAMATION, MB_TIMESHEET
  203.          txtTo.SelStart = 0
  204.          txtTo.SelLength = 32000
  205.          txtTo.SetFocus
  206.       Case ERR_BAD_DATE_ORDER
  207.          Beep
  208.          MsgBox MB_BAD_DATE_ORDER, MB_ICONEXCLAMATION, MB_TIMESHEET
  209.       Case ERR_BAD_DATE_RANGE
  210.          Beep
  211.          MsgBox MB_BAD_DATE_RANGE, MB_ICONEXCLAMATION, MB_TIMESHEET
  212.       Case ERR_BAD_PARAM
  213.          'In this case, we'll default to "all resources"
  214.          iResSelection = ALL_RESOURCES
  215.          Resume
  216.       Case Else
  217.          Beep
  218.          MsgBox MB_GENERIC_ERROR + " Err#" + Str$(Err), MB_ICONEXCLAMATION, MB_TIMESHEET
  219.          TerminateApplication
  220.    End Select
  221.    Exit Sub
  222. End Sub
  223. Sub Form_Load ()
  224. ' Size and position the main 3D panel.
  225. pnlMain.Top = 0
  226. pnlMain.Left = 0
  227. pnlMain.Width = frmOptions.ScaleWidth
  228. pnlMain.Height = frmOptions.ScaleHeight
  229. ' Center the form on the screen.
  230. frmOptions.Top = (Screen.Height - frmOptions.Height) / 2
  231. frmOptions.Left = (Screen.Width - frmOptions.Width) / 2
  232. End Sub
  233. Sub optAllResources_Click (Value As Integer)
  234.    cboResources.ListIndex = -1
  235.    cboResources.Enabled = False
  236. End Sub
  237. Sub optOneResource_Click (Value As Integer)
  238.    If LoadResourceCombo(Me!cboResources) Then
  239.       cboResources.Enabled = True
  240.       ' Selects the first resource in the list, unless the user
  241.       'has previously made a selection.
  242.       If cboResources.ListIndex = -1 Then
  243.          cboResources.ListIndex = 0
  244.       End If
  245.    End If
  246. End Sub
  247. Sub txtTo_Change ()
  248. If Len(txtTo.Text) > 2 Then
  249.    cmdOK.Enabled = True
  250.    cmdOK.Enabled = False
  251. End If
  252. End Sub
  253.