61 void setText (
const String& newText,
73 String getText (
bool returnActiveEditorContents =
false)
const;
85 void setFont (
const Font& newFont);
91 Font getFont() const noexcept;
106 backgroundColourId = 0x1000280,
107 textColourId = 0x1000281,
108 outlineColourId = 0x1000282,
110 backgroundWhenEditingColourId = 0x1000283,
111 textWhenEditingColourId = 0x1000284,
112 outlineWhenEditingColourId = 0x1000285
142 void attachToComponent (
Component* owner,
bool onLeft);
163 void setMinimumHorizontalScale (
float newScale);
199 void addListener (Listener* listener);
202 void removeListener (Listener* listener);
235 void setEditable (
bool editOnSingleClick,
236 bool editOnDoubleClick =
false,
237 bool lossOfFocusDiscardsChanges =
false);
249 bool isEditable() const noexcept {
return editSingleClick || editDoubleClick; }
264 void hideEditor (
bool discardCurrentEditorContents);
267 bool isBeingEdited() const noexcept;
270 TextEditor* getCurrentTextEditor() const noexcept;
296 virtual void textWasEdited();
299 virtual void textWasChanged();
305 virtual void editorAboutToBeHidden (
TextEditor*);
311 void resized()
override;
315 void mouseDoubleClick (
const MouseEvent&)
override;
317 void componentMovedOrResized (
Component&,
bool wasMoved,
bool wasResized)
override;
319 void componentParentHierarchyChanged (
Component&)
override;
321 void componentVisibilityChanged (
Component&)
override;
323 void inputAttemptWhenModal()
override;
327 void enablementChanged()
override;
331 void textEditorTextChanged (
TextEditor&)
override;
333 void textEditorReturnKeyPressed (
TextEditor&)
override;
335 void textEditorEscapeKeyPressed (
TextEditor&)
override;
337 void textEditorFocusLost (
TextEditor&)
override;
339 void colourChanged()
override;
343 void callChangeListeners();
355 float minimumHorizontalScale = 0;
356 TextInputTarget::VirtualKeyboardType keyboardType = TextInputTarget::textKeyboard;
357 bool editSingleClick =
false;
358 bool editDoubleClick =
false;
359 bool lossOfFocusDiscardsChanges =
false;
360 bool leftOfOwnerComp =
false;
362 bool updateFromTextEditorContents (TextEditor&);
Specifies a set of gaps to be left around the sides of a rectangle.
Gets informed about changes to a component's hierarchy or position.
The base class for all JUCE user-interface objects.
FocusChangeType
Enumeration used by the focusGained() and focusLost() methods.
Represents a particular font, including its size, style, etc.
A graphics context, used for drawing a component or image.
Represents a type of justification to be used when positioning graphical items.
A class for receiving events from a Label.
virtual void labelTextChanged(Label *labelThatHasChanged)=0
Called when a Label's text has changed.
virtual void editorShown(Label *, TextEditor &)
Called when a Label goes into editing mode and displays a TextEditor.
virtual void editorHidden(Label *, TextEditor &)
Called when a Label is about to delete its TextEditor and exit editing mode.
virtual ~Listener()=default
Destructor.
A component that displays a text string, and can optionally become a text editor when clicked.
bool isEditableOnDoubleClick() const noexcept
Returns true if this option was set using setEditable().
std::function< void()> onTextChange
You can assign a lambda to this callback object to have it called when the label text is changed.
ColourIds
A set of colour IDs to use to change the colour of various aspects of the label.
Value & getTextValue() noexcept
Returns the text content as a Value object.
bool isEditable() const noexcept
Returns true if the user can edit this label's text.
BorderSize< int > getBorderSize() const noexcept
Returns the size of the border to be left around the text.
Justification getJustificationType() const noexcept
Returns the type of justification, as set in setJustificationType().
bool doesLossOfFocusDiscardChanges() const noexcept
Returns true if this option has been set in a call to setEditable().
std::function< void()> onEditorShow
You can assign a lambda to this callback object to have it called when the label's editor is shown.
bool isEditableOnSingleClick() const noexcept
Returns true if this option was set using setEditable().
float getMinimumHorizontalScale() const noexcept
Specifies the amount that the font can be squashed horizontally.
std::function< void()> onEditorHide
You can assign a lambda to this callback object to have it called when the label's editor is hidden.
bool isAttachedOnLeft() const noexcept
If the label is attached to the left of another component, this returns true.
void setKeyboardType(TextInputTarget::VirtualKeyboardType type) noexcept
Set a keyboard type for use when the text editor is shown.
Holds a set of objects and can invoke a member function callback on each object in the set with a sin...
Contains position and status information about a mouse event.
Receives callbacks from a TextEditor component when it changes.
VirtualKeyboardType
A set of possible on-screen keyboard types, for use in the getKeyboardType() method.
Receives callbacks when a Value object changes.
Represents a shared variant value.
This class acts as a pointer which will automatically become null if the object to which it points is...
@ valueChanged
Indicates that the UI element's value has changed.
NotificationType
These enums are used in various classes to indicate whether a notification event should be sent out.
This abstract base class is implemented by LookAndFeel classes to provide label drawing functionality...