[DEVELOPMENT ENVIRONMENT]

* NEW: Better command-line help text.

[WEBSITE MAKER]
* NEW: Update to Gambas 3.9.0.

[WIKI CGI SCRIPT]
* NEW: Add border shadow around screenshots links.

[GB.FORM.EDITOR]
* BUG: TextEditor: Fix the Highlight property when set to "None".
* BUG: TextEditor: Fix the Highlight property declaration.
* OPT: TextEditor: Faster layout and scroll, especially when there are a lot of lines and wrapping mode is enabled.


git-svn-id: svn://localhost/gambas/trunk@7874 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
Benoît Minisini 2016-08-28 21:25:46 +00:00
parent cd33ca44f7
commit bf38b6c891
19 changed files with 110 additions and 68 deletions

View file

@ -1,9 +1,9 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.8.90
# Compiled with Gambas 3.9.90
Title=Gambas web site generator
Startup=MMain
Icon=html.png
Version=3.8.90
Version=3.9.90
VersionFile=1
Component=gb.image
Component=gb.gui

View file

@ -14,7 +14,7 @@ Sub InitVar()
'DIM aDev AS String[] = ["92", "91", "90", "51"]
$cVar["OLD_VERSION"] = "2.24.0"
$cVar["DEV_VERSION"] = "3.8.4"
$cVar["DEV_VERSION"] = "3.9.0"
InitAuthor

View file

@ -2,7 +2,7 @@ MMain
Gambas web site generator
0
0
3.8.90
3.9.90
gb.image
gb.gui

View file

@ -83,8 +83,8 @@ function goto_frame(url, menu)
<li><a href="#">{Download}</a>
<ul class="sub-menu" id="m-download">
<li><a target="_blank" href="http://sourceforge.net/projects/gambas/files/gambas3/gambas3-3.8.4.tar.bz2/download">{Download} Gambas 3.8.4...</a></li>
<li><a href="#" onclick="goto_frame('$(WIKI:/doc/release/3.8.4)','m-download');">{Release Notes}</a></li>
<li><a target="_blank" href="http://sourceforge.net/projects/gambas/files/gambas3/gambas3-3.9.0.tar.bz2/download">{Download} Gambas 3.9.0...</a></li>
<li><a href="#" onclick="goto_frame('$(WIKI:/doc/release/3.9.0)','m-download');">{Release Notes}</a></li>
<li><a target="_blank" href="http://sourceforge.net/projects/gambas/files/">{Other downloads}...</a></li>
<li><a target="_blank" href="http://sourceforge.net/p/gambas/code">{Browse source code}...</a></li>
</a>

View file

@ -1,10 +1,10 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.8.90
# Compiled with Gambas 3.9.90
Title=Gambas Wiki Web Application
Startup=Main
UseHttpServer=1
Icon=icon.png
Version=3.8.90
Version=3.9.90
VersionFile=1
Component=gb.db
Component=gb.net

View file

@ -662,3 +662,6 @@ DIV.code PRE {
border: none;
}
IMG.screenshot {
box-shadow: 0 0 0.5em rgba(0,0,0,0.25);
}

View file

@ -2,7 +2,7 @@ Main
Gambas Wiki Web Application
0
0
3.8.90
3.9.90
gb.db
gb.net

View file

@ -1089,6 +1089,8 @@ Private Sub GetCurrentProc(Optional iLine As Integer = $hEditor.Line) As String
Dim sProc As String
If $bNoHighlight Then Return
While iLine >= 0
If $hEditor[iLine].Limit Then

View file

@ -1,7 +1,12 @@
Gambas 3 Integrated Development Environment
Usage: gambas3 [options] [<project directory> or <file>]
Usage: gambas3 [<project directory> | <file>]
Open the IDE with the specific project or the specific file.
If no argument is specified, open the IDE with a nice welcome dialog.
Usage: gambas3 [options]
Options:
-V --version display version

View file

@ -1,5 +1,5 @@
[Component]
Key=gb.form.editor
Version=3.8.90
Version=3.9.90
Needs=Form
Requires=gb.eval.highlight

View file

