TextEditor (gb.form.editor)

This control is an enhanced text editor with syntax highlighting support.

This editor has the following special features:

  • Source code syntax highlighting for Gambas, HTML, CSS, C, C++, JavaScript, SQL and diff files.

  • Fully managed editing including Copy, Paste, Cut, Undo and Redo.

  • Line wrapping!

  • Many IDE selectable display features (Line numbering, block folding indicators, brace matching indicators...

  • Coding enhancements such as bookmarks, tab expansion, breakpoint indicatiors...

  • ...and much more!

Esta classe herda UserControl em gb.qt4.
Esta classe é
Create a new TextEditor control.
criável
.
Esta classe funciona como um array
Return a virtual object representing a specific line.
apenas leitura
.

Propriedades

Métodos Eventos
Returns or sets the action string associated with the control.
Action  
Returns or sets the background color used by the control.
Background  
Return or set the list of lines having a bookmark
Bookmarks  
Returns or sets if the control has a border.
Border  
Return or set the list of lines having a breakpoint
Breakpoints  
Returns a collection of each control included in the container.
Children  
A synonymous for the ClientHeight property.
ClientH  
Returns the height of the area containing the controls.
ClientHeight  
A synonymous for the ClientWidth property.
ClientW  
Returns the width of the area containing the controls.
ClientWidth  
Returns the position of the top border of the area containing the controls.
ClientX  
Returns the position of the left border of the area containing the controls.
ClientY  
Return or set if braces are automatically closed.
CloseBraces  
Return or set if strings are automatically closed.
CloseStrings  
Return the cursor position in the current line.
Column  
Return the number of lines.
Count  
Return the current line as a virtual object.
Current  
Use this property for assigning a custom cursor to a control.
Cursor  
Indicates that the control is in design mode.
Design  
Return or set if the "diff mode" is activated.
DiffMode  
Return or set the list of lines having a disabled breakpoint
DisabledBreakpoints  
Returns or sets if a control accepts drops.
Drop  
Indicates that the control is enabled.
Enabled  
Return or set the newline separator used by the editor.
EndOfLine  
Returns or sets if a control will expand if included in a container that arranges its contents.
Expand  
Returns or sets the font used to draw text in the control.
Font  
Returns or sets the foreground color used by the control.
Foreground  
A synonymous for the Height property.
H  
Returns the internal X11 window handle of the control.
Handle  
Returns whether the control has the focus.
HasFocus  
Returns or sets the height of the control.
Height  
Return or set the highlighting mode.
Highlight  
Returns whether the mouse cursor is inside the control.
Hovered  
A synonymous for the Handle property.
Id  
Returns or sets if a control must be ignored when its parent arranges its children.
Ignore  
Return the language keywords associated with the editor mode, as defined by the Mode property.
Keywords  
Return the old column position before a cursor move.
LastColumn  
Return the old line position before a cursor move.
LastLine  
Returns or sets the position of the left border of the control relative to its parent.
Left  
Compute and return the length of the Text property as UTF-8 characters.
Length  
Return the cursor line position.
Line  
Return the height of a line in pixels.
LineHeight  
Return or set the line number offset.
LineNumberOffset  
Return the number of lines minus one.
Max  
Return or set the editor mode.
Mode  
Returns or sets the appearence of the cursor when it points inside the control.
Mouse  
Returns or sets the name of the control.
Name  
Returns the next control having the same parent.
Next  
Return or set if a control cannot be focused with the TAB key.
NoTabFocus  
Return or set if the editor is in overwrite mode.
Overwrite  
Returns the control container.
Parent  
Return or set the name of the menu that will be popped-up when the user presses the right mouse button or the keyboard MENU key.
PopupMenu  
Returns the previous control having the same parent.
Previous  
Return or set the "proxy" of a control.
Proxy  
Return or set if the editor is read-only.
ReadOnly  
Returns the position of the left border of the control in screen coordinates.
ScreenX  
Returns the position of the top border of the control in screen coordinates.
ScreenY  
Return or set which scrollbars are displayed.
ScrollBar  
Returns the contents height.
ScrollH  
Returns the contents height.
ScrollHeight  
Returns the contents width.
ScrollW  
Returns the contents width.
ScrollWidth  
Returns or sets the horizontal scrolling position.
ScrollX  
Returns or sets the vertical scrolling position.
ScrollY  
Return if some text is selected.
Selected  
Return the editor selected text.
SelectedText  
Return the column position of the selection mark.
SelectionColumn  
Return the line position of the selection mark.
SelectionLine  
Return or set if matching braces are highlighted.
ShowBraces  
Return or set if the current line is highlighted.
ShowCurrent  
Return or set if the cursor is visible.
ShowCursor  
Return or set if the functions can be collapsed and expanded.
ShowExpand  
Return or set if the breakpoint or bookmark icons are visible.
ShowIcon  
Return or set if the editor displays tab characters as little gray arrows.
ShowIndent  
Return or set if the function limits are visible.
ShowLimit  
Return or set if the editor show line numbers.
ShowLineNumber  
Return or set if the modified lines are highlighted in the margin.
ShowModified  
Return or set if the cursor current position is displayed.
ShowPosition  
Return or set if the editor replaces its scrollbar by a minified preview.
ShowPreview  
Return or set if trailing whitespaces are displayed as dots.
ShowSpaces  
Return or set the debugger stop line.
StopLine  
Return a virtual object that allows to define the editor highlighting style
Styles  
Return or set if the ident is made of tab characters.
TabIndent  
Return or set the tab size.
TabSize  
Returns or sets the control tag.
Tag  
Return or set the editor text contents.
Text  
Returns or sets the tooltip shown when the mouse stays on the control for a short time.
Tooltip  
Returns or sets the position of the top border of the control relative to its parent.
Top  
Returns or sets if the control will receive MouseMove events.
Tracking  
Return or set the main view of a editor.
View  
Indicates if the control is visible or not.
Visible  
A synonymous for the Width property.
W  
Returns or sets the width of the control.
Width  
Returns the top-level window that contains the control.
Window  
Return or set if the editor wraps the lines to fit the control width.
Wrap  
Returns or sets the position of the left border of the control relative to its parent.
X  
Returns or sets the position of the top border of the control relative to its parent.
Y  
Start a serie of changes that will be undone in one shot.
Begin  
Clear the editor contents
Clear  
Collapse all functions
CollapseAll  
Copy the currently selected text to the clipboard.
Copy  
Convert a cursor position into pixel position
CursorAt  
Copy the currently selected text to the clipboard, and delete the selected text.
Cut  
Destroys the control.
Delete  
Starts a drag & drop process.
Drag  
End a serie of changes.
End  
Enter "diff mode".
EnterDiffMode  
Expand all functions.
ExpandAll  
Finds the first child control pointed by the X and Y coordinates.
FindChild  
Find the line position of the next difference.
FindNextDiff  
Find the line position of the next function limit.
FindNextLimit  
Find the next line containing a specific string.
FindNextString  
Find the line position of the previous difference.
FindPreviousDiff  
Find the line position of the previous function limit.
FindPreviousLimit  
Find the previous line containing a specific string.
FindPreviousString  
Return the highlighting a specific line.
GetHighlight  
Return the indent of a line or of a line range.
GetIndent  
Return the selected lines if any.
GetSelectedLines  
Move the cursor to the specified position.
Goto  
Move the cursor to the specified position and center the view around it.
GotoCenter  
Grab the keyboard and the mouse so that all keyboard and mouse events are received by the control.
Grab  
Hides the control.
Hide  
Hide the current selection if any.
HideSelection  
Highlight a specific string everywhere in the editor.
HighlightString  
Indent the selected text, or the current line if there is no selected text.
Indent  
Insert some text at the current cursor position.
Insert  
Return if the editor contents is void.
IsVoid  
Leave diff mode.
LeaveDiffMode  
Load a file into the editor.
Load  
Sends the control to the background of its parent.
Lower  
Convert the selected text to lower case.
LowerCase  
Moves and/or resizes the control.
Move  
Moves and/or resizes the control.
MoveScaled  
Paste the contents of the clipboard inside the editor.
Paste  
Print some text inside the editor.
Print  
Sends the control to the foreground of its parent.
Raise  
Redo the last undone editor modification.
Redo  
Refresh the editor view.
Refresh  
Remove the text located between two cursor positions.
Remove  
Changes the container of a control.
Reparent  
Reset the modified and saved flags of each line.
Reset  
Resizes the control.
Resize  
Resizes the control.
ResizeScaled  
Restore the cursor position and selection range saved by the SaveCursor method.
RestoreCursor  
Save the editor contents into a file.
Save  
Save the current cursor position and selection range.
SaveCursor  
Scroll the contents to the given position.
Scroll  
Select a specific text range.
Select  
Select all editor contents
SelectAll  
Gives the focus to the control.
SetFocus  
Shows the control.
Show  
Return the column located under the specified mouse cursor position.
ToColumn  
Return the line located under the specified mouse cursor position.
ToLine  
Return the relative position in pixels of a specific cursor position.
ToPos  
Return the relative horizontal position in pixels of a specific cursor position.
ToPosX  
Return the relative vertical position in pixels of a specific cursor position.
ToPosY  
Undo the last editor modification.
Undo  
Unindent the selected text, or the current line if there is no selected text.
Unindent  
Convert the selected text to upper case.
UpperCase  
This event is raised when a container has just finished arranging its contents.
Arrange  
This event is raised just before a container arranges its contents.
BeforeArrange  
This event is raised when the editor contents has changed.
Change  
This event is raised when the cursor has moved.
Cursor  
Raised when the user quickly clicks twice on the control.
DblClick  
This event is raised when the mouse enters the control during a drag & drop process.
Drag  
This event is raised when the mouse leaves the control during a drag & drop operation.
DragLeave  
This event is raised while the mouse moves inside the control during a drag & drop process.
DragMove  
This event is raised when a drag is dropped in the control.
Drop  
Raised when the mouse enters the control.
Enter  
Raised when the control has got the focus.
GotFocus  
This event is raised when a text line must be highlighted.
Highlight  
Raised when a key is pressed while the control has the focus.
KeyPress  
Raised when a key is released while the control has the focus.
KeyRelease  
Raised when the mouse leaves the control.
Leave  
Raised when the control has lost the focus.
LostFocus  
This event is raised when the user has clicked twice inside the margin.
Margin  
Raised when the user clicks on the control with the right mouse button, or if it hits the MENU key.
Menu  
Raised when a mouse button is pressed while the cursor is inside the control.
MouseDown  
This event is raised when a drag operation should be started.
MouseDrag  
Raised when the mouse moves inside the control while a mouse button is pressed.
MouseMove  
Raised when a mouse button is depressed while the cursor is inside the control.
MouseUp  
This event is raised when the user moves or presses the mouse wheel while the mouse is inside the control.
MouseWheel  
This event is raised when a new child Control has just been inserted into the container.
NewChild  
This event is raised when the editor has scrolled.
Scroll  

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.