QT Class RadLabel

 

Overview

The RadLabel class is the principal tool for AIS Lisp to display text or an image. RadLabel panes come standard with a support for rich text. The RadLabel is one of the key words accepted by the qt new: function. There can be many RadLabel objects.

new

Overview

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

 

Syntax

(qt new: RadLabel: LabelDescriptor)

Arguments

LabelDescriptorA descriptive string for the new Label object.
radLabelPtrAlways returns a pointer to the newly created RadLabel 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 radLabelPtr (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object
(setq tabIndex (qt mainWindow: addTab: radLabelPtr "MyTab" 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 RadLabel object and returns a null pointer.

 

Syntax

(qt delete: radLabelPtr)

Arguments

radLabelPtrThe pointer to the radLabelPtr object to be destroyed.
nullPtrAlways returns a null pointer.

 

Example1

(setq radLabelPtr (qt new: RadLabel:)) ;; Create a RadLabel object.
(setq radLabelPtr (qt delete: radLabelPtr)) ;; Destroy the RadLabel object.

setLabel

Overview

The radLabel setText function sets a descriptive label in the pane.

 

Syntax

(qt radLabelPtr setText: text)

Arguments

text A descriptive label string
true Always returns true

 

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 radLabelPtr (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object with a descriptive label
(setq tabIndex (qt mainWindow: addTab: radLabelPtr "MyTab" editMgr )) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(sleep 10000.0) ;; Wait
(qt radLabelPtr setText: "Goodbye World") ;; Set a new descriptive label to an existing radLabel object"

getLabel

Overview

The radLabel getText function gets the pointer to descriptive label string for an existing radLabel object widget.

 

Syntax

(setq myLabelTextPtr(qt radLabelPtr getText:))

Arguments

myLabelTextPtr Always returns the label of the radLabel 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 radLabelPtr (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object with a descriptive label
(setq myLabelPtr(qt radLabelPtr getText:)) ;; Get the descriptive label to an existing radLabel object"
(setq tabIndex (qt mainWindow: addTab: radLabelPtr myLabelPtr editMgr )) ;; Use the retrieved name as the title for the tab
(qt mainWindow: maximize:) ;; Display the main window

setTextFormat

Overview

The radLabel setTextFormat function sets the format rule for the label; It can be set to Plain text if value of the argument is 0 or Rich Text if the value is 1.

 

Syntax

(qt radLabelPtr setText: textFormat)

Arguments

TextFormatRule An Integer (0=Plain Text, 1=Rich Text)
true Always returns true

 

Example1

(defun editMgr(...) true) ;; Create a tab manager that does nothing when clicked
(qt mainWindow: setTitle: (append "My QT Horizontal Tab Demo.")) ;; Set the main window title
(setq radLabelPtr (qt new: RadLabel: "Hello World")) ;; Create a new RadLabel object with a descriptive label
(setq tabIndex (qt mainWindow: addTab: radLabelPtr "MyTab" editMgr )) ;; Add a new tab to the main window horizontal tab bar
(qt mainWindow: maximize:) ;; Display the main window
(setq myLabelPtr(qt radLabelPtr getText:)) ;; Get the descriptive label to an existing radLabel object"
(sleep 10000.0) ;; Wait
(qt radLabelPtr setTextFormat: 1) ;; Force the label field to interpret Rich Text
(qt radLabelPtr setText: "Goodbye World") ;; Set a new rich text descriptive label for the radLabel object"