Gambas Documentation - /comp/gb.qt4.ext/editor

/comp/gb.qt4.ext/editor

# Editor (gb.qt4.ext)

This control is a text editor with syntax highlighting support.

This editor has the following special features:

- Gambas source code syntax highlighting.

- Custom syntax highlighting, thanks to the Highlight event.

- Two (or more) editors can display the same text document.

- It can display line numbers on its left border too.

This class inherits Control in gb.qt4.
This class is
Create a new Editor.
creatable
.

Static properties | Constants
--- | ---

Return or set the picture used as bookmark symbol.
BookmarkPicture
Return or set the picture used by all Editor controls as breakpoint mark.
BreakpointPicture

AlwaysShowCursor BackgroundLimit
This flag indicates that procedures will be drawn with an alternative background.
BackgroundLimits
BlendLimit
This flag indicates that procedure separations will be drawn with a gradient.
BlendedLimits
Set this flag to hide the editor left margin.
HideMargin
Set this flag to highlight matching braces or brackets.
HighlightBraces
Set this flag to highlight the text as soon as the cursor moves.
HighlightImmediately
LineLimit
Set this flag to disable procedure folding.
NoFolding
NoLimit
Set this flag to highlight the current line.
ShowCurrentLine
Set this flag to display trailing spaces at the end of the line with little dots.
ShowDots
Set this flag to show the limits between procedures (or parts of the text that depends on the highlighting style).
ShowLimits
Set this flag to display line numbers.
ShowLineNumbers
Set this flag to mark modified lines.
ShowModifiedLines

Properties | Methods | Events
--- | --- | ---

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 editor bookmarks through an array of line positions.
Bookmarks
Return or set if the Editor has a border.
Border
Return or set the editor breakpoints through an array of line positions.
Breakpoints
Return the width of the `"m"` character in pixels.
CharWidth
Return the cursor column.
Column
Return or set the current executed line.
CurrentLine
Use this property for assigning a custom cursor to a control.
Cursor
Return the horizontal cursor position in pixels.
CursorX
Return the vertical position of the cursor top in pixels.
CursorY
Indicates that the control is in design mode.
Design
Returns or sets if a control accepts drops.
Drop
Indicates that the control is enabled.
Enabled
EndOfLine
Returns or sets if a control will expand if included in a container that arranges its contents.
Expand
Return a virtual array used for setting editor flags.
Flags
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 highlight 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 or set if keywords must be displayed entirely in upper case, like in Gambas 2.
KeywordsUseUpperCase
Returns or sets the position of the left border of the control relative to its parent.
Left
Return the text length in characters.
Length
Return the cursor line.
Line
Return the line height in pixels.
LineHeight
Return or set the offset added to line numbers.
LineNumberOffset
Return a virtual class that represents all lines of the edited text.
Lines
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
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 in read-only mode.
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 or sets the horizontal scrolling position.
ScrollX
Returns or sets the vertical scrolling position.
ScrollY
Return or set if some text is selected.
Selected
Return a virtual object used for managing the Editor selection.
Selection
Return a virtual class that allows to define the colors and font attributes used for highlighting the text.
Styles
Return or set the number of spaces used for displaying a tab character.
TabSize
Returns or sets the control tag.
Tag
Return or set the Editor text.
Text
Returns or sets the tooltip shown when the mouse stays on the control a few 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
Set this property to let the Editor edit the text of another Editor control.
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
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

Begin an undo block.
Begin
Clear the edited text.
Clear
Collapse all procedures.
CollapseAll
Copy the current selected text to the clipboard.
Copy
Cut the current selected text and put it into the clipboard.
Cut
Destroys the control.
Delete
Starts a drag & drop process.
Drag
End an undo block.
End
Expand all procedures.
ExpandAll
Find the next breakpoint after the specified line and return its line.
FindNextBreakpoint
Find the next limit (i.e. procedure beginning) after the specified line and return its line number.
FindNextLimit
Search for a specific word.
FindNextWord
Move the cursor to the specified position.
Goto
Grab the keyboard and the mouse so that all keyboard and mouse events are received by the control.
Grab
Hides the control.
Hide
Highlight the edited text entirely if some lines have not been highlighted yet.
HighlightAll
Indent the current selected text.
Indent
Insert the specified text in the Editor.
Insert
Sends the control to the background of its parent.
Lower
Moves and/or resizes the control.
Move
Moves and/or resizes the control.
MoveScaled
Paste the clipboard contents at the current cursor position.
Paste
Return the column under the specified pixel position.
PosToColumn
Return the line under the specified pixel vertical position.
PosToLine
Insert text like the Insert method, but all control characters (those having an ASCII code lower than 32) are interpreted.
Print
Sends the control to the foreground of its parent.
Raise
Redo the last undone modification.
Redo
Redraws the control, or just a part of it.
Refresh
Remove the text located between the specified limits.
Remove
Changes the container of a control.
Reparent
Reset all lines marked as modified.
Reset
Resizes the control.
Resize
Resizes the control.
ResizeScaled
Scroll the contents to the given position.
Scroll
Select the text located between the specified limits.
Select
Select all text.
SelectAll
Gives the focus to the control.
SetFocus
Shows the control.
Show
Highlight a specified string everywhere in the text.
ShowString
Return the X coordinate of a cursor position in pixels.
ToPosX
Undo the last modification.
Undo
Unindent the current selected text.
Unindent

This event is raised when the edited text has been modified.
Change
This event is raised each time the cursor moves.
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 the Highlight property is set to Highlight.Custom, each time a 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 double-clicks inside the margin of the specified line.
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 the text scrolls.
Scroll