@ -4,7 +4,7 @@ C
_Properties
C
s
"*,Border=True,ScrollBar{Scroll.*}=Both,Highlight{None;Custom;Gambas;HTML;CSS;WebPage;Diff;JavaScript;SQL},ReadOnly,TabSize{Range:2;64}=2,Wrap,ShowPosition,ShowLimit,ShowCurrent,ShowLineNumber,ShowModified,ShowBraces,ShowIcon,ShowExpand,ShowCursor=True,ShowSpaces,ShowIndent"
"*,Border=True,ScrollBar{Scroll.*}=Both,Highlight{None;Custom;Gambas;HTML;CSS;WebPage;Diff;JavaScript;SQL}=None,ReadOnly,TabSize{Range:2;64}=2,Wrap,ShowPosition,ShowLimit,ShowCurrent,ShowLineNumber,ShowModified,ShowBraces,ShowIcon,ShowExpand,ShowCursor=True,ShowSpaces,ShowIndent"
_DrawWith
C
s
@ -233,10 +233,6 @@ Copy
m
TextWidth
m
i
(sText)s
_ClearCachePos
m
@ -565,6 +561,10 @@ TimerCacheLine_Timer
m
_HasFolding
m
b
#_TextEditor_Line
C

View file

@ -1,14 +1,14 @@
# Gambas Project File 3.0
# Compiled with Gambas 3.8.90
# Compiled with Gambas 3.9.90
Title=Text editor with syntax highlighting
Startup=FTestEditor
Version=3.8.90
Version=3.9.90
VersionFile=1
Component=gb.image
Component=gb.gui
Component=gb.eval
Component=gb.eval.highlight
Environment="GB_GUI=gb.qt4"
Environment="GB_GUI=gb.qt5"
TabSize=2
Language=fr
Type=Component

View file

@ -833,6 +833,7 @@ Private Sub Highlight_Write(Value As String)
Dim Y As Integer
Value = LCase(Value)
If Value And If Value <> "none" And If Value <> "custom" Then
If Value == "c++" Then Value = "cplusplus"
$hHighlight = TextHighlighter[Value]

View file

@ -2,11 +2,14 @@
Private Sub Reload()
'TextEditor1.Highlight = "gambas"
'TextEditor1.Load("~/gambas/3.0/issues/839/test-OutOfBoundsLongCode/.src/MMain.module")
TextEditor1.Load("~/2003001092.csv")
'TextEditor1.Load("~/gambas/3.0/test/test4/.src/MSort.module")
TextEditor1.CollapseAll
Dim I As Integer
System.Profile = False
'TextEditor1.Load("~/test.txt")
For I = 1 To 100
TextEditor1.Insert(String$(80, CStr(I) & " ") & "\n")
Next
System.Profile = True
End

View file

@ -33,6 +33,7 @@
Font = Font["Liberation Mono"]
Background = Color.TextBackground
Border = False
Wrap = True
ShowPosition = True
ShowLimit = True
ShowCurrent = True

View file

@ -2,13 +2,15 @@
Public Sub Main()
Dim hImage As New Picture(512, 64) ', Color.White, Image.Premultiplied)
Dim hFile As File
Dim I As Integer
hFile = Open "~/test.txt" For Create
hImage.Fill(Color.White)
Paint.Begin(hImage)
Paint.DrawText("Gambas Already Means BASIC", 0, 32)
Paint.End
For I = 1 To 40000
Print #hFile, String$(80, CStr(I) & " ")
Next
hImage.Save("~/test.png")
hFile.Close
End

View file

