LMMS
Loading...
Searching...
No Matches
juce::TextEditor::InsertAction Struct Reference
Inheritance diagram for juce::TextEditor::InsertAction:
juce::UndoableAction

Public Member Functions

 InsertAction (TextEditor &ed, const String &newText, int insertPos, const Font &newFont, Colour newColour, int oldCaret, int newCaret)
bool perform () override
bool undo () override
int getSizeInUnits () override
Public Member Functions inherited from juce::UndoableAction
virtual ~UndoableAction ()=default
virtual UndoableActioncreateCoalescedAction (UndoableAction *nextAction)

Private Attributes

TextEditorowner
const String text
const int insertIndex
const int oldCaretPos
const int newCaretPos
const Font font
const Colour colour

Additional Inherited Members

Protected Member Functions inherited from juce::UndoableAction
 UndoableAction ()=default

Constructor & Destructor Documentation

◆ InsertAction()

juce::TextEditor::InsertAction::InsertAction ( TextEditor & ed,
const String & newText,
int insertPos,
const Font & newFont,
Colour newColour,
int oldCaret,
int newCaret )
inline

Member Function Documentation

◆ getSizeInUnits()

int juce::TextEditor::InsertAction::getSizeInUnits ( )
inlineoverridevirtual

Returns a value to indicate how much memory this object takes up.

Because the UndoManager keeps a list of UndoableActions, this is used to work out how much space each one will take up, so that the UndoManager can work out how many to keep.

The default value returned here is 10 - units are arbitrary and don't have to be accurate.

See also
UndoManager::getNumberOfUnitsTakenUpByStoredCommands, UndoManager::setMaxNumberOfStoredUnits

Reimplemented from juce::UndoableAction.

◆ perform()

bool juce::TextEditor::InsertAction::perform ( )
inlineoverridevirtual

Overridden by a subclass to perform the action.

This method is called by the UndoManager, and shouldn't be used directly by applications.

Be careful not to make any calls in a perform() method that could call recursively back into the UndoManager::perform() method

Returns
true if the action could be performed.
See also
UndoManager::perform

Implements juce::UndoableAction.

◆ undo()

bool juce::TextEditor::InsertAction::undo ( )
inlineoverridevirtual

Overridden by a subclass to undo the action.

This method is called by the UndoManager, and shouldn't be used directly by applications.

Be careful not to make any calls in an undo() method that could call recursively back into the UndoManager::perform() method

Returns
true if the action could be undone without any errors.
See also
UndoManager::perform

Implements juce::UndoableAction.

Member Data Documentation

◆ colour

const Colour juce::TextEditor::InsertAction::colour
private

◆ font

const Font juce::TextEditor::InsertAction::font
private

◆ insertIndex

const int juce::TextEditor::InsertAction::insertIndex
private

◆ newCaretPos

const int juce::TextEditor::InsertAction::newCaretPos
private

◆ oldCaretPos

const int juce::TextEditor::InsertAction::oldCaretPos
private

◆ owner

TextEditor& juce::TextEditor::InsertAction::owner
private

◆ text

const String juce::TextEditor::InsertAction::text
private

The documentation for this struct was generated from the following file: