home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / message / msgbox2 / frmcodeo.frm (.txt) < prev    next >
Encoding:
Visual Basic Form  |  1995-01-18  |  18.1 KB  |  540 lines

  1. VERSION 2.00
  2. Begin Form frmCodeOpts 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "Code Options"
  6.    ClientHeight    =   4296
  7.    ClientLeft      =   2112
  8.    ClientTop       =   1308
  9.    ClientWidth     =   5580
  10.    Height          =   4668
  11.    Left            =   2064
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    MinButton       =   0   'False
  15.    ScaleHeight     =   4296
  16.    ScaleWidth      =   5580
  17.    Top             =   984
  18.    Width           =   5676
  19.    Begin TextBox txtTabStop 
  20.       Height          =   288
  21.       Left            =   1440
  22.       MaxLength       =   2
  23.       TabIndex        =   1
  24.       Top             =   84
  25.       Width           =   552
  26.    End
  27.    Begin SSCheck Chk3DIncDims 
  28.       Caption         =   "&Put Declares on clipboard"
  29.       Font3D          =   0  'None
  30.       Height          =   252
  31.       Left            =   60
  32.       TabIndex        =   2
  33.       Top             =   420
  34.       Width           =   2772
  35.    End
  36.    Begin SSCheck chkConst 
  37.       Caption         =   "&Put Constants on clipboard"
  38.       Font3D          =   0  'None
  39.       Height          =   252
  40.       Left            =   60
  41.       TabIndex        =   3
  42.       Top             =   720
  43.       Width           =   2652
  44.    End
  45.    Begin SSFrame Frame3D2 
  46.       Caption         =   "Use 3D"
  47.       Font3D          =   0  'None
  48.       ForeColor       =   &H00000000&
  49.       Height          =   1332
  50.       Left            =   60
  51.       TabIndex        =   8
  52.       Top             =   1020
  53.       Width           =   2052
  54.       Begin SSOption optUse3D 
  55.          Caption         =   "Never"
  56.          Font3D          =   0  'None
  57.          Height          =   192
  58.          Index           =   0
  59.          Left            =   180
  60.          TabIndex        =   9
  61.          Top             =   240
  62.          Width           =   972
  63.       End
  64.       Begin SSOption optUse3D 
  65.          Caption         =   "Always"
  66.          Font3D          =   0  'None
  67.          Height          =   192
  68.          Index           =   1
  69.          Left            =   180
  70.          TabIndex        =   10
  71.          Top             =   420
  72.          Width           =   1392
  73.       End
  74.       Begin SSOption optUse3D 
  75.          Caption         =   "App Startup"
  76.          Font3D          =   0  'None
  77.          Height          =   192
  78.          Index           =   2
  79.          Left            =   180
  80.          TabIndex        =   11
  81.          Top             =   600
  82.          Width           =   1392
  83.       End
  84.       Begin SSCheck chkIncDecl 
  85.          Caption         =   "Include Declares"
  86.          Font3D          =   0  'None
  87.          Height          =   252
  88.          Left            =   180
  89.          TabIndex        =   12
  90.          Top             =   780
  91.          Width           =   1812
  92.       End
  93.       Begin SSCheck chkIncCode 
  94.          Caption         =   "Include 3D Code"
  95.          Font3D          =   0  'None
  96.          Height          =   252
  97.          Left            =   180
  98.          TabIndex        =   29
  99.          Top             =   1020
  100.          Width           =   1812
  101.       End
  102.    End
  103.    Begin SSFrame Frame3D1 
  104.       Caption         =   "Constants"
  105.       Font3D          =   0  'None
  106.       ForeColor       =   &H00000000&
  107.       Height          =   912
  108.       Left            =   2520
  109.       TabIndex        =   4
  110.       Top             =   1200
  111.       Width           =   1572
  112.       Begin SSOption optConst 
  113.          Caption         =   "&None"
  114.          Font3D          =   0  'None
  115.          Height          =   192
  116.          Index           =   0
  117.          Left            =   180
  118.          TabIndex        =   5
  119.          Top             =   240
  120.          Width           =   1152
  121.       End
  122.       Begin SSOption optConst 
  123.          Caption         =   "&Local"
  124.          Font3D          =   0  'None
  125.          Height          =   192
  126.          Index           =   1
  127.          Left            =   180
  128.          TabIndex        =   6
  129.          Top             =   420
  130.          Width           =   1152
  131.       End
  132.       Begin SSOption optConst 
  133.          Caption         =   "&Global"
  134.          Font3D          =   0  'None
  135.          Height          =   192
  136.          Index           =   2
  137.          Left            =   180
  138.          TabIndex        =   7
  139.          Top             =   600
  140.          Width           =   1152
  141.       End
  142.    End
  143.    Begin SSFrame frm3DVariable 
  144.       Caption         =   "Name of variables"
  145.       Font3D          =   0  'None
  146.       ForeColor       =   &H00000000&
  147.       Height          =   1992
  148.       Left            =   60
  149.       TabIndex        =   28
  150.       Top             =   2340
  151.       Width           =   5412
  152.       Begin TextBox txtTitel 
  153.          Height          =   288
  154.          Left            =   1740
  155.          MaxLength       =   40
  156.          TabIndex        =   14
  157.          Top             =   300
  158.          Width           =   2352
  159.       End
  160.       Begin TextBox txtMessage 
  161.          Height          =   288
  162.          Left            =   1740
  163.          MaxLength       =   40
  164.          TabIndex        =   16
  165.          Top             =   600
  166.          Width           =   2352
  167.       End
  168.       Begin TextBox txtStyle 
  169.          Height          =   288
  170.          Left            =   1740
  171.          MaxLength       =   40
  172.          TabIndex        =   18
  173.          Top             =   900
  174.          Width           =   2352
  175.       End
  176.       Begin TextBox txtAnswer 
  177.          Height          =   288
  178.          Left            =   1740
  179.          MaxLength       =   40
  180.          TabIndex        =   20
  181.          Top             =   1200
  182.          Width           =   2352
  183.       End
  184.       Begin TextBox txtRLF 
  185.          Height          =   288
  186.          Left            =   1740
  187.          MaxLength       =   40
  188.          TabIndex        =   22
  189.          Top             =   1500
  190.          Width           =   2352
  191.       End
  192.       Begin CommandButton cmdSetAs 
  193.          Caption         =   "Set as Def."
  194.          Height          =   312
  195.          Left            =   4260
  196.          TabIndex        =   24
  197.          Top             =   600
  198.          Width           =   1032
  199.       End
  200.       Begin CommandButton cmdDefaults 
  201.          Caption         =   "Defaults"
  202.          Height          =   312
  203.          Left            =   4260
  204.          TabIndex        =   23
  205.          Top             =   240
  206.          Width           =   1032
  207.       End
  208.       Begin Label Label5 
  209.          AutoSize        =   -1  'True
  210.          BackStyle       =   0  'Transparent
  211.          Caption         =   "T&itle"
  212.          Height          =   192
  213.          Left            =   180
  214.          TabIndex        =   13
  215.          Top             =   300
  216.          Width           =   384
  217.       End
  218.       Begin Label Label4 
  219.          AutoSize        =   -1  'True
  220.          BackStyle       =   0  'Transparent
  221.          Caption         =   "&Message"
  222.          Height          =   192
  223.          Left            =   180
  224.          TabIndex        =   15
  225.          Top             =   600
  226.          Width           =   780
  227.       End
  228.       Begin Label Label2 
  229.          AutoSize        =   -1  'True
  230.          BackStyle       =   0  'Transparent
  231.          Caption         =   "&Style"
  232.          Height          =   192
  233.          Left            =   180
  234.          TabIndex        =   17
  235.          Top             =   900
  236.          Width           =   432
  237.       End
  238.       Begin Label Label3 
  239.          AutoSize        =   -1  'True
  240.          BackStyle       =   0  'Transparent
  241.          Caption         =   "&Answer"
  242.          Height          =   192
  243.          Left            =   180
  244.          TabIndex        =   19
  245.          Top             =   1200
  246.          Width           =   612
  247.       End
  248.       Begin Label Label6 
  249.          AutoSize        =   -1  'True
  250.          BackStyle       =   0  'Transparent
  251.          Caption         =   "&Return Line Feed"
  252.          Height          =   192
  253.          Left            =   180
  254.          TabIndex        =   21
  255.          Top             =   1500
  256.          Width           =   1428
  257.       End
  258.    End
  259.    Begin CommandButton cmdOK 
  260.       Caption         =   "OK"
  261.       Default         =   -1  'True
  262.       Height          =   312
  263.       Left            =   4440
  264.       TabIndex        =   25
  265.       Top             =   120
  266.       Width           =   1032
  267.    End
  268.    Begin CommandButton cmdCancel 
  269.       Cancel          =   -1  'True
  270.       Caption         =   "Cancel"
  271.       Height          =   312
  272.       Left            =   4440
  273.       TabIndex        =   26
  274.       Top             =   480
  275.       Width           =   1032
  276.    End
  277.    Begin CommandButton cmdHelp 
  278.       Caption         =   "Help"
  279.       Height          =   312
  280.       Left            =   4440
  281.       TabIndex        =   27
  282.       Top             =   900
  283.       Width           =   1032
  284.    End
  285.    Begin Label Label1 
  286.       AutoSize        =   -1  'True
  287.       BackStyle       =   0  'Transparent
  288.       Caption         =   "&Tab Stop Size"
  289.       Height          =   192
  290.       Left            =   60
  291.       TabIndex        =   0
  292.       Top             =   120
  293.       Width           =   1188
  294.    End
  295. Option Explicit
  296. Sub ChangeCancel ()
  297.   If frmCodeOpts.Visible Then cmdCancel.Caption = "Close"
  298. End Sub
  299. Sub cmdCancel_Click ()
  300.   Me.Hide
  301. End Sub
  302. Sub cmdDefaults_Click ()
  303.   Dim pstrWinDir As String
  304.   Dim pstrTabStop As String
  305.   Dim pstrIncDims As String
  306.   Dim pstrVBIni As String
  307.   Dim pstrMsgBoxIni As String
  308.   Dim pstrTitleName As String
  309.   Dim pstrMsgName As String
  310.   Dim pstrStyleName As String
  311.   Dim pstrAnswerName As String
  312.   Dim pstrReturnName As String
  313.   ' Get info from the VB ini file for Defaults
  314.   pstrWinDir = GetWinDir()
  315.   pstrVBIni = MakePath(pstrWinDir, "vb.ini")
  316.   pstrTabStop = ReadIni("Visual Basic", "TabStops", "4", pstrVBIni)
  317.   pstrIncDims = ReadIni("Visual Basic", "InsOptExplicit", "1", pstrVBIni)
  318.   ' Make path and file name of the ini file
  319.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  320.   ' Put the info up on the form
  321.   If Trim(pstrIncDims) = "1" Then
  322.     Chk3DIncDims.Value = True
  323.   Else
  324.     Chk3DIncDims.Value = False
  325.   End If
  326.   ' Get the Default names from ini if defined
  327.   pstrTitleName = ReadIni("Defaults", "Title Name", "pstrTheTitle", pstrMsgBoxIni)
  328.   pstrMsgName = ReadIni("Defaults", "Msg Name", "pstrTheMessage", pstrMsgBoxIni)
  329.   pstrStyleName = ReadIni("Defaults", "Style Name", "pintTheStyle", pstrMsgBoxIni)
  330.   pstrAnswerName = ReadIni("Defaults", "Answer Name", "pintTheAnswer", pstrMsgBoxIni)
  331.   pstrReturnName = ReadIni("Defaults", "Return Name", "pstrCR", pstrMsgBoxIni)
  332.   ' Put the Default names
  333.   txtTabStop = pstrTabStop
  334.   txtTitel = pstrTitleName
  335.   txtMessage = pstrMsgName
  336.   txtStyle = pstrStyleName
  337.   txtAnswer = pstrAnswerName
  338.   txtRLF = pstrReturnName
  339. End Sub
  340. Sub cmdHelp_Click ()
  341.   Dim pstrTheMessage As String
  342.   Dim pstrCR As String
  343.   pstrCR = Chr$(13) & Chr$(10)
  344.   pstrTheMessage = "This is the Code options window where you can set several options about the code to be produced." & pstrCR
  345.   pstrTheMessage = pstrTheMessage & "The new options for version 2.1 are:" & pstrCR
  346.   pstrTheMessage = pstrTheMessage & "  Never   Never use the 3D code" & pstrCR
  347.   pstrTheMessage = pstrTheMessage & "  Always   Always use the 3D code" & pstrCR
  348.   pstrTheMessage = pstrTheMessage & "  App Startup  Use the 3D code only at project startup and unload" & pstrCR
  349.   pstrTheMessage = pstrTheMessage & "  Include Declares  Includes the Declares for the 3D code" & pstrCR
  350.   pstrTheMessage = pstrTheMessage & "  Include Code  Includes the 3D code" & pstrCR
  351.   Call Turn3dOnOff
  352.   MsgBox pstrTheMessage, 64, "Code Options Help"
  353.   Call Turn3dOnOff
  354. End Sub
  355. Sub cmdOK_Click ()
  356.   Call SaveCodeOptions("Code Options")
  357.   Call cmdCancel_Click
  358. End Sub
  359. Sub cmdSetAs_Click ()
  360.   Dim pintTheStyle As Integer
  361.   Dim pintTheAnswer As Integer
  362.   Dim pstrTheMessage As String
  363.   Dim pstrTheTitle As String
  364.   pstrTheMessage = "Are you shure you want to set as defaults?"
  365.   pintTheStyle = 36
  366.   pstrTheTitle = "MsgBox Editor"
  367.   Call Turn3dOnOff
  368.   pintTheAnswer = MsgBox(pstrTheMessage, pintTheStyle, pstrTheTitle)
  369.   Call Turn3dOnOff
  370.   If pintTheAnswer = 6 Then  'Answered Yes
  371.     Call SaveCodeOptions("Defaults")
  372.   Else     'Answered No
  373.   End If
  374. End Sub
  375. Sub Form_Load ()
  376.   Call CenterOnForm(MsgBxGen, Me)
  377.   Call GetCodeOptions
  378. End Sub
  379. Sub GetCodeOptions ()
  380.   Dim pstrWinDir As String
  381.   Dim pstrTabStop As String
  382.   Dim pstrIncDims As String
  383.   Dim pstrIncConst As String
  384.   Dim pstrConstType As String
  385.   Dim pstrVBIni As String
  386.   Dim pstrMsgBoxIni As String
  387.   Dim pstrTitleName As String
  388.   Dim pstrMsgName As String
  389.   Dim pstrStyleName As String
  390.   Dim pstrAnswerName As String
  391.   Dim pstrReturnName As String
  392.   Dim pstr3DUse As String
  393.   Dim pstrInc3DDecl As String
  394.   Dim pstrIncCode As String
  395.   ' Get info from the VB ini file for Defaults
  396.   pstrWinDir = GetWinDir()
  397.   pstrVBIni = MakePath(pstrWinDir, "vb.ini")
  398.   pstrTabStop = ReadIni("Visual Basic", "TabStops", "4", pstrVBIni)
  399.   pstrIncDims = ReadIni("Visual Basic", "InsOptExplicit", "1", pstrVBIni)
  400.   ' Get info from the MsgBox ini file
  401.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  402.   pstrIncDims = ReadIni("Code Options", "Include Dims", pstrIncDims, pstrMsgBoxIni)
  403.   pstrIncConst = ReadIni("Code Options", "Include Const", pstrIncConst, pstrMsgBoxIni)
  404.   pstrConstType = ReadIni("Code Options", "Const Type", pstrConstType, pstrMsgBoxIni)
  405.   pstrTabStop = ReadIni("Code Options", "Tab Stop", pstrTabStop, pstrMsgBoxIni)
  406.   pstrTitleName = ReadIni("Code Options", "Title Name", "pstrTheTitle", pstrMsgBoxIni)
  407.   pstrMsgName = ReadIni("Code Options", "Msg Name", "pstrTheMessage", pstrMsgBoxIni)
  408.   pstrStyleName = ReadIni("Code Options", "Style Name", "pintTheStyle", pstrMsgBoxIni)
  409.   pstrAnswerName = ReadIni("Code Options", "Answer Name", "pintTheAnswer", pstrMsgBoxIni)
  410.   pstrReturnName = ReadIni("Code Options", "Return Name", "pstrCR", pstrMsgBoxIni)
  411.   pstr3DUse = ReadIni("Code Options", "Use 3D", "Never", pstrMsgBoxIni)
  412.   pstrInc3DDecl = ReadIni("Code Options", "Inc 3D Decl", "0", pstrMsgBoxIni)
  413.   pstrIncCode = ReadIni("Code Options", "Inc 3D Code", "0", pstrMsgBoxIni)
  414.   ' Put the info up on the form
  415.   If Val(pstrIncDims) = False Or Val(pstrIncDims) = True Then
  416.     Chk3DIncDims.Value = Val(pstrIncDims)
  417.   Else
  418.     Chk3DIncDims.Value = 0
  419.   End If
  420.   If Trim(pstrIncConst) = "1" Then chkConst.Value = True
  421.   Select Case pstrConstType
  422.     Case "Local"
  423.       optConst(1).Value = True
  424.     Case "Global"
  425.       optConst(2).Value = True
  426.     Case Else
  427.       optConst(0).Value = True
  428.   End Select
  429.   Select Case pstr3DUse
  430.     Case "Never"
  431.       optUse3D(0).Value = True
  432.     Case "Always"
  433.       optUse3D(1).Value = True
  434.     Case "Startup"
  435.       optUse3D(2).Value = True
  436.   End Select
  437.   If Val(pstrInc3DDecl) = False Or Val(pstrInc3DDecl) = True Then
  438.     chkIncDecl.Value = Val(pstrInc3DDecl)
  439.   Else
  440.     chkIncDecl.Value = 0
  441.   End If
  442.   If Val(pstrIncCode) = False Or Val(pstrIncCode) = True Then
  443.     chkIncCode.Value = Val(pstrIncCode)
  444.   Else
  445.     chkIncCode.Value = 0
  446.   End If
  447.   txtTabStop = pstrTabStop
  448.   txtTitel = pstrTitleName
  449.   txtMessage = pstrMsgName
  450.   txtStyle = pstrStyleName
  451.   txtAnswer = pstrAnswerName
  452.   txtRLF = pstrReturnName
  453. End Sub
  454. Sub optUse3D_Click (Index As Integer, Value As Integer)
  455.   If optUse3D(0).Value Then
  456.     chkIncDecl.Value = 0
  457.     chkIncDecl.Enabled = False
  458.   Else
  459.     chkIncDecl.Enabled = True
  460.   End If
  461. End Sub
  462. Sub SaveCodeOptions (AppTile As String)
  463.   Dim pstrTabStop As String
  464.   Dim pstrIncDims As String
  465.   Dim pstrIncConst As String
  466.   Dim pstrConstType As String
  467.   Dim pstrMsgBoxIni As String
  468.   Dim pstrTitleName As String
  469.   Dim pstrMsgName As String
  470.   Dim pstrStyleName As String
  471.   Dim pstrAnswerName As String
  472.   Dim pstrReturnName As String
  473.   Dim pstr3DUse As String
  474.   Dim pstrIncCode As String
  475.   ' Make path and file name of the ini file
  476.   pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
  477.   ' Get the variables name from the form
  478.   pstrTitleName = txtTitel
  479.   pstrMsgName = txtMessage
  480.   pstrStyleName = txtStyle
  481.   pstrAnswerName = txtAnswer
  482.   pstrReturnName = txtRLF
  483.   ' Put the variables names in to the MsgBox ini file
  484.   Call SaveIni(AppTile, "Title Name", pstrTitleName, pstrMsgBoxIni)
  485.   Call SaveIni(AppTile, "Msg Name", pstrMsgName, pstrMsgBoxIni)
  486.   Call SaveIni(AppTile, "Style Name", pstrStyleName, pstrMsgBoxIni)
  487.   Call SaveIni(AppTile, "Answer Name", pstrAnswerName, pstrMsgBoxIni)
  488.   Call SaveIni(AppTile, "Return Name", pstrReturnName, pstrMsgBoxIni)
  489.   If AppTile = "Code Options" Then
  490.     ' Get Tab size info from form
  491.     pstrTabStop = txtTabStop
  492.     ' Get const and const type
  493.     If chkConst.Value = True Then
  494.       pstrIncConst = "1"
  495.     Else
  496.       pstrIncConst = "0"
  497.     End If
  498.     If optConst(0).Value = True Then
  499.       pstrConstType = "None"
  500.     ElseIf optConst(1).Value = True Then
  501.       pstrConstType = "Local"
  502.     Else
  503.       pstrConstType = "Global"
  504.     End If
  505.     If optUse3D(0).Value Then
  506.       pstr3DUse = "Never"
  507.     ElseIf optUse3D(1).Value Then
  508.       pstr3DUse = "Always"
  509.     Else
  510.       pstr3DUse = "Startup"
  511.     End If
  512.     ' Put Dims and Tab size info in to the MsgBox ini file
  513.     Call SaveIni(AppTile, "Include Dims", Trim(Str(Chk3DIncDims.Value)), pstrMsgBoxIni)
  514.     Call SaveIni(AppTile, "Include Const", pstrIncConst, pstrMsgBoxIni)
  515.     Call SaveIni(AppTile, "Const Type", pstrConstType, pstrMsgBoxIni)
  516.     Call SaveIni(AppTile, "Tab Stop", pstrTabStop, pstrMsgBoxIni)
  517.     Call SaveIni(AppTile, "Use 3D", pstr3DUse, pstrMsgBoxIni)
  518.     Call SaveIni(AppTile, "Inc 3D Decl", Trim(Str(chkIncDecl.Value)), pstrMsgBoxIni)
  519.     Call SaveIni(AppTile, "Inc 3D Code", Trim(Str(chkIncCode.Value)), pstrMsgBoxIni)
  520.   End If
  521. End Sub
  522. Sub txtAnswer_Change ()
  523.   Call ChangeCancel
  524. End Sub
  525. Sub txtMessage_Change ()
  526.   Call ChangeCancel
  527. End Sub
  528. Sub txtRLF_Change ()
  529.   Call ChangeCancel
  530. End Sub
  531. Sub txtStyle_Change ()
  532.   Call ChangeCancel
  533. End Sub
  534. Sub txtTabStop_Change ()
  535.   Call ChangeCancel
  536. End Sub
  537. Sub txtTitel_Change ()
  538.   Call ChangeCancel
  539. End Sub
  540.