home *** CD-ROM | disk | FTP | other *** search
/ Programming Tool Box / SIMS_2.iso / vb_tools / manythng / setup.frm < prev    next >
Text File  |  1994-09-28  |  14KB  |  463 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. End
  242. Option Explicit
  243.  
  244. Sub cmdCancel_Click ()
  245.     
  246.     End ' end program
  247.  
  248. End Sub
  249.  
  250. Sub cmdOK_Click ()
  251.     Dim i As Integer
  252.     Dim File As Integer
  253.  
  254.     If FastPaletteCycleCheck.Value = 1 Then
  255.         FastPaletteCycleFlag = 1
  256.     Else
  257.         FastPaletteCycleFlag = 0
  258.     End If
  259.  
  260.     If RandomFlagCheck.Value = 1 Then
  261.         RandomFlag = 1
  262.     Else
  263.         RandomFlag = 0
  264.     End If
  265.  
  266.     If LowMemoryCheck.Value = 1 Then
  267.         LowMemoryFlag = 1
  268.     Else
  269.         LowMemoryFlag = 0
  270.     End If
  271.  
  272.     'remove trailing \ from directory
  273.     If Right$(txtBmpsDir, 1) = "\" Then
  274.       txtBmpsDir = Left$(txtBmpsDir, Len(txtBmpsDir) - 1)
  275.     End If
  276.  
  277.     'remove trailing \ from directory
  278.     If Right$(txtCycleBmpsDir, 1) = "\" Then
  279.       txtCycleBmpsDir = Left$(txtCycleBmpsDir, Len(txtCycleBmpsDir) - 1)
  280.     End If
  281.  
  282.     ' store setup data in control.ini
  283.     i = WritePrivateProfileString(secName, keyName, txtMaxLines, iniName)
  284.     i = WritePrivateProfileString(secName, RepeatName, txtRepeatCount, iniName)
  285.     i = WritePrivateProfileString(secName, ChangeMinutesName, txtChangeMin, iniName)
  286.     i = WritePrivateProfileString(secName, MaxCumsName, txtMaxCums, iniName)
  287.     i = WritePrivateProfileString(secName, BmpsDirName, txtBmpsDir, iniName)
  288.     i = WritePrivateProfileString(secName, CycleBmpsDirName, txtCycleBmpsDir, iniName)
  289.     i = WritePrivateProfileString(secName, BmpSecondsName, txtBmpSeconds, iniName)
  290.     i = WritePrivateProfileString(secName, RandomFlagName, Str$(RandomFlag), iniName)
  291.     i = WritePrivateProfileString(secName, FastPaletteCycleName, Str$(FastPaletteCycleFlag), iniName)
  292.     i = WritePrivateProfileString(secName, LowMemoryFlagName, Str$(LowMemoryFlag), iniName)
  293.     i = WritePrivateProfileString(secName, StartSaverName, txtStartSaver, iniName)
  294.  
  295.     Call encode
  296.     i = WritePrivateProfileString(secName, PasswordName, PasswdScram, iniName)
  297.  
  298.     Dim FileName As String
  299.  
  300.     ' look for bmps
  301.     i = 0'set to non-zero on error
  302.     On Error GoTo CmdOK_Error
  303.     FileName = Dir$(txtBmpsDir & "\*.bmp")
  304.     On Error GoTo 0
  305.     If FileName = "" Then
  306.         i = 1
  307.     End If
  308.     
  309.     If i <> 0 Then 'if bmp not found look for gifs
  310.       i = 0
  311.       On Error GoTo CmdOK_Error
  312.       FileName = Dir$(txtBmpsDir & "\*.gif")
  313.       On Error GoTo 0
  314.       If FileName = "" Then
  315.         i = 1
  316.       End If
  317.     End If
  318.     
  319.     If i <> 0 Then 'if gif not found look for dibs
  320.       i = 0
  321.       On Error GoTo CmdOK_Error
  322.       FileName = Dir$(txtBmpsDir & "\*.dib")
  323.       On Error GoTo 0
  324.       If FileName = "" Then
  325.         i = 1
  326.       End If
  327.     End If
  328.  
  329.     If i = 1 Then
  330.       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"
  331.     ElseIf i = 2 Then
  332.       MsgBox "Directory not found at:" + Chr$(10) + txtBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for slide show", 48, "Many Things"
  333.     End If
  334.     
  335.     'look for gifs
  336.     i = 0'set to non-zero on error
  337.     On Error GoTo CmdOK_Error
  338.     FileName = Dir$(txtCycleBmpsDir & "\*.gif")
  339.     On Error GoTo 0
  340.     If FileName = "" Then
  341.         i = 1
  342.     End If
  343.     
  344.     If i = 1 Then
  345.       MsgBox "GIFs not found in:" + Chr$(10) + txtCycleBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for palette cycling", 48, "Many Things"
  346.     ElseIf i = 2 Then
  347.       MsgBox "Directory not found at:" + Chr$(10) + txtCycleBmpsDir + Chr$(10) + "Need to change location" + Chr$(10) + "of graphics for palette cycling", 48, "Many Things"
  348.     End If
  349.     
  350.     End ' end program
  351.  
  352. CmdOK_Error:
  353.     ' could not find path
  354.     On Error GoTo 0
  355.     i = 2: FileName = "X"
  356.     Resume Next
  357. '1001 MsgBox "Directory not found" + Chr$(10) + "for location of bitmaps:" + Chr$(10) + txtBmpsDir + "\", 48, "Many Things"
  358.     End
  359.  
  360. End Sub
  361.  
  362. Sub Form_Load ()
  363.     txtMaxLines = maxLines      ' Set to current max lines
  364.     txtRepeatCount = RepeatCount
  365.     txtChangeMin = MaxChangeMinutes
  366.     txtMaxCums = MaxCums
  367.     txtMaxLines.SelLength = 3   ' Select the current value
  368.     txtBmpsDir = BitmapsDir
  369.     txtCycleBmpsDir = CycleBitmapsDir
  370.     txtBmpSeconds = BmpSeconds
  371.  
  372.     If RandomFlag <> 0 Then
  373.       RandomFlagCheck.Value = 1
  374.     Else
  375.       RandomFlagCheck.Value = 0
  376.     End If
  377.  
  378.     If LowMemoryFlag <> 0 Then
  379.       LowMemoryCheck.Value = 1
  380.     Else
  381.       LowMemoryCheck.Value = 0
  382.     End If
  383.     
  384.     If FastPaletteCycleFlag <> 0 Then
  385.         FastPaletteCycleCheck.Value = 1
  386.     Else
  387.         FastPaletteCycleCheck.Value = 0
  388.     End If
  389.  
  390.     txtStartSaver = StartSaver
  391.  
  392. End Sub
  393.  
  394. Sub Password_Button_Click ()
  395.  
  396.   Password.Show 1
  397.  
  398. End Sub
  399.  
  400. Sub Password_Click ()
  401.  
  402.   Password.Show
  403.  
  404. End Sub
  405.  
  406. Sub txtBmpSeconds_KeyPress (KeyAscii As Integer)
  407.     If KeyAscii < 32 Then
  408.         '                       ' Let Ctrl keys pass through
  409.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  410.         KeyAscii = 0            ' Discard chars other than digits
  411.     End If
  412.  
  413. End Sub
  414.  
  415. Sub txtChangeMin_KeyPress (KeyAscii As Integer)
  416.     If KeyAscii < 32 Then
  417.         '                       ' Let Ctrl keys pass through
  418.     ElseIf KeyAscii = Asc(".") Then ' only 1 decimal
  419.       If InStr(txtChangeMin, ".") > 0 Then
  420.         KeyAscii = 0            ' Discard extra decimals
  421.       End If
  422.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  423.         KeyAscii = 0            ' Discard chars other than digits
  424.     End If
  425.  
  426. End Sub
  427.  
  428. Sub txtMaxCums_KeyPress (KeyAscii As Integer)
  429.     If KeyAscii < 32 Then
  430.         '                       ' Let Ctrl keys pass through
  431.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  432.         KeyAscii = 0            ' Discard chars other than digits
  433.     End If
  434.  
  435. End Sub
  436.  
  437. Sub txtMaxLines_KeyPress (KeyAscii As Integer)
  438.     If KeyAscii < 32 Then
  439.         '                       ' Let Ctrl keys pass through
  440.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  441.         KeyAscii = 0            ' Discard chars other than digits
  442.     End If
  443. End Sub
  444.  
  445. Sub txtRepeatCount_KeyPress (KeyAscii As Integer)
  446.     If KeyAscii < 32 Then
  447.         '                       ' Let Ctrl keys pass through
  448.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  449.         KeyAscii = 0            ' Discard chars other than digits
  450.     End If
  451.  
  452. End Sub
  453.  
  454. Sub TxtStartSaver_KeyPress (KeyAscii As Integer)
  455.     If KeyAscii < 32 Then
  456.         '                       ' Let Ctrl keys pass through
  457.     ElseIf KeyAscii < Asc("0") Or KeyAscii > Asc("9") Then
  458.         KeyAscii = 0            ' Discard chars other than digits
  459.     End If
  460.  
  461. End Sub
  462.  
  463.