home *** CD-ROM | disk | FTP | other *** search
/ Resource for Source: C/C++ / Resource for Source - C-C++.iso / misc_src / manyth31 / setup.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-11-01  |  13.9 KB  |  417 lines

  1. VERSION 2.00
  2. Begin Form SetupForm 
  3.    BorderStyle     =   3  'Fixed Double
  4.    Caption         =   "Many Things"
  5.    ClientHeight    =   6165
  6.    ClientLeft      =   2310
  7.    ClientTop       =   1560
  8.    ClientWidth     =   5505
  9.    Height          =   6570
  10.    Left            =   2250
  11.    LinkTopic       =   "Form2"
  12.    MaxButton       =   0   'False
  13.    MinButton       =   0   'False
  14.    ScaleHeight     =   6165
  15.    ScaleWidth      =   5505
  16.    Top             =   1215
  17.    Width           =   5625
  18.    Begin CheckBox FastPaletteCycleCheck 
  19.       Caption         =   "Fast Palette Cycling"
  20.       Height          =   240
  21.       Left            =   2775
  22.       TabIndex        =   24
  23.       Top             =   4725
  24.       Width           =   2040
  25.    End
  26.    Begin TextBox txtCycleBmpsDir 
  27.       Height          =   360
  28.       Left            =   3150
  29.       TabIndex        =   22
  30.       Text            =   "c:\windows\cycle"
  31.       Top             =   4230
  32.       Width           =   2265
  33.    End
  34.    Begin CommandButton Password_Button 
  35.       Caption         =   "Password"
  36.       Height          =   375
  37.       Left            =   3600
  38.       TabIndex        =   11
  39.       Top             =   5490
  40.       Width           =   1185
  41.    End
  42.    Begin CheckBox LowMemoryCheck 
  43.       Caption         =   "Low Memory Mode"
  44.       Height          =   240
  45.       Left            =   300
  46.       TabIndex        =   7
  47.       Top             =   4725
  48.       Width           =   2115
  49.    End
  50.    Begin CheckBox RandomFlagCheck 
  51.       Caption         =   "Random Sequence"
  52.       Height          =   240
  53.       Left            =   300
  54.       TabIndex        =   8
  55.       Top             =   5100
  56.       Width           =   2130
  57.    End
  58.    Begin TextBox TxtStartSaver 
  59.       Height          =   315
  60.       Left            =   4815
  61.       TabIndex        =   5
  62.       Text            =   "0"
  63.       Top             =   3465
  64.       Width           =   615
  65.    End
  66.    Begin TextBox txtBmpSeconds 
  67.       Height          =   315
  68.       Left            =   4815
  69.       TabIndex        =   4
  70.       Text            =   "5"
  71.       Top             =   3105
  72.       Width           =   615
  73.    End
  74.    Begin TextBox txtBmpsDir 
  75.       Height          =   315
  76.       Left            =   3150
  77.       TabIndex        =   6
  78.       Text            =   "c:\windows"
  79.       Top             =   3825
  80.       Width           =   2280
  81.    End
  82.    Begin TextBox txtMaxCums 
  83.       Height          =   315
  84.       Left            =   4815
  85.       TabIndex        =   2
  86.       Text            =   "1000"
  87.       Top             =   2385
  88.       Width           =   615
  89.    End
  90.    Begin TextBox txtChangeMin 
  91.       Height          =   315
  92.       Left            =   4815
  93.       TabIndex        =   3
  94.       Text            =   "5"
  95.       Top             =   2745
  96.       Width           =   615
  97.    End
  98.    Begin TextBox txtRepeatCount 
  99.       Height          =   315
  100.       Left            =   4815
  101.       TabIndex        =   1
  102.       Text            =   "10"
  103.       Top             =   2025
  104.       Width           =   615
  105.    End
  106.    Begin TextBox txtMaxLines 
  107.       Height          =   315
  108.       Left            =   4815
  109.       TabIndex        =   0
  110.       Text            =   "100"
  111.       Top             =   1665
  112.       Width           =   615
  113.    End
  114.    Begin CommandButton cmdCancel 
  115.       Cancel          =   -1  'True
  116.       Caption         =   "Cancel"
  117.       Height          =   375
  118.       Left            =   2160
  119.       TabIndex        =   10
  120.       Top             =   5490
  121.       Width           =   1095
  122.    End
  123.    Begin CommandButton cmdOK 
  124.       Caption         =   "OK"
  125.       Default         =   -1  'True
  126.       Height          =   375
  127.       Left            =   675
  128.       TabIndex        =   9
  129.       Top             =   5490
  130.       Width           =   1140
  131.    End
  132.    Begin Label Label12 
  133.       Caption         =   "Dir. of GIFs for Palette Cyling:"
  134.       Height          =   240
  135.       Left            =   450
  136.       TabIndex        =   23
  137.       Top             =   4275
  138.       Width           =   2565
  139.    End
  140.    Begin Label Label11 
  141.       Caption         =   "Starting Saver (0=random):"
  142.       Height          =   225
  143.       Left            =   2430
  144.       TabIndex        =   21
  145.       Top             =   3510
  146.       Width           =   2325
  147.    End
  148.    Begin Label Label9 
  149.       Caption         =   "Seconds before changing pictures in slide show:"
  150.       Height          =   255
  151.       Left            =   690
  152.       TabIndex        =   20
  153.       Top             =   3150
  154.       Width           =   4170
  155.    End
  156.    Begin Label Label8 
  157.       Caption         =   "Dir. of BMPs + GIFs for slide show:"
  158.       Height          =   255
  159.       Left            =   75
  160.       TabIndex        =   19
  161.       Top             =   3870
  162.       Width           =   3015
  163.    End
  164.    Begin Label Label7 
  165.       Caption         =   "Maximum number of objects before clearing screen:"
  166.       Height          =   255
  167.       Left            =   300
  168.       TabIndex        =   18
  169.       Top             =   2430
  170.       Width           =   4485
  171.    End
  172.    Begin Label Label6 
  173.       Caption         =   "Minutes before changing to new saver:"
  174.       Height          =   255
  175.       Left            =   1350
  176.       TabIndex        =   17
  177.       Top             =   2775
  178.       Width           =   3375
  179.    End
  180.    Begin Label Label5 
  181.       Caption         =   "Number of new objects before changing colors:"
  182.       Height          =   255
  183.       Left            =   720
  184.       TabIndex        =   16
  185.       Top             =   2040
  186.       Width           =   4035
  187.    End
  188.    Begin Label Label4 
  189.       Caption         =   "Maximum number of objects before erasing old objects:"
  190.       Height          =   255
  191.       Left            =   90
  192.       TabIndex        =   15
  193.       Top             =   1710
  194.       Width           =   4740
  195.    End
  196.    Begin Image Image1 
  197.       Height          =   480
  198.       Left            =   180
  199.       Picture         =   SETUP.FRX:0000
  200.       Top             =   405
  201.       Width           =   480
  202.    End
  203.    Begin Label Label3 
  204.       Alignment       =   2  'Center
  205.       Caption         =   "Version 3.1"
  206.       FontBold        =   0   'False
  207.       FontItalic      =   0   'False
  208.       FontName        =   "Arial"
  209.       FontSize        =   8.25
  210.       FontStrikethru  =   0   'False
  211.       FontUnderline   =   0   'False
  212.       Height          =   240
  213.       Left            =   2100
  214.       TabIndex        =   14
  215.       Top             =   585
  216.       Width           =   1260
  217.    End
  218.    Begin Label Label2 
  219.       Caption         =   "Multiple Screen Savers by  Bruce McLean"
  220.       Height          =   255
  221.       Left            =   900
  222.       TabIndex        =   13
  223.       Top             =   225
  224.       Width           =   3765
  225.    End
  226.    Begin Label Label1 
  227.       Alignment       =   2  'Center
  228.       Caption         =   "This is a collection of screen savers that switch at regular intervals to add a bit of variety to the screen."
  229.       FontBold        =   0   'False
  230.       FontItalic      =   0   'False
  231.       FontName        =   "Arial"
  232.       FontSize        =   8.25
  233.       FontStrikethru  =   0   'False
  234.       FontUnderline   =   0   'False
  235.       Height          =   495
  236.       Left            =   780
  237.       TabIndex        =   12
  238.       Top             =   1005
  239.       Width           =   3855
  240.    End
  241. Option Explicit
  242. Sub cmdCancel_Click ()
  243.     End ' end program
  244. End Sub
  245. Sub cmdOK_Click ()
  246.     Dim i As Integer
  247.     Dim File As Integer
  248.     If FastPaletteCycleCheck.Value = 1 Then
  249.         FastPaletteCycleFlag = 1
  250.     Else
  251.         FastPaletteCycleFlag = 0
  252.     End If
  253.     If RandomFlagCheck.Value = 1 Then
  254.         RandomFlag = 1
  255.     Else
  256.         RandomFlag = 0
  257.     End If
  258.     If LowMemoryCheck.Value = 1 Then
  259.         LowMemoryFlag = 1
  260.     Else
  261.         LowMemoryFlag = 0
  262.     End If
  263.     'remove trailing \ from directory
  264.     If Right$(txtBmpsDir, 1) = "\" Then
  265.       txtBmpsDir = Left$(txtBmpsDir, Len(txtBmpsDir) - 1)
  266.     End If
  267.     'remove trailing \ from directory
  268.     If Right$(txtCycleBmpsDir, 1) = "\" Then
  269.       txtCycleBmpsDir = Left$(txtCycleBmpsDir, Len(txtCycleBmpsDir) - 1)
  270.     End If
  271.     ' store setup data in control.ini
  272.     i = WritePrivateProfileString(secName, keyName, txtMaxLines, iniName)
  273.     i = WritePrivateProfileString(secName, RepeatName, txtRepeatCount, iniName)
  274.     i = WritePrivateProfileString(secName, ChangeMinutesName, txtChangeMin, iniName)
  275.     i = WritePrivateProfileString(secName, MaxCumsName, txtMaxCums, iniName)
  276.     i = WritePrivateProfileString(secName, BmpsDirName, txtBmpsDir, iniName)
  277.     i = WritePrivateProfileString(secName, CycleBmpsDirName, txtCycleBmpsDir, iniName)
  278.     i = WritePrivateProfileString(secName, BmpSecondsName, txtBmpSeconds, iniName)
  279.     i = WritePrivateProfileString(secName, RandomFlagName, Str$(RandomFlag), iniName)
  280.     i = WritePrivateProfileString(secName, FastPaletteCycleName, Str$(FastPaletteCycleFlag), iniName)
  281.     i = WritePrivateProfileString(secName, LowMemoryFlagName, Str$(LowMemoryFlag), iniName)
  282.     i = WritePrivateProfileString(secName, StartSaverName, txtStartSaver, iniName)
  283.     Call encode
  284.     i = WritePrivateProfileString(secName, PasswordName, PasswdScram, iniName)
  285.     Dim FileName As String
  286.     ' look for bmps
  287.     i = 0'set to non-zero on error
  288.     On Error GoTo CmdOK_Error
  289.     FileName = Dir$(txtBmpsDir & "\*.bmp")
  290.     On Error GoTo 0
  291.     If FileName = "" Then
  292.         i = 1
  293.     End If
  294.     If i <> 0 Then 'if bmp not found look for gifs
  295.       i = 0
  296.       On Error GoTo CmdOK_Error
  297.       FileName = Dir$(txtBmpsDir & "\*.gif")
  298.       On Error GoTo 0
  299.       If FileName = "" Then
  300.         i = 1
  301.       End If
  302.     End If
  303.     If i <> 0 Then 'if gif not found look for dibs
  304.       i = 0
  305.       On Error GoTo CmdOK_Error
  306.       FileName = Dir$(txtBmpsDir & "\*.dib")
  307.       On Error GoTo 0
  308.       If FileName = "" Then
  309.         i = 1
  310.       End If
  311.     End If
  312.     If i = 1 Then
  313.       MsgBox "BMPs, GIFs, nor DIBs found in:" + Chr$(10) + txtBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for slide show", 48, "Many Things"
  314.     ElseIf i = 2 Then
  315.       MsgBox "Directory not found at:" + Chr$(10) + txtBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for slide show", 48, "Many Things"
  316.     End If
  317.     'look for gifs
  318.     i = 0'set to non-zero on error
  319.     On Error GoTo CmdOK_Error
  320.     FileName = Dir$(txtCycleBmpsDir & "\*.gif")
  321.     On Error GoTo 0
  322.     If FileName = "" Then
  323.         i = 1
  324.     End If
  325.     If i = 1 Then
  326.       MsgBox "GIFs not found in:" + Chr$(10) + txtCycleBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for palette cycling", 48, "Many Things"
  327.     ElseIf i = 2 Then
  328.       MsgBox "Directory not found at:" + Chr$(10) + txtCycleBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for palette cycling", 48, "Many Things"
  329.     End If
  330.     End ' end program
  331. CmdOK_Error:
  332.     ' could not find path
  333.     On Error GoTo 0
  334.     i = 2: FileName = "X"
  335.     Resume Next
  336. '1001 MsgBox "Directory not found" + Chr$(10) + "for location of bitmaps:" + Chr$(10) + txtBmpsDir + "\", 48, "Many Things"
  337.     End
  338. End Sub
  339. Sub Form_Load ()
  340.     txtMaxLines = maxLines      ' Set to current max lines
  341.     txtRepeatCount = RepeatCount
  342.     txtChangeMin = MaxChangeMinutes
  343.     txtMaxCums = MaxCums
  344.     txtMaxLines.SelLength = 3   ' Select the current value
  345.     txtBmpsDir = BitmapsDir
  346.     txtCycleBmpsDir = CycleBitmapsDir
  347.     txtBmpSeconds = BmpSeconds
  348.     If RandomFlag <> 0 Then
  349.       RandomFlagCheck.Value = 1
  350.     Else
  351.       RandomFlagCheck.Value = 0
  352.     End If
  353.     If LowMemoryFlag <> 0 Then
  354.       LowMemoryCheck.Value = 1
  355.     Else
  356.       LowMemoryCheck.Value = 0
  357.     End If
  358.     If FastPaletteCycleFlag <> 0 Then
  359.         FastPaletteCycleCheck.Value = 1
  360.     Else
  361.         FastPaletteCycleCheck.Value = 0
  362.     End If
  363.     txtStartSaver = StartSaver
  364. End Sub
  365. Sub Password_Button_Click ()
  366.   Password.Show 1
  367. End Sub
  368. Sub Password_Click ()
  369.   Password.Show
  370. End Sub
  371. Sub txtBmpSeconds_KeyPress (KeyAscii As Integer)
  372.     If KeyAscii < 32 Then
  373.         '                       ' Let Ctrl keys pass through
  374.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  375.         KeyAscii = 0            ' Discard chars other than digits
  376.     End If
  377. End Sub
  378. Sub txtChangeMin_KeyPress (KeyAscii As Integer)
  379.     If KeyAscii < 32 Then
  380.         '                       ' Let Ctrl keys pass through
  381.     ElseIf KeyAscii = Asc(".") Then ' only 1 decimal
  382.       If InStr(txtChangeMin, ".") > 0 Then
  383.         KeyAscii = 0            ' Discard extra decimals
  384.       End If
  385.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  386.         KeyAscii = 0            ' Discard chars other than digits
  387.     End If
  388. End Sub
  389. Sub txtMaxCums_KeyPress (KeyAscii As Integer)
  390.     If KeyAscii < 32 Then
  391.         '                       ' Let Ctrl keys pass through
  392.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  393.         KeyAscii = 0            ' Discard chars other than digits
  394.     End If
  395. End Sub
  396. Sub txtMaxLines_KeyPress (KeyAscii As Integer)
  397.     If KeyAscii < 32 Then
  398.         '                       ' Let Ctrl keys pass through
  399.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  400.         KeyAscii = 0            ' Discard chars other than digits
  401.     End If
  402. End Sub
  403. Sub txtRepeatCount_KeyPress (KeyAscii As Integer)
  404.     If KeyAscii < 32 Then
  405.         '                       ' Let Ctrl keys pass through
  406.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  407.         KeyAscii = 0            ' Discard chars other than digits
  408.     End If
  409. End Sub
  410. Sub TxtStartSaver_KeyPress (KeyAscii As Integer)
  411.     If KeyAscii < 32 Then
  412.         '                       ' Let Ctrl keys pass through
  413.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  414.         KeyAscii = 0            ' Discard chars other than digits
  415.     End If
  416. End Sub
  417.