Gambas文档
编译和安装
错误消息
代码片段
待办事项
废弃的组件
教程
开发环境文档
开发者文档
名词解释
如何操作
说明
维基手册
维基搜索
维基许可协议
文档
应用程序仓库
语言概览
语言索引
主题
组件
gb
gb.args
gb.cairo
gb.chart
gb.clipper
gb.complex
gb.compress
gb.crypt
gb.data
gb.db
gb.db.form
gb.db.mysql
gb.db.odbc
gb.db.postgresql
gb.db.sqlite2
gb.db.sqlite3
gb.dbus
gb.dbus.trayicon
gb.debug
gb.desktop
gb.desktop.x11
gb.eval
gb.eval.highlight
gb.form
gb.form.dialog
gb.form.editor
TextEditor
gb.form.htmlview
gb.form.mdi
gb.form.print
gb.form.terminal
gb.gmp
gb.gsl
gb.gtk
gb.gtk3
gb.gtk3.opengl
gb.gtk3.webview
gb.gui
gb.gui.qt
gb.gui.qt.ext
gb.gui.trayicon
gb.gui.webview
gb.hash
gb.highlight
gb.image
gb.image.effect
gb.image.io
gb.inotify
gb.logging
gb.map
gb.media
gb.media.form
gb.mime
gb.mongodb
gb.mysql
gb.ncurses
gb.net
gb.net.curl
gb.net.pop3
gb.net.smtp
gb.opengl
gb.opengl.glsl
gb.opengl.glu
gb.opengl.sge
gb.openssl
gb.option
gb.pcre
gb.pdf
gb.poppler
gb.qt4
gb.qt4.ext
gb.qt4.opengl
gb.qt4.webkit
gb.qt4.webview
gb.qt5
gb.qt5.ext
gb.qt5.opengl
gb.qt5.webview
gb.qt6
gb.qt6.ext
gb.qt6.opengl
gb.qt6.webview
gb.report
gb.report2
gb.sdl
gb.sdl2
gb.sdl2.audio
gb.settings
gb.signal
gb.term
gb.test
gb.util
gb.util.web
gb.v4l
gb.vb
gb.web
gb.web.feed
gb.web.form
gb.web.gui
gb.xml
gb.xml.html
gb.xml.rpc
gb.xml.xslt
最近的修改

TextEditor (gb.form.editor)

此控件是一个增强的文本编辑器,支持语法高亮显示。

