📄 frmmain.frm
字号:
VERSION 5.00
Object = "{F9043C88-F6F2-101A-A3C9-08002B2F49FB}#1.2#0"; "COMDLG32.OCX"
Begin VB.Form frmMain
Caption = "DigiSystems D++"
ClientHeight = 6615
ClientLeft = 3285
ClientTop = 2145
ClientWidth = 8400
Icon = "frmMain.frx":0000
LinkTopic = "Form1"
ScaleHeight = 6615
ScaleWidth = 8400
Begin MSComDlg.CommonDialog CommonDialog1
Left = 0
Top = 6120
_ExtentX = 847
_ExtentY = 847
_Version = 393216
End
Begin VB.TextBox txtDebug
Height = 1455
Left = 0
Locked = -1 'True
MultiLine = -1 'True
ScrollBars = 2 'Vertical
TabIndex = 1
Top = 4650
Visible = 0 'False
Width = 7215
End
Begin VB.TextBox txtText
Height = 4575
Left = 0
MultiLine = -1 'True
ScrollBars = 3 'Both
TabIndex = 0
Top = 0
Width = 7215
End
Begin VB.Menu mnuFile
Caption = "&File"
Begin VB.Menu mnuFileNew
Caption = "&New"
Shortcut = ^N
End
Begin VB.Menu mnuFileLine1
Caption = "-"
End
Begin VB.Menu mnuFileOpen
Caption = "&Open"
Shortcut = ^O
End
Begin VB.Menu mnuFileClose
Caption = "&Close"
End
Begin VB.Menu mnuFileLine2
Caption = "-"
End
Begin VB.Menu mnuFileSave
Caption = "&Save"
Shortcut = ^S
End
Begin VB.Menu mnuFileSaveAS
Caption = "Save &As..."
End
Begin VB.Menu mnuFileLine3
Caption = "-"
End
Begin VB.Menu mnuFileExit
Caption = "E&xit"
End
End
Begin VB.Menu mnuEdit
Caption = "&Edit"
Begin VB.Menu mnuEditCut
Caption = "C&ut"
Shortcut = ^X
End
Begin VB.Menu mnuEditCopy
Caption = "&Copy"
Shortcut = ^C
End
Begin VB.Menu mnuEditPaste
Caption = "&Paste"
Shortcut = ^V
End
End
Begin VB.Menu mnuView
Caption = "&View"
Begin VB.Menu mnuViewDebug
Caption = "&Debug"
End
End
Begin VB.Menu mnuProject
Caption = "&Project"
Begin VB.Menu mnuProjectCompile
Caption = "&Compile"
Shortcut = {F6}
End
Begin VB.Menu mnuProjectRun
Caption = "&Run"
Shortcut = {F5}
End
Begin VB.Menu mnuProjectStop
Caption = "&Stop"
Enabled = 0 'False
Shortcut = {F7}
End
End
Begin VB.Menu mnuHelp
Caption = "&Help"
Begin VB.Menu mnuHelpAbout
Caption = "&About"
End
End
End
Attribute VB_Name = "frmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim debugactive As Boolean, save As Boolean
Private Sub Form_Load()
Me.Show
GETDLL
debugactive = False
save = False
If FileExist(GetSystemDirectory & "\DPPAPP.dll") = False Then
MsgBox "DPPAPP.DLL not found in system folder!", vbCritical, "File Not Found!"
End
End If
End Sub
Private Sub Form_Resize()
On Error Resume Next
If debugactive = True Then
txtDebug.Top = ScaleHeight - txtDebug.Height
txtDebug.Width = ScaleWidth
txtText.Width = ScaleWidth
txtText.Height = ScaleHeight - (txtDebug.Height + 50)
Else
txtText.Width = ScaleWidth
txtText.Height = ScaleHeight
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub mnuEditCopy_Click()
On Error Resume Next
Clipboard.SetText txtText.SelText
End Sub
Private Sub mnuEditCut_Click()
On Error Resume Next
Clipboard.SetText txtText.SelText
txtText.SelText = ""
End Sub
Private Sub mnuEditPaste_Click()
On Error Resume Next
txtText.SelText = Clipboard.GetText
End Sub
Private Sub mnuFileClose_Click()
save = False
Me.Caption = "DigiSystems D++"
txtText.Text = ""
End Sub
Private Sub mnuFileExit_Click()
End
End Sub
Private Sub mnuFileNew_Click()
save = False
Me.Caption = "DigiSystems D++"
txtText.Text = ""
End Sub
Private Sub mnuFileOpen_Click()
On Error GoTo endit
CommonDialog1.Filter = "D++ Files (*.dpp)|*.dpp|All Files (*.*)|*.*"
CommonDialog1.DialogTitle = "Open D++ File"
CommonDialog1.CancelError = True
CommonDialog1.ShowOpen
txtText.Text = ReadFile(CommonDialog1.FileName)
Me.Caption = "DigiSystems D++ - [" & CommonDialog1.FileTitle & "]"
save = True
endit:
End Sub
Private Sub mnuFileSave_Click()
If save = True Then
Open CommonDialog1.FileName For Output As #1
Print #1, txtText.Text
Close #1
Me.Caption = "DigiSystems D++ - [" & CommonDialog1.FileTitle & "]"
Else
mnuFileSaveAS_Click
End If
End Sub
Private Sub mnuFileSaveAS_Click()
On Error GoTo endit
CommonDialog1.Filter = "D++ Files (*.dpp)|*.dpp|All Files (*.*)|*.*"
CommonDialog1.DialogTitle = "Save D++ File"
CommonDialog1.CancelError = True
CommonDialog1.ShowSave
If FileExist(CommonDialog1.FileName) Then
overwrite = MsgBox("File Exists! Overwrite?", 276, "File Found!")
If overwrite = 6 Then
Open CommonDialog1.FileName For Output As #1
Print #1, txtText.Text
Close #1
Else
Exit Sub
End If
End If
Me.Caption = "DigiSystems D++ - [" & CommonDialog1.FileTitle & "]"
save = True
endit:
End Sub
Private Sub mnuHelpAbout_Click()
frmAbout.Show
End Sub
Private Sub mnuProjectCompile_Click()
debugactive = True
txtDebug.Visible = True
mnuViewDebug.Checked = True
Form_Resize
mnuProjectStop.Enabled = True
txtDebug.Text = ""
AddDebug ">DigiSystems D++ Debug"
AddDebug ">"
Make
AddDebug ">D++ Application Finished"
mnuProjectStop.Enabled = False
End Sub
Private Sub mnuProjectRun_Click()
debugactive = True
txtDebug.Visible = True
mnuViewDebug.Checked = True
Form_Resize
mnuProjectStop.Enabled = True
txtDebug.Text = ""
AddDebug ">DigiSystems D++ Debug"
AddDebug ">"
Compile
AddDebug ">D++ Application Finished"
mnuProjectStop.Enabled = False
End Sub
Private Sub mnuViewDebug_Click()
If mnuViewDebug.Checked = True Then
debugactive = False
txtDebug.Visible = False
Form_Resize
mnuViewDebug.Checked = False
Else
debugactive = True
txtDebug.Visible = True
Form_Resize
mnuViewDebug.Checked = True
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -