Vuo  2.1.2
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
VuoTextEditor Class Reference

Description

An input editor that displays a text area for entering plain text.

The text area has a fixed width but automatically adjusts its height (up to a point) to fit the text.

Definition at line 19 of file VuoTextEditor.hh.

Public Member Functions

 VuoTextEditor (void)
 Creates an input editor whose show() function displays a text edit. More...
 
bool supportsTabbingBetweenPorts (void)
 Returns true. More...
 
- Public Member Functions inherited from VuoInputEditorWithDialog
json_objectshow (QPoint portLeftCenter, json_object *originalValue, json_object *details, map< QString, json_object * > portNamesAndValues)
 Displays a frameless dialog. More...
 

Protected Slots

virtual void resizeToFitText ()
 Resizes the text edit and dialog to the height of the text. More...
 

Protected Member Functions

void setUpDialog (QDialog &dialog, json_object *originalValue, json_object *details)
 Sets up a dialog containing a text edit. More...
 
json_objectgetAcceptedValue (void)
 Returns the current text in the text edit. More...
 
QString convertToTextEditFormat (json_object *value)
 Removes quotation marks from the value to display in the text edit. More...
 
json_objectconvertFromTextEditFormat (const QString &valueAsString)
 Adds quotation marks around the value from the text edit. More...
 
void resizeToFitTextWithBaseline (int baselineWidth=0, int baselineHeight=0)
 Resizes the text edit and dialog to the height of the text, taking the requested baselineWidth and baselineHeight into account. More...
 
bool eventFilter (QObject *object, QEvent *event) VuoWarnUnusedResult
 Handles some events before they reach the text edit or related widgets. More...
 
bool event (QEvent *event) VuoWarnUnusedResult
 Handles some events received by the input editor. More...
 
virtual bool getCodeEditor (json_object *details)
 Returns a boolean indicating whether this text editor is in code-editing mode, given an optional details object. More...
 
- Protected Member Functions inherited from VuoInputEditorWithDialog
 VuoInputEditorWithDialog (void)
 Creates an input editor whose show() function displays a frameless dialog. More...
 
QDialog * getDialog (void)
 Returns a pointer to the dialog displayed by show(). More...
 
void setFirstWidgetInTabOrder (QWidget *widget)
 Makes the given widget the first in this input editor's tab order. More...
 
void setLastWidgetInTabOrder (QWidget *widget)
 Makes the given widget the last in this input editor's tab order. More...
 
bool eventFilter (QObject *object, QEvent *event) VuoWarnUnusedResult
 Handles tabbing past the last widget or reverse-tabbing past the first widget in the tab order. More...
 

Protected Attributes

QPlainTextEdit * textEdit
 The text area widget. More...
 
bool isCodeEditor
 Whether or not to treat the input text as code. More...
 
- Protected Attributes inherited from VuoInputEditorWithDialog
bool isDark
 Is Vuo Editor in Dark Interface Mode? More...
 

Additional Inherited Members

- Signals inherited from VuoInputEditor
void valueChanged (json_object *newValue)
 An input editor can emit this signal to inform the Vuo Editor that the value has been edited. More...
 
void tabbedPastLastWidget ()
 If supportsTabbingBetweenPorts() returns true, an input editor should emit this signal when the Tab key is pressed while the last widget in the input editor's tab order has focus. More...
 
void tabbedBackwardPastFirstWidget ()
 If supportsTabbingBetweenPorts() returns true, an input editor should emit this signal when the Shift-Tab key combination is pressed while the first widget in the input editor's tab order has focus. More...
 
- Static Public Member Functions inherited from VuoInputEditor
static QFont getDefaultFont (void)
 Returns the font that input editors are recommended to use. More...
 
static QString getDefaultFontCss (void)
 Returns a CSS representation of the font that input editors are recommended to use. More...
 

Constructor & Destructor Documentation

◆ VuoTextEditor()

VuoTextEditor::VuoTextEditor ( void  )

Creates an input editor whose show() function displays a text edit.

Definition at line 20 of file VuoTextEditor.cc.

Member Function Documentation

◆ convertFromTextEditFormat()

json_object * VuoTextEditor::convertFromTextEditFormat ( const QString &  valueAsString)
protected

Adds quotation marks around the value from the text edit.

Definition at line 77 of file VuoTextEditor.cc.

◆ convertToTextEditFormat()

QString VuoTextEditor::convertToTextEditFormat ( json_object value)
protected

Removes quotation marks from the value to display in the text edit.

Definition at line 69 of file VuoTextEditor.cc.

◆ event()

bool VuoTextEditor::event ( QEvent *  event)
protected

Handles some events received by the input editor.

Definition at line 202 of file VuoTextEditor.cc.

◆ eventFilter()

bool VuoTextEditor::eventFilter ( QObject *  object,
QEvent *  event 
)
protected

Handles some events before they reach the text edit or related widgets.

Definition at line 131 of file VuoTextEditor.cc.

◆ getAcceptedValue()

json_object * VuoTextEditor::getAcceptedValue ( void  )
protectedvirtual

Returns the current text in the text edit.

Implements VuoInputEditorWithDialog.

Definition at line 61 of file VuoTextEditor.cc.

◆ getCodeEditor()

bool VuoTextEditor::getCodeEditor ( json_object details)
protectedvirtual

Returns a boolean indicating whether this text editor is in code-editing mode, given an optional details object.

Definition at line 234 of file VuoTextEditor.cc.

◆ resizeToFitText

void VuoTextEditor::resizeToFitText ( )
protectedvirtualslot

Resizes the text edit and dialog to the height of the text.

Definition at line 85 of file VuoTextEditor.cc.

◆ resizeToFitTextWithBaseline()

void VuoTextEditor::resizeToFitTextWithBaseline ( int  baselineWidth = 0,
int  baselineHeight = 0 
)
protected

Resizes the text edit and dialog to the height of the text, taking the requested baselineWidth and baselineHeight into account.

If possible, the text edit will be resized to have exactly the baseline width requested, and at least the baseline height requested. Baseline dimensions of 0 are ignored.

Definition at line 96 of file VuoTextEditor.cc.

◆ setUpDialog()

void VuoTextEditor::setUpDialog ( QDialog &  dialog,
json_object originalValue,
json_object details 
)
protectedvirtual

Sets up a dialog containing a text edit.

Removes the quotation marks surrounding originalValue before displaying it in the line edit.

Implements VuoInputEditorWithDialog.

Definition at line 31 of file VuoTextEditor.cc.

◆ supportsTabbingBetweenPorts()

bool VuoTextEditor::supportsTabbingBetweenPorts ( void  )
virtual

Returns true.

Reimplemented from VuoInputEditor.

Definition at line 248 of file VuoTextEditor.cc.

Member Data Documentation

◆ isCodeEditor

bool VuoTextEditor::isCodeEditor
protected

Whether or not to treat the input text as code.

Definition at line 40 of file VuoTextEditor.hh.

◆ textEdit

QPlainTextEdit* VuoTextEditor::textEdit
protected

The text area widget.

Definition at line 39 of file VuoTextEditor.hh.


The documentation for this class was generated from the following files: