home *** CD-ROM | disk | FTP | other *** search
/ Computerworld 1996 March / Computerworld_1996-03_cd.bin / idg_cd3 / utility / ssetup26 / choice2.fr_ / CHOICE2.FRM (.txt)
Encoding:
Visual Basic Form  |  1995-07-27  |  17.8 KB  |  578 lines

  1. VERSION 2.00
  2. Begin Form Form4 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "Installation options..."
  6.    ClientHeight    =   4200
  7.    ClientLeft      =   1320
  8.    ClientTop       =   2112
  9.    ClientWidth     =   6372
  10.    ControlBox      =   0   'False
  11.    Height          =   4524
  12.    Left            =   1272
  13.    LinkMode        =   1  'Source
  14.    LinkTopic       =   "Form4"
  15.    MaxButton       =   0   'False
  16.    MinButton       =   0   'False
  17.    ScaleHeight     =   4200
  18.    ScaleWidth      =   6372
  19.    Top             =   1836
  20.    Width           =   6468
  21.    Begin CommandButton Commande2 
  22.       Caption         =   "&Abort"
  23.       Height          =   375
  24.       Left            =   5040
  25.       TabIndex        =   1
  26.       Top             =   720
  27.       Width           =   1215
  28.    End
  29.    Begin CommandButton Commande1 
  30.       Caption         =   "OK"
  31.       Height          =   375
  32.       Left            =   5040
  33.       TabIndex        =   0
  34.       Top             =   240
  35.       Width           =   1215
  36.    End
  37.    Begin Frame Cadre1 
  38.       BackColor       =   &H00C0C0C0&
  39.       Caption         =   "Install... "
  40.       Height          =   3375
  41.       Left            =   120
  42.       TabIndex        =   6
  43.       Top             =   120
  44.       Width           =   4815
  45.       Begin CheckBox Coche8 
  46.          BackColor       =   &H00C0C0C0&
  47.          Caption         =   "Coche8"
  48.          Height          =   255
  49.          Left            =   120
  50.          TabIndex        =   14
  51.          Top             =   2880
  52.          Visible         =   0   'False
  53.          Width           =   3375
  54.       End
  55.       Begin CheckBox Coche7 
  56.          BackColor       =   &H00C0C0C0&
  57.          Caption         =   "Coche7"
  58.          Height          =   255
  59.          Left            =   120
  60.          TabIndex        =   13
  61.          Top             =   2520
  62.          Visible         =   0   'False
  63.          Width           =   3375
  64.       End
  65.       Begin CheckBox Coche6 
  66.          BackColor       =   &H00C0C0C0&
  67.          Caption         =   "Coche6"
  68.          Height          =   255
  69.          Left            =   120
  70.          TabIndex        =   12
  71.          Top             =   2160
  72.          Visible         =   0   'False
  73.          Width           =   3375
  74.       End
  75.       Begin CheckBox Coche5 
  76.          BackColor       =   &H00C0C0C0&
  77.          Caption         =   "Coche5"
  78.          Height          =   255
  79.          Left            =   120
  80.          TabIndex        =   11
  81.          Top             =   1800
  82.          Visible         =   0   'False
  83.          Width           =   3375
  84.       End
  85.       Begin CheckBox Coche4 
  86.          BackColor       =   &H00C0C0C0&
  87.          Caption         =   "Coche4"
  88.          Height          =   255
  89.          Left            =   120
  90.          TabIndex        =   10
  91.          Top             =   1440
  92.          Visible         =   0   'False
  93.          Width           =   3375
  94.       End
  95.       Begin CheckBox Coche3 
  96.          BackColor       =   &H00C0C0C0&
  97.          Caption         =   "Coche3"
  98.          Height          =   255
  99.          Left            =   120
  100.          TabIndex        =   9
  101.          Top             =   1080
  102.          Visible         =   0   'False
  103.          Width           =   3375
  104.       End
  105.       Begin CheckBox Coche2 
  106.          BackColor       =   &H00C0C0C0&
  107.          Caption         =   "Coche2"
  108.          Height          =   255
  109.          Left            =   120
  110.          TabIndex        =   8
  111.          Top             =   720
  112.          Visible         =   0   'False
  113.          Width           =   3375
  114.       End
  115.       Begin CheckBox Coche1 
  116.          BackColor       =   &H00C0C0C0&
  117.          Caption         =   "Coche1"
  118.          Height          =   255
  119.          Left            =   120
  120.          TabIndex        =   7
  121.          Top             =   360
  122.          Visible         =   0   'False
  123.          Width           =   3375
  124.       End
  125.       Begin Label Etiquette10 
  126.          Alignment       =   1  'Right Justify
  127.          BackColor       =   &H00C0C0C0&
  128.          Height          =   255
  129.          Left            =   3600
  130.          TabIndex        =   22
  131.          Top             =   2880
  132.          Visible         =   0   'False
  133.          Width           =   1095
  134.       End
  135.       Begin Label Etiquette9 
  136.          Alignment       =   1  'Right Justify
  137.          BackColor       =   &H00C0C0C0&
  138.          Height          =   255
  139.          Left            =   3600
  140.          TabIndex        =   21
  141.          Top             =   2520
  142.          Visible         =   0   'False
  143.          Width           =   1095
  144.       End
  145.       Begin Label Etiquette8 
  146.          Alignment       =   1  'Right Justify
  147.          BackColor       =   &H00C0C0C0&
  148.          Height          =   255
  149.          Left            =   3600
  150.          TabIndex        =   20
  151.          Top             =   2160
  152.          Visible         =   0   'False
  153.          Width           =   1095
  154.       End
  155.       Begin Label Etiquette7 
  156.          Alignment       =   1  'Right Justify
  157.          BackColor       =   &H00C0C0C0&
  158.          Height          =   255
  159.          Left            =   3600
  160.          TabIndex        =   19
  161.          Top             =   1800
  162.          Visible         =   0   'False
  163.          Width           =   1095
  164.       End
  165.       Begin Label Etiquette6 
  166.          Alignment       =   1  'Right Justify
  167.          BackColor       =   &H00C0C0C0&
  168.          Height          =   255
  169.          Left            =   3600
  170.          TabIndex        =   18
  171.          Top             =   1440
  172.          Visible         =   0   'False
  173.          Width           =   1095
  174.       End
  175.       Begin Label Etiquette5 
  176.          Alignment       =   1  'Right Justify
  177.          BackColor       =   &H00C0C0C0&
  178.          Height          =   255
  179.          Left            =   3600
  180.          TabIndex        =   17
  181.          Top             =   1080
  182.          Visible         =   0   'False
  183.          Width           =   1095
  184.       End
  185.       Begin Label Etiquette4 
  186.          Alignment       =   1  'Right Justify
  187.          BackColor       =   &H00C0C0C0&
  188.          Height          =   255
  189.          Left            =   3600
  190.          TabIndex        =   16
  191.          Top             =   720
  192.          Visible         =   0   'False
  193.          Width           =   1095
  194.       End
  195.       Begin Label Etiquette3 
  196.          Alignment       =   1  'Right Justify
  197.          BackColor       =   &H00C0C0C0&
  198.          Height          =   255
  199.          Left            =   3600
  200.          TabIndex        =   15
  201.          Top             =   360
  202.          Visible         =   0   'False
  203.          Width           =   1095
  204.       End
  205.    End
  206.    Begin Label FreeLabel 
  207.       Alignment       =   1  'Right Justify
  208.       BackColor       =   &H00C0C0C0&
  209.       Caption         =   "K"
  210.       Height          =   255
  211.       Left            =   3360
  212.       TabIndex        =   5
  213.       Top             =   3840
  214.       Width           =   1455
  215.    End
  216.    Begin Label Etiquette2 
  217.       BackColor       =   &H00C0C0C0&
  218.       Caption         =   "Free disk space (Kb.):"
  219.       Height          =   255
  220.       Left            =   240
  221.       TabIndex        =   3
  222.       Top             =   3840
  223.       Width           =   3255
  224.    End
  225.    Begin Label SelLabel 
  226.       Alignment       =   1  'Right Justify
  227.       BackColor       =   &H00C0C0C0&
  228.       Caption         =   "K"
  229.       Height          =   255
  230.       Left            =   3240
  231.       TabIndex        =   4
  232.       Top             =   3600
  233.       Width           =   1575
  234.    End
  235.    Begin Label Etiquette1 
  236.       BackColor       =   &H00C0C0C0&
  237.       Caption         =   "Required disk space (Kb.):"
  238.       Height          =   255
  239.       Left            =   240
  240.       TabIndex        =   2
  241.       Top             =   3600
  242.       Width           =   3255
  243.    End
  244. Sub Coche1_Click ()
  245. '---------------------------------------------------
  246. ' Add or remove a group
  247. ' and change the selection size
  248. '---------------------------------------------------
  249. a% = 1
  250. If (Coche1.Value = 0) Then
  251.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  252.  Section(a%).bSelected% = 0
  253.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  254.  Section(a%).bSelected% = 1
  255. End If
  256. If (iLanguage% = LANGUAGE_FRENCH) Then
  257.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  258.  If (Section(a%).bSelected% = 1) Then
  259.   Etiquette3.Caption = Str$(UserConfigSize&) + " Ko."
  260.  End If
  261.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  262.  If (Section(a%).bSelected% = 1) Then
  263.   Etiquette3.Caption = Str$(UserConfigSize&) + " Kb."
  264.  End If
  265. End If
  266. If (Section(a%).bSelected% = 0) Then
  267.  Etiquette3.Caption = ""
  268. End If
  269. End Sub
  270. Sub Coche2_Click ()
  271. a% = 2
  272. If (Coche2.Value = 0) Then
  273.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  274.  Section(a%).bSelected% = 0
  275.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  276.  Section(a%).bSelected% = 1
  277. End If
  278. If (iLanguage% = LANGUAGE_FRENCH) Then
  279.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  280.  If (Section(a%).bSelected% = 1) Then
  281.   Etiquette4.Caption = Str$(UserConfigSize&) + " Ko."
  282.  End If
  283.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  284.  If (Section(a%).bSelected% = 1) Then
  285.   Etiquette4.Caption = Str$(UserConfigSize&) + " Kb."
  286.  End If
  287. End If
  288. If (Section(a%).bSelected% = 0) Then
  289.  Etiquette4.Caption = ""
  290. End If
  291. End Sub
  292. Sub Coche3_Click ()
  293. a% = 3
  294. If (Coche3.Value = 0) Then
  295.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  296.  Section(a%).bSelected% = 0
  297.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  298.  Section(a%).bSelected% = 1
  299. End If
  300. If (iLanguage% = LANGUAGE_FRENCH) Then
  301.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  302.  If (Section(a%).bSelected% = 1) Then
  303.   Etiquette5.Caption = Str$(UserConfigSize&) + " Ko."
  304.  End If
  305.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  306.  If (Section(a%).bSelected% = 1) Then
  307.   Etiquette5.Caption = Str$(UserConfigSize&) + " Kb."
  308.  End If
  309. End If
  310. If (Section(a%).bSelected% = 0) Then
  311.  Etiquette5.Caption = ""
  312. End If
  313. End Sub
  314. Sub Coche4_Click ()
  315. a% = 4
  316. If (Coche4.Value = 0) Then
  317.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  318.  Section(a%).bSelected% = 0
  319.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  320.  Section(a%).bSelected% = 1
  321. End If
  322. If (iLanguage% = LANGUAGE_FRENCH) Then
  323.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  324.  If (Section(a%).bSelected% = 1) Then
  325.   Etiquette6.Caption = Str$(UserConfigSize&) + " Ko."
  326.  End If
  327.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  328.  If (Section(a%).bSelected% = 1) Then
  329.   Etiquette6.Caption = Str$(UserConfigSize&) + " Kb."
  330.  End If
  331. End If
  332. If (Section(a%).bSelected% = 0) Then
  333.  Etiquette6.Caption = ""
  334. End If
  335. End Sub
  336. Sub Coche5_Click ()
  337. a% = 5
  338. If (Coche5.Value = 0) Then
  339.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  340.  Section(a%).bSelected% = 0
  341.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  342.  Section(a%).bSelected% = 1
  343. End If
  344. If (iLanguage% = LANGUAGE_FRENCH) Then
  345.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  346.  If (Section(a%).bSelected% = 1) Then
  347.   Etiquette7.Caption = Str$(UserConfigSize&) + " Ko."
  348.  End If
  349.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  350.  If (Section(a%).bSelected% = 1) Then
  351.   Etiquette7.Caption = Str$(UserConfigSize&) + " Kb."
  352.  End If
  353. End If
  354. If (Section(a%).bSelected% = 0) Then
  355.  Etiquette7.Caption = ""
  356. End If
  357. End Sub
  358. Sub Coche6_Click ()
  359. a% = 6
  360. If (Coche6.Value = 0) Then
  361.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  362.  Section(a%).bSelected% = 0
  363.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  364.  Section(a%).bSelected% = 1
  365. End If
  366. If (iLanguage% = LANGUAGE_FRENCH) Then
  367.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  368.  If (Section(a%).bSelected% = 1) Then
  369.   Etiquette8.Caption = Str$(UserConfigSize&) + " Ko."
  370.  End If
  371.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  372.  If (Section(a%).bSelected% = 1) Then
  373.   Etiquette8.Caption = Str$(UserConfigSize&) + " Kb."
  374.  End If
  375. End If
  376. If (Section(a%).bSelected% = 0) Then
  377.  Etiquette8.Caption = ""
  378. End If
  379. End Sub
  380. Sub Coche7_Click ()
  381. a% = 7
  382. If (Coche7.Value = 0) Then
  383.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  384.  Section(a%).bSelected% = 0
  385.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  386.  Section(a%).bSelected% = 1
  387. End If
  388. If (iLanguage% = LANGUAGE_FRENCH) Then
  389.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  390.  If (Section(a%).bSelected% = 1) Then
  391.   Etiquette9.Caption = Str$(UserConfigSize&) + " Ko."
  392.  End If
  393.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  394.  If (Section(a%).bSelected% = 1) Then
  395.   Etiquette9.Caption = Str$(UserConfigSize&) + " Kb."
  396.  End If
  397. End If
  398. If (Section(a%).bSelected% = 0) Then
  399.  Etiquette9.Caption = ""
  400. End If
  401. End Sub
  402. Sub Coche8_Click ()
  403. a% = 8
  404. If (Coche8.Value = 0) Then
  405.  UserConfigSize& = UserConfigSize& - Section(a%).lSize&
  406.  Section(a%).bSelected% = 0
  407.  UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  408.  Section(a%).bSelected% = 1
  409. End If
  410. If (iLanguage% = LANGUAGE_FRENCH) Then
  411.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  412.  If (Section(a%).bSelected% = 1) Then
  413.   Etiquette10.Caption = Str$(UserConfigSize&) + " Ko."
  414.  End If
  415.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  416.  If (Section(a%).bSelected% = 1) Then
  417.   Etiquette10.Caption = Str$(UserConfigSize&) + " Kb."
  418.  End If
  419. End If
  420. If (Section(a%).bSelected% = 0) Then
  421.  Etiquette10.Caption = ""
  422. End If
  423. End Sub
  424. Sub Commande1_Click ()
  425. If (UserConfigSize& > AskForDriveSpace(GetDriveNumber(UserPath$))) Then
  426.  Beep
  427.  If (iLanguage% = LANGUAGE_FRENCH) Then
  428.   MsgBox "Il n' a pas assez d' espace disponible pour cette s
  429. lection!"
  430.  Else
  431.   MsgBox "Not enough free disk space!"
  432.  End If
  433. Exit Sub
  434. End If
  435. '---------------------------------------------------
  436. ' We actually add the groups to install depending
  437. ' on the selected groups
  438. '---------------------------------------------------
  439. For a% = 1 To 8
  440. If (Section(a%).bSelected% = 1) Then
  441.  TempPath$ = UserPath$
  442.  If (Section(a%).Directory <> "") Then
  443.   TempPath$ = TempPath$ + Section(a%).Directory$
  444.  End If
  445.  b% = AddSectionToCopyList(Section(a%).Name$, TempPath$)
  446. End If
  447. Next a%
  448. bUserAbort% = 0
  449. bIsSetupOK% = 1
  450. OptionCanClose% = 1
  451. Unload Form4
  452. End Sub
  453. Sub Commande2_Click ()
  454. If (iLanguage% = LANGUAGE_FRENCH) Then
  455. a% = MsgBox("Etes vous certain de vouloir abandonner l' installation?", 36)
  456. a% = MsgBox("Are you sure you wish to cancel this installation?", 36)
  457. End If
  458. If (a% = 6) Then
  459. OptionCanClose% = 1
  460. bIsSetupOK% = 0
  461. bUserAbort% = 1
  462. Unload Form4
  463. End If
  464. End Sub
  465. Sub Form_Load ()
  466. 'Form4.Move (Screen.Height / 2) - (Height / 2), (Screen.Width / 2) - (Width / 2), Width, Height
  467. Form4.Move (Screen.Width / 2) - (Width / 2), (Screen.Height / 2) - (Height / 2), Width, Height
  468. Form4.Caption = Dialog2Title$
  469. If (iLanguage% = LANGUAGE_FRENCH) Then
  470. Commande2.Caption = "&Abandonner"
  471. Cadre1.Caption = "Installer... "
  472. Etiquette1.Caption = "Taille de la s
  473. lection:"
  474. Etiquette2.Caption = "Espace disponible:"
  475. End If
  476. '-------------------------------------------------------
  477. 'CheckBoxes initialization
  478. '-------------------------------------------------------
  479. If (NumberOfSections% > 8) Then
  480.  Beep
  481.  MsgBox "This sample program doesn' t use more than 8 sections!"
  482.  Exit Sub
  483. End If
  484. UserConfigSize& = 0
  485. For a% = 1 To NumberOfSections%
  486.  If (Section(a%).Name$ <> "") Then
  487.   Section(a%).lSize& = GetSectionSize(Section(a%).Name$)
  488.   szTempSize$ = Str$(Section(a%).lSize&)
  489.   If (Section(a%).bSelected% = 1) Then
  490.    UserConfigSize& = UserConfigSize& + Section(a%).lSize&
  491.   End If
  492.  If (iLanguage% = LANGUAGE_FRENCH) Then
  493.   szTempSize$ = szTempSize$ + " Ko."
  494.  Else
  495.   szTempSize$ = szTempSize$ + " Kb."
  496.  End If
  497.  If (iLanguage% = LANGUAGE_FRENCH) Then
  498.   szTempLabel$ = Section(a%).FLabel$
  499.  Else
  500.   szTempLabel$ = Section(a%).ELabel$
  501.  End If
  502.  'You probably will enhance this very bad method to enable the checkboxes...
  503.  If (a% = 1) Then
  504.   Coche1.Visible = 1
  505.   Etiquette3.Visible = 1
  506.   Coche1.Caption = szTempLabel$
  507.   If (Section(a%).bSelected% = 1) Then
  508.      Coche1.Value = 1
  509.      Etiquette3.Caption = szTempSize$
  510.   End If
  511.  ElseIf (a% = 2) Then
  512.   Coche2.Visible = 1
  513.   Etiquette4.Visible = 1
  514.   Coche2.Caption = szTempLabel$
  515.   If (Section(a%).bSelected% = 1) Then
  516.     Coche2.Value = 1
  517.     Etiquette4.Caption = szTempSize$
  518.   End If
  519.  ElseIf (a% = 3) Then
  520.   Coche3.Visible = 1
  521.   Etiquette5.Visible = 1
  522.   Coche3.Caption = szTempLabel$
  523.   If (Section(a%).bSelected% = 1) Then
  524.     Coche3.Value = 1
  525.     Etiquette5.Caption = szTempSize$
  526.   End If
  527.  ElseIf (a% = 4) Then
  528.   Coche4.Visible = 1
  529.   Etiquette6.Visible = 1
  530.   Coche4.Caption = szTempLabel$
  531.   If (Section(a%).bSelected% = 1) Then
  532.     Coche4.Value = 1
  533.     Etiquette6.Caption = szTempSize$
  534.   End If
  535.  ElseIf (a% = 5) Then
  536.   Coche5.Visible = 1
  537.   Etiquette7.Visible = 1
  538.   Coche5.Caption = szTempLabel$
  539.   If (Section(a%).bSelected% = 1) Then
  540.     Coche5.Value = 1
  541.     Etiquette7.Caption = szTempSize$
  542.   End If
  543.  ElseIf (a% = 6) Then
  544.   Coche6.Visible = 1
  545.   Etiquette8.Visible = 1
  546.   Coche6.Caption = szTempLabel$
  547.   If (Section(a%).bSelected% = 1) Then
  548.     Coche6.Value = 1
  549.     Etiquette8.Caption = szTempSize$
  550.   End If
  551.  ElseIf (a% = 7) Then
  552.   Coche7.Visible = 1
  553.   Etiquette9.Visible = 1
  554.   Coche7.Caption = szTempLabel$
  555.   If (Section(a%).bSelected% = 1) Then
  556.     Coche7.Value = 1
  557.     Etiquette9.Caption = szTempSize$
  558.   End If
  559.  Else
  560.   Coche8.Visible = 1
  561.   Etiquette10.Visible = 1
  562.   Coche8.Caption = szTempLabel$
  563.   If (Section(a%).bSelected% = 1) Then
  564.     Coche8.Value = 1
  565.     Etiquette10.Caption = szTempSize$
  566.   End If
  567.  End If
  568. End If
  569. Next a%
  570. lFreeDiskSpace& = AskForDriveSpace(GetDriveNumber(UserPath))
  571. If (iLanguage% = LANGUAGE_FRENCH) Then
  572.  SelLabel.Caption = Str$(UserConfigSize&) + " Ko."
  573.  FreeLabel.Caption = Str$(lFreeDiskSpace&) + " Ko."
  574.  SelLabel.Caption = Str$(UserConfigSize&) + " Kb."
  575.  FreeLabel.Caption = Str$(lFreeDiskSpace&) + " Kb."
  576. End If
  577. End Sub
  578.