Browse Source

Added method UndoManager::getCurrentTransactionName

tags/2021-05-28
jules 10 years ago
parent
commit
db4a0ffec5
3 changed files with 14 additions and 1 deletions
  1. +8
    -0
      modules/juce_data_structures/undomanager/juce_UndoManager.cpp
  2. +5
    -0
      modules/juce_data_structures/undomanager/juce_UndoManager.h
  3. +1
    -1
      modules/juce_gui_basics/widgets/juce_TextEditor.h

+ 8
- 0
modules/juce_data_structures/undomanager/juce_UndoManager.cpp View File

@@ -203,6 +203,14 @@ void UndoManager::setCurrentTransactionName (const String& newName) noexcept
action->name = newName;
}
String UndoManager::getCurrentTransactionName() const noexcept
{
if (ActionSet* action = getCurrentSet())
return action->name;
return newTransactionName;
}
//==============================================================================
UndoManager::ActionSet* UndoManager::getCurrentSet() const noexcept { return transactions [nextIndex - 1]; }
UndoManager::ActionSet* UndoManager::getNextSet() const noexcept { return transactions [nextIndex]; }


+ 5
- 0
modules/juce_data_structures/undomanager/juce_UndoManager.h View File

@@ -144,6 +144,11 @@ public:
*/
void setCurrentTransactionName (const String& newName) noexcept;
/** Returns the name of the current transaction.
@see setCurrentTransactionName
*/
String getCurrentTransactionName() const noexcept;
//==============================================================================
/** Returns true if there's at least one action in the list to undo.
@see getUndoDescription, undo, canRedo


+ 1
- 1
modules/juce_gui_basics/widgets/juce_TextEditor.h View File

@@ -194,7 +194,7 @@ public:
These constants can be used either via the Component::setColour(), or LookAndFeel::setColour()
methods.
NB: You can also set the caret colour using CaretComponent::caretColourId
@see Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour


Loading…
Cancel
Save