User Tools

Site Tools


richtextbox

RichTextBox (QTextEdit)

The Qt documentation in C++ of this class (QTextEdit) can be read here: http://doc.trolltech.com/4.3/qtextedit.html

A control for the form object, provides a powerful single-page rich text editor.

Please read the control class overview Control as well.

It is an advanced WYSIWYG viewer/editor supporting rich text formatting using HTML-style tags. It is optimized to handle large documents and to respond quickly to user input. It can display a large HTML subset, including tables and images.

The following link lists the HTML tags supported by Qt's rich text engine: http://doc.trolltech.com/4.3/richtext-html-subset.html

The property “Value” contains the text of this control. “OldValue” is there as well. Use method “Append(String)” to quickly append text to the current text.

Be aware that either syntax highlighting through keywords or richt text is supported. This is no “limitation” of KBasic, but of Qt. Which means you cannot display rich text and combine it with syntax highlighting of keywords. WORKAROUND: First load the text in the Richtextbox and then load the keywords and it works.

PROPERTIES

Value

Property Value As String

Returns the text as plain text without RTF formatting or with RTF formatting, if AcceptRichText = True.


OldValue

Property OldValue As String (ReadOnly)


Text

Property Text As String.

Same as Value. Provided for easy-use.


ReadOnly

Property ReadOnly As Boolean


WordWrap

Property WordWrap As Boolean


Flat

Property Flat As Boolean (ReadWrite)

If it is true, appears as flat control. This is only useful to change the visual appearance.


Alignment

Property Alignment As String (ReadWrite)


AcceptRichText

Property AcceptRichText As Boolean (ReadWrite)


Comment1Begin

Property Comment1Begin As String (ReadOnly)


Comment1End

Property Comment1End As String (ReadOnly)


Comment2Begin

Property Comment2Begin As String (must be one character only / ReadOnly)

Means a one line comment, starts with one character till end of line (EOL)


Keywords

Property Keywords As String (CSV/ReadOnly)


Commands

Property Commands As String (CSV/ReadOnly)


CommentColor

Property CommentColor As String (ReadOnly)


KeywordColor

Property KeywordColor As String (ReadOnly)


CommandColor

Property CommandColor As String (ReadOnly)

(StringColor)

Property StringColorAs String (ReadOnly)

Not implemented yet.

METHODS


Html

Function Html() As String


IsModified

Function IsModified() As Boolean


SetModified

Function SetModified(Boolean)


(SetFontColor)

Not implemented yet.

Sub SetFontColor(ColorObject As Color)


SetFontColor

Sub SetFontColor(ColorId As String)


SetFontPointSize

Sub SetFontPointSize(FontPointSize As Double)


SetFontFamily

Sub SetFontFamily(FontFamily As String)


SetFontBold

Sub SetFontBold(IsFontBold As Boolean)


SetFontItalic

Sub SetFontItalic(IsFontItalic As Boolean)


SetFontUnderline

Sub SetFontUnderline(IsFontUnderline As Boolean)


Line

Function Line() As Integer


Column

Function Column() As Integer


Selected

Function Selected() As String


Undo

Sub Undo()


Redo

Sub Redo()


SetTabChangesFocus

Sub SetTabChangesFocus(IsTabChangesFocus As Boolean)


SetTabStopWidth

Sub SetTabStopWidth (TabStopWidth As Integer)


RemoveAll

Sub RemoveAll()


Copy

Sub Copy()


Paste

Sub Paste()


Cut

Sub Cut()


SelectAll

Sub SelectAll()


InsertHtml

Sub InsertHtml(Text As String)


InsertPlainText

Sub InsertPlainText(Text As String)


Append

Sub Append(Text As String)


SetHtml

Sub SetHtml(String)


SetPlainText

Sub SetPlainText(String)


PlainText

Function PlainText() As String


SetTextCursorPosition

Sub SetTextCursorPosition(Row As Integer, Column As Integer)

Implemented since KBasic V1.89(j).


SetTextCursorPosition

Sub SetTextCursorPosition(Index As Integer)

Not implemented yet.


WrappedLine() WrappedColumn() WrappedSetTextCursorPosition(Line, Column)

Works on the appearance the user is shown (visible count of lines and columns)

Not implemented yet.

EVENTS

OnEvent

Sub OnEvent()

This event is called whenever the text has changed.


OnCursorPositionChanged

Sub OnCursorPositionChanged()


OnAction

Sub OnAction(CopyAvailable As Boolean, PasteAvailable As Boolean, UndoAvailable As Boolean, RedoAvailable As Boolean)


richtextbox.txt · Last modified: 2013/06/04 13:56 by berndnoetscher