Added syntax highlighting for HTML,CSS,Gambas,Website,JavaScript, a terminal window and made run feature which detects shebang lines automatically, run in popup terminal window.

This commit is contained in:
Paul M 2020-03-15 21:59:17 -05:00
parent f0b90830d6
commit 6f8e6de1c4
8 changed files with 170 additions and 10 deletions

View file

@ -1,7 +1,7 @@
# Gambas Project File 3.0
Title=Kpad
Startup=FMain
Version=0.0.4
Version=0.0.7
Component=gb.image
Component=gb.gui.qt
Component=gb.form
@ -12,8 +12,11 @@ Component=gb.util
Component=gb.form.editor
Component=gb.settings
Component=gb.term
Component=gb.form.terminal
Component=gb.pcre
Component=gb.signal
Description="Gambas version of kake pad"
Authors="Paul M"
TabSize=2
Language=en_US
KeepDebugInfo=0

View file

@ -12,7 +12,7 @@ Private txtc As Boolean ' Contents of text editor used in combination with tchng
Public Sub Menu5_Click()
CloseDoc()
Me.Close
End
@ -76,7 +76,7 @@ Private Function CloseDoc() As Boolean
Endif
txtc = False
Me.Close
End
@ -170,9 +170,10 @@ End
Public Sub Menu24_Click()
' This does work but gambas app launched from a console, looks like gb.term.form might be option in the future
Exec [regx[3].Text, Dialog.Path] ' We might want to pop that into a visible window for shell stuff, does work
'Shell(regx[3].Text & " " & Dialog.Path)
Global.termrun = [regx[3].Text, Dialog.Path]
FTerm.Show
FTerm.termrun()
End
Public Sub Menu25_Click()
@ -191,3 +192,67 @@ End
Public Sub Form_Open()
txtc = False
End
Public Sub Menu11_Click()
Replace.Show()
End
Public Sub Menu27_Click()
If Menu27.Checked Then
TextEditor1.Highlight = "gambas"
Endif
End
Public Sub Menu28_Click()
If Menu28.Checked Then
TextEditor1.Highlight = "html"
Endif
End
Public Sub Menu29_Click()
If Menu29.Checked Then
TextEditor1.Highlight = "css"
Endif
End
Public Sub Menu30_Click()
If Menu30.Checked Then
TextEditor1.Highlight = "javascript"
Endif
End
Public Sub Menu31_Click()
If Menu31.Checked Then
TextEditor1.Highlight = "sql"
Endif
End
Public Sub Menu32_Click()
If Menu32.Checked Then
TextEditor1.Highlight = "webpage"
Endif
End
Public Sub Menu33_Click()
Global.termrun = ["/bin/bash"]
FTerm.Show
FTerm.termrun()
End

View file

@ -30,7 +30,6 @@
}
{ Menu11 Menu
Text = ("Replace")
Enabled = False
}
{ Menu19 Menu
Text = ("--------")
@ -59,6 +58,33 @@
}
{ Menu7 Menu
Text = ("View")
{ Menu26 Menu
Text = ("Highlighting")
{ Menu27 Menu
Text = ("Gambas")
Radio = True
}
{ Menu28 Menu
Text = ("HTML")
Radio = True
}
{ Menu29 Menu
Text = ("CSS")
Radio = True
}
{ Menu30 Menu
Text = ("JavaScript")
Radio = True
}
{ Menu31 Menu
Text = ("SQL")
Radio = True
}
{ Menu32 Menu
Text = ("WebPage")
Radio = True
}
}
{ Menu4 Menu
Text = ("Word Wrap")
Toggle = True
@ -71,6 +97,9 @@
Text = ("Line Numbers")
Toggle = True
}
{ Menu33 Menu
Text = ("View Terminal")
}
}
{ Menu23 Menu
Text = ("Run")

9
kpad/.src/FTerm.class Normal file
View file

@ -0,0 +1,9 @@
' Gambas class file
Public Sub termrun()
'Exec [FMain.regx[3], Dialog.Path]
TerminalView1.Exec(Global.termrun)
End

14
kpad/.src/FTerm.form Normal file
View file

@ -0,0 +1,14 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,64,64)
Text = ("Terminal Output")
Arrangement = Arrange.Fill
AutoResize = True
{ TerminalView1 TerminalView
MoveScaled(0,0,64,64)
Expand = True
Blink = True
ShowScrollBar = True
}
}

View file

@ -11,11 +11,11 @@ Create Static
' Variables first some might get removed
Public cbflag As Integer
Public txtch As Integer
Public dlgtitle As String
'Public txtch As Integer
'Public dlgtitle As String
Public fndin As String
Public rpstr As String
Public termrun As String[]
' Allows for waiting on custom dialogs, shouldn't have had to do it like this

15
kpad/.src/Replace.class Normal file
View file

@ -0,0 +1,15 @@
' Gambas class file
Public Sub Form_Open()
End
Public Sub Button1_Click()
FMain.TextEditor1.FindNextString(TextBox1.text, 1)
End

25
kpad/.src/Replace.form Normal file
View file

@ -0,0 +1,25 @@
# Gambas Form File 3.0
{ Form Form
MoveScaled(0,0,64,17)
Text = ("Find And Replace")
Resizable = False
{ Label1 Label
MoveScaled(1,3,15,4)
Text = ("Find:")
}
{ Label2 Label
MoveScaled(1,8,8,4)
Text = ("Replace:")
}
{ TextBox1 TextBox
MoveScaled(9,3,25,4)
}
{ TextBox2 TextBox
MoveScaled(9,8,25,4)
}
{ Button1 Button
MoveScaled(49,11,14,4)
Text = ("Find / Replace")
}
}