此编辑器具有以下特殊功能:

  • Gambas、HTML、CSS、C、C++、JavaScript、SQL和diff文件的源代码语法高亮显示。

  • 完整支持编辑,包括复制、粘贴、剪切、撤消和重做。

  • 断行!

  • 许多IDE可选显示功能(行编号、块折叠指示器、大括号匹配指示器。。。

  • 编码增强功能,如书签、选项卡扩展、断点指示器。。。

  • 。。。还有更多!

该类继承于 UserControlgb.qt4中.

该类是可创建

该类行为像一个只读数组。

属性
Bookmarks   Return or set the list of lines having a bookmark
Border   Return or set if a border must be drawn around the editor.
Breakpoints   Return or set the list of lines having a breakpoint
CloseBraces   Return or set if braces are automatically closed.
CloseStrings   Return or set if strings are automatically closed.
Column   Return the current column position, starting from zero.
Count   Return the number of lines.
Current   Return the current line as a virtual object.
CurrentWord   Return the current word around the cursor.
DiffMode   Return or set if the "diff mode" is activated.
DisabledBreakpoints   Return or set the list of lines having a disabled breakpoint
EndOfLine   Return or set the newline separator used by the editor.
Font  
Highlight   Return or set the highlighting mode.
Keywords   Return the language keywords associated with the editor mode, as defined by the Mode property.
LastColumn   Return the old column position before a cursor move.
LastLine   Return the old line position before a cursor move.
Length   Return the length of the editor contents.
Line   Return the current line position, starting from zero.
LineHeight   Return the height of a line in pixels.
LineNumberOffset   Return or set the line number offset.
Max   Return the number of lines minus one.
Mode   Return or set the editor mode.
Overwrite   Return or set if the editor is in overwrite mode.
ReadOnly   Return or set if the editor is in read-only mode.
Rewrite   Return or set if the highlighter can rewrite the highlighted contents.
ScrollBar  
ScrollH  
ScrollHeight  
ScrollW  
ScrollWidth  
ScrollX  
ScrollY  
Selected   Return if some text is selected.
SelectedText   Return the selected text if any.
SelectionColumn   Return the column position of the selection mark.
SelectionLine   Return the line position of the selection mark.
ShowBraces   Return or set if matching braces are highlighted.
ShowCurrent   Return or set if the current line is highlighted.
ShowCursor   Return or set if the cursor is visible.
ShowExpand   Return or set if the functions can be collapsed and expanded.
ShowIcon   Return or set if the breakpoint or bookmark icons are visible.
ShowIndent   Return or set if indentation is highlighted with vertical lines.
ShowLimit   Return or set if the function limits are visible.
ShowLineNumber   Return or set if the line numbers are displayed.
ShowModified   Return or set if the modified lines are highlighted in the margin.
ShowPosition   Return or set if the cursor current position is displayed.
ShowPreview   Return or set if the editor right scrollbar is replaced by a preview.
ShowSpaces   Return or set if trailing whitespaces are displayed as dots.
StopLine   Return or set the debugger stop line.
Styles   Return a virtual object that allows to define the editor highlighting style.
TabIndent   Return or set if the ident is made of tab characters.
TabSize   Return or set the tab size.
Text   Return or set the editor contents.
Theme   Return or set the theme used for highlighting. Replace the Styles property.
View   Return or set the main view of a editor.
Wrap   Return or set if the editor wraps its contents.

Inherited properties
Action  
Background  
Children  
ClientH  
ClientHeight  
ClientW  
ClientWidth  
ClientX  
ClientY  
Cursor  
Design  
Direction  
Drop  
Enabled  
Expand  
Foreground  
H  
Handle  
HasFocus  
Height  
Hovered  
Id  
Ignore  
Left  
Mouse  
Name  
Next  
NoAnimation  
NoTabFocus  
Parent  
PopupMenu  
Previous  
Proxy  
ProxyFor  
RightToLeft  
ScreenX  
ScreenY  
Tag  
Tooltip  
Top  
Tracking  
Visible  
W  
Width  
Window  
X  
Y  

方法
Append   Append some text to the editor's end without moving the cursor.
Begin   Start a serie of changes that will be undone in one shot.
Clear   Clear the editor contents
CollapseAll   Collapse all functions
Copy   Copy the current selected text to the clipboard.
CursorAt   Convert a cursor position into pixel position
Cut   Cut the current selected text and copy it to the clipboard.
End   End a serie of changes.
EnsureVisible  
EnterDiffMode   Enter "diff mode".
ExpandAll   Expand all functions.
FindNextDiff   Find the line position of the next difference.
FindNextLimit   Find the line position of the next function limit.
FindNextString   Find the next line containing a specific string or find the next occurence of a string.
FindPreviousDiff   Find the line position of the previous difference.
FindPreviousLimit   Find the line position of the previous function limit.
FindPreviousString   Find the previous line containing a specific string or find the previous occurence of a string.
GetHighlight   Return the highlighting of a specific line.
GetIndent   Return the indent of a line or of a line range.
GetSelectedLines   Return the selected lines if any.
Goto   Move the cursor to the specified position.
GotoCenter   Move the cursor to the specified position and center the view around it.
HideSelection   Hide the current selection if any.
HighlightString   Highlight a specific string everywhere in the editor.
Indent   Indent the selected text, or the current line if there is no selected text.
Insert   Insert some text at the current cursor position.
IsVoid   Return if the editor contents is void.
LeaveDiffMode   Leave diff mode.
Load   Load a file into the editor.
LowerCase   Convert the selected text to lower case.
Paste   Paste the contents of the clipboard inside the editor.
Print   Print some text inside the editor.
Redo   Redo the last undone change.
Refresh   Refresh the editor view.
Remove   Remove the text located between two cursor positions.
Reset   Reset the modified and saved flags of each line.
RestoreCursor   Restore the cursor position and selection range saved by the SaveCursor method.
Save   Save the editor contents into a file.
SaveCursor   Save the current cursor position and selection range.
Scroll  
Select   Select a specific text range.
SelectAll   Select all editor contents
ShowFindPanel   Display the text search panel.
ShowGotoPanel   Display the goto line panel.
ToColumn   Return the column located under the specified mouse cursor position.
ToLine   Return the line located under the specified mouse cursor position.
ToPos   Return the relative position in pixels of a specific cursor position.
ToPosX   Return the relative horizontal position in pixels of a specific cursor position.
ToPosY   Return the relative vertical position in pixels of a specific cursor position.
Undo   Undo the last change.
Unindent   Unindent the selected text, or the current line if there is no selected text.
UpperCase   Convert the selected text to upper case.

Inherited methods
Delete  
Drag  
FindChild  
Grab  
Hide  
Lower  
Move  
MoveScaled  
Raise  
Reparent  
Resize  
ResizeScaled  
SetFocus  
Show  

事件
Change   This event is raised when the editor contents has changed.
Cursor   This event is raised when the cursor has moved.
Highlight   This event is raised when a text line must be highlighted.
Margin   This event is raised when the user has clicked twice inside the margin.
Scroll   This event is raised when the editor has scrolled.

Inherited events
Arrange  
BeforeArrange  
DblClick  
Drag  
DragLeave  
DragMove  
Drop  
Enter  
GotFocus  
KeyPress   KeyPress例程结束后,textbox控件内部的文本被Gambas根据按键编辑。所以它不检测从KeyPress 事件处理程序及其调用的任何子程序和函数中写回进Text 属性的任何信息。而Change事件开始于内容更新之后。
KeyRelease  
Leave  
LostFocus  
Menu  
MouseDown  
MouseDrag  
MouseMove  
MouseUp  
MouseWheel  
NewChild  

Guess where it's used within Gambas itself

Do not use the normal Background and Foreground properties to change the look of a TextEditor.

To change background colors or other highlighting styles within the Editor control you must use the Styles property and a Highlight constant.

For example:

TextEditor1.Styles[Highlight.Background].Color = Color.RGB(200, 200, 200)

See the Highlight class for all available constants.