A GTextArea is a multi-line editable text box. More...
#include "gtextarea.h"
Public Types | |
enum | TextPosition { TEXT_BESIDE_ICON, TEXT_UNDER_ICON, TEXT_ONLY } |
The places where an interactor can place its text relative to its icon. More... | |
Public Member Functions | |
GTextArea(int rows, int columns, QWidget* parent=nullptr) | |
Creates a new text area large enough to display the given number of rows and columns of text. More... | |
GTextArea(string text="", QWidget* parent=nullptr) | |
Creates a new text area with the given initial text. More... | |
~GTextArea() override | |
Frees memory allocated internally by the text area. More... | |
void | addActionListener() (deprecated) |
Adds an event listener to be notified when this interactor is clicked or generally interacted with. More... | |
void | appendFormattedText(string text, string color="", string font="") |
Adds formatted text to the end of the text area. More... | |
void | appendHtml(string html) |
Adds HTML-formatted text to the end of the text area. More... | |
void | appendText(string text) |
Adds the given plain text to the end of the text area. More... | |
void | clearSelection() |
Deselects any text that is currently selected in the text area. More... | |
void | clearText() |
Sets the text in the text area to be empty. More... | |
bool | eventsEnabled() const override |
Returns true if this interactor is currently accepting events. More... | |
string | getAccelerator() const |
Returns a string representing a hotkey for this interactor, or an empty string if no accelerator has been set. More... | |
string | getActionCommand() const |
Returns an action command for this interactor, which is a semi-unique string you can use to identify it when events occur. More... | |
string | getBackground() const |
Returns the background color of the interactor as a string. More... | |
int | getBackgroundInt() const |
Returns the background color of the interactor as an RGB integer. More... | |
GRectangle | getBounds() const |
Returns a rectangle representing the x/y position and size of this interactor. More... | |
string | getColor() const |
Returns the foreground/text color of the interactor as a string. More... | |
int | getColorInt() const |
Returns the foreground/text color of the interactor as an RGB integer. More... | |
int | getColumns() const |
Returns the number of visible columns (characters wide) in the text area. More... | |
GContainer * | getContainer() const |
Returns a pointer to the onscreen container holding this interactor. More... | |
int | getCursorPosition() const |
Returns the keyboard cursor's current position in the text area as a 0-based character index within the overall text string. More... | |
string | getFont() const |
Returns the font of this interactor's text as a font string such as "Helvetica-12-Bold". More... | |
string | getForeground() const |
Returns the foreground/text color of the interactor as a string. More... | |
int | getForegroundInt() const |
Returns the foreground/text color of the interactor as an RGB integer. More... | |
double | getHeight() const |
Returns the current onscreen height of this interactor in pixels. More... | |
string | getHtml() const |
Returns the text area's current text as HTML. More... | |
string | getIcon() const |
Returns the file name of the icon associated with this interactor, or an empty string if no icon has been set. More... | |
int | getID() const |
Returns a globally unique identifier for this interactor, which is set when the interactor is constructed. More... | |
_Internal_QWidget* | getInternalWidget() const override |
Returns a direct pointer to the internal Qt widget being wrapped by this interactor. More... | |
GPoint | getLocation() const |
Returns an (x, y) point representing the onscreen location of the top-left corner of this interactor within its containing window. More... | |
double | getMinimumHeight() const |
Returns the minimum height in pixels that this interactor will permit itself to be resized to. More... | |
GDimension | getMinimumSize() const |
Returns a GDimension structure representing the minimum size in pixels that this interactor will permit itself to be resized to. More... | |
double | getMinimumWidth() const |
Returns the minimum width in pixels that this interactor will permit itself to be resized to. More... | |
string | getName() const |
Returns a string representing a unique name for this interactor. More... | |
string | getPlaceholder() const |
Returns the text area's placeholder text, which is usually displayed as a light gray text in the text area when the area is empty. More... | |
double | getPreferredHeight() const |
Returns the height in pixels that this interactor would prefer to be, which would exactly fit its contents with no stretching or scrollbars. More... | |
GDimension | getPreferredSize() const |
Returns a GDimension structure storing the width and height in pixels that this interactor would prefer to be, which would exactly fit its contents with no stretching or scrollbars. More... | |
double | getPreferredWidth() const |
Returns the height in pixels that this interactor would prefer to be, which would exactly fit its contents with no stretching or scrollbars. More... | |
int | getRows() const |
Returns the number of visible rows (lines tall) in the text area. More... | |
string | getSelectedText() const |
Returns the text that is currently selected in the text area. More... | |
int | getSelectionEnd() const |
Returns the index just past the end of the current selection of text as a 0-based character index within the overall text string. More... | |
int | getSelectionLength() const |
Returns the number of characters that are currently selected. More... | |
int | getSelectionStart() const |
Returns the index of the start of the current selection of text as a 0-based character index within the overall text string. More... | |
GDimension | getSize() const |
Returns a GDimension structure storing the current onscreen width and height of this interactor in pixels. More... | |
string | getText() const |
Returns the text area's current text. More... | |
string | getType() const override |
Returns a string representing the class name of this interactor, such as "GButton" or "GCheckBox". More... | |
QWidget* | getWidget() const override |
Returns a direct pointer to the internal Qt widget being wrapped by this interactor. More... | |
double | getWidth() const |
Returns the current onscreen width of this interactor in pixels. More... | |
double | getX() const |
Returns the x-coordinate of the top-left pixel of this interactor within its onscreen window. More... | |
double | getY() const |
Returns the y-coordinate of the top-left pixel of this interactor within its onscreen window. More... | |
bool | inBounds(double x, double y) const |
Returns true if the given x/y pixel is within the bounds of this interactor. More... | |
bool | inBounds(int x, int y) const |
Returns true if the given x/y pixel is within the bounds of this interactor. More... | |
bool | isContextMenuEnabled() const |
Returns true if a context menu will pop up when the user right-clicks the text area. More... | |
bool | isEditable() const |
Returns whether the text area allows the user to modify its text. More... | |
bool | isEnabled() const |
Returns true if this interactor is currently enabled. More... | |
bool | isLineWrap() const |
Returns whether the text area wraps its text when a line becomes too long. More... | |
bool | isVisible() const |
Returns true if the interactor is visible on the screen. More... | |
void | moveCursorToEnd() |
Sets the text area's keyboard cursor position to the end of the current text. More... | |
void | moveCursorToStart() |
Sets the text area's keyboard cursor position to the start of the current text. More... | |
void | removeActionListener() |
Removes the action listener from this interactor so that it will no longer call it when events occur. More... | |
void | removeClickListener() |
Removes the click listener from this interactor so that it will no longer call it when events occur. More... | |
void | removeDoubleClickListener() |
Removes the double-click listener from this interactor so that it will no longer call it when events occur. More... | |
void | removeKeyListener() |
Removes the key listener from this interactor so that it will no longer call it when key events occur. More... | |
void | removeMouseListener() |
Removes the mouse listener from this interactor so that it will no longer call it when events occur. More... | |
void | removeTextChangeListener() |
Removes the text change listener from this text area so that it will no longer call it when the user modifies the text. More... | |
void | requestFocus() |
Transfers keyboard focus to this interactor. More... | |
void | scrollToBottom() |
Moves the visible scroll region of the text area so that the bottom part of the text is visible. More... | |
void | scrollToTop() |
Moves the visible scroll region of the text area so that the top part of the text is visible. More... | |
void | select(int startIndex, int length) |
Sets the given range of text to be selected, beginning with the given start index as a 0-based character index within the overall text string, and extending for the given length of characters. More... | |
void | selectAll() |
Selects the entire text of the text area. More... | |
void | setAccelerator(string accelerator) |
Sets an accelerator hotkey for this interactor, such as "Ctrl-S". More... | |
void | setActionCommand(string actionCommand) |
Sets the action command for this interactor. More... | |
void | setActionListener(GEventListener func) |
Sets an action listener on this interactor so that it will be called when it is interacted with in its primary way. More... | |
void | setActionListener(GEventListenerVoid func) |
Sets an action listener on this interactor so that it will be called when it is interacted with in its primary way. More... | |
void | setBackground(int rgb) |
Sets the background color of the interactor to the color represented by the given RGB integer. More... | |
void | setBackground(string color) |
Sets the background color of the interactor to the color represented by the given string. More... | |
void | setBounds(double x, double y, double width, double height) |
Sets the size and location of the widget. More... | |
void | setBounds(const GRectangle &size) |
Sets the size and location of the widget. More... | |
void | setClickListener(GEventListener func) |
Sets a mouse listener on this interactor so that it will be called when the mouse is clicked on it. More... | |
void | setClickListener(GEventListenerVoid func) |
Sets a mouse listener on this interactor so that it will be called when the mouse is clicked on it. More... | |
void | setColor(int rgb) |
Sets the foreground/text color of the interactor to the color represented by the given RGB integer. More... | |
void | setColor(string color) |
Sets the foreground/text color of the interactor to the color represented by the given string. More... | |
void | setColumns(int columns) |
Sets the width of the text area to be wide enough to fit the given number of characters (columns) of text. More... | |
void | setContextMenuEnabled(bool enabled) |
Sets whether a context menu will pop up when the user right-clicks the text area. More... | |
void | setCursorPosition(int index, bool keepAnchor=false) |
Moves the keyboard cursor to the given 0-based character index within the text. More... | |
void | setDoubleClickListener(GEventListener func) |
Sets a mouse listener on this interactor so that it will be called when the mouse is double-clicked on it. More... | |
void | setDoubleClickListener(GEventListenerVoid func) |
Sets a mouse listener on this interactor so that it will be called when the mouse is double-clicked on it. More... | |
void | setEditable(bool value) |
Sets whether the text area allows the user to modify its text. More... | |
void | setEnabled(bool value) |
Sets whether this interactor is currently enabled. More... | |
void | setEventsEnabled(bool eventsEnabled) |
Sets whether the object is currently allowing itself to fire events. More... | |
void | setFont(const QFont &font) |
Sets the font used by this widget to the given Qt font. More... | |
void | setFont(string font) |
Sets the font used by this widget to the font represented by the given font string, such as "Helvetica-16-Bold". More... | |
void | setForeground(int rgb) |
Sets the foreground/text color of the interactor to the color represented by the given RGB integer. More... | |
void | setForeground(string color) |
Sets the foreground/text color of the interactor to the color represented by the given string. More... | |
void | setHeight(double height) |
Sets the onscreen height of the interactor in pixels. More... | |
void | setHtml(string html) |
Sets the text area's current text to the given HTML string. More... | |
void | setIcon(const QIcon &icon) |
Sets the icon associated with this interactor. More... | |
void | setIcon(const QPixmap &icon) |
Sets the icon associated with this interactor. More... | |
void | setIcon(string filename, bool retainIconSize=true) |
Sets the file name of the icon associated with this interactor, or an empty string if no icon has been set. More... | |
void | setKeyListener(GEventListener func) |
Sets a key listener on this interactor so that it will be called when the user presses any key. More... | |
void | setKeyListener(GEventListenerVoid func) |
Sets a key listener on this interactor so that it will be called when the user presses any key. More... | |
void | setLineWrap(bool wrap) |
Sets whether the text area wraps its text when a line becomes too long. More... | |
void | setLocation(double x, double y) |
Sets the onscreen x/y-coordinate of the top-left corner of the interactor relative to its window. More... | |
void | setMinimumSize(double width, double height) |
Sets the minimum size in pixels that this interactor will permit itself to be resized to. More... | |
void | setMinimumSize(const GDimension &size) |
Sets the minimum size in pixels that this interactor will permit itself to be resized to. More... | |
void | setMouseListener(GEventListener func) override |
Sets a mouse listener on this text area so that it will be called when the user moves or clicks the mouse. More... | |
void | setMouseListener(GEventListenerVoid func) override |
Sets a mouse listener on this text area so that it will be called when the user moves or clicks the mouse. More... | |
void | setName(string name) |
Sets a string representing a unique name for this interactor. More... | |
void | setPlaceholder(string text) |
Sets the text area's placeholder text, which is usually displayed as a light gray text in the text area when the area is empty. More... | |
void | setPreferredHeight(double height) |
Sets the height in pixels that this interactor would prefer to be. More... | |
void | setPreferredSize(double width, double height) |
Sets the width and height in pixels that this interactor would prefer to be. More... | |
void | setPreferredSize(const GDimension &size) |
Sets the size in pixels that this interactor would prefer to be. More... | |
void | setPreferredWidth(double width) |
Sets the width in pixels that this interactor would prefer to be. More... | |
void | setRows(int rows) |
Sets the height of the text area to be wide enough to fit the given number of lines (rows) of text. More... | |
void | setRowsColumns(int rows, int columns) |
Sets the size of the text area to be wide enough to fit the given number of lines (rows) and characters (columns) of text. More... | |
void | setSize(double width, double height) |
Sets the onscreen width and height of the interactor in pixels. More... | |
void | setSize(const GDimension &size) |
Sets the onscreen width and height of the interactor in pixels. More... | |
void | setText(string text) |
Sets the text area's current text to the given string, replacing any existing text. More... | |
void | setTextChangeListener(GEventListener func) |
Sets a text change listener on this text area so that it will be called when the user modifies the current text. More... | |
void | setTextChangeListener(GEventListenerVoid func) |
Sets a text change listener on this text area so that it will be called when the user modifies the current text. More... | |
void | setTooltip(string tooltipText) |
Sets a "tooltip" that will appear if the user hovers their mouse over the interactor. More... | |
void | setVisible(bool visible) |
Returns true if the interactor is visible on the screen. More... | |
void | setWidth(double width) |
Sets the onscreen width of the interactor in pixels. More... | |
void | setX(double x) |
Sets the onscreen x-coordinate of the top-left corner of the interactor relative to its window. More... | |
void | setY(double y) |
Sets the onscreen y-coordinate of the top-left corner of the interactor relative to its window. More... | |
string | toString() const |
Returns a string representation of this observable object's state. More... | |
Protected Member Functions | |
void | clearEventListeners() |
Removes all event listeners from this object. More... | |
void | ensureThreadSafety(string memberName="") |
Ensures that we are currently in the Qt GUI thread. More... | |
void | fireEvent(GEvent &event) |
Sends out the given event to any attached listeners. More... | |
void | fireGEvent(QEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QCloseEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QKeyEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QMouseEvent *event, EventType eventType, string eventName, string actionCommand="") |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QResizeEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QTimerEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QWheelEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
void | fireGEvent(QWindowStateChangeEvent *event, EventType eventType, string eventName) |
Creates an event of the given type, then sends it out to any attached listeners. More... | |
bool | hasEventListener(string eventName) const |
Returns true if the observable object has a listener for the given type of event. More... | |
bool | isAcceptingEvent(int eventMask) const |
Returns true if the observable object has a listener for the given type of event. More... | |
bool | isAcceptingEvent(const GEvent &event) const |
Returns true if the observable object has a listener for the given type of event. More... | |
bool | isAcceptingEvent(string eventType) const |
Returns true if the observable object has a listener for the given type of event. More... | |
void | removeEventListener(string eventName) |
Removes any event listener from this observable object that would respond to the given type of event, such as "click" or "keydown". More... | |
void | removeEventListeners(std::initializer_list< string > eventNames) |
Removes any event listener from this observable object that would respond to the given types of events, such as "click" or "keydown". More... | |
void | setEventListener(string eventName, GEventListener func) |
Adds an event listener from this observable object to respond to the given type of event, such as "click" or "keydown". More... | |
void | setEventListener(string eventName, GEventListenerVoid func) |
Adds an event listener from this observable object to respond to the given type of event, such as "click" or "keydown". More... | |
void | setEventListeners(std::initializer_list< string > eventNames, GEventListener func) |
Adds an event listener from this observable object to respond to the given types of events, such as "click" or "keydown". More... | |
void | setEventListeners(std::initializer_list< string > eventNames, GEventListenerVoid func) |
Adds an event listener from this observable object to respond to the given types of events, such as "click" or "keydown". More... | |
A GTextArea is a multi-line editable text box.
The box allows the user to type arbitrarily long documents. Scroll bars will appear if the text becomes too long to fit in the visible area of the box.
|
inherited |
GTextArea | ( | int | rows, |
int | columns, | ||
QWidget* | parent = nullptr |
||
) |
Creates a new text area large enough to display the given number of rows and columns of text.
ErrorException | if rows or columns value is negative |
GTextArea | ( | string | text = "" , |
QWidget* | parent = nullptr |
||
) |
Creates a new text area with the given initial text.
|
override |
Frees memory allocated internally by the text area.
|
virtualinherited |
Adds an event listener to be notified when this interactor is clicked or generally interacted with.
|
virtual |
Adds formatted text to the end of the text area.
The text will be formatted with the given color and font.
|
virtual |
Adds HTML-formatted text to the end of the text area.
|
virtual |
Adds the given plain text to the end of the text area.
|
protectedvirtualinherited |
Removes all event listeners from this object.
|
virtual |
Deselects any text that is currently selected in the text area.
|
virtual |
Sets the text in the text area to be empty.
|
protectedvirtualinherited |
Ensures that we are currently in the Qt GUI thread.
|
overridevirtualinherited |
Returns true if this interactor is currently accepting events.
Initially true. An interactor must be visible and added to an onscreen window to receive events.
Reimplemented from GObservable.
|
protectedvirtualinherited |
Sends out the given event to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
protectedvirtualinherited |
Creates an event of the given type, then sends it out to any attached listeners.
|
virtualinherited |
Returns a string representing a hotkey for this interactor, or an empty string if no accelerator has been set.
Reimplemented in GButton.
|
virtualinherited |
Returns an action command for this interactor, which is a semi-unique string you can use to identify it when events occur.
For example, for buttons, the default action command is the button's text.
Reimplemented in GChooser, GRadioButton, GButton, and GCheckBox.
|
virtualinherited |
Returns the background color of the interactor as a string.
Reimplemented in GCanvas.
|
virtualinherited |
Returns the background color of the interactor as an RGB integer.
Reimplemented in GCanvas.
|
virtualinherited |
Returns a rectangle representing the x/y position and size of this interactor.
|
virtualinherited |
Returns the foreground/text color of the interactor as a string.
Equivalent to getForeground.
|
virtualinherited |
Returns the foreground/text color of the interactor as an RGB integer.
Equivalent to getForegroundInt.
|
virtual |
Returns the number of visible columns (characters wide) in the text area.
|
virtualinherited |
Returns a pointer to the onscreen container holding this interactor.
When an interactor is created, its container is initially null. This will become non-null automatically if you add the interactor to a window or other layout container. Interactors must be added to a container or window to receive events or to become visible on the screen.
|
virtual |
Returns the keyboard cursor's current position in the text area as a 0-based character index within the overall text string.
|
virtualinherited |
Returns the font of this interactor's text as a font string such as "Helvetica-12-Bold".
Reimplemented in GCanvas.
|
virtualinherited |
Returns the foreground/text color of the interactor as a string.
Equivalent to getColor.
|
virtualinherited |
Returns the foreground/text color of the interactor as an RGB integer.
Equivalent to getColorInt.
|
virtualinherited |
Returns the current onscreen height of this interactor in pixels.
|
virtual |
Returns the text area's current text as HTML.
This differs from getText in that tags and formatting are not stripped.
|
virtualinherited |
Returns the file name of the icon associated with this interactor, or an empty string if no icon has been set.
Not all types of interactors support icons.
|
virtualinherited |
Returns a globally unique identifier for this interactor, which is set when the interactor is constructed.
These IDs can be useful for debugging to help identify interactors uniquely.
|
overridevirtual |
Returns a direct pointer to the internal Qt widget being wrapped by this interactor.
This must be overridden by all interactor subclasses. Students/clients generally should not need to call this.
Implements GInteractor.
|
virtualinherited |
Returns an (x, y) point representing the onscreen location of the top-left corner of this interactor within its containing window.
|
virtualinherited |
Returns the minimum height in pixels that this interactor will permit itself to be resized to.
|
virtualinherited |
Returns a GDimension structure representing the minimum size in pixels that this interactor will permit itself to be resized to.
|
virtualinherited |
Returns the minimum width in pixels that this interactor will permit itself to be resized to.
|
virtualinherited |
Returns a string representing a unique name for this interactor.
The default name string uses the interactor's type and its ID to make a string like "GButton_14", but you can override this by calling setName.
|
virtual |
Returns the text area's placeholder text, which is usually displayed as a light gray text in the text area when the area is empty.
This usually indicates a hint to the user about what value to type. The default initial placeholder is empty.
|
virtualinherited |
Returns the height in pixels that this interactor would prefer to be, which would exactly fit its contents with no stretching or scrollbars.
|
virtualinherited |
Returns a GDimension structure storing the width and height in pixels that this interactor would prefer to be, which would exactly fit its contents with no stretching or scrollbars.
Reimplemented in GContainer.
|
virtualinherited |
Returns the height in pixels that this interactor would prefer to be, which would exactly fit its contents with no stretching or scrollbars.
|
virtual |
Returns the number of visible rows (lines tall) in the text area.
This is approximate and will be rounded down to the nearest integer if the text area's size is not exactly a multiple of the row/line size.
|
virtual |
Returns the text that is currently selected in the text area.
If no text is currently selected, returns an empty string.
|
virtual |
Returns the index just past the end of the current selection of text as a 0-based character index within the overall text string.
If no text is currently selected, returns -1.
|
virtual |
Returns the number of characters that are currently selected.
If no text is currently selected, returns 0.
|
virtual |
Returns the index of the start of the current selection of text as a 0-based character index within the overall text string.
If no text is currently selected, returns -1.
|
virtualinherited |
Returns a GDimension structure storing the current onscreen width and height of this interactor in pixels.
|
virtual |
Returns the text area's current text.
|
overridevirtual |
Returns a string representing the class name of this interactor, such as "GButton" or "GCheckBox".
All subclasses of GInteractor must implement this method.
Implements GInteractor.
|
overridevirtual |
Returns a direct pointer to the internal Qt widget being wrapped by this interactor.
This must be overridden by all interactor subclasses. Students/clients generally should not need to call this.
Implements GInteractor.
|
virtualinherited |
Returns the current onscreen width of this interactor in pixels.
|
virtualinherited |
Returns the x-coordinate of the top-left pixel of this interactor within its onscreen window.
|
virtualinherited |
Returns the y-coordinate of the top-left pixel of this interactor within its onscreen window.
|
protectedvirtualinherited |
Returns true if the observable object has a listener for the given type of event.
|
virtualinherited |
Returns true if the given x/y pixel is within the bounds of this interactor.
|
virtualinherited |
Returns true if the given x/y pixel is within the bounds of this interactor.
|
protectedvirtualinherited |
Returns true if the observable object has a listener for the given type of event.
See gevent.h for event types and masks.
|
protectedvirtualinherited |
Returns true if the observable object has a listener for the given type of event.
|
protectedvirtualinherited |
Returns true if the observable object has a listener for the given type of event.
|
virtual |
Returns true if a context menu will pop up when the user right-clicks the text area.
By default this is true, but it can be turned off by calling setContextMenuEnabled(false).
|
virtual |
Returns whether the text area allows the user to modify its text.
Default true.
|
virtualinherited |
Returns true if this interactor is currently enabled.
Most interactors begin as enabled but can be disabled to stop them from being able to be clicked on or otherwise emit events.
|
virtual |
Returns whether the text area wraps its text when a line becomes too long.
Default true.
|
virtualinherited |
Returns true if the interactor is visible on the screen.
Interactors will not be visible until they are added to an onscreen window or container.
|
virtual |
Sets the text area's keyboard cursor position to the end of the current text.
|
virtual |
Sets the text area's keyboard cursor position to the start of the current text.
|
virtualinherited |
Removes the action listener from this interactor so that it will no longer call it when events occur.
|
virtualinherited |
Removes the click listener from this interactor so that it will no longer call it when events occur.
|
virtualinherited |
Removes the double-click listener from this interactor so that it will no longer call it when events occur.
|
protectedvirtualinherited |
Removes any event listener from this observable object that would respond to the given type of event, such as "click" or "keydown".
|
protectedvirtualinherited |
Removes any event listener from this observable object that would respond to the given types of events, such as "click" or "keydown".
|
virtualinherited |
Removes the key listener from this interactor so that it will no longer call it when key events occur.
|
virtualinherited |
Removes the mouse listener from this interactor so that it will no longer call it when events occur.
|
virtual |
Removes the text change listener from this text area so that it will no longer call it when the user modifies the text.
|
virtualinherited |
Transfers keyboard focus to this interactor.
Reimplemented in GTable.
|
virtual |
Moves the visible scroll region of the text area so that the bottom part of the text is visible.
|
virtual |
Moves the visible scroll region of the text area so that the top part of the text is visible.
|
virtual |
Sets the given range of text to be selected, beginning with the given start index as a 0-based character index within the overall text string, and extending for the given length of characters.
ErrorException | if start index or length is negative |
|
virtual |
Selects the entire text of the text area.
|
virtualinherited |
Sets an accelerator hotkey for this interactor, such as "Ctrl-S".
Not all interactor types support accelerators.
accelerator | a hotkey such as "Ctrl-S" |
Reimplemented in GButton.
|
virtualinherited |
Sets the action command for this interactor.
The action command is meant to be a semi-unique string you can use to identify the interactor when events occur. For example, for buttons, the default action command is the button's text, but you can change it to a different string if you prefer. The main usage of this feature is if you want to use the same function as an event listener for many interactors, you can use the action command to help distinguish which interactor generates each event.
|
virtualinherited |
Sets an action listener on this interactor so that it will be called when it is interacted with in its primary way.
For example, if this interactor is a button, this will fire when it is clicked. Any existing action listener will be replaced.
|
virtualinherited |
Sets an action listener on this interactor so that it will be called when it is interacted with in its primary way.
For example, if this interactor is a button, this will fire when it is clicked. Any existing action listener will be replaced.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Sets the size and location of the widget.
In general you should avoid explicitly sizing and positioning widgets in this way; instead, use containers and regions to help you lay out widgets at the proper sizes.
Reimplemented in GLabel.
|
virtualinherited |
Sets the size and location of the widget.
In general you should avoid explicitly sizing and positioning widgets in this way; instead, use containers and regions to help you lay out widgets at the proper sizes.
Reimplemented in GLabel.
|
virtualinherited |
Sets a mouse listener on this interactor so that it will be called when the mouse is clicked on it.
Any existing click listener will be replaced.
|
virtualinherited |
Sets a mouse listener on this interactor so that it will be called when the mouse is clicked on it.
Any existing click listener will be replaced.
|
virtualinherited |
|
virtualinherited |
|
virtual |
Sets the width of the text area to be wide enough to fit the given number of characters (columns) of text.
ErrorException | if columns value is negative |
|
virtual |
Sets whether a context menu will pop up when the user right-clicks the text area.
Initially true.
|
virtual |
Moves the keyboard cursor to the given 0-based character index within the text.
ErrorException | if index is negative |
|
virtualinherited |
Sets a mouse listener on this interactor so that it will be called when the mouse is double-clicked on it.
Any existing double-click listener will be replaced.
|
virtualinherited |
Sets a mouse listener on this interactor so that it will be called when the mouse is double-clicked on it.
Any existing double-click listener will be replaced.
|
virtual |
Sets whether the text area allows the user to modify its text.
Default true.
|
virtualinherited |
Sets whether this interactor is currently enabled.
Most interactors begin as enabled but can be disabled to stop them from being able to be clicked on or otherwise emit events.
|
protectedvirtualinherited |
Adds an event listener from this observable object to respond to the given type of event, such as "click" or "keydown".
Any prior listener for that type of event is replaced.
|
protectedvirtualinherited |
Adds an event listener from this observable object to respond to the given type of event, such as "click" or "keydown".
Any prior listener for that type of event is replaced.
|
protectedvirtualinherited |
Adds an event listener from this observable object to respond to the given types of events, such as "click" or "keydown".
Any prior listener for those types of event are replaced.
|
protectedvirtualinherited |
Adds an event listener from this observable object to respond to the given types of events, such as "click" or "keydown".
Any prior listener for those types of event are replaced.
|
virtualinherited |
Sets whether the object is currently allowing itself to fire events.
Initially this is true.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Sets the onscreen height of the interactor in pixels.
ErrorException | if height is negative |
Reimplemented in GLabel.
|
virtual |
Sets the text area's current text to the given HTML string.
This differs from setText in that HTML tags and formatting are applied to the text rather than considered to be regular characters.
|
virtualinherited |
|
virtualinherited |
|
virtualinherited |
Sets the file name of the icon associated with this interactor, or an empty string if no icon has been set.
Not all types of interactors support icons.
filename | icon file path to use |
retainIconSize | true if icon should stay at its existing pixel size (default), or false if it should be resized to fit the interactor |
|
virtualinherited |
Sets a key listener on this interactor so that it will be called when the user presses any key.
Any existing key listener will be replaced.
Reimplemented in GCanvas.
|
virtualinherited |
Sets a key listener on this interactor so that it will be called when the user presses any key.
Any existing key listener will be replaced.
Reimplemented in GCanvas.
|
virtual |
Sets whether the text area wraps its text when a line becomes too long.
Default true.
|
virtualinherited |
Sets the onscreen x/y-coordinate of the top-left corner of the interactor relative to its window.
Generally clients should not call this and should instead use containers and layout regions to position interactors.
Reimplemented in GLabel.
|
virtualinherited |
Sets the minimum size in pixels that this interactor will permit itself to be resized to.
ErrorException | if width or height is negative |
|
virtualinherited |
Sets the minimum size in pixels that this interactor will permit itself to be resized to.
ErrorException | if width or height is negative |
|
overridevirtual |
Sets a mouse listener on this text area so that it will be called when the user moves or clicks the mouse.
Any existing mouse listener will be replaced.
Reimplemented from GInteractor.
|
overridevirtual |
Sets a mouse listener on this text area so that it will be called when the user moves or clicks the mouse.
Any existing mouse listener will be replaced.
Reimplemented from GInteractor.
|
virtualinherited |
Sets a string representing a unique name for this interactor.
The default name string uses the interactor's type and its ID to make a string like "GButton_14", but you can override this by calling setName.
name | a string such as "GButton_14" |
|
virtual |
Sets the text area's placeholder text, which is usually displayed as a light gray text in the text area when the area is empty.
This usually indicates a hint to the user about what value to type. The default initial placeholder is empty.
|
virtualinherited |
Sets the height in pixels that this interactor would prefer to be.
Normally clients do not need to call this method; the interactor can figure out its own preferred size. But calling it can help you to hint to the container/layout system if you want a given interactor to "prefer" to make itself larger or smaller for the purposes of your particular program.
|
virtualinherited |
Sets the width and height in pixels that this interactor would prefer to be.
Normally clients do not need to call this method; the interactor can figure out its own preferred size. But calling it can help you to hint to the container/layout system if you want a given interactor to "prefer" to make itself larger or smaller for the purposes of your particular program.
|
virtualinherited |
Sets the size in pixels that this interactor would prefer to be.
Normally clients do not need to call this method; the interactor can figure out its own preferred size.
|
virtualinherited |
Sets the width in pixels that this interactor would prefer to be.
Normally clients do not need to call this method; the interactor can figure out its own preferred size.
|
virtual |
Sets the height of the text area to be wide enough to fit the given number of lines (rows) of text.
ErrorException | if rows value is negative |
|
virtual |
Sets the size of the text area to be wide enough to fit the given number of lines (rows) and characters (columns) of text.
ErrorException | if rows or columns value is negative |
|
virtualinherited |
Sets the onscreen width and height of the interactor in pixels.
ErrorException | if width or height is negative |
Reimplemented in GLabel.
|
virtualinherited |
Sets the onscreen width and height of the interactor in pixels.
ErrorException | if width or height is negative |
Reimplemented in GLabel.
|
virtual |
Sets the text area's current text to the given string, replacing any existing text.
|
virtual |
Sets a text change listener on this text area so that it will be called when the user modifies the current text.
Any existing text change listener will be replaced.
A text change listener is similar to a key listener in that each will fire an event when the user types a character in the text area. But a key listener will fire when any key is pressed, even one that does not modify the text itself, such as when the user presses an arrow key or the Ctrl key or Esc or any other special character.
A text change listener will fire only when the actual text changes, such as when the user types a new character into the area.
|
virtual |
Sets a text change listener on this text area so that it will be called when the user modifies the current text.
Any existing text change listener will be replaced.
A text change listener is similar to a key listener in that each will fire an event when the user types a character in the text area. But a key listener will fire when any key is pressed, even one that does not modify the text itself, such as when the user presses an arrow key or the Ctrl key or Esc or any other special character.
A text change listener will fire only when the actual text changes, such as when the user types a new character into the area.
|
virtualinherited |
Sets a "tooltip" that will appear if the user hovers their mouse over the interactor.
Set an empty string to clear the tooltip.
|
virtualinherited |
Returns true if the interactor is visible on the screen.
Interactors will not be visible until they are added to an onscreen window or container. If you call setVisible on an interactor that is not in any onscreen container, it will have no effect.
Reimplemented in GLabel.
|
virtualinherited |
Sets the onscreen width of the interactor in pixels.
ErrorException | if width is negative |
Reimplemented in GLabel.
|
virtualinherited |
Sets the onscreen x-coordinate of the top-left corner of the interactor relative to its window.
Generally clients should not call this and should instead use containers and layout regions to position interactors.
Reimplemented in GLabel.
|
virtualinherited |
Sets the onscreen y-coordinate of the top-left corner of the interactor relative to its window.
Generally clients should not call this and should instead use containers and layout regions to position interactors.
Reimplemented in GLabel.
|
virtualinherited |
Returns a string representation of this observable object's state.
Primarily used for debugging purposes.