[DEVELOPMENT ENVIRONMENT]
* NEW: Little changes in Sapphire theme. * BUG: Fix text editor toolbar tooltips. * NEW: Support for C and C++ files. * BUG: Support for procedure folding and unfolding shortcuts in the text editor. * NEW: A "Paste special" button in the code editor toolbar. [GB.EVAL.HIGHLIGHT] * NEW: C and C++ syntax hilighting. [GB.FORM.MDI] * BUG: Don't try to optimize Toolbar separators in design mode. [GB.QT4.EXT] * NEW: In Editor, highlight both matching braces now. git-svn-id: svn://localhost/gambas/trunk@3770 867c0c6c-44f3-4631-809d-bfa615b0a4ec
This commit is contained in:
parent
b947d1f8f9
commit
0c678f3cba
1
TODO
1
TODO
@ -49,6 +49,7 @@ GUI RELATED STUFF
|
||||
- GridView automatic column resizing by code in gb.gtk, and in gb.qt.
|
||||
- Moveable tabs.
|
||||
- ListView and GridView selection interface should be the same.
|
||||
- More clever vertical toolbar.
|
||||
|
||||
DESKTOP COMPONENT
|
||||
|
||||
|
@ -290,11 +290,11 @@ msgstr ""
|
||||
msgid "Provides"
|
||||
msgstr ""
|
||||
|
||||
#: CInsertColor.class:103 FEditor.class:3672 FTextEditor.class:997
|
||||
#: CInsertColor.class:103 FEditor.class:3684 FTextEditor.class:1019
|
||||
msgid "Insert color"
|
||||
msgstr ""
|
||||
|
||||
#: CModule.class:28 FCreateFile.class:652 FEditor.class:3637 FForm.class:3728
|
||||
#: CModule.class:28 FCreateFile.class:652 FEditor.class:3638 FForm.class:3728
|
||||
#: FInfo.class:89
|
||||
msgid "Form"
|
||||
msgstr ""
|
||||
@ -476,7 +476,7 @@ msgstr ""
|
||||
#: FReportBorderChooser.class:345 FReportBrushChooser.class:475
|
||||
#: FReportCoordChooser.class:126 FSave.class:118 FSaveProjectAs.class:130
|
||||
#: FSelectExtraFile.class:78 FSelectIcon.class:272 FSnippet.class:142
|
||||
#: FTableChooser.class:144 FText.class:106 FTextEditor.class:463
|
||||
#: FTableChooser.class:144 FText.class:106 FTextEditor.class:485
|
||||
#: FTranslate.class:638 Project.module:412
|
||||
msgid "Cancel"
|
||||
msgstr ""
|
||||
@ -511,46 +511,46 @@ msgid ""
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:225 FConflict.class:325 FConnectionEditor.class:1874
|
||||
#: FEditor.class:3470 FForm.class:3558 FIconEditor.class:2176
|
||||
#: FEditor.class:3471 FForm.class:3558 FIconEditor.class:2176
|
||||
#: FImageEditor.class:77 FMenu.class:971 FOutput.class:388
|
||||
#: FTextEditor.class:770
|
||||
#: FTextEditor.class:792
|
||||
msgid "Cut"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:231 FConflict.class:331 FConnectionEditor.class:1651
|
||||
#: FEditor.class:3476 FForm.class:3565 FIconEditor.class:2184
|
||||
#: FEditor.class:3477 FForm.class:3565 FIconEditor.class:2184
|
||||
#: FImageEditor.class:86 FMenu.class:977 FOutput.class:395
|
||||
#: FTextEditor.class:777
|
||||
#: FTextEditor.class:799
|
||||
msgid "Copy"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:237 FConflict.class:337 FConnectionEditor.class:1895
|
||||
#: FEditor.class:3483 FForm.class:3578 FIconEditor.class:2192
|
||||
#: FEditor.class:3484 FForm.class:3578 FIconEditor.class:2192
|
||||
#: FImageEditor.class:95 FMenu.class:983 FOutput.class:402
|
||||
#: FPasteTable.class:331 FTextEditor.class:784
|
||||
#: FPasteTable.class:331 FTextEditor.class:806
|
||||
msgid "Paste"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:243 FConflict.class:343 FConnectionEditor.class:1902
|
||||
#: FEditor.class:3454 FForm.class:3803 FIconEditor.class:2160
|
||||
#: FEditor.class:3455 FForm.class:3803 FIconEditor.class:2160
|
||||
#: FImageEditor.class:105 FOption.class:1552 FOutput.class:371
|
||||
#: FTextEditor.class:753
|
||||
#: FTextEditor.class:775
|
||||
msgid "Undo"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:249 FConflict.class:349 FConnectionEditor.class:1909
|
||||
#: FEditor.class:3461 FForm.class:3813 FImageEditor.class:113
|
||||
#: FOutput.class:378 FTextEditor.class:760
|
||||
#: FEditor.class:3462 FForm.class:3813 FImageEditor.class:113
|
||||
#: FOutput.class:378 FTextEditor.class:782
|
||||
msgid "Redo"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:255 FConflict.class:355 FEditor.class:3698 FMenu.class:993
|
||||
#: FTextEditor.class:956
|
||||
#: FCommit.class:255 FConflict.class:355 FEditor.class:3710 FMenu.class:993
|
||||
#: FTextEditor.class:978
|
||||
msgid "Indent"
|
||||
msgstr ""
|
||||
|
||||
#: FCommit.class:261 FConflict.class:361 FEditor.class:3706 FMenu.class:999
|
||||
#: FTextEditor.class:963
|
||||
#: FCommit.class:261 FConflict.class:361 FEditor.class:3718 FMenu.class:999
|
||||
#: FTextEditor.class:985
|
||||
msgid "Unindent"
|
||||
msgstr ""
|
||||
|
||||
@ -696,8 +696,8 @@ msgstr ""
|
||||
msgid "The table '&1' has been modified. Do you want to save it?"
|
||||
msgstr ""
|
||||
|
||||
#: FConnectionEditor.class:284 FEditor.class:3588 FForm.class:3719
|
||||
#: FIconEditor.class:1426 FImageEditor.class:60 FTextEditor.class:875
|
||||
#: FConnectionEditor.class:284 FEditor.class:3589 FForm.class:3719
|
||||
#: FIconEditor.class:1426 FImageEditor.class:60 FTextEditor.class:897
|
||||
msgid "Save"
|
||||
msgstr ""
|
||||
|
||||
@ -820,7 +820,7 @@ msgstr ""
|
||||
|
||||
#: FConnectionEditor.class:1622 FEditor.class:2276 FForm.class:2960
|
||||
#: FHelpBrowser.class:347 FIconEditor.class:2046 FImageEditor.class:68
|
||||
#: FTextEditor.class:463 FTranslate.class:732
|
||||
#: FTextEditor.class:485 FTranslate.class:732
|
||||
msgid "Reload"
|
||||
msgstr ""
|
||||
|
||||
@ -1287,7 +1287,7 @@ msgstr ""
|
||||
msgid "Stack backtrace"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:2276 FIconEditor.class:2046 FTextEditor.class:463
|
||||
#: FEditor.class:2276 FIconEditor.class:2046 FTextEditor.class:485
|
||||
msgid ""
|
||||
"The file has been modified.\n"
|
||||
"\n"
|
||||
@ -1298,115 +1298,115 @@ msgstr ""
|
||||
msgid "(Declarations)"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3390
|
||||
#: FEditor.class:3391
|
||||
msgid "Go to"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3395 FTextEditor.class:744
|
||||
#: FEditor.class:3396 FTextEditor.class:766
|
||||
msgid "Go to line..."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3401
|
||||
#: FEditor.class:3402
|
||||
msgid "Find definition"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3408 FHelpBrowser.class:329
|
||||
#: FEditor.class:3409 FHelpBrowser.class:329
|
||||
msgid "Go back"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3415
|
||||
#: FEditor.class:3416
|
||||
msgid "Open form"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3422 FForm.class:3490 FMain.class:2637
|
||||
#: FEditor.class:3423 FForm.class:3490 FMain.class:2637
|
||||
msgid "&Startup class"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3430
|
||||
#: FEditor.class:3431
|
||||
msgid "Run &until current line"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3437
|
||||
#: FEditor.class:3438
|
||||
msgid "Toggle &breakpoint"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3445
|
||||
#: FEditor.class:3446
|
||||
msgid "&Watch expression"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3490
|
||||
#: FEditor.class:3491
|
||||
msgid "Paste special..."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3496 FTextEditor.class:791
|
||||
#: FEditor.class:3497 FTextEditor.class:813
|
||||
msgid "Insert color..."
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3505 FTextEditor.class:800
|
||||
#: FEditor.class:3506 FTextEditor.class:822
|
||||
msgid "Select &All"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3514
|
||||
#: FEditor.class:3515
|
||||
msgid "Comment"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3521
|
||||
#: FEditor.class:3522
|
||||
msgid "Uncomment"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3531 FOutput.class:419 FTextEditor.class:809
|
||||
#: FEditor.class:3532 FOutput.class:419 FTextEditor.class:831
|
||||
msgid "Find next"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3538 FOutput.class:426 FTextEditor.class:816
|
||||
#: FEditor.class:3539 FOutput.class:426 FTextEditor.class:838
|
||||
msgid "Find previous"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3547 FTextEditor.class:825
|
||||
#: FEditor.class:3548 FTextEditor.class:847
|
||||
msgid "View"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3551 FTextEditor.class:829
|
||||
#: FEditor.class:3552 FTextEditor.class:851
|
||||
msgid "No split"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3558 FTextEditor.class:836
|
||||
#: FEditor.class:3559 FTextEditor.class:858
|
||||
msgid "Horizontal split"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3565 FTextEditor.class:843
|
||||
#: FEditor.class:3566 FTextEditor.class:865
|
||||
msgid "Vertical split"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3576
|
||||
#: FEditor.class:3577
|
||||
msgid "Make code pretty"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3598 FPasteSpecial.class:253
|
||||
#: FEditor.class:3599 FPasteSpecial.class:253
|
||||
msgid "Paste as string"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3603 FPasteSpecial.class:258
|
||||
#: FEditor.class:3604 FPasteSpecial.class:258
|
||||
msgid "Paste as multi-line string"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3608 FPasteSpecial.class:243
|
||||
#: FEditor.class:3609 FPasteSpecial.class:243
|
||||
msgid "Paste as comments"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3615 FOption.class:1149
|
||||
#: FEditor.class:3616 FOption.class:1149
|
||||
msgid "Editor"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3765
|
||||
#: FEditor.class:3777
|
||||
msgid "Toggle breakpoint"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3774
|
||||
#: FEditor.class:3786
|
||||
msgid "Watch expression"
|
||||
msgstr ""
|
||||
|
||||
#: FEditor.class:3787
|
||||
#: FEditor.class:3799
|
||||
msgid "Procedure list"
|
||||
msgstr ""
|
||||
|
||||
@ -1549,7 +1549,7 @@ msgstr ""
|
||||
msgid "Menu editor..."
|
||||
msgstr ""
|
||||
|
||||
#: FForm.class:3749 FTextEditor.class:906
|
||||
#: FForm.class:3749 FTextEditor.class:928
|
||||
msgid "Code"
|
||||
msgstr ""
|
||||
|
||||
@ -1763,7 +1763,7 @@ msgstr ""
|
||||
msgid "Pick a color"
|
||||
msgstr ""
|
||||
|
||||
#: FImageEditor.class:54 FTextEditor.class:884
|
||||
#: FImageEditor.class:54 FTextEditor.class:906
|
||||
msgid "Text editor"
|
||||
msgstr ""
|
||||
|
||||
@ -3823,23 +3823,23 @@ msgstr ""
|
||||
msgid "Use a fixed font"
|
||||
msgstr ""
|
||||
|
||||
#: FTextEditor.class:658
|
||||
#: FTextEditor.class:680
|
||||
msgid "The file has been compressed from &1 to &2 bytes (&3)."
|
||||
msgstr ""
|
||||
|
||||
#: FTextEditor.class:658
|
||||
#: FTextEditor.class:680
|
||||
msgid "Original file has been saved in the <b>Project</b> folder."
|
||||
msgstr ""
|
||||
|
||||
#: FTextEditor.class:664
|
||||
#: FTextEditor.class:686
|
||||
msgid "Unable to compress file."
|
||||
msgstr ""
|
||||
|
||||
#: FTextEditor.class:854
|
||||
#: FTextEditor.class:876
|
||||
msgid "Compress file"
|
||||
msgstr ""
|
||||
|
||||
#: FTextEditor.class:860
|
||||
#: FTextEditor.class:882
|
||||
msgid "Uncompress file"
|
||||
msgstr ""
|
||||
|
||||
|
@ -239,8 +239,18 @@
|
||||
Border = False
|
||||
Menu = "mnuPasteAs"
|
||||
}
|
||||
{ btnPasteSpecial ToolButton mnuPasteSpecial
|
||||
Name = "btnPasteSpecial"
|
||||
MoveScaled(20,0,14,4)
|
||||
Visible = False
|
||||
ToolTip = ("Copy")
|
||||
Action = ".paste-special"
|
||||
AutoResize = True
|
||||
Text = ("Paste special...")
|
||||
Picture = Picture["icon:/small/paste"]
|
||||
}
|
||||
{ btnInsertColor MenuButton
|
||||
MoveScaled(20,0,6,4)
|
||||
MoveScaled(34,0,6,4)
|
||||
ToolTip = ("Insert color")
|
||||
Action = ".color"
|
||||
Picture = Picture["icon:/small/color"]
|
||||
@ -249,27 +259,27 @@
|
||||
}
|
||||
{ btnUndo ToolButton mnuUndo
|
||||
Name = "btnUndo"
|
||||
MoveScaled(25,0,4,4)
|
||||
MoveScaled(39,0,4,4)
|
||||
ToolTip = ("Undo")
|
||||
Action = ".undo"
|
||||
Picture = Picture["icon:/small/undo"]
|
||||
}
|
||||
{ btnRedo ToolButton mnuRedo
|
||||
Name = "btnRedo"
|
||||
MoveScaled(28,0,4,4)
|
||||
MoveScaled(42,0,4,4)
|
||||
ToolTip = ("Redo")
|
||||
Action = ".redo"
|
||||
Picture = Picture["icon:/small/redo"]
|
||||
}
|
||||
{ btnIndent ToolButton
|
||||
MoveScaled(31,0,4,4)
|
||||
MoveScaled(45,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Indent")
|
||||
Action = ".indent"
|
||||
Picture = Picture["icon:/small/indent"]
|
||||
}
|
||||
{ btnUnindent ToolButton
|
||||
MoveScaled(34,0,4,4)
|
||||
MoveScaled(48,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Unindent")
|
||||
Action = ".unindent"
|
||||
@ -277,21 +287,21 @@
|
||||
}
|
||||
{ btnComment ToolButton mnuComment
|
||||
Name = "btnComment"
|
||||
MoveScaled(37,0,4,4)
|
||||
MoveScaled(51,0,4,4)
|
||||
ToolTip = ("Comment")
|
||||
Action = ".comment"
|
||||
Picture = Picture["img/16/comment.png"]
|
||||
}
|
||||
{ btnUncomment ToolButton mnuUncomment
|
||||
Name = "btnUncomment"
|
||||
MoveScaled(40,0,4,4)
|
||||
MoveScaled(54,0,4,4)
|
||||
ToolTip = ("Uncomment")
|
||||
Action = ".uncomment"
|
||||
Picture = Picture["img/16/uncomment.png"]
|
||||
}
|
||||
{ btnNoSplit ToolButton mnuNoSplit
|
||||
Name = "btnNoSplit"
|
||||
MoveScaled(42,0,4,4)
|
||||
MoveScaled(56,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("No split")
|
||||
Action = ".view-nosplit"
|
||||
@ -299,7 +309,7 @@
|
||||
}
|
||||
{ btnHorizontalSplit ToolButton mnuHorizontalSplit
|
||||
Name = "btnHorizontalSplit"
|
||||
MoveScaled(45,0,4,4)
|
||||
MoveScaled(59,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Horizontal split")
|
||||
Action = ".view-hsplit"
|
||||
@ -307,7 +317,7 @@
|
||||
}
|
||||
{ btnVerticalSplit ToolButton mnuVerticalSplit
|
||||
Name = "btnVerticalSplit"
|
||||
MoveScaled(48,0,4,4)
|
||||
MoveScaled(62,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Vertical split")
|
||||
Action = ".view-vsplit"
|
||||
@ -315,14 +325,14 @@
|
||||
}
|
||||
{ btnPretty ToolButton mnuPretty
|
||||
Name = "btnPretty"
|
||||
MoveScaled(51,0,4,4)
|
||||
MoveScaled(65,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Make code pretty")
|
||||
Action = ".pretty"
|
||||
Picture = Picture["icon:/small/wizard"]
|
||||
}
|
||||
{ btnBreakpoint ToolButton
|
||||
MoveScaled(54,0,4,4)
|
||||
MoveScaled(68,0,4,4)
|
||||
ToolTip = ("Toggle breakpoint")
|
||||
Action = ".break"
|
||||
Picture = Picture["icon:/small/halt"]
|
||||
@ -330,16 +340,16 @@
|
||||
}
|
||||
{ btnWatch ToolButton mnuWatch
|
||||
Name = "btnWatch"
|
||||
MoveScaled(57,0,4,4)
|
||||
MoveScaled(71,0,4,4)
|
||||
ToolTip = ("Watch expression")
|
||||
Action = ".watch"
|
||||
Picture = Picture["icon:/small/watch"]
|
||||
}
|
||||
{ Separator2 Separator
|
||||
MoveScaled(63,0,1,4)
|
||||
MoveScaled(77,0,1,4)
|
||||
}
|
||||
{ btnProc ToolButton
|
||||
MoveScaled(65,0,46,4)
|
||||
MoveScaled(79,0,46,4)
|
||||
Mouse = Mouse.Pointing
|
||||
Action = ".proc"
|
||||
Text = ("Procedure list")
|
||||
@ -347,7 +357,7 @@
|
||||
}
|
||||
{ btnDefinition ToolButton mnuDefinition
|
||||
Name = "btnDefinition"
|
||||
MoveScaled(111,0,4,4)
|
||||
MoveScaled(125,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Find definition")
|
||||
Action = ".find-definition"
|
||||
@ -355,7 +365,7 @@
|
||||
}
|
||||
{ btnLastPosition ToolButton mnuLastPosition
|
||||
Name = "btnLastPosition"
|
||||
MoveScaled(114,0,4,4)
|
||||
MoveScaled(128,0,4,4)
|
||||
Visible = False
|
||||
ToolTip = ("Go back")
|
||||
Action = ".go-back"
|
||||
@ -487,6 +497,7 @@
|
||||
{ Action paste-special
|
||||
Text = "Paste special..."
|
||||
Shortcut = "Ctrl+Shift+V"
|
||||
Picture = "icon:/small/paste"
|
||||
}
|
||||
{ Action paste-string
|
||||
Text = "Paste as string"
|
||||
@ -572,7 +583,7 @@
|
||||
{ Toolbars
|
||||
{ Toolbar editor
|
||||
Text = "Editor"
|
||||
List = "save,reload,show-form,cut,copy,paste,color,undo,redo,indent,unindent,comment,uncomment,view-nosplit,view-hsplit,view-vsplit,pretty,break,watch,proc,find-definition,go-back"
|
||||
List = "save,reload,show-form,cut,copy,paste,paste-special,color,undo,redo,indent,unindent,comment,uncomment,view-nosplit,view-hsplit,view-vsplit,pretty,break,watch,proc,find-definition,go-back"
|
||||
Default = "save,reload,show-form,paste,color,undo,redo,comment,uncomment,break,watch,|,proc"
|
||||
}
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ Public Age As Integer
|
||||
|
||||
Property Read ReadOnly As Boolean
|
||||
|
||||
Static Private $aExt As String[] = ["htm", "html", "xml", "svg", "css", "webpage", "js"]
|
||||
Static Private $aExt As String[] = ["htm", "html", "xml", "svg", "css", "webpage", "js", "c", "h", "cpp"]
|
||||
|
||||
' Private Const STYLE_HTML As Integer = 1
|
||||
' Private Const STYLE_CSS As Integer = 2
|
||||
@ -81,6 +81,10 @@ Public Sub LoadFile() As Boolean
|
||||
Case "js"
|
||||
edtEditor.Highlight = Highlight.JavaScript
|
||||
bShowCompress = Not Project.IsHiddenPath(Path)
|
||||
Case "c"
|
||||
edtEditor.Highlight = Highlight.C
|
||||
Case "cpp", "h"
|
||||
edtEditor.Highlight = Highlight.CPlusPlus
|
||||
Case Else
|
||||
edtEditor.Highlight = Highlight.HTML
|
||||
End Select
|
||||
@ -225,6 +229,24 @@ Public Sub Editors_KeyPress()
|
||||
Editor.Cut
|
||||
Endif
|
||||
Endif
|
||||
|
||||
Else If Key.Code = Key.Return Then
|
||||
|
||||
If Key.Control Then
|
||||
|
||||
If Key.Shift Then
|
||||
If Editor.Lines[Editor.Line].Expanded Then
|
||||
Editor.CollapseAll
|
||||
Else
|
||||
Editor.ExpandAll
|
||||
Endif
|
||||
Else
|
||||
Editor.Lines[Editor.Line].Expanded = Not Editor.Lines[Editor.Line].Expanded
|
||||
Endif
|
||||
Stop Event
|
||||
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
End
|
||||
|
@ -232,14 +232,14 @@
|
||||
{ btnCompress ToolButton mnuCompress
|
||||
Name = "btnCompress"
|
||||
MoveScaled(58,0,4,4)
|
||||
ToolTip = ("Indent")
|
||||
ToolTip = ("Compress file")
|
||||
Action = ".compress"
|
||||
Picture = Picture["icon:/small/archive"]
|
||||
}
|
||||
{ btnUncompress ToolButton mnuUncompress
|
||||
Name = "btnUncompress"
|
||||
MoveScaled(61,0,4,4)
|
||||
ToolTip = ("Unindent")
|
||||
MoveScaled(62,0,4,4)
|
||||
ToolTip = ("Uncompress file")
|
||||
Action = ".uncompress"
|
||||
Picture = Picture["icon:/small/undo"]
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ Breakpoint="#FF5F5F"
|
||||
Current="#BFDFFF"
|
||||
Datatype="#0080FF"
|
||||
Selection="#C0C0FF"
|
||||
Highlight="#FFFF00"
|
||||
Highlight="#E0E000"
|
||||
CurrentLine="#E7F3FF"
|
||||
Error="#808000,Underline"
|
||||
Help="#808080,Bold,Italic"
|
||||
Preprocessor="#00FF00,Bold"
|
||||
Preprocessor="#00C000,Bold"
|
||||
|
@ -21,3 +21,11 @@ _DoJavascript
|
||||
M
|
||||
|
||||
|
||||
_DoC
|
||||
M
|
||||
|
||||
|
||||
_DoCPlusPlus
|
||||
M
|
||||
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
# Gambas Project File 3.0
|
||||
# Compiled with Gambas 2.99.0
|
||||
# Compiled with Gambas 2.99.1
|
||||
Title=gb.eval.highlight
|
||||
Startup=Main
|
||||
Version=0.0.62
|
||||
Version=0.0.73
|
||||
Component=gb.eval
|
||||
TabSize=2
|
||||
MakeComponent=1
|
||||
|
@ -12,9 +12,12 @@ SearchComment=False
|
||||
SearchString=True
|
||||
|
||||
[OpenFile]
|
||||
Active=1
|
||||
File[1]=".src/Highlight.class:30.21"
|
||||
Count=1
|
||||
File[1]=".src/Highlight.class:29.2"
|
||||
File[2]=".src/HighlightJavascript.module:12.2"
|
||||
Active=3
|
||||
File[3]=".src/HighlightC.module:245.67"
|
||||
File[4]=".src/Main.module:0.0"
|
||||
Count=4
|
||||
|
||||
[Watches]
|
||||
Count=0
|
||||
|
@ -31,3 +31,15 @@ Static Public Sub _DoJavascript()
|
||||
HighlightJavascript.Run
|
||||
|
||||
End
|
||||
|
||||
Static Public Sub _DoC()
|
||||
|
||||
HighlightC.Run
|
||||
|
||||
End
|
||||
|
||||
Static Public Sub _DoCPlusPlus()
|
||||
|
||||
HighlightCPlusPlus.Run
|
||||
|
||||
End
|
||||
|
263
comp/src/gb.eval.highlight/.src/HighlightC.module
Normal file
263
comp/src/gb.eval.highlight/.src/HighlightC.module
Normal file
@ -0,0 +1,263 @@
|
||||
' Gambas module file
|
||||
|
||||
Private Const IDENT_CAR As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"
|
||||
Private Const DIGIT_CAR As String = "0123456789.+-eE"
|
||||
|
||||
Private $cKeyword As New Collection
|
||||
Private $cOperator As New Collection
|
||||
Private $cType As New Collection
|
||||
|
||||
Public Sub _init()
|
||||
|
||||
Dim sStr As String
|
||||
|
||||
For Each sStr In ["auto", "break", "case", "const", "continue", "default", "do", "else", "enum", "extern", "for",
|
||||
"goto", "if", "register", "return", "sizeof", "static", "struct", "switch", "typedef", "union", "volatile", "while"]
|
||||
$cKeyword[sStr] = 0
|
||||
Next
|
||||
|
||||
For Each sStr In ["FALSE", "NULL" "TRUE"]
|
||||
$cKeyword[sStr] = 1
|
||||
Next
|
||||
|
||||
For Each sStr In ["{", "}", ".", ">=", "+", "<<", "!", "=", ">>=", ";", "==", "-", ">>", "~", "+=", "(", ",", "!=", "*", "&&", "-=", "&=", ")", "<", "%", "&", "||", "*=", "|=", "[", ">", "++", "|", "?", "%=", "^=",
|
||||
"--", "^", ":", "<<=", "]", "<=", "/", "/="]
|
||||
$cOperator[sStr] = True
|
||||
Next
|
||||
|
||||
For Each sStr In ["void", "signed", "unsigned", "char", "short", "int", "long", "float", "double", "int64_t", "uint64_t", "int32_t", "uint32_t", "int16_t", "uint16_t", "int8_t", "uint8_t"]
|
||||
$cType[sStr] = True
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
Public Sub RunWith(cKeyword As Collection, cOperator As Collection, cType As Collection)
|
||||
|
||||
Dim iState As Integer
|
||||
Dim iTag As Integer
|
||||
Dim sText As String
|
||||
Dim iLenText As Integer
|
||||
Dim iPos, iSavePos As Integer
|
||||
Dim sCar As String
|
||||
Dim bSingleLineComment As Boolean
|
||||
Dim bSingleQuoteString As Boolean
|
||||
Dim sIdent As String
|
||||
Dim iPosType, iPosIdent, iPosAfterIdent As Integer
|
||||
Dim bTestShowLimit As Boolean
|
||||
Dim bLastExpr As Boolean
|
||||
|
||||
iState = Highlight.State
|
||||
iTag = Highlight.Tag
|
||||
sText = Highlight.Text
|
||||
iLenText = String.Len(sText)
|
||||
bLastExpr = True
|
||||
If iState = Highlight.Operator Then bLastExpr = False
|
||||
|
||||
If Left(LTrim(sText)) = "#" Then
|
||||
|
||||
Highlight.Add(Highlight.Preprocessor, iLenText)
|
||||
iState = Highlight.Normal
|
||||
|
||||
Else
|
||||
|
||||
For iPos = 1 To iLenText
|
||||
|
||||
If iState = Highlight.Normal Then
|
||||
|
||||
sCar = String.Mid$(sText, iPos, 1)
|
||||
If sCar = "/" Then
|
||||
sCar = String.Mid$(sText, iPos + 1, 1)
|
||||
If sCar = "/" Then
|
||||
iState = Highlight.Comment
|
||||
bSingleLineComment = True
|
||||
Else If sCar = "*" Then
|
||||
sCar = String.Mid$(sText, iPos + 2, 1)
|
||||
If sCar = "*" Then
|
||||
iState = Highlight.Help
|
||||
Else
|
||||
iState = Highlight.Comment
|
||||
Endif
|
||||
bSingleLineComment = False
|
||||
Endif
|
||||
Else If sCar = "\"" Then
|
||||
iState = Highlight.String
|
||||
bSingleQuoteString = False
|
||||
Else If sCar = "'" Then
|
||||
iState = Highlight.String
|
||||
bSingleQuoteString = True
|
||||
Else If Asc(sCar) <= 32 Then
|
||||
|
||||
Else If IsDigit(sCar) Then
|
||||
|
||||
sIdent = sCar
|
||||
sCar = String.Mid$(sText, iPos + 1, 1)
|
||||
If sCar = "x" Or If sCar = "X" Then
|
||||
sIdent &= sCar
|
||||
Inc iPos
|
||||
While iPos < iLenText
|
||||
Inc iPos
|
||||
sCar = String.Mid$(sText, iPos, 1)
|
||||
If Not IsHexa(sCar) Then
|
||||
Dec iPos
|
||||
Break
|
||||
Endif
|
||||
sIdent &= sCar
|
||||
Wend
|
||||
Else
|
||||
While iPos < iLenText
|
||||
Inc iPos
|
||||
sCar = String.Mid$(sText, iPos, 1)
|
||||
If InStr(DIGIT_CAR, sCar) = 0 Then
|
||||
Dec iPos
|
||||
Break
|
||||
Endif
|
||||
sIdent &= sCar
|
||||
Wend
|
||||
Endif
|
||||
|
||||
Highlight.Add(Highlight.Number, String.Len(sIdent))
|
||||
iState = Highlight.Normal
|
||||
bLastExpr = True
|
||||
Continue
|
||||
|
||||
Else If Len(sCar) >= 2 Or If InStr(IDENT_CAR, sCar) Then
|
||||
|
||||
sIdent = sCar
|
||||
iSavePos = iPos
|
||||
|
||||
While iPos < iLenText
|
||||
Inc iPos
|
||||
sCar = String.Mid$(sText, iPos, 1)
|
||||
If Len(sCar) = 1 And If Not IsDigit(sCar) And If InStr(IDENT_CAR, sCar) = 0 Then
|
||||
Dec iPos
|
||||
Break
|
||||
Endif
|
||||
sIdent &= sCar
|
||||
Wend
|
||||
|
||||
If cKeyword.Exist(sIdent) Then
|
||||
iState = Highlight.Keyword
|
||||
If cKeyword[sIdent] = 1 Then bLastExpr = True
|
||||
Else If cType.Exist(sIdent) Then
|
||||
iState = Highlight.Datatype
|
||||
bLastExpr = True
|
||||
If iPosType = 0 Then iPosType = iSavePos
|
||||
Else
|
||||
iState = Highlight.Symbol
|
||||
If iPosAfterIdent = 0 Then
|
||||
iPosIdent = iSavePos
|
||||
iPosAfterIdent = iSavePos + String.Len(sIdent)
|
||||
Endif
|
||||
bLastExpr = True
|
||||
Endif
|
||||
|
||||
Highlight.Add(iState, String.Len(sIdent))
|
||||
iState = Highlight.Normal
|
||||
Continue
|
||||
|
||||
Else
|
||||
|
||||
sIdent = sCar
|
||||
|
||||
While iPos < iLenText
|
||||
If cOperator.Exist(sIdent) Then Break
|
||||
Inc iPos
|
||||
sCar = String.Mid$(sText, iPos, 1)
|
||||
If IsLetter(sCar) Or If IsDigit(sCar) Or If IsBlank(sCar) Then
|
||||
Dec iPos
|
||||
Break
|
||||
Endif
|
||||
sIdent &= sCar
|
||||
Wend
|
||||
|
||||
If cOperator.Exist(sIdent) Then
|
||||
iState = Highlight.Operator
|
||||
Else
|
||||
iState = Highlight.Error
|
||||
Endif
|
||||
|
||||
Highlight.Add(iState, String.Len(sIdent))
|
||||
iState = Highlight.Normal
|
||||
bLastExpr = False
|
||||
|
||||
'Dec iPos
|
||||
Continue
|
||||
|
||||
Endif
|
||||
|
||||
Else If iState = Highlight.Comment Or If iState = Highlight.Help Then
|
||||
|
||||
If Not bSingleLineComment Then
|
||||
sCar = String.Mid$(sText, iPos, 2)
|
||||
If sCar = "*/" Then
|
||||
Highlight.Add(iState, 2)
|
||||
Inc iPos
|
||||
iState = Highlight.Normal
|
||||
Continue
|
||||
Endif
|
||||
Endif
|
||||
|
||||
Else If iState = Highlight.String Then
|
||||
|
||||
sCar = String.Mid$(sText, iPos, 1)
|
||||
If sCar = "\\" Then
|
||||
sCar = String.Mid$(sText, iPos + 1, 1)
|
||||
If sCar = "x" Then
|
||||
Highlight.Add(iState, 3)
|
||||
iPos += 2
|
||||
Continue
|
||||
Else If sCar = "u" Then
|
||||
Highlight.Add(iState, 5)
|
||||
iPos += 4
|
||||
Continue
|
||||
Else
|
||||
Highlight.Add(iState, 2)
|
||||
Inc iPos
|
||||
Continue
|
||||
Endif
|
||||
Else If sCar = "\"" And If Not bSingleQuoteString Then
|
||||
Highlight.Add(iState)
|
||||
iState = Highlight.Normal
|
||||
bLastExpr = True
|
||||
Continue
|
||||
Else If sCar = "'" And If bSingleQuoteString Then
|
||||
Highlight.Add(iState)
|
||||
iState = Highlight.Normal
|
||||
bLastExpr = True
|
||||
Continue
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
Highlight.Add(iState)
|
||||
|
||||
Next
|
||||
|
||||
If iState = Highlight.Comment And If bSingleLineComment Then
|
||||
iState = Highlight.Normal
|
||||
Endif
|
||||
|
||||
If iState <> Highlight.Comment And If iState <> Highlight.Help Then
|
||||
iState = Highlight.Normal
|
||||
Endif
|
||||
|
||||
Endif
|
||||
|
||||
If iPosType > 0 And iPosAfterIdent > iPosType Or If iPosIdent = 1 Then
|
||||
If InStr(String.Mid$(sText, iPosAfterIdent), "(") Then
|
||||
If RInStr(sText, ";") = 0 Then
|
||||
Highlight.ShowLimit = True
|
||||
Endif
|
||||
Endif
|
||||
Endif
|
||||
|
||||
Highlight.State = iState
|
||||
Highlight.Tag = iTag
|
||||
|
||||
End
|
||||
|
||||
Public Sub Run()
|
||||
|
||||
RunWith($cKeyword, $cOperator, $cType)
|
||||
|
||||
End
|
43
comp/src/gb.eval.highlight/.src/HighlightCPlusPlus.module
Normal file
43
comp/src/gb.eval.highlight/.src/HighlightCPlusPlus.module
Normal file
@ -0,0 +1,43 @@
|
||||
' Gambas module file
|
||||
|
||||
' Gambas module file
|
||||
|
||||
Private Const IDENT_CAR As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$"
|
||||
Private Const DIGIT_CAR As String = "0123456789.+-eE"
|
||||
|
||||
Private $cKeyword As New Collection
|
||||
Private $cOperator As New Collection
|
||||
Private $cType As New Collection
|
||||
|
||||
Public Sub _init()
|
||||
|
||||
Dim sStr As String
|
||||
|
||||
For Each sStr In ["asm", "auto", "break", "case", "catch", "class", "const", "const_cast", "continue", "default", "delete", "do", "dynamic_cast",
|
||||
"else", "enum", "explicit", "export", "extern", "for", "friend", "goto", "if", "inline", "mutable", "namespace", "new", "operator",
|
||||
"private", "protected", "public", "register", "reinterpret_cast", "return", "sizeof", "static", "static_cast", "struct", "switch",
|
||||
"template", "this", "throw", "try", "typedef", "typeid", "typename", "union", "using", "virtual", "volatile", "while"]
|
||||
$cKeyword[sStr] = 0
|
||||
Next
|
||||
|
||||
For Each sStr In ["false", "null" "true", "FALSE", "TRUE", "NULL"]
|
||||
$cKeyword[sStr] = 1
|
||||
Next
|
||||
|
||||
For Each sStr In ["{", "}", ".", ">=", "+", "<<", "!", "=", ">>=", ";", "==", "-", ">>", "~", "+=", "(", ",", "!=", "*", "&&", "-=", "&=", ")", "<", "%", "&", "||", "*=", "|=", "[", ">", "++", "|", "?", "%=", "^=",
|
||||
"--", "^", ":", "<<=", "]", "<=", "/", "/="]
|
||||
$cOperator[sStr] = True
|
||||
Next
|
||||
|
||||
For Each sStr In ["void", "bool", "signed", "unsigned", "char", "short", "int", "long", "float", "double", "int64_t", "uint64_t", "int32_t",
|
||||
"uint32_t", "int16_t", "uint16_t", "int8_t", "uint8_t", "wchar_t"]
|
||||
$cType[sStr] = True
|
||||
Next
|
||||
|
||||
End
|
||||
|
||||
Public Sub Run()
|
||||
|
||||
HighlightC.RunWith($cKeyword, $cOperator, $cType)
|
||||
|
||||
End
|
@ -2,7 +2,7 @@ Main
|
||||
gb.eval.highlight
|
||||
0
|
||||
0
|
||||
0.0.62
|
||||
0.0.72
|
||||
|
||||
gb.eval
|
||||
|
||||
|
@ -1117,6 +1117,8 @@ Private Sub CheckSeparators()
|
||||
Dim hChild As Control
|
||||
Dim aDelete As New Control[]
|
||||
|
||||
If $bDesign Then Return
|
||||
|
||||
For Each hChild In panToolBar.Children
|
||||
If hChild Is Separator Then
|
||||
hChild.Resize(SEPARATOR_SIZE, SEPARATOR_SIZE)
|
||||
|
@ -46,7 +46,8 @@ enum
|
||||
HIGHLIGHT_WEBPAGE,
|
||||
HIGHLIGHT_DIFF,
|
||||
HIGHLIGHT_JAVASCRIPT,
|
||||
HIGHLIGHT_C
|
||||
HIGHLIGHT_C,
|
||||
HIGHLIGHT_CPLUSPLUS
|
||||
};
|
||||
|
||||
typedef
|
||||
@ -63,6 +64,7 @@ static HIGHLIGHT_NAME _highlight_name[] = {
|
||||
{ HIGHLIGHT_DIFF, "_DoDiff" },
|
||||
{ HIGHLIGHT_JAVASCRIPT, "_DoJavascript" },
|
||||
{ HIGHLIGHT_C, "_DoC" },
|
||||
{ HIGHLIGHT_CPLUSPLUS, "_DoCPlusPlus" },
|
||||
{ HIGHLIGHT_CUSTOM, NULL }
|
||||
};
|
||||
|
||||
@ -1095,6 +1097,7 @@ GB_DESC CHighlightDesc[] =
|
||||
GB_CONSTANT("Diff", "i", HIGHLIGHT_DIFF),
|
||||
GB_CONSTANT("JavaScript", "i", HIGHLIGHT_JAVASCRIPT),
|
||||
GB_CONSTANT("C", "i", HIGHLIGHT_C),
|
||||
GB_CONSTANT("CPlusPlus", "i", HIGHLIGHT_CPLUSPLUS),
|
||||
|
||||
GB_CONSTANT("Background", "i", HIGHLIGHT_BACKGROUND),
|
||||
GB_CONSTANT("Normal", "i", HIGHLIGHT_NORMAL),
|
||||
|
@ -740,8 +740,10 @@ void GEditor::paintCell(QPainter *painter, int row, int)
|
||||
}
|
||||
else
|
||||
{
|
||||
QBrush brush(styles[GLine::Selection].color, Qt::Dense4Pattern);
|
||||
p.fillRect(0, 0, cache->width(), 1, brush);
|
||||
//QBrush brush(styles[GLine::Selection].color, Qt::Dense4Pattern);
|
||||
//p.fillRect(0, 0, cache->width(), 1, brush);
|
||||
p.setPen(styles[GLine::Selection].color);
|
||||
p.drawLine(0, 0, cache->width() - 1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -814,7 +816,7 @@ void GEditor::paintCell(QPainter *painter, int row, int)
|
||||
//highlight_text(p, x1m * charWidth + margin, fm.ascent(), l->s.getString().mid(x1m, 1), styles[GLine::Highlight].color);
|
||||
//highlight_text(p, x2m * charWidth + margin, fm.ascent(), l->s.getString().mid(x2m, 1), styles[GLine::Highlight].color);
|
||||
highlight_text(p, lineWidth(ym, x1m), fm.ascent(), lineWidth(ym, x1m + 1), _cellh, l->s.getString().mid(x1m, 1), styles[GLine::Highlight].color);
|
||||
//highlight_text(p, lineWidth(ym, x2m), fm.ascent(), lineWidth(ym, x2m + 1), _cellh, l->s.getString().mid(x2m, 1), styles[GLine::Highlight].color);
|
||||
highlight_text(p, lineWidth(ym, x2m), fm.ascent(), lineWidth(ym, x2m + 1), _cellh, l->s.getString().mid(x2m, 1), styles[GLine::Highlight].color);
|
||||
/*p.fillRect(x1m * charWidth + margin, 0, charWidth, _cellh, styles[GLine::Highlight].color);
|
||||
p.fillRect(x2m * charWidth + margin, 0, charWidth, _cellh, styles[GLine::Highlight].color);*/
|
||||
}
|
||||
|
@ -43,6 +43,7 @@
|
||||
#include "gbx_exec.h"
|
||||
|
||||
//#define DEBUG_STACK 1
|
||||
//#define SHOW_FUNCTION 1
|
||||
|
||||
/* Current virtual machine state */
|
||||
STACK_CONTEXT EXEC_current = { 0 };
|
||||
@ -436,6 +437,11 @@ void EXEC_enter(void)
|
||||
printf(" | >> %s\n", func->debug->name);
|
||||
#endif
|
||||
|
||||
#if SHOW_FUNCTION
|
||||
if (func->debug)
|
||||
fprintf(stderr, "%s.%s\n", EXEC.class->name, func->debug->name);
|
||||
#endif
|
||||
|
||||
/* check number of arguments */
|
||||
|
||||
if (UNLIKELY(nparam < func->npmin))
|
||||
@ -576,6 +582,11 @@ void EXEC_enter_quick(void)
|
||||
printf(" | >> %s\n", func->debug->name);
|
||||
#endif
|
||||
|
||||
#if SHOW_FUNCTION
|
||||
if (func->debug)
|
||||
fprintf(stderr, "%s.%s\n", EXEC.class->name, func->debug->name);
|
||||
#endif
|
||||
|
||||
/* save context & check stack */
|
||||
|
||||
STACK_push_frame(&EXEC_current, func->stack_usage);
|
||||
|
Loading…
x
Reference in New Issue
Block a user