QT Class RadTextEdit

 

Overview

The RadTextEdit class is the principal tool for AIS Lisp to surface text edit pane functionality. The RadTextEdit is one of the key words accepted by the qt new: function. Each RadTextEdit control comes with HTML rich text functionality. There can be many RadTextEdit objects.

new

Overview

The new function creates a new RadTextEdit object and returns a pointer to the newly created object. The RadTextEdit is one of the class key words accepted by the qt new: function. There can be many RadTextEdit objects.

 

Syntax

(qt new: RadTextEdit:)

(qt new: RadTextEdit: keyMgr)

Arguments

keyMgr(Optional)The key manager lambda to manage the RADTextEDIT object's key strokes.
ReturnsAlways returns a pointer to the newly created RadTextEdit object.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window

delete

Overview

The delete function destroys a RadTextEdit object and returns a null pointer.

 

Syntax

(qt delete: radTextEditPtr)

Arguments

radTextEditPtrThe pointer to the RadTextEdit object to be destroyed.
ReturnsAlways returns a null pointer.

 

Example1

(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a RadTextEdit object.
(setq radTextEditPtr (qt delete: radTextEditPtr)) ;; Destroy the RadTextEdit object.

copy

Overview

The RadTextEdit copy function copies the currently selected (highlights) text in the RadTextEdit display pane to the main window clipboard. The copy function alwats returns #void.

 

Syntax

(qt radTextEditPtr copy:)

Arguments

resultAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to "Hello world".
(setq return (qt radTextEditPtr find: "Hello" false true false)) ;; Select and highlight the "Hello" text in the RadTextEdit pane.
(qt radTextEditPtr copy:) ;; Copy the selected text to the main window clipboard.

find

Overview

The RadTextEdit find function locates and selects (highlights) the next occurance of the specified text in the RadTextEdit display pane. The find can be case sensitive, backwards or forewards, and search for whole words only depending on the specified switches. Once found the matching text is selected (highlighted) in the RadTextEdit display pane. The find function returns true if the specified text was found and selected.

 

Syntax

(setq result (qt radTextEditPtr find: text caseInSensitiveSW backWardsSW wholeWordSW))

Arguments

textThe text to be matched in the RadTextEdit display pane.
caseInSensitiveSWTrue if the find is to be case sensitive.
backWardsSWTrue if the find is to be backwards from the current cursor location.
wholeWordSWTrue if the find is to be for whole words only.
resultAlways returns the true if the find was successful.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to "Hello world".
(setq return (qt radTextEditPtr find: "Hello" false true false)) ;; Select and highlight the "Hello" text in the RadTextEdit pane.

getHtmlText

Overview

The RadTextEdit getHtmlText function returns the entire contents of the RadTextEdite display pane as an HTML markup string.

 

Syntax

(setq myHtml (qt radTextEditPtr getHtmlText:))

Arguments

myHtmlAlways returns the entire contents of the RadTextEdit display pane as an HTML markup string.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setHtmlText: "Hello world")) ;; Set the RadTextEdit display pane to specified HTML text.
(setq return (qt radTextEditPtr getHtmlText:)) ;; Return the HTML text in the RadTextEdit pane.

getText

Overview

The RadTextEdit getText function returns the entire contents of the RadTextEdit display pane as an ASCII string.

 

Syntax

(setq myText (qt radTextEditPtr getText:))

Arguments

myTextAlways returns the entire contents of the RadTextEdit display pane as an ADCII string.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.
(setq return (qt radTextEditPtr getText:)) ;; Return the ASCII text in the RadTextEdit pane.

getSelectedText

Overview

The RadTextEdit getSelectedText function returns the entire contents of currently selected text in the RadTextEdit display pane.

 

Syntax

(setq myText (qt radTextEditPtr getSelectedText:))

Arguments

myTextAlways returns the entire contents of currently selected text in the RadTextEdit display pane.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.
(setq result (qt radTextEditPtr find: "world" false true false)) ;; Select and highlight the "world" text on the RadTextEdit pane.
(setq result (qt radTextEditPtr getSelectedText:)) ;; Return the text selected by the find.

getSelectionEnd

Overview

The RadTextEdit getSelectionEnd function returns the end position of the currently selected text in the RadTextEdit display pane.

 

Syntax

(setq pos (qt radTextEditPtr getSelectionEnd:))

Arguments

posAlways returns the end position of the currently selected text in the RadTextEdit display pane.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.
(setq result (qt radTextEditPtr find: "world" false true false)) ;; Select and highlight the "world" text on the RadTextEdit pane.
(setq result (qt radTextEditPtr getSelectedEnd:)) ;; Return the selected text ending position of 10.

getSelectionStart

Overview

The RadTextEdit getSelectionStart function returns the start position of the currently selected text in the RadTextEdit display pane.

 

Syntax

(setq pos (qt radTextEditPtr getSelectionStart:))

Arguments

posAlways returns the start position of the currently selected text in the RadTextEdit display pane.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.
(setq result (qt radTextEditPtr find: "world" false true false)) ;; Select and highlight the "world" text on the RadTextEdit pane.
(setq result (qt radTextEditPtr getSelectedStart:)) ;; Return the selected text starting position of 6.

paste

Overview

The RadTextEdit paste function copies the main window clipboard contents into the currently selected (highlighted) text in the RadTextEdit display pane. The copy function alwats returns #void.

 

Syntax

(qt radTextEditPtr paste:)

Arguments

resultAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to "Hello world".
(setq return (qt radTextEditPtr find: "Hello" false true false)) ;; Select and highlight the "Hello" text in the RadTextEdit pane.
(qt mainWindow: setClipboardText: "Bye") ;; Copy the text "Byen" into the main window clipboard.
(qt radTextEditPtr paste:) ;; Copy the text "Bye" over the selected text in the RadTextEdit pane which now reads "Bye world".

selectAll

Overview

The RadTextEdit selectAll function selects highlights all text in the RadTextEdit display pane.

 

Syntax

(qt radTextEditPtr selectAll:)

Arguments

returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr selectAll:)) ;; Select and highlight all text in the RadTextEdit pane.
(setq result (qt radTextEditPtr getSelectedText:)) ;; Return the text selected which is "Hello world".

setAcceptRichText

Overview

The RadTextEdit setAcceptRichText function sets the RadTextEdit to accept rich text (true) or not (false).

 

Syntax

(qt radTextEditPtr setAcceptRichText: switch)

Arguments

switchThe switch to accept rich text (true) or not (false).
returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setAcceptRichText: false)) ;; Set the RadTextEdit pane NOT tp accept rich text.
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.

setFocus

Overview

The RadTextEdit setFocus function sets the RadTextEdit to have the focus.

 

Syntax

(qt radTextEditPtr setFocus:)

Arguments

returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setAcceptRichText: false)) ;; Set the RadTextEdit pane NOT tp accept rich text.
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr setFocus:)) ;; Sets the RadTextEdit display pane to have the focus.

setHtmlText

Overview

The RadTextEdit setHtmlText function sets the entire contents of the RadTextEdit display pane to the specified HTML text.

 

Syntax

(qt radTextEditPtr setHtmlText: myText)

Arguments

myTextThe ASCII text value to be set in the RadTextEdit display pane.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setHtmlText: "Hello world")) ;; Set the RadTextEdit display pane to specified HTML text.

setMgr

Overview

The RadTextEdit setMgr function sets the RadTextEdit key stroke manager name - where (defun mgrLambdaName(command) ...lisp code...)

 

Syntax

(qt radTextEditPtr setMgr: mgrLambdaName)

Arguments

mgrLambdaNameThe RadTextEdit key stroke manager name - where (defun mgrLambdaName(command) ...lisp code...).

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setHtmlText: "Hello world")) ;; Set the RadTextEdit display pane to specified HTML text.

setReadOnly

Overview

The RadTextEdit setReadOnly function sets the RadTextEdit to read only mode (true).

 

Syntax

(qt radTextEditPtr setReadOnly: switch)

Arguments

switchThe RadTextEdit read only switch (true) or (false) if editing allowed.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setHtmlText: "Hello world") ;; Set the RadTextEdit display pane to specified HTML text.
(qt radTextEditPtr setReadOnly: true) ;; Set the RadTextEdit display pane to read only mode.

setSelectedText

Overview

The RadTextEdit setSelectedText function sets the currently selected text based on the command (all, line, word).

 

Syntax

(qt radTextEditPtr setSelectedText: command)

(qt radTextEditPtr setSelectedText: start end)

Arguments

commandThe the command (all, line, word) for selecting the text around the current cursor position.
startThe starting position for selecting the text in the RadTextEdit display pane.
endThe ending position for selecting the text in the RadTextEdit display pane.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world") ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr setSelectedText: word) ;; Set the RadTextEdit selected text to highlight the word "world".

setTabsOff

Overview

The RadTextEdit setTabsOff function sets the RADTextEdit not to accept tabs.

 

Syntax

(qt radTextEditPtr setTabsOff:)

Arguments

returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world") ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr setTabsOff:) ;; Set the RadTextEdit not to accept tabs.

setTabsOn

Overview

The RadTextEdit setTabsOn function sets the RADTextEdit to accept tabs.

 

Syntax

(qt radTextEditPtr setTabsOn:)

Arguments

returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world") ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr setTabsOn:) ;; Set the RadTextEdit to accept tabs.

setText

Overview

The RadTextEdit setText function sets the entire contents of the RadTextEdit display pane to the specified ASCII text.

 

Syntax

(qt radTextEditPtr setText: myText)

Arguments

myTextThe ASCII text value to be set in the RadTextEdit display pane.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit:)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world")) ;; Set the RadTextEdit display pane to specified ASCII text.

setWordWrapOff

Overview

The RadTextEdit setWordWrapOff function sets the RADTextEdit not to wrap words at the end of the dispaly pane width.

 

Syntax

(qt radTextEditPtr setWordWrapOff:)

Arguments

returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world") ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr setWordWrapOff:) ;; Set the RadTextEdit not to wrap words at the end of the dispaly pane width.

setWordWrapOn

Overview

The RadTextEdit setWordWrapOn function sets the RADTextEdit to wrap words at the end of the dispaly pane width.

 

Syntax

(qt radTextEditPtr setWordWrapOn:)

Arguments

returnsAlways returns #void.

 

Example1

(defun editMgr(...) true) ;; Don't do anything special when the tab is clicked
(qt mainWindow: setTitle: (append "My QT Edit Demo.")) ;; Set the main window title
(setq radTextEditPtr (qt new: RadTextEdit: editMgr)) ;; Create a QT TextEdit object (a GUI descentant of RadWidget).
(setq tabIndex (qt mainWindow: addTab: radTextEditPtr "Edit" editMgr)) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(qt radTextEditPtr setText: "Hello world") ;; Set the RadTextEdit display pane to specified ASCII text.
(qt radTextEditPtr setWordWrapOn:) ;; Set the RadTextEdit to wrap words at the end of the dispaly pane width.