home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
- Object = "{831FDD16-0C5C-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCTL.OCX"
- Begin VB.MDIForm frmMain
- BackColor = &H8000000C&
- Caption = "TCrypt"
- ClientHeight = 5655
- ClientLeft = 165
- ClientTop = 735
- ClientWidth = 7530
- Icon = "frmMain.frx":0000
- LinkTopic = "MDIForm1"
- StartUpPosition = 3 'Windows Default
- Begin MSComctlLib.ImageList imgDisabled
- Left = 1800
- Top = 480
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 2
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":0442
- Key = ""
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":1096
- Key = ""
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ImageList imlToolbarIcons
- Left = 2400
- Top = 480
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 16
- ImageHeight = 16
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 7
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":1CEA
- Key = "New2"
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":222C
- Key = "Open"
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":233E
- Key = "Save"
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2450
- Key = "Print"
- EndProperty
- BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2562
- Key = "Cut"
- EndProperty
- BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2674
- Key = "Copy"
- EndProperty
- BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2786
- Key = "Paste"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.ImageList ImgList
- Left = 1200
- Top = 480
- _ExtentX = 1005
- _ExtentY = 1005
- BackColor = -2147483643
- ImageWidth = 32
- ImageHeight = 32
- MaskColor = 12632256
- _Version = 393216
- BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
- NumListImages = 4
- BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":2898
- Key = ""
- EndProperty
- BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":34EC
- Key = ""
- EndProperty
- BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":4140
- Key = ""
- EndProperty
- BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
- Picture = "frmMain.frx":4D94
- Key = ""
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.Toolbar tbToolBar
- Align = 1 'Align Top
- Height = 420
- Left = 0
- TabIndex = 1
- Top = 0
- Width = 7530
- _ExtentX = 13282
- _ExtentY = 741
- ButtonWidth = 609
- ButtonHeight = 582
- Appearance = 1
- ImageList = "imlToolbarIcons"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 9
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "New"
- Object.ToolTipText = "New"
- ImageKey = "New2"
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Open"
- Object.ToolTipText = "Open"
- ImageKey = "Open"
- EndProperty
- BeginProperty Button3 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Save"
- Object.ToolTipText = "Save"
- ImageKey = "Save"
- EndProperty
- BeginProperty Button4 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button5 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Print"
- Object.ToolTipText = "Print"
- ImageKey = "Print"
- EndProperty
- BeginProperty Button6 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Style = 3
- EndProperty
- BeginProperty Button7 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Cut"
- Object.ToolTipText = "Cut"
- ImageKey = "Cut"
- EndProperty
- BeginProperty Button8 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Copy"
- Object.ToolTipText = "Copy"
- ImageKey = "Copy"
- EndProperty
- BeginProperty Button9 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Paste"
- Object.ToolTipText = "Paste"
- ImageKey = "Paste"
- EndProperty
- EndProperty
- End
- Begin MSComctlLib.StatusBar sbStatusBar
- Align = 2 'Align Bottom
- Height = 270
- Left = 0
- TabIndex = 0
- Top = 5385
- Width = 7530
- _ExtentX = 13282
- _ExtentY = 476
- _Version = 393216
- BeginProperty Panels {8E3867A5-8586-11D1-B16A-00C0F0283628}
- NumPanels = 3
- BeginProperty Panel1 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- AutoSize = 1
- Object.Width = 7646
- Text = "Status"
- TextSave = "Status"
- EndProperty
- BeginProperty Panel2 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 6
- AutoSize = 2
- TextSave = "4/25/00"
- EndProperty
- BeginProperty Panel3 {8E3867AB-8586-11D1-B16A-00C0F0283628}
- Style = 5
- AutoSize = 2
- TextSave = "6:55 PM"
- EndProperty
- EndProperty
- End
- Begin MSComDlg.CommonDialog dlgCommonDialog
- Left = 3000
- Top = 2280
- _ExtentX = 847
- _ExtentY = 847
- _Version = 393216
- End
- Begin MSComctlLib.Toolbar tbCrypt
- Align = 1 'Align Top
- Height = 660
- Left = 0
- TabIndex = 2
- Top = 420
- Width = 7530
- _ExtentX = 13282
- _ExtentY = 1164
- ButtonWidth = 1032
- ButtonHeight = 1005
- Appearance = 1
- ImageList = "ImgList"
- DisabledImageList= "imgDisabled"
- _Version = 393216
- BeginProperty Buttons {66833FE8-8583-11D1-B16A-00C0F0283628}
- NumButtons = 2
- BeginProperty Button1 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Encrypt"
- Object.ToolTipText = "Encrypt"
- ImageIndex = 1
- EndProperty
- BeginProperty Button2 {66833FEA-8583-11D1-B16A-00C0F0283628}
- Key = "Decrypt"
- Object.ToolTipText = "Decrypt"
- ImageIndex = 2
- EndProperty
- EndProperty
- End
- Begin VB.Menu mnuFile
- Caption = "&File"
- Begin VB.Menu mnuFileNew
- Caption = "&New"
- Shortcut = ^N
- End
- Begin VB.Menu mnuFileOpen
- Caption = "&Open..."
- Shortcut = ^O
- End
- Begin VB.Menu mnuFileBar0
- Caption = "-"
- End
- Begin VB.Menu mnuFileSave
- Caption = "&Save"
- End
- Begin VB.Menu mnuFileSaveAs
- Caption = "Save &As..."
- End
- Begin VB.Menu mnuFileBar1
- Caption = "-"
- End
- Begin VB.Menu mnuFilePrint
- Caption = "&Print..."
- End
- Begin VB.Menu mnuFileBar2
- Caption = "-"
- End
- Begin VB.Menu mnuFileExit
- Caption = "E&xit"
- End
- End
- Begin VB.Menu mnuEdit
- Caption = "&Edit"
- Begin VB.Menu mnuEditCut
- Caption = "Cu&t"
- Shortcut = ^X
- End
- Begin VB.Menu mnuEditCopy
- Caption = "&Copy"
- Shortcut = ^C
- End
- Begin VB.Menu mnuEditPaste
- Caption = "&Paste"
- Shortcut = +{INSERT}
- End
- End
- Begin VB.Menu mnuView
- Caption = "&View"
- Begin VB.Menu mnuViewToolbar
- Caption = "&Toolbar"
- Checked = -1 'True
- End
- Begin VB.Menu mnuViewStatusBar
- Caption = "Status &Bar"
- Checked = -1 'True
- End
- Begin VB.Menu mnuViewBar0
- Caption = "-"
- End
- Begin VB.Menu mnuViewRefresh
- Caption = "&Refresh"
- End
- End
- Begin VB.Menu mnuTools
- Caption = "&Tools"
- Begin VB.Menu mnuEncrypt
- Caption = "&Encrypt"
- End
- Begin VB.Menu mnuDecrypt
- Caption = "&Decrypt"
- End
- End
- Begin VB.Menu mnuWindow
- Caption = "&Window"
- WindowList = -1 'True
- Begin VB.Menu mnuWindowNewWindow
- Caption = "&New Window"
- End
- Begin VB.Menu mnuWindowBar0
- Caption = "-"
- End
- Begin VB.Menu mnuWindowCascade
- Caption = "&Cascade"
- End
- Begin VB.Menu mnuWindowTileHorizontal
- Caption = "Tile &Horizontal"
- End
- Begin VB.Menu mnuWindowTileVertical
- Caption = "Tile &Vertical"
- End
- Begin VB.Menu mnuWindowArrangeIcons
- Caption = "&Arrange Icons"
- End
- End
- Begin VB.Menu mnuHelp
- Caption = "&Help"
- Begin VB.Menu mnuHelpmnuSupport
- Caption = "&Support"
- End
- Begin VB.Menu mnuHelpBar0
- Caption = "-"
- End
- Begin VB.Menu mnuHelpAbout
- Caption = "&About "
- End
- End
- Attribute VB_Name = "frmMain"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Private Sub MDIForm_Load()
- Me.Left = GetSetting(App.Title, "Settings", "MainLeft", 1000)
- Me.Top = GetSetting(App.Title, "Settings", "MainTop", 1000)
- Me.Width = GetSetting(App.Title, "Settings", "MainWidth", 6500)
- Me.Height = GetSetting(App.Title, "Settings", "MainHeight", 6500)
- LoadNewDoc
- fMainForm.tbCrypt.Buttons(1).Enabled = False
- fMainForm.tbCrypt.Buttons(2).Enabled = False
- fMainForm.mnuEncrypt.Enabled = False
- fMainForm.mnuDecrypt.Enabled = False
- End Sub
- Private Sub LoadNewDoc()
- Static lDocumentCount As Long
- Dim frmD As frmDocument
- lDocumentCount = lDocumentCount + 1
- Set frmD = New frmDocument
- frmD.Caption = "Document " & lDocumentCount
- frmD.Show
- End Sub
- Private Sub MDIForm_Unload(Cancel As Integer)
- If Me.WindowState <> vbMinimized Then
- SaveSetting App.Title, "Settings", "MainLeft", Me.Left
- SaveSetting App.Title, "Settings", "MainTop", Me.Top
- SaveSetting App.Title, "Settings", "MainWidth", Me.Width
- SaveSetting App.Title, "Settings", "MainHeight", Me.Height
- End If
- End Sub
- Private Sub mnuDecrypt_Click()
- Decrypt ActiveForm.rtfText.Text, ActiveForm.rtfText
- End Sub
- Private Sub mnuEncrypt_Click()
- Encrypt ActiveForm.rtfText.Text, ActiveForm.rtfText
- End Sub
- Private Sub tbToolBar_ButtonClick(ByVal Button As MSComctlLib.Button)
- On Error Resume Next
- Select Case Button.Key
- Case "New"
- LoadNewDoc
- Case "Open"
- mnuFileOpen_Click
- Case "Save"
- mnuFileSave_Click
- Case "Print"
- mnuFilePrint_Click
- Case "Cut"
- mnuEditCut_Click
- Case "Copy"
- mnuEditCopy_Click
- Case "Paste"
- mnuEditPaste_Click
- End Select
- End Sub
- Private Sub mnuHelpAbout_Click()
- frmAbout.Show vbModal, Me
- End Sub
- Private Sub mnuHelpmnuSupport_Click()
- MsgBox "Email me: adz@bluehome.net"
- End Sub
- Private Sub mnuWindowArrangeIcons_Click()
- Me.Arrange vbArrangeIcons
- End Sub
- Private Sub mnuWindowTileVertical_Click()
- Me.Arrange vbTileVertical
- End Sub
- Private Sub mnuWindowTileHorizontal_Click()
- Me.Arrange vbTileHorizontal
- End Sub
- Private Sub mnuWindowCascade_Click()
- Me.Arrange vbCascade
- End Sub
- Private Sub mnuWindowNewWindow_Click()
- LoadNewDoc
- End Sub
- Private Sub mnuViewRefresh_Click()
- ActiveForm.rtfText.Refresh
- End Sub
- Private Sub mnuViewStatusBar_Click()
- mnuViewStatusBar.Checked = Not mnuViewStatusBar.Checked
- sbStatusBar.Visible = mnuViewStatusBar.Checked
- End Sub
- Private Sub mnuViewToolbar_Click()
- mnuViewToolbar.Checked = Not mnuViewToolbar.Checked
- tbToolBar.Visible = mnuViewToolbar.Checked
- End Sub
- Private Sub mnuEditPaste_Click()
- On Error Resume Next
- ActiveForm.rtfText.SelRTF = Clipboard.GetText
- End Sub
- Private Sub mnuEditCopy_Click()
- On Error Resume Next
- Clipboard.SetText ActiveForm.rtfText.SelRTF
- End Sub
- Private Sub mnuEditCut_Click()
- On Error Resume Next
- Clipboard.SetText ActiveForm.rtfText.SelRTF
- ActiveForm.rtfText.SelText = vbNullString
- End Sub
- Private Sub mnuFileExit_Click()
- 'unload the form
- Unload Me
- End Sub
- Private Sub mnuFilePrint_Click()
- On Error Resume Next
- If ActiveForm Is Nothing Then Exit Sub
- With dlgCommonDialog
- .DialogTitle = "Print"
- .CancelError = True
- .Flags = cdlPDReturnDC + cdlPDNoPageNums
- If ActiveForm.rtfText.SelLength = 0 Then
- .Flags = .Flags + cdlPDAllPages
- Else
- .Flags = .Flags + cdlPDSelection
- End If
- .ShowPrinter
- If Err <> MSComDlg.cdlCancel Then
- ActiveForm.rtfText.SelPrint .hDC
- End If
- End With
- End Sub
- Private Sub mnuFileSaveAs_Click()
- On Error Resume Next
- Dim sFile As String
- Dim Num As Byte
- Dim sText As String
- If ActiveForm Is Nothing Then Exit Sub
- With dlgCommonDialog
- .DialogTitle = "Save As"
- .CancelError = True
- 'ToDo: set the flags and attributes of the common dialog control
- .Filter = "Text Files (*.TXT*)|*.TXT*"
- .ShowSave
- If Len(.FileName) = 0 Then
- Exit Sub
- End If
- sFile = .FileName
- End With
- If LCase(Right(sFile, 4)) <> ".txt" Then
- sFile = sFile & ".txt"
- End If
- sText = ActiveForm.rtfText.Text
- Num = FreeFile
- Kill sFile
- Open sFile For Binary As Num
- Put Num, , sText
- Close Num
- ActiveForm.Caption = sFile
- End Sub
- Private Sub mnuFileSave_Click()
- On Error Resume Next
- Dim sFile As String
- Dim sText As String
- Dim Num As Byte
- If Left$(ActiveForm.Caption, 8) = "Document" Then
- With dlgCommonDialog
- .DialogTitle = "Save"
- .CancelError = True
- 'ToDo: set the flags and attributes of the common dialog control
- .Filter = "Text Files (*.TXT*)|*.TXT*"
- .ShowSave
- If Len(.FileName) = 0 Then
- Exit Sub
- End If
- sFile = .FileName
- End With
- If LCase(Right(sFile, 4)) <> ".txt" Then
- sFile = sFile & ".txt"
- End If
- sText = ActiveForm.rtfText.Text
- Num = FreeFile
- Kill sFile
- Open sFile For Binary As Num
- Put Num, , sText
- Close Num
- ActiveForm.Caption = sFile
- Else
- sFile = ActiveForm.Caption
- sText = ActiveForm.rtfText.Text
- Num = FreeFile
- Kill sFile
- Open sFile For Binary As Num
- Put Num, , sText
- Close Num
- ActiveForm.Caption = sFile
- End If
- End Sub
- Private Sub mnuFileOpen_Click()
- Dim sFile As String
- Dim sText As String
- Dim Num As Byte
- If ActiveForm Is Nothing Then LoadNewDoc
- With dlgCommonDialog
- .DialogTitle = "Open"
- .CancelError = True
- 'ToDo: set the flags and attributes of the common dialog control
- .Filter = "Plain Text Files (*.TXT*)|*.TXT*"
- .ShowOpen
- If Len(.FileName) = 0 Then
- Exit Sub
- End If
- sFile = .FileName
- End With
- Num = FreeFile
- Open sFile For Binary As Num
- sText = Space(LOF(Num))
- Get Num, , sText
- Close Num
- ActiveForm.rtfText.Text = sText
- ActiveForm.Caption = sFile
- End Sub
- Private Sub mnuFileNew_Click()
- LoadNewDoc
- End Sub
- Private Sub tbCrypt_ButtonClick(ByVal Button As MSComctlLib.Button)
- Select Case Button.Key
- Case "Encrypt"
- Encrypt ActiveForm.rtfText.Text, ActiveForm.rtfText
- Case "Decrypt"
- Decrypt ActiveForm.rtfText.Text, ActiveForm.rtfText
- End Select
- End Sub
-