@ -4,7 +4,7 @@ Export
Inherits UserControl
Public Const _Properties As String = "*,Border=True,ScrollBar{Scroll.*}=Both,Highlight{None;Custom;Gambas;HTML;CSS;WebPage;Diff;JavaScript;SQL},ReadOnly,TabSize{Range:2;64}=2,Wrap,ShowPosition,ShowLimit,ShowCurrent,ShowLineNumber,ShowModified,ShowBraces,ShowIcon,ShowExpand,ShowCursor=True,ShowSpaces,ShowIndent"
Public Const _Properties As String = "*,Border=True,ScrollBar{Scroll.*}=Both,Highlight{None;Custom;Gambas;HTML;CSS;WebPage;Diff;JavaScript;SQL}=None,ReadOnly,TabSize{Range:2;64}=2,Wrap,ShowPosition,ShowLimit,ShowCurrent,ShowLineNumber,ShowModified,ShowBraces,ShowIcon,ShowExpand,ShowCursor=True,ShowSpaces,ShowIndent"
Public Const _DrawWith As String = "-"
Public Const _DefaultEvent As String = "Change"
Public Const _Similar As String = "TextArea"
@ -125,7 +125,6 @@ Private $iBackground As Integer
Private $iForeground As Integer
Private $iSelectedBackground As Integer
Private $iLimitColor As Integer
Private $iMultiLineColor As Integer
Private $iIndentColor As Integer
Private $iLineNumberOffset As Integer
@ -176,6 +175,7 @@ Private $bUpdateHeightAllowed As Boolean
Private $bPrint As Boolean
Private $sPrintBuffer As String
Private $iMarginColor As Integer
Public Sub _new()
@ -466,7 +466,7 @@ Private Sub DrawMatch(X As Integer, Y As Integer, H As Integer, XM As Integer, Y
Dim WW As Integer
XY = LinePos(YM, XM)
WW = TextWidth(String.Mid$($hDoc.Lines[YM], XM + 1, 1))
WW = TextWidth($hDoc.Lines[YM], XM + 1, 1)
Paint.FillRect(X + XY.X, Y + XY.Y, WW, H, $hStyles[Highlight.Highlight].Color)
End
@ -608,7 +608,7 @@ Private Sub DrawHighlightedText(Row As Integer, sText As String, aColor As Byte[
If Not hImage Then
W = X2 - XX
If W <= 0 Then W = TextWidth(sStr)
If W <= 0 Then W = TextWidth(sStr, 1, iLen)
If hStyle.Bold Then Inc W
hImage = New Image(W, H, Color.Transparent)
@ -741,6 +741,11 @@ Private Sub DrawLine(X As Integer, Y As Integer, Width As Integer, Height As Int
' Current line or stop line
Try aLayout = $cLineLayout[Row]
If Row = $Y And If aLayout Then
Paint.FillRect(X, Y, Width, Height, $iMarginColor)
Endif
If Row = $iStopLine Then
Paint.FillRect(X, Y, Width, Height, $hStyles[Highlight.Current].Color)
Else If $bShowCurrent And If Row = $Y Then
@ -827,7 +832,6 @@ Private Sub DrawLine(X As Integer, Y As Integer, Width As Integer, Height As Int
' Text
Try aLayout = $cLineLayout[Row]
sText = $hDoc.Lines[Row]
If hInfo.Colors Then
@ -903,22 +907,6 @@ Private Sub DrawLine(X As Integer, Y As Integer, Width As Integer, Height As Int
Endif
If Row = $Y And If aLayout Then
Paint.FillRect($iWidth - $MW - 4, Y, 4, Height, $iMultiLineColor)
' Paint.Background = $iMultiLineColor
'
' Paint.AntiAlias = False
' Paint.MoveTo($iWidth - $MW - 5, Y + 1)
' Paint.RelLineTo(3, 0)
' Paint.RelLineTo(0, Height - 3)
' Paint.RelLineTo(-3, 0)
' Paint.Stroke
' Paint.AntiAlias = True
Endif
' Cursor
If Row = $Y And If $bShowCursor And If Me.HasFocus And If Not $bHideCursor Then
@ -1050,22 +1038,24 @@ Private Sub DrawMargin(X As Integer, Y As Integer, Width As Integer, Height As I
End
Public Sub TextWidth(sText As String) As Integer
Fast Private Sub TextWidth(sText As String, iStart As Integer, iLength As Integer) As Integer
Dim aText As String[]
Dim I As Integer
Dim W As Float
If InStr(sText, "\t") = 0 Then
I = InStr(sText, "\t", iStart) - iStart
If I < 0 Or If I >= iLength Then
If $fCharWidth Then
Return $fCharWidth * String.Len(sText)
Return $fCharWidth * iLength
Else
Return $hFont.TextWidth(sText)
Return $hFont.TextWidth(String.Mid$(sText, iStart, iLength))
Endif
Endif
If Not sText Then Return 0
aText = Split(sText, "\t")
If iLength <= 0 Then Return 0
aText = Split(String.Mid$(sText, iStart, iLength), "\t")
If $fCharWidth Then
@ -1112,7 +1102,7 @@ Private Sub LinePos(Y As Integer, Optional X As Integer = -1) As Point
P += aLayout[I]
X -= aLayout[I]
Next
XX = TextWidth(String.Mid$($hDoc.Lines[Y], P + 1, X))
XX = TextWidth($hDoc.Lines[Y], P + 1, X)
If I Then XX += LineStartPos(Y)
hPos = Point(XX, I * $LH)
Goto CACHE_POS
@ -1121,9 +1111,9 @@ Private Sub LinePos(Y As Integer, Optional X As Integer = -1) As Point
hPos = New Point
If X < 0 Then
hPos.X = TextWidth($hDoc.Lines[Y])
hPos.X = TextWidth($hDoc.Lines[Y], 1, $hDoc.LineLength[Y])
Else
hPos.X = TextWidth(String.Left($hDoc.Lines[Y], X))
hPos.X = TextWidth($hDoc.Lines[Y], 1, X)
Endif
CACHE_POS:
@ -2509,7 +2499,7 @@ Public Sub View_Draw()
$iSelectedBackground = $hStyles[Highlight.Selection].Color
$iLimitColor = Color.Gradient($iBackground, $hStyles[Highlight.Comment].Color)
$iIndentColor = Color.Gradient($iBackground, $iForeground)
$iMultiLineColor = Color.Gradient($iBackground, $iLimitColor)
$iMarginColor = Color.Merge($iLimitColor, $iBackground, 0.8)
$bStyleChanged = False
Endif
@ -2593,7 +2583,7 @@ Public Sub View_Draw()
W = $MW
If $bShowModified Then W -= 4
If W > 0 Then Paint.FillRect(XX + $hView.ScrollX, hClip.Y, W, hClip.H, Color.Merge($iLimitColor, $iBackground, 0.8))
If W > 0 Then Paint.FillRect(XX + $hView.ScrollX, hClip.Y, W, hClip.H, $iMarginColor)
If $MW Then
@ -2749,7 +2739,7 @@ Private Sub ShowPosition_Write(Value As Boolean)
If $bShowPosition Then
If Not $hLabel Then
$hLabelFrame = New Panel(Me)
$hLabelFrame.Background = Color.SetAlpha($hStyles[Highlight.Background].Color, 128)
$hLabelFrame.Background = Color.SetAlpha($hStyles[Highlight.Background].Color, 64)
$hLabelFrame.Ignore = True
$hLabel = New Label($hLabelFrame) ' TODO: NULL + gb.gtk => crash!
$hLabel.AutoResize = True
@ -4452,7 +4442,7 @@ Public Sub _UpdateLineHeight(Y As Integer)
aLayout = New Integer[]
S = 1
L = String.Len(sText)
L = $hDoc.LineLength[Y]
Do
@ -4462,7 +4452,7 @@ Public Sub _UpdateLineHeight(Y As Integer)
While F > D + 1
P = (D + F) \ 2
W = TextWidth(String.Mid(sText, S, P - S + 1))
W = TextWidth(sText, S, P - S + 1)
If W > WMax Then
F = P
Else
@ -4763,3 +4753,9 @@ Private Sub ClearCacheText()
$cCacheText.Clear
End
Public Sub _HasFolding() As Boolean
If $aFold And If $aFold.Count Then Return True
End

View file

@ -15,6 +15,7 @@ Private $iHeight As Integer
Private $cCacheRowY As New Collection
Private $cCacheRowFromPos As New Collection
Private $iLastRow As Integer
Private Sub GetView() As TextEditor
@ -72,8 +73,33 @@ Public Sub _GetRowY(iRow As Integer) As Integer
Try Return $cCacheRowY[iRow]
If $cHeight Then
If $cCacheRowY.Exist($iLastRow) And If iRow > Abs(iRow - $iLastRow) Then
If $iLastRow < iRow Then
I = $iLastRow
While I < iRow
If hView._IsRowVisible(I) Then Try Y += CInt($cHeight[I]) - 1
Inc I
Wend
Y += iRow - $iLastRow
Else
I = $iLastRow
While I > iRow
Dec I
If hView._IsRowVisible(I) Then Try Y -= CInt($cHeight[I]) - 1
Wend
Y += iRow - $iLastRow
Endif
Y *= DH
Y += $cCacheRowY[$iLastRow]
Else
Y = iViewRow
For Each I In $aHeight
@ -86,10 +112,12 @@ Public Sub _GetRowY(iRow As Integer) As Integer
Y *= DH
Endif
$cCacheRowY[iRow] = Y
StripCache($cCacheRowY)
$iLastRow = iRow
Return Y
End
@ -133,6 +161,7 @@ Public Sub _SetRowHeight(iRow As Integer, H As Integer)
If Not $cHeight Then
$cHeight = New Collection
'$cHeight.Default = 1
$aHeight = New Integer[]
Endif

View file

@ -2,7 +2,7 @@ FTestEditor
Text editor with syntax highlighting
0
0
3.8.90
3.9.90
gb.image
gb.gui