home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form frmCodeOpts
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "Code Options"
- ClientHeight = 4296
- ClientLeft = 2112
- ClientTop = 1308
- ClientWidth = 5580
- Height = 4668
- Left = 2064
- LinkTopic = "Form1"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 4296
- ScaleWidth = 5580
- Top = 984
- Width = 5676
- Begin TextBox txtTabStop
- Height = 288
- Left = 1440
- MaxLength = 2
- TabIndex = 1
- Top = 84
- Width = 552
- End
- Begin SSCheck Chk3DIncDims
- Caption = "&Put Declares on clipboard"
- Font3D = 0 'None
- Height = 252
- Left = 60
- TabIndex = 2
- Top = 420
- Width = 2772
- End
- Begin SSCheck chkConst
- Caption = "&Put Constants on clipboard"
- Font3D = 0 'None
- Height = 252
- Left = 60
- TabIndex = 3
- Top = 720
- Width = 2652
- End
- Begin SSFrame Frame3D2
- Caption = "Use 3D"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 1332
- Left = 60
- TabIndex = 8
- Top = 1020
- Width = 2052
- Begin SSOption optUse3D
- Caption = "Never"
- Font3D = 0 'None
- Height = 192
- Index = 0
- Left = 180
- TabIndex = 9
- Top = 240
- Width = 972
- End
- Begin SSOption optUse3D
- Caption = "Always"
- Font3D = 0 'None
- Height = 192
- Index = 1
- Left = 180
- TabIndex = 10
- Top = 420
- Width = 1392
- End
- Begin SSOption optUse3D
- Caption = "App Startup"
- Font3D = 0 'None
- Height = 192
- Index = 2
- Left = 180
- TabIndex = 11
- Top = 600
- Width = 1392
- End
- Begin SSCheck chkIncDecl
- Caption = "Include Declares"
- Font3D = 0 'None
- Height = 252
- Left = 180
- TabIndex = 12
- Top = 780
- Width = 1812
- End
- Begin SSCheck chkIncCode
- Caption = "Include 3D Code"
- Font3D = 0 'None
- Height = 252
- Left = 180
- TabIndex = 29
- Top = 1020
- Width = 1812
- End
- End
- Begin SSFrame Frame3D1
- Caption = "Constants"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 912
- Left = 2520
- TabIndex = 4
- Top = 1200
- Width = 1572
- Begin SSOption optConst
- Caption = "&None"
- Font3D = 0 'None
- Height = 192
- Index = 0
- Left = 180
- TabIndex = 5
- Top = 240
- Width = 1152
- End
- Begin SSOption optConst
- Caption = "&Local"
- Font3D = 0 'None
- Height = 192
- Index = 1
- Left = 180
- TabIndex = 6
- Top = 420
- Width = 1152
- End
- Begin SSOption optConst
- Caption = "&Global"
- Font3D = 0 'None
- Height = 192
- Index = 2
- Left = 180
- TabIndex = 7
- Top = 600
- Width = 1152
- End
- End
- Begin SSFrame frm3DVariable
- Caption = "Name of variables"
- Font3D = 0 'None
- ForeColor = &H00000000&
- Height = 1992
- Left = 60
- TabIndex = 28
- Top = 2340
- Width = 5412
- Begin TextBox txtTitel
- Height = 288
- Left = 1740
- MaxLength = 40
- TabIndex = 14
- Top = 300
- Width = 2352
- End
- Begin TextBox txtMessage
- Height = 288
- Left = 1740
- MaxLength = 40
- TabIndex = 16
- Top = 600
- Width = 2352
- End
- Begin TextBox txtStyle
- Height = 288
- Left = 1740
- MaxLength = 40
- TabIndex = 18
- Top = 900
- Width = 2352
- End
- Begin TextBox txtAnswer
- Height = 288
- Left = 1740
- MaxLength = 40
- TabIndex = 20
- Top = 1200
- Width = 2352
- End
- Begin TextBox txtRLF
- Height = 288
- Left = 1740
- MaxLength = 40
- TabIndex = 22
- Top = 1500
- Width = 2352
- End
- Begin CommandButton cmdSetAs
- Caption = "Set as Def."
- Height = 312
- Left = 4260
- TabIndex = 24
- Top = 600
- Width = 1032
- End
- Begin CommandButton cmdDefaults
- Caption = "Defaults"
- Height = 312
- Left = 4260
- TabIndex = 23
- Top = 240
- Width = 1032
- End
- Begin Label Label5
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "T&itle"
- Height = 192
- Left = 180
- TabIndex = 13
- Top = 300
- Width = 384
- End
- Begin Label Label4
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Message"
- Height = 192
- Left = 180
- TabIndex = 15
- Top = 600
- Width = 780
- End
- Begin Label Label2
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Style"
- Height = 192
- Left = 180
- TabIndex = 17
- Top = 900
- Width = 432
- End
- Begin Label Label3
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Answer"
- Height = 192
- Left = 180
- TabIndex = 19
- Top = 1200
- Width = 612
- End
- Begin Label Label6
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Return Line Feed"
- Height = 192
- Left = 180
- TabIndex = 21
- Top = 1500
- Width = 1428
- End
- End
- Begin CommandButton cmdOK
- Caption = "OK"
- Default = -1 'True
- Height = 312
- Left = 4440
- TabIndex = 25
- Top = 120
- Width = 1032
- End
- Begin CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 312
- Left = 4440
- TabIndex = 26
- Top = 480
- Width = 1032
- End
- Begin CommandButton cmdHelp
- Caption = "Help"
- Height = 312
- Left = 4440
- TabIndex = 27
- Top = 900
- Width = 1032
- End
- Begin Label Label1
- AutoSize = -1 'True
- BackStyle = 0 'Transparent
- Caption = "&Tab Stop Size"
- Height = 192
- Left = 60
- TabIndex = 0
- Top = 120
- Width = 1188
- End
- Option Explicit
- Sub ChangeCancel ()
- If frmCodeOpts.Visible Then cmdCancel.Caption = "Close"
- End Sub
- Sub cmdCancel_Click ()
- Me.Hide
- End Sub
- Sub cmdDefaults_Click ()
- Dim pstrWinDir As String
- Dim pstrTabStop As String
- Dim pstrIncDims As String
- Dim pstrVBIni As String
- Dim pstrMsgBoxIni As String
- Dim pstrTitleName As String
- Dim pstrMsgName As String
- Dim pstrStyleName As String
- Dim pstrAnswerName As String
- Dim pstrReturnName As String
- ' Get info from the VB ini file for Defaults
- pstrWinDir = GetWinDir()
- pstrVBIni = MakePath(pstrWinDir, "vb.ini")
- pstrTabStop = ReadIni("Visual Basic", "TabStops", "4", pstrVBIni)
- pstrIncDims = ReadIni("Visual Basic", "InsOptExplicit", "1", pstrVBIni)
- ' Make path and file name of the ini file
- pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
- ' Put the info up on the form
- If Trim(pstrIncDims) = "1" Then
- Chk3DIncDims.Value = True
- Else
- Chk3DIncDims.Value = False
- End If
- ' Get the Default names from ini if defined
- pstrTitleName = ReadIni("Defaults", "Title Name", "pstrTheTitle", pstrMsgBoxIni)
- pstrMsgName = ReadIni("Defaults", "Msg Name", "pstrTheMessage", pstrMsgBoxIni)
- pstrStyleName = ReadIni("Defaults", "Style Name", "pintTheStyle", pstrMsgBoxIni)
- pstrAnswerName = ReadIni("Defaults", "Answer Name", "pintTheAnswer", pstrMsgBoxIni)
- pstrReturnName = ReadIni("Defaults", "Return Name", "pstrCR", pstrMsgBoxIni)
- ' Put the Default names
- txtTabStop = pstrTabStop
- txtTitel = pstrTitleName
- txtMessage = pstrMsgName
- txtStyle = pstrStyleName
- txtAnswer = pstrAnswerName
- txtRLF = pstrReturnName
- End Sub
- Sub cmdHelp_Click ()
- Dim pstrTheMessage As String
- Dim pstrCR As String
- pstrCR = Chr$(13) & Chr$(10)
- pstrTheMessage = "This is the Code options window where you can set several options about the code to be produced." & pstrCR
- pstrTheMessage = pstrTheMessage & "The new options for version 2.1 are:" & pstrCR
- pstrTheMessage = pstrTheMessage & " Never Never use the 3D code" & pstrCR
- pstrTheMessage = pstrTheMessage & " Always Always use the 3D code" & pstrCR
- pstrTheMessage = pstrTheMessage & " App Startup Use the 3D code only at project startup and unload" & pstrCR
- pstrTheMessage = pstrTheMessage & " Include Declares Includes the Declares for the 3D code" & pstrCR
- pstrTheMessage = pstrTheMessage & " Include Code Includes the 3D code" & pstrCR
- Call Turn3dOnOff
- MsgBox pstrTheMessage, 64, "Code Options Help"
- Call Turn3dOnOff
- End Sub
- Sub cmdOK_Click ()
- Call SaveCodeOptions("Code Options")
- Call cmdCancel_Click
- End Sub
- Sub cmdSetAs_Click ()
- Dim pintTheStyle As Integer
- Dim pintTheAnswer As Integer
- Dim pstrTheMessage As String
- Dim pstrTheTitle As String
- pstrTheMessage = "Are you shure you want to set as defaults?"
- pintTheStyle = 36
- pstrTheTitle = "MsgBox Editor"
- Call Turn3dOnOff
- pintTheAnswer = MsgBox(pstrTheMessage, pintTheStyle, pstrTheTitle)
- Call Turn3dOnOff
- If pintTheAnswer = 6 Then 'Answered Yes
- Call SaveCodeOptions("Defaults")
- Else 'Answered No
- End If
- End Sub
- Sub Form_Load ()
- Call CenterOnForm(MsgBxGen, Me)
- Call GetCodeOptions
- End Sub
- Sub GetCodeOptions ()
- Dim pstrWinDir As String
- Dim pstrTabStop As String
- Dim pstrIncDims As String
- Dim pstrIncConst As String
- Dim pstrConstType As String
- Dim pstrVBIni As String
- Dim pstrMsgBoxIni As String
- Dim pstrTitleName As String
- Dim pstrMsgName As String
- Dim pstrStyleName As String
- Dim pstrAnswerName As String
- Dim pstrReturnName As String
- Dim pstr3DUse As String
- Dim pstrInc3DDecl As String
- Dim pstrIncCode As String
- ' Get info from the VB ini file for Defaults
- pstrWinDir = GetWinDir()
- pstrVBIni = MakePath(pstrWinDir, "vb.ini")
- pstrTabStop = ReadIni("Visual Basic", "TabStops", "4", pstrVBIni)
- pstrIncDims = ReadIni("Visual Basic", "InsOptExplicit", "1", pstrVBIni)
- ' Get info from the MsgBox ini file
- pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
- pstrIncDims = ReadIni("Code Options", "Include Dims", pstrIncDims, pstrMsgBoxIni)
- pstrIncConst = ReadIni("Code Options", "Include Const", pstrIncConst, pstrMsgBoxIni)
- pstrConstType = ReadIni("Code Options", "Const Type", pstrConstType, pstrMsgBoxIni)
- pstrTabStop = ReadIni("Code Options", "Tab Stop", pstrTabStop, pstrMsgBoxIni)
- pstrTitleName = ReadIni("Code Options", "Title Name", "pstrTheTitle", pstrMsgBoxIni)
- pstrMsgName = ReadIni("Code Options", "Msg Name", "pstrTheMessage", pstrMsgBoxIni)
- pstrStyleName = ReadIni("Code Options", "Style Name", "pintTheStyle", pstrMsgBoxIni)
- pstrAnswerName = ReadIni("Code Options", "Answer Name", "pintTheAnswer", pstrMsgBoxIni)
- pstrReturnName = ReadIni("Code Options", "Return Name", "pstrCR", pstrMsgBoxIni)
- pstr3DUse = ReadIni("Code Options", "Use 3D", "Never", pstrMsgBoxIni)
- pstrInc3DDecl = ReadIni("Code Options", "Inc 3D Decl", "0", pstrMsgBoxIni)
- pstrIncCode = ReadIni("Code Options", "Inc 3D Code", "0", pstrMsgBoxIni)
- ' Put the info up on the form
- If Val(pstrIncDims) = False Or Val(pstrIncDims) = True Then
- Chk3DIncDims.Value = Val(pstrIncDims)
- Else
- Chk3DIncDims.Value = 0
- End If
- If Trim(pstrIncConst) = "1" Then chkConst.Value = True
- Select Case pstrConstType
- Case "Local"
- optConst(1).Value = True
- Case "Global"
- optConst(2).Value = True
- Case Else
- optConst(0).Value = True
- End Select
- Select Case pstr3DUse
- Case "Never"
- optUse3D(0).Value = True
- Case "Always"
- optUse3D(1).Value = True
- Case "Startup"
- optUse3D(2).Value = True
- End Select
- If Val(pstrInc3DDecl) = False Or Val(pstrInc3DDecl) = True Then
- chkIncDecl.Value = Val(pstrInc3DDecl)
- Else
- chkIncDecl.Value = 0
- End If
- If Val(pstrIncCode) = False Or Val(pstrIncCode) = True Then
- chkIncCode.Value = Val(pstrIncCode)
- Else
- chkIncCode.Value = 0
- End If
- txtTabStop = pstrTabStop
- txtTitel = pstrTitleName
- txtMessage = pstrMsgName
- txtStyle = pstrStyleName
- txtAnswer = pstrAnswerName
- txtRLF = pstrReturnName
- End Sub
- Sub optUse3D_Click (Index As Integer, Value As Integer)
- If optUse3D(0).Value Then
- chkIncDecl.Value = 0
- chkIncDecl.Enabled = False
- Else
- chkIncDecl.Enabled = True
- End If
- End Sub
- Sub SaveCodeOptions (AppTile As String)
- Dim pstrTabStop As String
- Dim pstrIncDims As String
- Dim pstrIncConst As String
- Dim pstrConstType As String
- Dim pstrMsgBoxIni As String
- Dim pstrTitleName As String
- Dim pstrMsgName As String
- Dim pstrStyleName As String
- Dim pstrAnswerName As String
- Dim pstrReturnName As String
- Dim pstr3DUse As String
- Dim pstrIncCode As String
- ' Make path and file name of the ini file
- pstrMsgBoxIni = MakePath((app.Path), app.EXEName & ".ini")
- ' Get the variables name from the form
- pstrTitleName = txtTitel
- pstrMsgName = txtMessage
- pstrStyleName = txtStyle
- pstrAnswerName = txtAnswer
- pstrReturnName = txtRLF
- ' Put the variables names in to the MsgBox ini file
- Call SaveIni(AppTile, "Title Name", pstrTitleName, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Msg Name", pstrMsgName, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Style Name", pstrStyleName, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Answer Name", pstrAnswerName, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Return Name", pstrReturnName, pstrMsgBoxIni)
- If AppTile = "Code Options" Then
- ' Get Tab size info from form
- pstrTabStop = txtTabStop
- ' Get const and const type
- If chkConst.Value = True Then
- pstrIncConst = "1"
- Else
- pstrIncConst = "0"
- End If
- If optConst(0).Value = True Then
- pstrConstType = "None"
- ElseIf optConst(1).Value = True Then
- pstrConstType = "Local"
- Else
- pstrConstType = "Global"
- End If
- If optUse3D(0).Value Then
- pstr3DUse = "Never"
- ElseIf optUse3D(1).Value Then
- pstr3DUse = "Always"
- Else
- pstr3DUse = "Startup"
- End If
- ' Put Dims and Tab size info in to the MsgBox ini file
- Call SaveIni(AppTile, "Include Dims", Trim(Str(Chk3DIncDims.Value)), pstrMsgBoxIni)
- Call SaveIni(AppTile, "Include Const", pstrIncConst, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Const Type", pstrConstType, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Tab Stop", pstrTabStop, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Use 3D", pstr3DUse, pstrMsgBoxIni)
- Call SaveIni(AppTile, "Inc 3D Decl", Trim(Str(chkIncDecl.Value)), pstrMsgBoxIni)
- Call SaveIni(AppTile, "Inc 3D Code", Trim(Str(chkIncCode.Value)), pstrMsgBoxIni)
- End If
- End Sub
- Sub txtAnswer_Change ()
- Call ChangeCancel
- End Sub
- Sub txtMessage_Change ()
- Call ChangeCancel
- End Sub
- Sub txtRLF_Change ()
- Call ChangeCancel
- End Sub
- Sub txtStyle_Change ()
- Call ChangeCancel
- End Sub
- Sub txtTabStop_Change ()
- Call ChangeCancel
- End Sub
- Sub txtTitel_Change ()
- Call ChangeCancel
- End Sub
-