JUCE  v6.1.6 (6.0.8-1114)
JUCE API
Looking for a senior C++ dev?
I'm looking for work. Hire me!
juce::TextEditor Class Reference

An editable text box. More...

#include <juce_TextEditor.h>

Inheritance diagram for juce::TextEditor:
Collaboration diagram for juce::TextEditor:

Classes

class  InputFilter
 Base class for input filters that can be applied to a TextEditor to restrict the text that can be entered. More...
 
class  LengthAndCharacterRestriction
 An input filter for a TextEditor that limits the length of text and/or the characters that it may contain. More...
 
class  Listener
 Receives callbacks from a TextEditor component when it changes. More...
 
struct  LookAndFeelMethods
 This abstract base class is implemented by LookAndFeel classes to provide TextEditor drawing functionality. More...
 

Public Types

enum  ColourIds {
  backgroundColourId = 0x1000200,
  textColourId = 0x1000201,
  highlightColourId = 0x1000202,
  highlightedTextColourId = 0x1000203,
  outlineColourId = 0x1000205,
  focusedOutlineColourId = 0x1000206,
  shadowColourId = 0x1000207
}
 A set of colour IDs to use to change the colour of various aspects of the editor. More...
 
enum  FocusChangeType {
  focusChangedByMouseClick,
  focusChangedByTabKey,
  focusChangedDirectly
}
 Enumeration used by the focusGained() and focusLost() methods. More...
 
enum  FocusContainerType {
  FocusContainerType::none,
  FocusContainerType::focusContainer,
  FocusContainerType::keyboardFocusContainer
}
 A focus container type that can be passed to setFocusContainerType(). More...
 
enum  VirtualKeyboardType {
  textKeyboard = 0,
  numericKeyboard,
  decimalKeyboard,
  urlKeyboard,
  emailAddressKeyboard,
  phoneNumberKeyboard
}
 A set of possible on-screen keyboard types, for use in the getKeyboardType() method. More...
 

Public Member Functions

 TextEditor (const String &componentName=String(), juce_wchar passwordCharacter=0)
 Creates a new, empty text editor. More...
 
 ~TextEditor () override
 Destructor. More...
 
void addAndMakeVisible (Component &child, int zOrder=-1)
 Adds a child component to this one, and also makes the child visible if it isn't already. More...
 
void addAndMakeVisible (Component *child, int zOrder=-1)
 Adds a child component to this one, and also makes the child visible if it isn't already. More...
 
void addChildAndSetID (Component *child, const String &componentID)
 Adds a child component to this one, makes it visible, and sets its component ID. More...
 
void addChildComponent (Component &child, int zOrder=-1)
 Adds a child component to this one. More...
 
void addChildComponent (Component *child, int zOrder=-1)
 Adds a child component to this one. More...
 
void addComponentListener (ComponentListener *newListener)
 Adds a listener to be told about changes to the component hierarchy or position. More...
 
void addKeyListener (KeyListener *newListener)
 Adds a listener that wants to hear about keypresses that this component receives. More...
 
void addListener (Listener *newListener)
 Registers a listener to be told when things happen to the text. More...
 
void addMouseListener (MouseListener *newListener, bool wantsEventsForAllNestedChildComponents)
 Registers a listener to be told when mouse events occur in this component. More...
 
virtual void addPopupMenuItems (PopupMenu &menuToAddTo, const MouseEvent *mouseClickEvent)
 This adds the items to the popup menu. More...
 
virtual void addToDesktop (int windowStyleFlags, void *nativeWindowToAttachTo=nullptr)
 Makes this component appear as a window on the desktop. More...
 
virtual void alphaChanged ()
 Called when setAlpha() is used to change the alpha value of this component. More...
 
void applyColourToAllText (const Colour &newColour, bool changeCurrentTextColour=true)
 Applies a colour to all the text in the editor. More...
 
void applyFontToAllText (const Font &newFont, bool changeCurrentFont=true)
 Applies a font to all the text in the editor. More...
 
bool areScrollbarsShown () const noexcept
 Returns true if scrollbars are enabled. More...
 
virtual void broughtToFront ()
 Called when this component has been moved to the front of its siblings. More...
 
virtual bool canModalEventBeSentToComponent (const Component *targetComponent)
 When a component is modal, this callback allows it to choose which other components can still receive events. More...
 
void centreWithSize (int width, int height)
 Changes the component's size and centres it within its parent. More...
 
virtual void childBoundsChanged (Component *child)
 Called when one of this component's children is moved or resized. More...
 
virtual void childrenChanged ()
 Subclasses can use this callback to be told when children are added or removed, or when their z-order changes. More...
 
void clear ()
 Deletes all the text from the editor. More...
 
virtual void colourChanged ()
 This method is called when a colour is changed by the setColour() method. More...
 
bool contains (Point< float > localPoint)
 Returns true if a given point lies within this component or one of its children. More...
 
bool contains (Point< int > localPoint)
 Returns true if a given point lies within this component or one of its children. More...
 
void copy ()
 Copies the currently selected region to the clipboard. More...
 
void copyAllExplicitColoursTo (Component &target) const
 This looks for any colours that have been specified for this component, and copies them to the specified target component. More...
 
bool copyToClipboard ()
 
Image createComponentSnapshot (Rectangle< int > areaToGrab, bool clipImageToComponentBounds=true, float scaleFactor=1.0f)
 Generates a snapshot of part of this component. More...
 
virtual std::unique_ptr< ComponentTraversercreateFocusTraverser ()
 Creates a ComponentTraverser object to determine the logic by which focus should be passed from this component. More...
 
virtual std::unique_ptr< ComponentTraversercreateKeyboardFocusTraverser ()
 Creates a ComponentTraverser object to use to determine the logic by which keyboard focus should be passed from this component. More...
 
void cut ()
 Deletes the currently selected region. More...
 
bool cutToClipboard ()
 
void deleteAllChildren ()
 Removes and deletes all of this component's children. More...
 
bool deleteBackwards (bool moveInWholeWordSteps)
 
bool deleteForwards (bool moveInWholeWordSteps)
 
void enablementChanged () override
 
void enterModalState (bool takeKeyboardFocus=true, ModalComponentManager::Callback *callback=nullptr, bool deleteWhenDismissed=false)
 Puts the component into a modal state. More...
 
void exitModalState (int returnValue)
 Ends a component's modal state. More...
 
ComponentfindChildWithID (StringRef componentID) const noexcept
 Looks for a child component with the specified ID. More...
 
Colour findColour (int colourID, bool inheritFromParent=false) const
 Looks for a colour that has been registered with the given colour ID number. More...
 
ComponentfindFocusContainer () const
 Returns the focus container for this component. More...
 
ComponentfindKeyboardFocusContainer () const
 Returns the keyboard focus container for this component. More...
 
template<class TargetClass >
TargetClass * findParentComponentOfClass () const
 Searches the parent components for a component of a specified class. More...
 
void focusGained (FocusChangeType) override
 
void focusLost (FocusChangeType) override
 
virtual void focusOfChildComponentChanged (FocusChangeType cause)
 Called to indicate a change in whether or not this component is the parent of the currently-focused component. More...
 
AccessibilityHandlergetAccessibilityHandler ()
 Returns the accessibility handler for this component, or nullptr if this component is not accessible. More...
 
float getAlpha () const noexcept
 Returns the component's current transparency level. More...
 
BorderSize< intgetBorder () const
 Returns the size of border around the edge of the component. More...
 
int getBottom () const noexcept
 Returns the y coordinate of the bottom edge of this component. More...
 
Rectangle< intgetBounds () const noexcept
 Returns this component's bounding box. More...
 
Rectangle< intgetBoundsInParent () const noexcept
 Returns the area of this component's parent which this component covers. More...
 
CachedComponentImagegetCachedComponentImage () const noexcept
 Returns the object that was set by setCachedComponentImage(). More...
 
int getCaretPosition () const
 Returns the current index of the caret. More...
 
Rectangle< intgetCaretRectangle () override
 Get the graphical position of the caret. More...
 
ComponentgetChildComponent (int index) const noexcept
 Returns one of this component's child components, by it index. More...
 
const Array< Component * > & getChildren () const noexcept
 Provides access to the underlying array of child components. More...
 
ComponentgetComponentAt (int x, int y)
 Returns the component at a certain point within this one. More...
 
ComponentgetComponentAt (Point< float > position)
 Returns the component at a certain point within this one. More...
 
ComponentgetComponentAt (Point< int > position)
 Returns the component at a certain point within this one. More...
 
ImageEffectFiltergetComponentEffect () const noexcept
 Returns the current component effect. More...
 
String getComponentID () const noexcept
 Returns the ID string that was set by setComponentID(). More...
 
String getDescription () const noexcept
 Returns the description for this component. More...
 
virtual float getDesktopScaleFactor () const
 Returns the default scale factor to use for this component when it is placed on the desktop. More...
 
int getExplicitFocusOrder () const
 Returns the focus order of this component, if one has been specified. More...
 
const FontgetFont () const noexcept
 Returns the font that's currently being used for new text. More...
 
int getHeight () const noexcept
 Returns the component's height in pixels. More...
 
String getHelpText () const noexcept
 Returns the help text for this component. More...
 
Range< intgetHighlightedRegion () const override
 Returns the range of characters that are selected. More...
 
String getHighlightedText () const
 Returns the section of text that is currently selected. More...
 
int getIndexOfChildComponent (const Component *child) const noexcept
 Returns the index of this component in the list of child components. More...
 
InputFiltergetInputFilter () const noexcept
 Returns the current InputFilter, as set by setInputFilter(). More...
 
void getInterceptsMouseClicks (bool &allowsClicksOnThisComponent, bool &allowsClicksOnChildComponents) const noexcept
 Retrieves the current state of the mouse-click interception flags. More...
 
Justification getJustificationType () const noexcept
 Returns the type of justification, as set in setJustification(). More...
 
VirtualKeyboardType getKeyboardType () override
 
int getLeftIndent () const noexcept
 Returns the gap at the left edge of the editor. More...
 
float getLineSpacing () const noexcept
 Returns the current line spacing of the TextEditor. More...
 
Rectangle< floatgetLocalArea (const Component *sourceComponent, Rectangle< float > areaRelativeToSourceComponent) const
 Converts a rectangle to be relative to this component's coordinate space. More...
 
Rectangle< intgetLocalArea (const Component *sourceComponent, Rectangle< int > areaRelativeToSourceComponent) const
 Converts a rectangle to be relative to this component's coordinate space. More...
 
Rectangle< intgetLocalBounds () const noexcept
 Returns the component's bounds, relative to its own origin. More...
 
Point< floatgetLocalPoint (const Component *sourceComponent, Point< float > pointRelativeToSourceComponent) const
 Converts a point to be relative to this component's coordinate space. More...
 
Point< intgetLocalPoint (const Component *sourceComponent, Point< int > pointRelativeToSourceComponent) const
 Converts a point to be relative to this component's coordinate space. More...
 
LookAndFeelgetLookAndFeel () const noexcept
 Finds the appropriate look-and-feel to use for this component. More...
 
bool getMouseClickGrabsKeyboardFocus () const noexcept
 Returns the last value set with setMouseClickGrabsKeyboardFocus(). More...
 
virtual MouseCursor getMouseCursor ()
 Returns the mouse cursor shape to use when the mouse is over this component. More...
 
Point< intgetMouseXYRelative () const
 Returns the mouse's current position, relative to this component. More...
 
String getName () const noexcept
 Returns the name of this component. More...
 
int getNumChildComponents () const noexcept
 Returns the number of child components that this component contains. More...
 
ComponentgetParentComponent () const noexcept
 Returns the component which this component is inside. More...
 
int getParentHeight () const noexcept
 Returns the height of the component's parent. More...
 
Rectangle< intgetParentMonitorArea () const
 Returns the screen coordinates of the monitor that contains this component. More...
 
int getParentWidth () const noexcept
 Returns the width of the component's parent. More...
 
juce_wchar getPasswordCharacter () const noexcept
 Returns the current password character. More...
 
ComponentPeergetPeer () const
 Returns the heavyweight window that contains this component. More...
 
Point< intgetPosition () const noexcept
 Returns the component's top-left position as a Point. More...
 
PositionergetPositioner () const noexcept
 Returns the Positioner object that has been set for this component. More...
 
const NamedValueSetgetProperties () const noexcept
 Returns the set of properties that belong to this component. More...
 
NamedValueSetgetProperties () noexcept
 Returns the set of properties that belong to this component. More...
 
bool getReturnKeyStartsNewLine () const
 Returns the value set by setReturnKeyStartsNewLine(). More...
 
int getRight () const noexcept
 Returns the x coordinate of the component's right-hand edge. More...
 
Rectangle< intgetScreenBounds () const
 Returns the bounds of this component, relative to the screen's top-left. More...
 
Point< intgetScreenPosition () const
 Returns the position of this component's top-left corner relative to the screen's top-left. More...
 
int getScreenX () const
 Returns this component's x coordinate relative the screen's top-left origin. More...
 
int getScreenY () const
 Returns this component's y coordinate relative the screen's top-left origin. More...
 
String getText () const
 Returns the entire contents of the editor. More...
 
RectangleList< intgetTextBounds (Range< int > textRange)
 Returns the bounding box for a range of text in the editor. More...
 
int getTextHeight () const
 Returns the maximum height of the text, as it is currently laid-out. More...
 
int getTextIndexAt (int x, int y) const
 Finds the index of the character at a given position. More...
 
String getTextInRange (const Range< int > &textRange) const override
 Returns a section of the contents of the editor. More...
 
String getTextToShowWhenEmpty () const noexcept
 Returns the text that will be shown when the text editor is empty. More...
 
ValuegetTextValue ()
 Returns a Value object that can be used to get or set the text. More...
 
int getTextWidth () const
 Returns the total width of the text, as it is currently laid-out. More...
 
String getTitle () const noexcept
 Returns the title text for this component. More...
 
String getTooltip () override
 Returns the tooltip assigned to this object. More...
 
int getTopIndent () const noexcept
 Returns the gap at the top edge of the editor. More...
 
ComponentgetTopLevelComponent () const noexcept
 Returns the highest-level component which contains this one or its parents. More...
 
int getTotalNumChars () const
 Counts the number of characters in the text. More...
 
AffineTransform getTransform () const
 Returns the transform that is currently being applied to this component. More...
 
bool getViewportIgnoreDragFlag () const noexcept
 Retrieves the current state of the Viewport drag-to-scroll functionality flag. More...
 
bool getWantsKeyboardFocus () const noexcept
 Returns true if the component is interested in getting keyboard focus. More...
 
int getWidth () const noexcept
 Returns the component's width in pixels. More...
 
void * getWindowHandle () const
 Returns the underlying native window handle for this component. More...
 
int getX () const noexcept
 Returns the x coordinate of the component's left edge. More...
 
int getY () const noexcept
 Returns the y coordinate of the top of this component. More...
 
void giveAwayKeyboardFocus ()
 If this component or any of its children currently have the keyboard focus, this will defocus it, send a focus change notification, and try to pass the focus to the next component. More...
 
void grabKeyboardFocus ()
 Tries to give keyboard focus to this component. More...
 
bool hasFocusOutline () const noexcept
 Returns true if this component should have a focus outline. More...
 
bool hasKeyboardFocus (bool trueIfChildIsFocused) const
 Returns true if this component currently has the keyboard focus. More...
 
virtual bool hitTest (int x, int y)
 Tests whether a given point is inside the component. More...
 
virtual void inputAttemptWhenModal ()
 Called when the user tries to click on a component that is blocked by another modal component. More...
 
void insertTextAtCaret (const String &textToInsert) override
 Inserts some text at the current caret position. More...
 
void invalidateAccessibilityHandler ()
 Invalidates the AccessibilityHandler that is currently being used for this component. More...
 
bool isAccessible () const noexcept
 Returns true if this component and its children are visible to accessibility clients. More...
 
bool isAlwaysOnTop () const noexcept
 Returns true if this component is set to always stay in front of its siblings. More...
 
bool isBroughtToFrontOnMouseClick () const noexcept
 Indicates whether the component should be brought to the front when clicked-on. More...
 
bool isCaretVisible () const noexcept
 Returns true if the caret is enabled. More...
 
bool isColourSpecified (int colourID) const
 Returns true if the specified colour ID has been explicitly set for this component using the setColour() method. More...
 
bool isCurrentlyBlockedByAnotherModalComponent () const
 Checks whether there's a modal component somewhere that's stopping this one from receiving messages. More...
 
bool isCurrentlyModal (bool onlyConsiderForemostModalComponent=true) const noexcept
 Returns true if this component is the modal one. More...
 
bool isEmpty () const
 Returns true if there are no characters in the editor. More...
 
bool isEnabled () const noexcept
 Returns true if the component (and all its parents) are enabled. More...
 
bool isFocusContainer () const noexcept
 Returns true if this component has been marked as a focus container. More...
 
bool isKeyboardFocusContainer () const noexcept
 Returns true if this component has been marked as a keyboard focus container. More...
 
bool isMouseButtonDown (bool includeChildren=false) const
 Returns true if the mouse button is currently held down in this component. More...
 
bool isMouseOver (bool includeChildren=false) const
 Returns true if the mouse is currently over this component. More...
 
bool isMouseOverOrDragging (bool includeChildren=false) const
 True if the mouse is over this component, or if it's being dragged in this component. More...
 
bool isMultiLine () const
 Returns true if the editor is in multi-line mode. More...
 
bool isOnDesktop () const noexcept
 Returns true if this component is currently showing on the desktop. More...
 
bool isOpaque () const noexcept
 Returns true if no parts of this component are transparent. More...
 
bool isPaintingUnclipped () const noexcept
 Returns true if this component doesn't require its graphics context to be clipped when it is being painted. More...
 
bool isParentOf (const Component *possibleChild) const noexcept
 Checks whether a component is anywhere inside this component or its children. More...
 
bool isPopupMenuCurrentlyActive () const noexcept
 Returns true if a popup-menu is currently being displayed. More...
 
bool isPopupMenuEnabled () const noexcept
 Returns true if the right-click menu is enabled. More...
 
bool isReadOnly () const noexcept
 Returns true if the editor is in read-only mode. More...
 
bool isShowing () const
 Tests whether this component and all its parents are visible. More...
 
bool isTabKeyUsedAsCharacter () const
 Returns true if the tab key is being used for input. More...
 
bool isTextInputActive () const override
 
bool isTransformed () const noexcept
 Returns true if a non-identity transform is being applied to this component. More...
 
bool isVisible () const noexcept
 Tests whether the component is visible or not. More...
 
bool isWhitespaceUnderlined () const noexcept
 Returns true if whitespace is underlined for underlined fonts. More...
 
bool keyPressed (const KeyPress &) override
 
bool keyStateChanged (bool) override
 
Rectangle< floatlocalAreaToGlobal (Rectangle< float > localArea) const
 Converts a rectangle from this component's coordinate space to a screen coordinate. More...
 
Rectangle< intlocalAreaToGlobal (Rectangle< int > localArea) const
 Converts a rectangle from this component's coordinate space to a screen coordinate. More...
 
Point< floatlocalPointToGlobal (Point< float > localPoint) const
 Converts a point relative to this component's top-left into a screen coordinate. More...
 
Point< intlocalPointToGlobal (Point< int > localPoint) const
 Converts a point relative to this component's top-left into a screen coordinate. More...
 
void lookAndFeelChanged () override
 
virtual void minimisationStateChanged (bool isNowMinimised)
 Called for a desktop component which has just been minimised or un-minimised. More...
 
virtual void modifierKeysChanged (const ModifierKeys &modifiers)
 Called when a modifier key is pressed or released. More...
 
void mouseDoubleClick (const MouseEvent &) override
 
void mouseDown (const MouseEvent &) override
 
void mouseDrag (const MouseEvent &) override
 
void mouseEnter (const MouseEvent &event) override
 Called when the mouse first enters a component. More...
 
void mouseExit (const MouseEvent &event) override
 Called when the mouse moves out of a component. More...
 
void mouseMagnify (const MouseEvent &event, float scaleFactor) override
 Called when a pinch-to-zoom mouse-gesture is used. More...
 
void mouseMove (const MouseEvent &event) override
 Called when the mouse moves inside a component. More...
 
void mouseUp (const MouseEvent &) override
 
void mouseWheelMove (const MouseEvent &, const MouseWheelDetails &) override
 
bool moveCaretDown (bool selecting)
 
bool moveCaretLeft (bool moveInWholeWordSteps, bool selecting)
 
bool moveCaretRight (bool moveInWholeWordSteps, bool selecting)
 
void moveCaretToEnd ()
 
bool moveCaretToEnd (bool selecting)
 
bool moveCaretToEndOfLine (bool selecting)
 
bool moveCaretToStartOfLine (bool selecting)
 
bool moveCaretToTop (bool selecting)
 
bool moveCaretUp (bool selecting)
 
virtual void moved ()
 Called when this component's position has been changed. More...
 
void moveKeyboardFocusToSibling (bool moveToNext)
 Tries to move the keyboard focus to one of this component's siblings. More...
 
bool pageDown (bool selecting)
 
bool pageUp (bool selecting)
 
void paint (Graphics &) override
 
void paintEntireComponent (Graphics &context, bool ignoreAlphaLevel)
 Draws this component and all its subcomponents onto the specified graphics context. More...
 
void paintOverChildren (Graphics &) override
 
void parentHierarchyChanged () override
 
virtual void parentSizeChanged ()
 Called when this component's immediate parent has been resized. More...
 
void paste ()
 Pastes the contents of the clipboard into the editor at the caret position. More...
 
bool pasteFromClipboard ()
 
virtual void performPopupMenuAction (int menuItemID)
 This is called to perform one of the items that was shown on the popup menu. More...
 
void postCommandMessage (int commandId)
 Dispatches a numbered message to this component. More...
 
int proportionOfHeight (float proportion) const noexcept
 Returns a proportion of the component's height. More...
 
int proportionOfWidth (float proportion) const noexcept
 Returns a proportion of the component's width. More...
 
bool reallyContains (Point< float > localPoint, bool returnTrueIfWithinAChild)
 Returns true if a given point lies in this component, taking any overlapping siblings into account. More...
 
bool reallyContains (Point< int > localPoint, bool returnTrueIfWithinAChild)
 Returns true if a given point lies in this component, taking any overlapping siblings into account. More...
 
bool redo ()
 
void removeAllChildren ()
 Removes all this component's children. More...
 
void removeChildComponent (Component *childToRemove)
 Removes one of this component's child-components. More...
 
ComponentremoveChildComponent (int childIndexToRemove)
 Removes one of this component's child-components by index. More...
 
void removeColour (int colourID)
 If a colour has been set with setColour(), this will remove it. More...
 
void removeComponentListener (ComponentListener *listenerToRemove)
 Removes a component listener. More...
 
void removeFromDesktop ()
 If the component is currently showing on the desktop, this will hide it. More...
 
void removeKeyListener (KeyListener *listenerToRemove)
 Removes a previously-registered key listener. More...
 
void removeListener (Listener *listenerToRemove)
 Deregisters a listener. More...
 
void removeMouseListener (MouseListener *listenerToRemove)
 Deregisters a mouse listener. More...
 
void repaint ()
 Marks the whole component as needing to be redrawn. More...
 
void repaint (int x, int y, int width, int height)
 Marks a subsection of this component as needing to be redrawn. More...
 
void repaint (Rectangle< int > area)
 Marks a subsection of this component as needing to be redrawn. More...
 
void resized () override
 
int runModalLoop ()
 Runs a component modally, waiting until the loop terminates. More...
 
bool scrollDown ()
 
void scrollEditorToPositionCaret (int desiredCaretX, int desiredCaretY)
 Attempts to scroll the text editor so that the caret ends up at a specified position. More...
 
bool scrollUp ()
 
bool selectAll ()
 
void sendLookAndFeelChange ()
 Calls the lookAndFeelChanged() method in this component and all its children. More...
 
void setAccessible (bool shouldBeAccessible)
 Sets whether this component and its children are visible to accessibility clients. More...
 
void setAlpha (float newAlpha)
 Changes the transparency of this component. More...
 
void setAlwaysOnTop (bool shouldStayOnTop)
 Sets whether the component should always be kept at the front of its siblings. More...
 
void setBorder (BorderSize< int > border)
 Changes the size of border left around the edge of the component. More...
 
void setBounds (int x, int y, int width, int height)
 Changes the component's position and size. More...
 
void setBounds (Rectangle< int > newBounds)
 Changes the component's position and size. More...
 
void setBoundsInset (BorderSize< int > borders)
 Changes the component's position and size based on the amount of space to leave around it. More...
 
void setBoundsRelative (float proportionalX, float proportionalY, float proportionalWidth, float proportionalHeight)
 Changes the component's position and size in terms of fractions of its parent's size. More...
 
void setBoundsRelative (Rectangle< float > proportionalArea)
 Changes the component's position and size in terms of fractions of its parent's size. More...
 
void setBoundsToFit (Rectangle< int > targetArea, Justification justification, bool onlyReduceInSize)
 Positions the component within a given rectangle, keeping its proportions unchanged. More...
 
void setBroughtToFrontOnMouseClick (bool shouldBeBroughtToFront) noexcept
 Indicates whether the component should be brought to the front when clicked. More...
 
void setBufferedToImage (bool shouldBeBuffered)
 Makes the component use an internal buffer to optimise its redrawing. More...
 
void setCachedComponentImage (CachedComponentImage *newCachedImage)
 Gives the component a CachedComponentImage that should be used to buffer its painting. More...
 
void setCaretPosition (int newIndex)
 Moves the caret to be in front of a given character. More...
 
void setCaretVisible (bool shouldBeVisible)
 Makes the caret visible or invisible. More...
 
void setCentrePosition (int x, int y)
 Changes the position of the component's centre. More...
 
void setCentrePosition (Point< int > newCentrePosition)
 Changes the position of the component's centre. More...
 
void setCentreRelative (float x, float y)
 Changes the position of the component's centre. More...
 
void setColour (int colourID, Colour newColour)
 Registers a colour to be used for a particular purpose. More...
 
void setComponentEffect (ImageEffectFilter *newEffect)
 Adds an effect filter to alter the component's appearance. More...
 
void setComponentID (const String &newID)
 Sets the component's ID string. More...
 
void setDescription (const String &newDescription)
 Sets the description for this component. More...
 
void setEnabled (bool shouldBeEnabled)
 Enables or disables this component. More...
 
void setEscapeAndReturnKeysConsumed (bool shouldBeConsumed) noexcept
 This can be used to change whether escape and return keypress events are propagated up to the parent component. More...
 
void setExplicitFocusOrder (int newFocusOrderIndex)
 Sets the focus order of this component. More...
 
void setFocusContainerType (FocusContainerType containerType) noexcept
 Sets whether this component is a container for components that can have their focus traversed, and the type of focus traversal that it supports. More...
 
void setFont (const Font &newFont)
 Sets the font to use for newly added text. More...
 
void setHasFocusOutline (bool hasFocusOutline) noexcept
 Use this to indicate that the component should have an outline drawn around it when it has keyboard focus. More...
 
void setHelpText (const String &newHelpText)
 Sets the help text for this component. More...
 
void setHighlightedRegion (const Range< int > &newSelection) override
 Selects a section of the text. More...
 
void setIndents (int newLeftIndent, int newTopIndent)
 Changes the size of the gap at the top and left-edge of the editor. More...
 
void setInputFilter (InputFilter *newFilter, bool takeOwnership)
 Sets an input filter that should be applied to this editor. More...
 
void setInputRestrictions (int maxTextLength, const String &allowedCharacters=String())
 Sets limits on the characters that can be entered. More...
 
void setInterceptsMouseClicks (bool allowClicksOnThisComponent, bool allowClicksOnChildComponents) noexcept
 Changes the default return value for the hitTest() method. More...
 
void setJustification (Justification newJustification)
 Modifies the justification of the text within the editor window. More...
 
void setKeyboardType (VirtualKeyboardType type) noexcept
 
void setLineSpacing (float newLineSpacing) noexcept
 Sets the line spacing of the TextEditor. More...
 
void setLookAndFeel (LookAndFeel *newLookAndFeel)
 Sets the look and feel to use for this component. More...
 
void setMouseClickGrabsKeyboardFocus (bool shouldGrabFocus)
 Chooses whether a click on this component automatically grabs the focus. More...
 
void setMouseCursor (const MouseCursor &cursorType)
 Changes the mouse cursor shape to use when the mouse is over this component. More...
 
void setMultiLine (bool shouldBeMultiLine, bool shouldWordWrap=true)
 Puts the editor into either multi- or single-line mode. More...
 
virtual void setName (const String &newName)
 Sets the name of this component. More...
 
void setOpaque (bool shouldBeOpaque)
 Indicates whether any parts of the component might be transparent. More...
 
void setPaintingIsUnclipped (bool shouldPaintWithoutClipping) noexcept
 This allows you to indicate that this component doesn't require its graphics context to be clipped when it is being painted. More...
 
void setPasswordCharacter (juce_wchar passwordCharacter)
 Changes the password character used to disguise the text. More...
 
void setPopupMenuEnabled (bool menuEnabled)
 Allows a right-click menu to appear for the editor. More...
 
void setPositioner (Positioner *newPositioner)
 Sets a new Positioner object for this component. More...
 
void setReadOnly (bool shouldBeReadOnly)
 Changes the editor to read-only mode. More...
 
void setRepaintsOnMouseActivity (bool shouldRepaint) noexcept
 Causes automatic repaints when the mouse enters or exits this component. More...
 
void setReturnKeyStartsNewLine (bool shouldStartNewLine)
 Changes the behaviour of the return key. More...
 
void setScrollbarsShown (bool shouldBeEnabled)
 Enables or disables scrollbars (this only applies when in multi-line mode). More...
 
void setScrollBarThickness (int newThicknessPixels)
 Changes the size of the scrollbars that are used. More...
 
void setScrollToShowCursor (bool shouldScrollToShowCaret)
 Used to disable the auto-scrolling which keeps the caret visible. More...
 
void setSelectAllWhenFocused (bool shouldSelectAll)
 If set to true, focusing on the editor will highlight all its text. More...
 
void setSize (int newWidth, int newHeight)
 Changes the size of the component. More...
 
void setTabKeyUsedAsCharacter (bool shouldTabKeyBeUsed)
 Indicates whether the tab key should be accepted and used to input a tab character, or whether it gets ignored. More...
 
void setTemporaryUnderlining (const Array< Range< int >> &) override
 
void setText (const String &newText, bool sendTextChangeMessage=true)
 Sets the entire content of the editor. More...
 
void setTextToShowWhenEmpty (const String &text, Colour colourToUse)
 When the text editor is empty, it can be set to display a message. More...
 
void setTitle (const String &newTitle)
 Sets the title for this component. More...
 
virtual void setTooltip (const String &newTooltip)
 Assigns a new tooltip to this object. More...
 
void setTopLeftPosition (int x, int y)
 Moves the component to a new position. More...
 
void setTopLeftPosition (Point< int > newTopLeftPosition)
 Moves the component to a new position. More...
 
void setTopRightPosition (int x, int y)
 Moves the component to a new position. More...
 
void setTransform (const AffineTransform &transform)
 Sets a transform matrix to be applied to this component. More...
 
void setViewportIgnoreDragFlag (bool ignoreDrag) noexcept
 Sets a flag to indicate whether mouse drag events on this Component should be ignored when it is inside a Viewport with drag-to-scroll functionality enabled. More...
 
virtual void setVisible (bool shouldBeVisible)
 Makes the component visible or invisible. More...
 
void setWantsKeyboardFocus (bool wantsFocus) noexcept
 Sets a flag to indicate whether this component wants keyboard focus or not. More...
 
void setWhitespaceUnderlined (bool shouldUnderlineWhitespace) noexcept
 Sets whether whitespace should be underlined when the editor font is underlined. More...
 
void toBack ()
 Changes this component's z-order to be at the back of all its siblings. More...
 
void toBehind (Component *other)
 Changes this component's z-order so that it's just behind another component. More...
 
void toFront (bool shouldAlsoGainKeyboardFocus)
 Brings the component to the front of its siblings. More...
 
bool undo ()
 
void updateMouseCursor () const
 Forces the current mouse cursor to be updated. More...
 
virtual void userTriedToCloseWindow ()
 For components on the desktop, this is called if the system wants to close the window. More...
 
virtual void visibilityChanged ()
 Called when this component's visibility changes. More...
 

Static Public Member Functions

static void beginDragAutoRepeat (int millisecondsBetweenCallbacks)
 Ensures that a non-stop stream of mouse-drag events will be sent during the current mouse-drag operation. More...
 
static float getApproximateScaleFactorForComponent (const Component *targetComponent)
 Returns the approximate scale factor for a given component by traversing its parent hierarchy and applying each transform and finally scaling this by the global scale factor. More...
 
static ComponentgetCurrentlyFocusedComponent () noexcept
 Returns the component that currently has the keyboard focus. More...
 
static ComponentgetCurrentlyModalComponent (int index=0) noexcept
 Returns one of the components that are currently modal. More...
 
static int getNumCurrentlyModalComponents () noexcept
 Returns the number of components that are currently in a modal state. More...
 
static bool isMouseButtonDownAnywhere () noexcept
 Returns true if a mouse button is currently down. More...
 
static void unfocusAllComponents ()
 If any component has keyboard focus, this will defocus it. More...
 

Public Attributes

std::function< void()> onEscapeKey
 You can assign a lambda to this callback object to have it called when the escape key is pressed. More...
 
std::function< void()> onFocusLost
 You can assign a lambda to this callback object to have it called when the editor loses key focus. More...
 
std::function< void()> onReturnKey
 You can assign a lambda to this callback object to have it called when the return key is pressed. More...
 
std::function< void()> onTextChange
 You can assign a lambda to this callback object to have it called when the text is changed. More...
 

Protected Member Functions

virtual void escapePressed ()
 Can be overridden to intercept escape key presses directly. More...
 
void newTransaction ()
 Begins a new transaction in the UndoManager. More...
 
virtual void returnPressed ()
 Can be overridden to intercept return key presses directly. More...
 
void scrollToMakeSureCursorIsVisible ()
 Scrolls the minimum distance needed to get the caret into view. More...
 
void textChanged ()
 Used internally to dispatch a text-change message. More...
 

Private Types

enum  DragType {
  notDragging,
  draggingSelectionStart,
  draggingSelectionEnd
}
 

Private Member Functions

void checkFocus ()
 
void checkLayout ()
 
void clearInternal (UndoManager *)
 
void coalesceSimilarSections ()
 
std::unique_ptr< AccessibilityHandlercreateAccessibilityHandler () override
 Override this method to return a custom AccessibilityHandler for this component. More...
 
void drawContent (Graphics &)
 
int findWordBreakAfter (int position) const
 
int findWordBreakBefore (int position) const
 
Rectangle< floatgetCaretRectangleFloat () const
 
void getCharPosition (int index, Point< float > &, float &lineHeight) const
 
int getMaximumTextHeight () const
 
int getMaximumTextWidth () const
 
Point< intgetTextOffset () const noexcept
 
UndoManagergetUndoManager () noexcept
 
int getWordWrapWidth () const
 
void handleCommandMessage (int) override
 Called to handle a command that was sent by postCommandMessage(). More...
 
int indexAtPosition (float x, float y) const
 
void insert (const String &, int insertIndex, const Font &, Colour, UndoManager *, int newCaretPos)
 
void moveCaret (int newCaretPos)
 
void moveCaretTo (int newPosition, bool isSelecting)
 
bool moveCaretWithTransaction (int newPos, bool selecting)
 
void recreateCaret ()
 
void reinsert (int insertIndex, const OwnedArray< UniformTextSection > &)
 
void remove (Range< int >, UndoManager *, int caretPositionToMoveTo)
 
void repaintText (Range< int >)
 
void scrollByLines (int deltaLines)
 
void setSelection (Range< int >) noexcept
 
void splitSection (int sectionIndex, int charToSplitAt)
 
void textWasChangedByValue ()
 
void timerCallbackInt ()
 
bool undoOrRedo (bool shouldUndo)
 
void updateCaretPosition ()
 
void updateValueFromText ()
 

Private Attributes

BorderSize< intborderSize { 1, 1, 1, 3 }
 
std::unique_ptr< CaretComponentcaret
 
int caretPosition = 0
 
bool caretVisible = true
 
Colour colourForTextWhenEmpty
 
bool consumeEscAndReturnKeys = true
 
Font currentFont { 14.0f }
 
DragType dragType = notDragging
 
OptionalScopedPointer< InputFilterinputFilter
 
Justification justification { Justification::topLeft }
 
bool keepCaretOnScreen = true
 
VirtualKeyboardType keyboardType = TextInputTarget::textKeyboard
 
unsigned int lastTransactionTime = 0
 
int leftIndent = 4
 
float lineSpacing = 1.0f
 
ListenerList< Listenerlisteners
 
bool menuActive = false
 
bool multiline = false
 
juce_wchar passwordCharacter
 
bool popupMenuEnabled = true
 
bool readOnly = false
 
bool returnKeyStartsNewLine = false
 
bool scrollbarVisible = true
 
OwnedArray< UniformTextSection > sections
 
bool selectAllTextWhenFocused = false
 
Range< intselection
 
bool tabKeyUsed = false
 
TextHolderComponent * textHolder
 
String textToShowWhenEmpty
 
Value textValue
 
String tooltipString
 
int topIndent = 4
 
int totalNumChars = 0
 
Array< Range< int > > underlinedSections
 
bool underlineWhitespace = true
 
UndoManager undoManager
 
bool valueTextNeedsUpdating = false
 
std::unique_ptr< Viewportviewport
 
bool wasFocused = false
 
bool wordWrap = false
 

Detailed Description

An editable text box.

A TextEditor can either be in single- or multi-line mode, and supports mixed fonts and colours.

See also
TextEditor::Listener, Label

@tags{GUI}

Member Enumeration Documentation

◆ ColourIds

A set of colour IDs to use to change the colour of various aspects of the editor.

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 also
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator
backgroundColourId 

The colour to use for the text component's background - this can be transparent if necessary.

textColourId 

The colour that will be used when text is added to the editor.

Note that because the editor can contain multiple colours, calling this method won't change the colour of existing text - to do that, use the applyColourToAllText() method

highlightColourId 

The colour with which to fill the background of highlighted sections of the text - this can be transparent if you don't want to show any highlighting.

highlightedTextColourId 

The colour with which to draw the text in highlighted sections.

outlineColourId 

If this is non-transparent, it will be used to draw a box around the edge of the component.

focusedOutlineColourId 

If this is non-transparent, it will be used to draw a box around the edge of the component when it has focus.

shadowColourId 

If this is non-transparent, it'll be used to draw an inner shadow around the edge of the editor.

◆ DragType

Enumerator
notDragging 
draggingSelectionStart 
draggingSelectionEnd 

◆ FocusChangeType

Enumeration used by the focusGained() and focusLost() methods.

Enumerator
focusChangedByMouseClick 

Means that the user clicked the mouse to change focus.

focusChangedByTabKey 

Means that the user pressed the tab key to move the focus.

focusChangedDirectly 

Means that the focus was changed by a call to grabKeyboardFocus().

◆ FocusContainerType

A focus container type that can be passed to setFocusContainerType().

If a component is marked as a focus container or keyboard focus container then it will act as the top-level component within which focus or keyboard focus is passed around. By default components are considered "focusable" if they are visible and enabled and "keyboard focusable" if getWantsKeyboardFocus() == true.

The order of traversal within a focus container is determined by the objects returned by createFocusTraverser() and createKeyboardFocusTraverser(), respectively - see the documentation of the default FocusContainer and KeyboardFocusContainer implementations for more information.

Enumerator
none 

The component will not act as a focus container.

    This is the default setting for non top-level components and means that it and any
    sub-components are navigable within their containing focus container.
focusContainer 

The component will act as a top-level component within which focus is passed around.

    The default traverser implementation returned by createFocusTraverser() will use this
    flag to find the first parent component (of the currently focused one) that wants to
    be a focus container.

    This is currently used when determining the hierarchy of accessible UI elements presented
    to screen reader clients on supported platforms. See the AccessibilityHandler class for
    more information.
keyboardFocusContainer 

The component will act as a top-level component within which keyboard focus is passed around.

    The default traverser implementation returned by createKeyboardFocusTraverser() will
    use this flag to find the first parent component (of the currently focused one) that
    wants to be a keyboard focus container.

    This is currently used when determining how keyboard focus is passed between components
    that have been marked as keyboard focusable with setWantsKeyboardFocus() when clicking
    on components and navigating with the tab key.

◆ VirtualKeyboardType

A set of possible on-screen keyboard types, for use in the getKeyboardType() method.

Enumerator
textKeyboard 
numericKeyboard 
decimalKeyboard 
urlKeyboard 
emailAddressKeyboard 
phoneNumberKeyboard 

Constructor & Destructor Documentation

◆ TextEditor()

juce::TextEditor::TextEditor ( const String componentName = String(),
juce_wchar  passwordCharacter = 0 
)
explicit

Creates a new, empty text editor.

Parameters
componentNamethe name to pass to the component for it to use as its name
passwordCharacterif this is not zero, this character will be used as a replacement for all characters that are drawn on screen - e.g. to create a password-style textbox containing circular blobs instead of text, you could set this value to 0x25cf, which is the unicode character for a black splodge (not all fonts include this, though), or 0x2022, which is a bullet (probably the best choice for linux).

◆ ~TextEditor()

juce::TextEditor::~TextEditor ( )
override

Destructor.

Member Function Documentation

◆ addAndMakeVisible() [1/2]

void juce::Component::addAndMakeVisible ( Component child,
int  zOrder = -1 
)
inherited

Adds a child component to this one, and also makes the child visible if it isn't already.

This is the same as calling setVisible (true) on the child and then addChildComponent(). See addChildComponent() for more details.

Parameters
childthe new component to add. If the component passed-in is already the child of another component, it'll first be removed from its current parent.
zOrderThe index in the child-list at which this component should be inserted. A value of -1 will insert it in front of the others, 0 is the back.

◆ addAndMakeVisible() [2/2]

void juce::Component::addAndMakeVisible ( Component child,
int  zOrder = -1 
)
inherited

Adds a child component to this one, and also makes the child visible if it isn't already.

This is the same as calling setVisible (true) on the child and then addChildComponent(). See addChildComponent() for more details.

Parameters
childthe new component to add. If the component passed-in is already the child of another component, it'll first be removed from its current parent.
zOrderThe index in the child-list at which this component should be inserted. A value of -1 will insert it in front of the others, 0 is the back.

Referenced by juce::StandaloneFilterWindow::MainContentComponent::MainContentComponent(), juce::StandaloneFilterWindow::MainContentComponent::NotificationArea::NotificationArea(), and juce::StandalonePluginHolder::SettingsComponent::SettingsComponent().

◆ addChildAndSetID()

void juce::Component::addChildAndSetID ( Component child,
const String componentID 
)
inherited

Adds a child component to this one, makes it visible, and sets its component ID.

See also
addAndMakeVisible, addChildComponent

◆ addChildComponent() [1/2]

void juce::Component::addChildComponent ( Component child,
int  zOrder = -1 
)
inherited

Adds a child component to this one.

Adding a child component does not mean that the component will own or delete the child - it's your responsibility to delete the component. Note that it's safe to delete a component without first removing it from its parent - doing so will automatically remove it and send out the appropriate notifications before the deletion completes.

If the child is already a child of this component, then no action will be taken, and its z-order will be left unchanged.

Parameters
childthe new component to add. If the component passed-in is already the child of another component, it'll first be removed from its current parent.
zOrderThe index in the child-list at which this component should be inserted. A value of -1 will insert it in front of the others, 0 is the back.
See also
removeChildComponent, addAndMakeVisible, addChildAndSetID, getChild, ComponentListener::componentChildrenChanged

◆ addChildComponent() [2/2]

void juce::Component::addChildComponent ( Component child,
int  zOrder = -1 
)
inherited

Adds a child component to this one.

Adding a child component does not mean that the component will own or delete the child - it's your responsibility to delete the component. Note that it's safe to delete a component without first removing it from its parent - doing so will automatically remove it and send out the appropriate notifications before the deletion completes.

If the child is already a child of this component, then no action will be taken, and its z-order will be left unchanged.

Parameters
childthe new component to add. If the component passed-in is already the child of another component, it'll first be removed from its current parent.
zOrderThe index in the child-list at which this component should be inserted. A value of -1 will insert it in front of the others, 0 is the back.
See also
removeChildComponent, addAndMakeVisible, addChildAndSetID, getChild, ComponentListener::componentChildrenChanged

Referenced by juce::StandaloneFilterWindow::MainContentComponent::MainContentComponent().

◆ addComponentListener()

void juce::Component::addComponentListener ( ComponentListener newListener)
inherited

Adds a listener to be told about changes to the component hierarchy or position.

Component listeners get called when this component's size, position or children change - see the ComponentListener class for more details.

Parameters
newListenerthe listener to register - if this is already registered, it will be ignored.
See also
ComponentListener, removeComponentListener

◆ addKeyListener()

void juce::Component::addKeyListener ( KeyListener newListener)
inherited

Adds a listener that wants to hear about keypresses that this component receives.

The listeners that are registered with a component are called by its keyPressed() or keyStateChanged() methods (assuming these haven't been overridden to do something else).

If you add an object as a key listener, be careful to remove it when the object is deleted, or the component will be left with a dangling pointer.

See also
keyPressed, keyStateChanged, removeKeyListener

◆ addListener()

void juce::TextEditor::addListener ( Listener newListener)

Registers a listener to be told when things happen to the text.

See also
removeListener

◆ addMouseListener()

void juce::Component::addMouseListener ( MouseListener newListener,
bool  wantsEventsForAllNestedChildComponents 
)
inherited

Registers a listener to be told when mouse events occur in this component.

If you need to get informed about mouse events in a component but can't or don't want to override its methods, you can attach any number of listeners to the component, and these will get told about the events in addition to the component's own callbacks being called.

Note that a MouseListener can also be attached to more than one component.

Parameters
newListenerthe listener to register
wantsEventsForAllNestedChildComponentsif true, the listener will receive callbacks for events that happen to any child component within this component, including deeply-nested child components. If false, it will only be told about events that this component handles.
See also
MouseListener, removeMouseListener

◆ addPopupMenuItems()

virtual void juce::TextEditor::addPopupMenuItems ( PopupMenu menuToAddTo,
const MouseEvent mouseClickEvent 
)
virtual

This adds the items to the popup menu.

By default it adds the cut/copy/paste items, but you can override this if you need to replace these with your own items.

If you want to add your own items to the existing ones, you can override this, call the base class's addPopupMenuItems() method, then append your own items.

When the menu has been shown, performPopupMenuAction() will be called to perform the item that the user has chosen.

The default menu items will be added using item IDs from the StandardApplicationCommandIDs namespace.

If this was triggered by a mouse-click, the mouseClickEvent parameter will be a pointer to the info about it, or may be null if the menu is being triggered by some other means.

See also
performPopupMenuAction, setPopupMenuEnabled, isPopupMenuEnabled

◆ addToDesktop()

virtual void juce::Component::addToDesktop ( int  windowStyleFlags,
void *  nativeWindowToAttachTo = nullptr 
)
virtualinherited

Makes this component appear as a window on the desktop.

Note that before calling this, you should make sure that the component's opacity is set correctly using setOpaque(). If the component is non-opaque, the windowing system will try to create a special transparent window for it, which will generally take a lot more CPU to operate (and might not even be possible on some platforms).

If the component is inside a parent component at the time this method is called, it will first be removed from that parent. Likewise if a component is on the desktop and is subsequently added to another component, it'll be removed from the desktop.

Parameters
windowStyleFlagsa combination of the flags specified in the ComponentPeer::StyleFlags enum, which define the window's characteristics.
nativeWindowToAttachTothis allows an OS object to be passed-in as the window in which the juce component should place itself. On Windows, this would be a HWND, a HIViewRef on the Mac. Not necessarily supported on all platforms, and best left as 0 unless you know what you're doing.
See also
removeFromDesktop, isOnDesktop, userTriedToCloseWindow, getPeer, ComponentPeer::setMinimised, ComponentPeer::StyleFlags, ComponentPeer::getStyleFlags, ComponentPeer::setFullScreen

Reimplemented in juce::TopLevelWindow.

◆ alphaChanged()

virtual void juce::Component::alphaChanged ( )
virtualinherited

Called when setAlpha() is used to change the alpha value of this component.

If you override this, you should also invoke the base class's implementation during your overridden function, as it performs some repainting behaviour.

Reimplemented in juce::NSViewComponent.

◆ applyColourToAllText()

void juce::TextEditor::applyColourToAllText ( const Colour newColour,
bool  changeCurrentTextColour = true 
)

Applies a colour to all the text in the editor.

If the changeCurrentTextColour argument is true then this will also set the new colour as the colour to be used for any new text that's added.

◆ applyFontToAllText()

void juce::TextEditor::applyFontToAllText ( const Font newFont,
bool  changeCurrentFont = true 
)

Applies a font to all the text in the editor.

If the changeCurrentFont argument is true then this will also set the new font as the font to be used for any new text that's added.

See also
setFont

◆ areScrollbarsShown()

bool juce::TextEditor::areScrollbarsShown ( ) const
inlinenoexcept

Returns true if scrollbars are enabled.

See also
setScrollbarsShown

◆ beginDragAutoRepeat()

static void juce::Component::beginDragAutoRepeat ( int  millisecondsBetweenCallbacks)
staticinherited

Ensures that a non-stop stream of mouse-drag events will be sent during the current mouse-drag operation.

This allows you to make sure that mouseDrag() events are sent continuously, even when the mouse isn't moving. This can be useful for things like auto-scrolling components when the mouse is near an edge.

Call this method during a mouseDown() or mouseDrag() callback, specifying the minimum interval between consecutive mouse drag callbacks. The callbacks will continue until the mouse is released, and then the interval will be reset, so you need to make sure it's called every time you begin a drag event. Passing an interval of 0 or less will cancel the auto-repeat.

See also
mouseDrag, Desktop::beginDragAutoRepeat

◆ broughtToFront()

virtual void juce::Component::broughtToFront ( )
virtualinherited

Called when this component has been moved to the front of its siblings.

The component may have been brought to the front by the toFront() method, or by the operating system if it's a top-level window.

See also
toFront

Reimplemented in juce::XEmbedComponent, and juce::MultiDocumentPanelWindow.

◆ canModalEventBeSentToComponent()

virtual bool juce::Component::canModalEventBeSentToComponent ( const Component targetComponent)
virtualinherited

When a component is modal, this callback allows it to choose which other components can still receive events.

When a modal component is active and the user clicks on a non-modal component, this method is called on the modal component, and if it returns true, the event is allowed to reach its target. If it returns false, the event is blocked and the inputAttemptWhenModal() callback is made.

It called by the isCurrentlyBlockedByAnotherModalComponent() method. The default implementation just returns false in all cases.

◆ centreWithSize()

void juce::Component::centreWithSize ( int  width,
int  height 
)
inherited

Changes the component's size and centres it within its parent.

After changing the size, the component will be moved so that it's centred within its parent. If the component is on the desktop (or has no parent component), then it'll be centred within the main monitor area.

◆ checkFocus()

void juce::TextEditor::checkFocus ( )
private

◆ checkLayout()

void juce::TextEditor::checkLayout ( )
private

◆ childBoundsChanged()

virtual void juce::Component::childBoundsChanged ( Component child)
virtualinherited

Called when one of this component's children is moved or resized.

If the parent wants to know about changes to its immediate children (not to children of its children), this is the method to override.

See also
moved, resized, parentSizeChanged

Reimplemented in juce::StandalonePluginHolder::SettingsComponent, juce::ResizableWindow, juce::CallOutBox, juce::TabBarButton, and juce::DrawableComposite.

◆ childrenChanged()

virtual void juce::Component::childrenChanged ( )
virtualinherited

Subclasses can use this callback to be told when children are added or removed, or when their z-order changes.

See also
parentHierarchyChanged, ComponentListener::componentChildrenChanged

Reimplemented in juce::DrawableComposite.

◆ clear()

void juce::TextEditor::clear ( )

Deletes all the text from the editor.

◆ clearInternal()

void juce::TextEditor::clearInternal ( UndoManager )
private

◆ coalesceSimilarSections()

void juce::TextEditor::coalesceSimilarSections ( )
private

◆ colourChanged()

◆ contains() [1/2]

bool juce::Component::contains ( Point< float localPoint)
inherited

Returns true if a given point lies within this component or one of its children.

Never override this method! Use hitTest to create custom hit regions.

Parameters
localPointthe coordinate to test, relative to this component's top-left.
Returns
true if the point is within the component's hit-test area, but only if that part of the component isn't clipped by its parent component. Note that this won't take into account any overlapping sibling components which might be in the way - for that, see reallyContains()
See also
hitTest, reallyContains, getComponentAt

◆ contains() [2/2]

bool juce::Component::contains ( Point< int localPoint)
inherited

Returns true if a given point lies within this component or one of its children.

Never override this method! Use hitTest to create custom hit regions.

Parameters
localPointthe coordinate to test, relative to this component's top-left.
Returns
true if the point is within the component's hit-test area, but only if that part of the component isn't clipped by its parent component. Note that this won't take into account any overlapping sibling components which might be in the way - for that, see reallyContains()
See also
hitTest, reallyContains, getComponentAt

◆ copy()

void juce::TextEditor::copy ( )

Copies the currently selected region to the clipboard.

See also
cut, paste, SystemClipboard

◆ copyAllExplicitColoursTo()

void juce::Component::copyAllExplicitColoursTo ( Component target) const
inherited

This looks for any colours that have been specified for this component, and copies them to the specified target component.

◆ copyToClipboard()

bool juce::TextEditor::copyToClipboard ( )

◆ createAccessibilityHandler()

std::unique_ptr<AccessibilityHandler> juce::TextEditor::createAccessibilityHandler ( )
overrideprivatevirtual

Override this method to return a custom AccessibilityHandler for this component.

The default implementation creates and returns a AccessibilityHandler object with an unspecified role, meaning that it will be visible to accessibility clients but without a specific role, action callbacks or interfaces. To control how accessibility clients see and interact with your component subclass AccessibilityHandler, implement the desired behaviours, and return an instance of it from this method in your component subclass.

The accessibility handler you return here is guaranteed to be destroyed before its Component, so it's safe to store and use a reference back to the Component inside the AccessibilityHandler if necessary.

See also
getAccessibilityHandler

Reimplemented from juce::Component.

◆ createComponentSnapshot()

Image juce::Component::createComponentSnapshot ( Rectangle< int areaToGrab,
bool  clipImageToComponentBounds = true,
float  scaleFactor = 1.0f 
)
inherited

Generates a snapshot of part of this component.

This will return a new Image, the size of the rectangle specified, containing a snapshot of the specified area of the component and all its children.

The image may or may not have an alpha-channel, depending on whether the image is opaque or not.

If the clipImageToComponentBounds parameter is true and the area is greater than the size of the component, it'll be clipped. If clipImageToComponentBounds is false then parts of the component beyond its bounds can be drawn.

See also
paintEntireComponent

◆ createFocusTraverser()

virtual std::unique_ptr<ComponentTraverser> juce::Component::createFocusTraverser ( )
virtualinherited

Creates a ComponentTraverser object to determine the logic by which focus should be passed from this component.

The default implementation of this method will return an instance of FocusTraverser if this component is a focus container (as determined by the setFocusContainerType() method). If the component isn't a focus container, then it will recursively call createFocusTraverser() on its parents.

If you override this to return a custom traverser object, then this component and all its sub-components will use the new object to make their focusing decisions.

◆ createKeyboardFocusTraverser()

virtual std::unique_ptr<ComponentTraverser> juce::Component::createKeyboardFocusTraverser ( )
virtualinherited

Creates a ComponentTraverser object to use to determine the logic by which keyboard focus should be passed from this component.

The default implementation of this method will return an instance of KeyboardFocusTraverser if this component is a keyboard focus container (as determined by the setFocusContainerType() method). If the component isn't a keyboard focus container, then it will recursively call createKeyboardFocusTraverser() on its parents.

If you override this to return a custom traverser object, then this component and all its sub-components will use the new object to make their keyboard focusing decisions.

Reimplemented in juce::Label, and juce::FilenameComponent.

◆ cut()

void juce::TextEditor::cut ( )

Deletes the currently selected region.

This doesn't copy the deleted section to the clipboard - if you need to do that, call copy() first.

See also
copy, paste, SystemClipboard

◆ cutToClipboard()

bool juce::TextEditor::cutToClipboard ( )

◆ deleteAllChildren()

void juce::Component::deleteAllChildren ( )
inherited

Removes and deletes all of this component's children.

My advice is to avoid this method! It's an old function that is only kept here for backwards-compatibility with legacy code, and should be viewed with extreme suspicion by anyone attempting to write modern C++. In almost all cases, it's much smarter to manage the lifetimes of your child components via modern RAII techniques such as simply making them member variables, or using std::unique_ptr, OwnedArray, etc to manage their lifetimes appropriately.

See also
removeAllChildren

◆ deleteBackwards()

bool juce::TextEditor::deleteBackwards ( bool  moveInWholeWordSteps)

◆ deleteForwards()

bool juce::TextEditor::deleteForwards ( bool  moveInWholeWordSteps)

◆ drawContent()

void juce::TextEditor::drawContent ( Graphics )
private

◆ enablementChanged()

void juce::TextEditor::enablementChanged ( )
overridevirtual

Reimplemented from juce::Component.

◆ enterModalState()

void juce::Component::enterModalState ( bool  takeKeyboardFocus = true,
ModalComponentManager::Callback callback = nullptr,
bool  deleteWhenDismissed = false 
)
inherited

Puts the component into a modal state.

This makes the component modal, so that messages are blocked from reaching any components other than this one and its children, but unlike runModalLoop(), this method returns immediately.

If takeKeyboardFocus is true, the component will use grabKeyboardFocus() to get the focus, which is usually what you'll want it to do. If not, it will leave the focus unchanged.

The callback is an optional object which will receive a callback when the modal component loses its modal status, either by being hidden or when exitModalState() is called. If you pass an object in here, the system will take care of deleting it later, after making the callback

If deleteWhenDismissed is true, then when it is dismissed, the component will be deleted and then the callback will be called. (This will safely handle the situation where the component is deleted before its exitModalState() method is called).

See also
exitModalState, runModalLoop, ModalComponentManager::attachCallback

◆ escapePressed()

virtual void juce::TextEditor::escapePressed ( )
protectedvirtual

Can be overridden to intercept escape key presses directly.

◆ exitModalState()

void juce::Component::exitModalState ( int  returnValue)
inherited

Ends a component's modal state.

If this component is currently modal, this will turn off its modalness, and return a value to the runModalLoop() method that might have be running its modal loop.

See also
runModalLoop, enterModalState, isCurrentlyModal

◆ findChildWithID()

Component* juce::Component::findChildWithID ( StringRef  componentID) const
noexceptinherited

Looks for a child component with the specified ID.

See also
setComponentID, getComponentID

◆ findColour()

Colour juce::Component::findColour ( int  colourID,
bool  inheritFromParent = false 
) const
inherited

Looks for a colour that has been registered with the given colour ID number.

If a colour has been set for this ID number using setColour(), then it is returned. If none has been set, the method will try calling the component's LookAndFeel class's findColour() method. If none has been registered with the look-and-feel either, it will just return black.

The colour IDs for various purposes are stored as enums in the components that they are relevant to - for an example, see Slider::ColourIds, Label::ColourIds, TextEditor::ColourIds, TreeView::ColourIds, etc.

See also
setColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour

Referenced by juce::StandalonePluginHolder::SettingsComponent::paint().

◆ findFocusContainer()

Component* juce::Component::findFocusContainer ( ) const
inherited

Returns the focus container for this component.

See also
isFocusContainer, setFocusContainerType

◆ findKeyboardFocusContainer()

Component* juce::Component::findKeyboardFocusContainer ( ) const
inherited

Returns the keyboard focus container for this component.

See also
isFocusContainer, setFocusContainerType

◆ findParentComponentOfClass()

template<class TargetClass >
TargetClass* juce::Component::findParentComponentOfClass ( ) const
inlineinherited

Searches the parent components for a component of a specified class.

For example findParentComponentOfClass <MyComp>() would return the first parent component that can be dynamically cast to a MyComp, or will return nullptr if none of the parents are suitable.

References juce::gl::p, and juce::gl::target.

◆ findWordBreakAfter()

int juce::TextEditor::findWordBreakAfter ( int  position) const
private

◆ findWordBreakBefore()

int juce::TextEditor::findWordBreakBefore ( int  position) const
private

◆ focusGained()

void juce::TextEditor::focusGained ( FocusChangeType  )
overridevirtual

Reimplemented from juce::Component.

◆ focusLost()

void juce::TextEditor::focusLost ( FocusChangeType  )
overridevirtual

Reimplemented from juce::Component.

◆ focusOfChildComponentChanged()

virtual void juce::Component::focusOfChildComponentChanged ( FocusChangeType  cause)
virtualinherited

Called to indicate a change in whether or not this component is the parent of the currently-focused component.

Essentially this is called when the return value of a call to hasKeyboardFocus (true) has changed. It happens when focus moves from one of this component's children (at any depth) to a component that isn't contained in this one, (or vice-versa). Note that this method does NOT get called to when focus simply moves from one of its child components to another.

See also
focusGained, setWantsKeyboardFocus, getCurrentlyFocusedComponent, hasKeyboardFocus

Reimplemented in juce::Slider, and juce::TopLevelWindow.

◆ getAccessibilityHandler()

AccessibilityHandler* juce::Component::getAccessibilityHandler ( )
inherited

Returns the accessibility handler for this component, or nullptr if this component is not accessible.

See also
setAccessible

◆ getAlpha()

float juce::Component::getAlpha ( ) const
noexceptinherited

Returns the component's current transparency level.

See setAlpha() for more details.

◆ getApproximateScaleFactorForComponent()

static float juce::Component::getApproximateScaleFactorForComponent ( const Component targetComponent)
staticinherited

Returns the approximate scale factor for a given component by traversing its parent hierarchy and applying each transform and finally scaling this by the global scale factor.

◆ getBorder()

BorderSize<int> juce::TextEditor::getBorder ( ) const

Returns the size of border around the edge of the component.

See also
setBorder

◆ getBottom()

int juce::Component::getBottom ( ) const
inlinenoexceptinherited

Returns the y coordinate of the bottom edge of this component.

This is a distance in pixels from the top edge of the component's parent.

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to its bounding box.

◆ getBounds()

Rectangle<int> juce::Component::getBounds ( ) const
inlinenoexceptinherited

Returns this component's bounding box.

The rectangle returned is relative to the top-left of the component's parent.

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to its bounding box.

Referenced by juce::LassoComponent< SelectableItemType >::dragLasso().

◆ getBoundsInParent()

Rectangle<int> juce::Component::getBoundsInParent ( ) const
noexceptinherited

Returns the area of this component's parent which this component covers.

The returned area is relative to the parent's coordinate space. If the component has an affine transform specified, then the resulting area will be the smallest rectangle that fully covers the component's transformed bounding box. If this component has no parent, the return value will simply be the same as getBounds().

◆ getCachedComponentImage()

CachedComponentImage* juce::Component::getCachedComponentImage ( ) const
inlinenoexceptinherited

Returns the object that was set by setCachedComponentImage().

See also
setCachedComponentImage

◆ getCaretPosition()

int juce::TextEditor::getCaretPosition ( ) const

Returns the current index of the caret.

See also
setCaretPosition

◆ getCaretRectangle()

Rectangle<int> juce::TextEditor::getCaretRectangle ( )
overridevirtual

Get the graphical position of the caret.

The rectangle returned is relative to the component's top-left corner.

See also
scrollEditorToPositionCaret

Implements juce::TextInputTarget.

◆ getCaretRectangleFloat()

Rectangle<float> juce::TextEditor::getCaretRectangleFloat ( ) const
private

◆ getCharPosition()

void juce::TextEditor::getCharPosition ( int  index,
Point< float > &  ,
float lineHeight 
) const
private

◆ getChildComponent()

Component* juce::Component::getChildComponent ( int  index) const
noexceptinherited

Returns one of this component's child components, by it index.

The component with index 0 is at the back of the z-order, the one at the front will have index (getNumChildComponents() - 1).

If the index is out-of-range, this will return a null pointer.

See also
getChildren, getNumChildComponents, getIndexOfChildComponent

◆ getChildren()

const Array<Component*>& juce::Component::getChildren ( ) const
inlinenoexceptinherited

Provides access to the underlying array of child components.

The most likely reason you may want to use this is for iteration in a range-based for loop.

◆ getComponentAt() [1/3]

Component* juce::Component::getComponentAt ( int  x,
int  y 
)
inherited

Returns the component at a certain point within this one.

Parameters
xthe x coordinate to test, relative to this component's left edge.
ythe y coordinate to test, relative to this component's top edge.
Returns
the component that is at this position - which may be 0, this component, or one of its children. Note that overlapping siblings that might actually be in the way are not taken into account by this method - to account for these, instead call getComponentAt on the top-level parent of this component.
See also
hitTest, contains, reallyContains

◆ getComponentAt() [2/3]

Component* juce::Component::getComponentAt ( Point< float position)
inherited

Returns the component at a certain point within this one.

Parameters
positionthe coordinate to test, relative to this component's top-left.
Returns
the component that is at this position - which may be 0, this component, or one of its children. Note that overlapping siblings that might actually be in the way are not taken into account by this method - to account for these, instead call getComponentAt on the top-level parent of this component.
See also
hitTest, contains, reallyContains

◆ getComponentAt() [3/3]

Component* juce::Component::getComponentAt ( Point< int position)
inherited

Returns the component at a certain point within this one.

Parameters
positionthe coordinate to test, relative to this component's top-left.
Returns
the component that is at this position - which may be 0, this component, or one of its children. Note that overlapping siblings that might actually be in the way are not taken into account by this method - to account for these, instead call getComponentAt on the top-level parent of this component.
See also
hitTest, contains, reallyContains

◆ getComponentEffect()

ImageEffectFilter* juce::Component::getComponentEffect ( ) const
inlinenoexceptinherited

Returns the current component effect.

See also
setComponentEffect

◆ getComponentID()

String juce::Component::getComponentID ( ) const
inlinenoexceptinherited

Returns the ID string that was set by setComponentID().

See also
setComponentID, findChildWithID

◆ getCurrentlyFocusedComponent()

static Component* juce::Component::getCurrentlyFocusedComponent ( )
staticnoexceptinherited

Returns the component that currently has the keyboard focus.

Returns
the focused component, or nullptr if nothing is focused.

◆ getCurrentlyModalComponent()

static Component* juce::Component::getCurrentlyModalComponent ( int  index = 0)
staticnoexceptinherited

Returns one of the components that are currently modal.

The index specifies which of the possible modal components to return. The order of the components in this list is the reverse of the order in which they became modal - so the component at index 0 is always the active component, and the others are progressively earlier ones that are themselves now blocked by later ones.

Returns
the modal component, or null if no components are modal (or if the index is out of range)
See also
getNumCurrentlyModalComponents, runModalLoop, isCurrentlyModal

◆ getDescription()

String juce::Component::getDescription ( ) const
inlinenoexceptinherited

Returns the description for this component.

See also
setDescription

◆ getDesktopScaleFactor()

virtual float juce::Component::getDesktopScaleFactor ( ) const
virtualinherited

Returns the default scale factor to use for this component when it is placed on the desktop.

The default implementation of this method just returns the value from Desktop::getGlobalScaleFactor(), but it can be overridden if a particular component has different requirements. The method only used if this component is added to the desktop - it has no effect for child components.

Reimplemented in juce::AlertWindow, juce::DialogWindow, and juce::TooltipWindow.

Referenced by juce::OpenGLContext::NativeContext::NativeContext(), and juce::CarbonViewWrapperComponent::setEmbeddedWindowToOurSize().

◆ getExplicitFocusOrder()

int juce::Component::getExplicitFocusOrder ( ) const
inherited

Returns the focus order of this component, if one has been specified.

By default components don't have a focus order - in that case, this will return 0.

See also
setExplicitFocusOrder

◆ getFont()

const Font& juce::TextEditor::getFont ( ) const
inlinenoexcept

Returns the font that's currently being used for new text.

See also
setFont

◆ getHeight()

◆ getHelpText()

String juce::Component::getHelpText ( ) const
inlinenoexceptinherited

Returns the help text for this component.

See also
setHelpText

◆ getHighlightedRegion()

Range<int> juce::TextEditor::getHighlightedRegion ( ) const
inlineoverridevirtual

Returns the range of characters that are selected.

If nothing is selected, this will return an empty range.

See also
setHighlightedRegion

Implements juce::TextInputTarget.

◆ getHighlightedText()

String juce::TextEditor::getHighlightedText ( ) const

Returns the section of text that is currently selected.

◆ getIndexOfChildComponent()

int juce::Component::getIndexOfChildComponent ( const Component child) const
noexceptinherited

Returns the index of this component in the list of child components.

A value of 0 means it is first in the list (i.e. behind all other components). Higher values are further towards the front.

Returns -1 if the component passed-in is not a child of this component.

See also
getChildren, getNumChildComponents, getChildComponent, addChildComponent, toFront, toBack, toBehind

◆ getInputFilter()

InputFilter* juce::TextEditor::getInputFilter ( ) const
inlinenoexcept

Returns the current InputFilter, as set by setInputFilter().

◆ getInterceptsMouseClicks()

void juce::Component::getInterceptsMouseClicks ( bool allowsClicksOnThisComponent,
bool allowsClicksOnChildComponents 
) const
noexceptinherited

Retrieves the current state of the mouse-click interception flags.

On return, the two parameters are set to the state used in the last call to setInterceptsMouseClicks().

See also
setInterceptsMouseClicks

◆ getJustificationType()

Justification juce::TextEditor::getJustificationType ( ) const
inlinenoexcept

Returns the type of justification, as set in setJustification().

◆ getKeyboardType()

VirtualKeyboardType juce::TextEditor::getKeyboardType ( )
inlineoverridevirtual

Reimplemented from juce::TextInputTarget.

◆ getLeftIndent()

int juce::TextEditor::getLeftIndent ( ) const
inlinenoexcept

Returns the gap at the left edge of the editor.

See also
setIndents

◆ getLineSpacing()

float juce::TextEditor::getLineSpacing ( ) const
inlinenoexcept

Returns the current line spacing of the TextEditor.

◆ getLocalArea() [1/2]

Rectangle<float> juce::Component::getLocalArea ( const Component sourceComponent,
Rectangle< float areaRelativeToSourceComponent 
) const
inherited

Converts a rectangle to be relative to this component's coordinate space.

This takes a rectangle that is relative to a different component, and returns its position relative to this component. If the sourceComponent parameter is null, the source rectangle is assumed to be a screen coordinate.

If you've used setTransform() to apply one or more transforms to components, then the source rectangle may not actually be rectangular when converted to the target space, so in that situation this will return the smallest rectangle that fully contains the transformed area.

◆ getLocalArea() [2/2]

Rectangle<int> juce::Component::getLocalArea ( const Component sourceComponent,
Rectangle< int areaRelativeToSourceComponent 
) const
inherited

Converts a rectangle to be relative to this component's coordinate space.

This takes a rectangle that is relative to a different component, and returns its position relative to this component. If the sourceComponent parameter is null, the source rectangle is assumed to be a screen coordinate.

If you've used setTransform() to apply one or more transforms to components, then the source rectangle may not actually be rectangular when converted to the target space, so in that situation this will return the smallest rectangle that fully contains the transformed area.

Referenced by juce::StandaloneFilterWindow::MainContentComponent::getSizeToContainEditor(), and juce::OpenGLContext::NativeContext::NativeContext().

◆ getLocalBounds()

Rectangle<int> juce::Component::getLocalBounds ( ) const
noexceptinherited

Returns the component's bounds, relative to its own origin.

This is like getBounds(), but returns the rectangle in local coordinates, In practice, it'll return a rectangle with position (0, 0), and the same size as this component.

Referenced by juce::OpenGLContext::NativeContext::NativeContext(), juce::StandaloneFilterWindow::MainContentComponent::NotificationArea::paint(), juce::StandalonePluginHolder::SettingsComponent::resized(), juce::StandaloneFilterWindow::MainContentComponent::resized(), and juce::StandaloneFilterWindow::MainContentComponent::NotificationArea::resized().

◆ getLocalPoint() [1/2]

Point<float> juce::Component::getLocalPoint ( const Component sourceComponent,
Point< float pointRelativeToSourceComponent 
) const
inherited

Converts a point to be relative to this component's coordinate space.

This takes a point relative to a different component, and returns its position relative to this component. If the sourceComponent parameter is null, the source point is assumed to be a global screen coordinate.

◆ getLocalPoint() [2/2]

Point<int> juce::Component::getLocalPoint ( const Component sourceComponent,
Point< int pointRelativeToSourceComponent 
) const
inherited

Converts a point to be relative to this component's coordinate space.

This takes a point relative to a different component, and returns its position relative to this component. If the sourceComponent parameter is null, the source point is assumed to be a global screen coordinate.

◆ getLookAndFeel()

LookAndFeel& juce::Component::getLookAndFeel ( ) const
noexceptinherited

Finds the appropriate look-and-feel to use for this component.

If the component hasn't had a look-and-feel explicitly set, this will return the parent's look-and-feel, or just the default one if there's no parent.

See also
setLookAndFeel, lookAndFeelChanged

Referenced by juce::LassoComponent< SelectableItemType >::paint(), and juce::StandalonePluginHolder::SettingsComponent::paint().

◆ getMaximumTextHeight()

int juce::TextEditor::getMaximumTextHeight ( ) const
private

◆ getMaximumTextWidth()

int juce::TextEditor::getMaximumTextWidth ( ) const
private

◆ getMouseClickGrabsKeyboardFocus()

bool juce::Component::getMouseClickGrabsKeyboardFocus ( ) const
noexceptinherited

Returns the last value set with setMouseClickGrabsKeyboardFocus().

See also
setMouseClickGrabsKeyboardFocus

◆ getMouseCursor()

virtual MouseCursor juce::Component::getMouseCursor ( )
virtualinherited

Returns the mouse cursor shape to use when the mouse is over this component.

The default implementation will return the cursor that was set by setCursor() but can be overridden for more specialised purposes, e.g. returning different cursors depending on the mouse position.

See also
MouseCursor

Reimplemented in juce::TableHeaderComponent.

◆ getMouseXYRelative()

Point<int> juce::Component::getMouseXYRelative ( ) const
inherited

Returns the mouse's current position, relative to this component.

The return value is relative to the component's top-left corner.

◆ getName()

String juce::Component::getName ( ) const
inlinenoexceptinherited

Returns the name of this component.

See also
setName

◆ getNumChildComponents()

int juce::Component::getNumChildComponents ( ) const
noexceptinherited

Returns the number of child components that this component contains.

See also
getChildren, getChildComponent, getIndexOfChildComponent

◆ getNumCurrentlyModalComponents()

static int juce::Component::getNumCurrentlyModalComponents ( )
staticnoexceptinherited

Returns the number of components that are currently in a modal state.

See also
getCurrentlyModalComponent

◆ getParentComponent()

Component* juce::Component::getParentComponent ( ) const
inlinenoexceptinherited

Returns the component which this component is inside.

If this is the highest-level component or hasn't yet been added to a parent, this will return null.

Referenced by juce::LassoComponent< SelectableItemType >::beginLasso(), and juce::CarbonViewWrapperComponent::setOurSizeToEmbeddedViewSize().

◆ getParentHeight()

int juce::Component::getParentHeight ( ) const
noexceptinherited

Returns the height of the component's parent.

If the component has no parent (i.e. if it's on the desktop), this will return the height of the screen.

◆ getParentMonitorArea()

Rectangle<int> juce::Component::getParentMonitorArea ( ) const
inherited

Returns the screen coordinates of the monitor that contains this component.

If there's only one monitor, this will return its size - if there are multiple monitors, it will return the area of the monitor that contains the component's centre.

◆ getParentWidth()

int juce::Component::getParentWidth ( ) const
noexceptinherited

Returns the width of the component's parent.

If the component has no parent (i.e. if it's on the desktop), this will return the width of the screen.

◆ getPasswordCharacter()

juce_wchar juce::TextEditor::getPasswordCharacter ( ) const
inlinenoexcept

Returns the current password character.

See also
setPasswordCharacter

◆ getPeer()

ComponentPeer* juce::Component::getPeer ( ) const
inherited

Returns the heavyweight window that contains this component.

If this component is itself on the desktop, this will return the window object that it is using. Otherwise, it will return the window of its top-level parent component.

This may return nullptr if there isn't a desktop component.

See also
addToDesktop, isOnDesktop

Referenced by juce::UIATransformProvider::getPeer(), juce::UIAWindowProvider::getPeer(), juce::OpenGLContext::NativeContext::NativeContext(), and juce::OpenGLContext::NativeContext::~NativeContext().

◆ getPosition()

Point<int> juce::Component::getPosition ( ) const
inlinenoexceptinherited

Returns the component's top-left position as a Point.

◆ getPositioner()

Positioner* juce::Component::getPositioner ( ) const
noexceptinherited

Returns the Positioner object that has been set for this component.

See also
setPositioner()

◆ getProperties() [1/2]

const NamedValueSet& juce::Component::getProperties ( ) const
inlinenoexceptinherited

Returns the set of properties that belong to this component.

Each component has a NamedValueSet object which you can use to attach arbitrary items of data to it.

◆ getProperties() [2/2]

NamedValueSet& juce::Component::getProperties ( )
inlinenoexceptinherited

Returns the set of properties that belong to this component.

Each component has a NamedValueSet object which you can use to attach arbitrary items of data to it.

◆ getReturnKeyStartsNewLine()

bool juce::TextEditor::getReturnKeyStartsNewLine ( ) const
inline

Returns the value set by setReturnKeyStartsNewLine().

See setReturnKeyStartsNewLine() for more info.

◆ getRight()

int juce::Component::getRight ( ) const
inlinenoexceptinherited

Returns the x coordinate of the component's right-hand edge.

This is a distance in pixels from the left edge of the component's parent.

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to its bounding box.

◆ getScreenBounds()

Rectangle<int> juce::Component::getScreenBounds ( ) const
inherited

Returns the bounds of this component, relative to the screen's top-left.

See also
getScreenPosition

Referenced by juce::CarbonViewWrapperComponent::setEmbeddedWindowToOurSize().

◆ getScreenPosition()

Point<int> juce::Component::getScreenPosition ( ) const
inherited

Returns the position of this component's top-left corner relative to the screen's top-left.

See also
getScreenBounds

◆ getScreenX()

int juce::Component::getScreenX ( ) const
inherited

Returns this component's x coordinate relative the screen's top-left origin.

See also
getX, localPointToGlobal

Referenced by juce::CarbonViewWrapperComponent::createWindow().

◆ getScreenY()

int juce::Component::getScreenY ( ) const
inherited

Returns this component's y coordinate relative the screen's top-left origin.

See also
getY, localPointToGlobal

Referenced by juce::CarbonViewWrapperComponent::createWindow().

◆ getText()

String juce::TextEditor::getText ( ) const

Returns the entire contents of the editor.

◆ getTextBounds()

RectangleList<int> juce::TextEditor::getTextBounds ( Range< int textRange)

Returns the bounding box for a range of text in the editor.

As the range may span multiple lines, this method returns a RectangleList.

The bounds are relative to the component's top-left and may extend beyond the bounds of the component if the text is long and word wrapping is disabled.

◆ getTextHeight()

int juce::TextEditor::getTextHeight ( ) const

Returns the maximum height of the text, as it is currently laid-out.

This may be larger than the size of the TextEditor, and can change when the TextEditor is resized or the text changes.

◆ getTextIndexAt()

int juce::TextEditor::getTextIndexAt ( int  x,
int  y 
) const

Finds the index of the character at a given position.

The coordinates are relative to the component's top-left.

◆ getTextInRange()

String juce::TextEditor::getTextInRange ( const Range< int > &  textRange) const
overridevirtual

Returns a section of the contents of the editor.

Implements juce::TextInputTarget.

◆ getTextOffset()

Point<int> juce::TextEditor::getTextOffset ( ) const
privatenoexcept

◆ getTextToShowWhenEmpty()

String juce::TextEditor::getTextToShowWhenEmpty ( ) const
inlinenoexcept

Returns the text that will be shown when the text editor is empty.

See also
setTextToShowWhenEmpty

◆ getTextValue()

Value& juce::TextEditor::getTextValue ( )

Returns a Value object that can be used to get or set the text.

Bear in mind that this operate quite slowly if your text box contains large amounts of text, as it needs to dynamically build the string that's involved. It's best used for small text boxes.

◆ getTextWidth()

int juce::TextEditor::getTextWidth ( ) const

Returns the total width of the text, as it is currently laid-out.

This may be larger than the size of the TextEditor, and can change when the TextEditor is resized or the text changes.

◆ getTitle()

String juce::Component::getTitle ( ) const
inlinenoexceptinherited

Returns the title text for this component.

See also
setTitle

◆ getTooltip()

String juce::SettableTooltipClient::getTooltip ( )
inlineoverridevirtualinherited

Returns the tooltip assigned to this object.

Implements juce::TooltipClient.

Reimplemented in juce::ComboBox.

◆ getTopIndent()

int juce::TextEditor::getTopIndent ( ) const
inlinenoexcept

Returns the gap at the top edge of the editor.

See also
setIndents

◆ getTopLevelComponent()

Component* juce::Component::getTopLevelComponent ( ) const
noexceptinherited

Returns the highest-level component which contains this one or its parents.

This will search upwards in the parent-hierarchy from this component, until it finds the highest one that doesn't have a parent (i.e. is on the desktop or not yet added to a parent), and will return that.

Referenced by juce::CarbonViewWrapperComponent::carbonEventHandler(), juce::CarbonViewWrapperComponent::componentMovedOrResized(), juce::OpenGLContext::NativeContext::createNativeWindow(), juce::OpenGLContext::NativeContext::NativeContext(), and juce::CarbonViewWrapperComponent::setEmbeddedWindowToOurSize().

◆ getTotalNumChars()

int juce::TextEditor::getTotalNumChars ( ) const

Counts the number of characters in the text.

This is quicker than getting the text as a string if you just need to know the length.

◆ getTransform()

AffineTransform juce::Component::getTransform ( ) const
inherited

Returns the transform that is currently being applied to this component.

For more details about transforms, see setTransform().

See also
setTransform

◆ getUndoManager()

UndoManager* juce::TextEditor::getUndoManager ( )
privatenoexcept

◆ getViewportIgnoreDragFlag()

bool juce::Component::getViewportIgnoreDragFlag ( ) const
inlinenoexceptinherited

Retrieves the current state of the Viewport drag-to-scroll functionality flag.

See also
setViewportIgnoreDragFlag

References juce::gl::flags.

◆ getWantsKeyboardFocus()

bool juce::Component::getWantsKeyboardFocus ( ) const
noexceptinherited

Returns true if the component is interested in getting keyboard focus.

This returns the flag set by setWantsKeyboardFocus(). The default setting is false.

See also
setWantsKeyboardFocus

◆ getWidth()

◆ getWindowHandle()

void* juce::Component::getWindowHandle ( ) const
inherited

Returns the underlying native window handle for this component.

This is platform-dependent and strictly for power-users only!

Referenced by juce::OpenGLContext::NativeContext::createNativeWindow(), and juce::CarbonViewWrapperComponent::getOwnerWindow().

◆ getWordWrapWidth()

int juce::TextEditor::getWordWrapWidth ( ) const
private

◆ getX()

int juce::Component::getX ( ) const
inlinenoexceptinherited

Returns the x coordinate of the component's left edge.

This is a distance in pixels from the left edge of the component's parent.

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to its bounding box.

Referenced by juce::StandaloneFilterWindow::~StandaloneFilterWindow().

◆ getY()

int juce::Component::getY ( ) const
inlinenoexceptinherited

Returns the y coordinate of the top of this component.

This is a distance in pixels from the top edge of the component's parent.

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to its bounding box.

Referenced by juce::StandaloneFilterWindow::~StandaloneFilterWindow().

◆ giveAwayKeyboardFocus()

void juce::Component::giveAwayKeyboardFocus ( )
inherited

If this component or any of its children currently have the keyboard focus, this will defocus it, send a focus change notification, and try to pass the focus to the next component.

See also
grabKeyboardFocus, setWantsKeyboardFocus, getCurrentlyFocusedComponent, focusGained, focusLost

◆ grabKeyboardFocus()

void juce::Component::grabKeyboardFocus ( )
inherited

Tries to give keyboard focus to this component.

When the user clicks on a component or its grabKeyboardFocus() method is called, the following procedure is used to work out which component should get it:

  • if the component that was clicked on actually wants focus (as indicated by calling getWantsKeyboardFocus), it gets it.
  • if the component itself doesn't want focus, it will try to pass it on to whichever of its children is the default component, as determined by the getDefaultComponent() implementation of the ComponentTraverser returned by createKeyboardFocusTraverser().
  • if none of its children want focus at all, it will pass it up to its parent instead, unless it's a top-level component without a parent, in which case it just takes the focus itself.

Important note! It's obviously not possible for a component to be focused unless it's actually visible, on-screen, and inside a window that is also visible. So there's no point trying to call this in the component's own constructor or before all of its parent hierarchy has been fully instantiated.

See also
giveAwayKeyboardFocus, setWantsKeyboardFocus, getWantsKeyboardFocus, hasKeyboardFocus, getCurrentlyFocusedComponent, focusGained, focusLost, keyPressed, keyStateChanged

◆ handleCommandMessage()

void juce::TextEditor::handleCommandMessage ( int  commandId)
overrideprivatevirtual

Called to handle a command that was sent by postCommandMessage().

This is called by the message thread when a command message arrives, and the component can override this method to process it in any way it needs to.

See also
postCommandMessage

Reimplemented from juce::Component.

◆ hasFocusOutline()

bool juce::Component::hasFocusOutline ( ) const
inlinenoexceptinherited

Returns true if this component should have a focus outline.

See also
FocusOutline, setHasFocusOutline

References juce::gl::flags.

◆ hasKeyboardFocus()

bool juce::Component::hasKeyboardFocus ( bool  trueIfChildIsFocused) const
inherited

Returns true if this component currently has the keyboard focus.

Parameters
trueIfChildIsFocusedif this is true, then the method returns true if either this component or any of its children (recursively) have the focus. If false, the method only returns true if this component has the focus.
See also
grabKeyboardFocus, giveAwayKeyboardFocus, setWantsKeyboardFocus, getCurrentlyFocusedComponent, focusGained, focusLost

◆ hitTest()

virtual bool juce::Component::hitTest ( int  x,
int  y 
)
virtualinherited

Tests whether a given point is inside the component.

Overriding this method allows you to create components which only intercept mouse-clicks within a user-defined area.

This is called to find out whether a particular x, y coordinate is considered to be inside the component or not, and is used by methods such as contains() and getComponentAt() to work out which component the mouse is clicked on.

Components with custom shapes will probably want to override it to perform some more complex hit-testing.

The default implementation of this method returns either true or false, depending on the value that was set by calling setInterceptsMouseClicks() (true is the default return value).

Note that the hit-test region is not related to the opacity with which areas of a component are painted.

Applications should never call hitTest() directly - instead use the contains() method, because this will also test for occlusion by the component's parent.

Note that for components on the desktop, this method will be ignored, because it's not always possible to implement this behaviour on all platforms.

Parameters
xthe x coordinate to test, relative to the left hand edge of this component. This value is guaranteed to be greater than or equal to zero, and less than the component's width
ythe y coordinate to test, relative to the top edge of this component. This value is guaranteed to be greater than or equal to zero, and less than the component's height
Returns
true if the click is considered to be inside the component
See also
setInterceptsMouseClicks, contains

Reimplemented in juce::LassoComponent< SelectableItemType >, juce::JUCESplashScreen, juce::ResizableBorderComponent, juce::CallOutBox, juce::ImageButton, juce::TabBarButton, juce::DrawableShape, juce::DrawableImage, and juce::ResizableCornerComponent.

◆ indexAtPosition()

int juce::TextEditor::indexAtPosition ( float  x,
float  y 
) const
private

◆ inputAttemptWhenModal()

virtual void juce::Component::inputAttemptWhenModal ( )
virtualinherited

Called when the user tries to click on a component that is blocked by another modal component.

When a component is modal and the user clicks on one of the other components, the modal component will receive this callback.

The default implementation of this method will play a beep, and bring the currently modal component to the front, but it can be overridden to do other tasks.

See also
isCurrentlyBlockedByAnotherModalComponent, canModalEventBeSentToComponent

Reimplemented in juce::Label, and juce::CallOutBox.

◆ insert()

void juce::TextEditor::insert ( const String ,
int  insertIndex,
const Font ,
Colour  ,
UndoManager ,
int  newCaretPos 
)
private

◆ insertTextAtCaret()

void juce::TextEditor::insertTextAtCaret ( const String textToInsert)
overridevirtual

Inserts some text at the current caret position.

If a section of the text is highlighted, it will be replaced by this string, otherwise it will be inserted.

To delete a section of text, you can use setHighlightedRegion() to highlight it, and call insertTextAtCaret (String()).

See also
setCaretPosition, getCaretPosition, setHighlightedRegion

Implements juce::TextInputTarget.

◆ invalidateAccessibilityHandler()

void juce::Component::invalidateAccessibilityHandler ( )
inherited

Invalidates the AccessibilityHandler that is currently being used for this component.

Use this to indicate that something in the accessible component has changed and its handler needs to be updated. This will trigger a call to createAccessibilityHandler().

◆ isAccessible()

bool juce::Component::isAccessible ( ) const
noexceptinherited

Returns true if this component and its children are visible to accessibility clients.

See also
setAccessible

◆ isAlwaysOnTop()

bool juce::Component::isAlwaysOnTop ( ) const
noexceptinherited

Returns true if this component is set to always stay in front of its siblings.

See also
setAlwaysOnTop

◆ isBroughtToFrontOnMouseClick()

bool juce::Component::isBroughtToFrontOnMouseClick ( ) const
noexceptinherited

Indicates whether the component should be brought to the front when clicked-on.

See also
setBroughtToFrontOnMouseClick

◆ isCaretVisible()

bool juce::TextEditor::isCaretVisible ( ) const
inlinenoexcept

Returns true if the caret is enabled.

See also
setCaretVisible

◆ isColourSpecified()

bool juce::Component::isColourSpecified ( int  colourID) const
inherited

Returns true if the specified colour ID has been explicitly set for this component using the setColour() method.

◆ isCurrentlyBlockedByAnotherModalComponent()

bool juce::Component::isCurrentlyBlockedByAnotherModalComponent ( ) const
inherited

Checks whether there's a modal component somewhere that's stopping this one from receiving messages.

If there is a modal component, its canModalEventBeSentToComponent() method will be called to see if it will still allow this component to receive events.

See also
runModalLoop, getCurrentlyModalComponent

◆ isCurrentlyModal()

bool juce::Component::isCurrentlyModal ( bool  onlyConsiderForemostModalComponent = true) const
noexceptinherited

Returns true if this component is the modal one.

It's possible to have nested modal components, e.g. a pop-up dialog box that launches another pop-up. If onlyConsiderForemostModalComponent is true then isCurrentlyModal will only return true for the one at the top of the stack. If onlyConsiderForemostModalComponent is false then isCurrentlyModal will return true for any modal component in the stack.

See also
getCurrentlyModalComponent

◆ isEmpty()

bool juce::TextEditor::isEmpty ( ) const

Returns true if there are no characters in the editor.

This is far more efficient than calling getText().isEmpty().

◆ isEnabled()

bool juce::Component::isEnabled ( ) const
noexceptinherited

Returns true if the component (and all its parents) are enabled.

Components are enabled by default, and can be disabled with setEnabled(). Exactly what difference this makes to the component depends on the type. E.g. buttons and sliders will choose to draw themselves differently, etc.

Note that if one of this component's parents is disabled, this will always return false, even if this component itself is enabled.

See also
setEnabled, enablementChanged

◆ isFocusContainer()

bool juce::Component::isFocusContainer ( ) const
noexceptinherited

Returns true if this component has been marked as a focus container.

See also
setFocusContainerType

◆ isKeyboardFocusContainer()

bool juce::Component::isKeyboardFocusContainer ( ) const
noexceptinherited

Returns true if this component has been marked as a keyboard focus container.

See also
setFocusContainerType

◆ isMouseButtonDown()

bool juce::Component::isMouseButtonDown ( bool  includeChildren = false) const
inherited

Returns true if the mouse button is currently held down in this component.

Note that this is a test to see whether the mouse is being pressed in this component, so it'll return false if called on component A when the mouse is actually being dragged in component B.

See also
isMouseButtonDownAnywhere, isMouseOver, isMouseOverOrDragging

◆ isMouseButtonDownAnywhere()

static bool juce::Component::isMouseButtonDownAnywhere ( )
staticnoexceptinherited

Returns true if a mouse button is currently down.

Unlike isMouseButtonDown, this will test the current state of the buttons without regard to which component (if any) it has been pressed in.

See also
isMouseButtonDown, ModifierKeys

Referenced by juce::LassoComponent< SelectableItemType >::paint().

◆ isMouseOver()

bool juce::Component::isMouseOver ( bool  includeChildren = false) const
inherited

Returns true if the mouse is currently over this component.

If the mouse isn't over the component, this will return false, even if the mouse is currently being dragged - so you can use this in your mouseDrag method to find out whether it's really over the component or not.

Note that when the mouse button is being held down, then the only component for which this method will return true is the one that was originally clicked on.

Also note that on a touch-screen device, this will only return true when a finger is actually down - as soon as all touch is released, isMouseOver will always return false.

If includeChildren is true, then this will also return true if the mouse is over any of the component's children (recursively) as well as the component itself.

See also
isMouseButtonDown. isMouseOverOrDragging, mouseDrag

◆ isMouseOverOrDragging()

bool juce::Component::isMouseOverOrDragging ( bool  includeChildren = false) const
inherited

True if the mouse is over this component, or if it's being dragged in this component.

This is a handy equivalent to (isMouseOver() || isMouseButtonDown()).

See also
isMouseOver, isMouseButtonDown, isMouseButtonDownAnywhere

◆ isMultiLine()

bool juce::TextEditor::isMultiLine ( ) const

Returns true if the editor is in multi-line mode.

◆ isOnDesktop()

bool juce::Component::isOnDesktop ( ) const
noexceptinherited

Returns true if this component is currently showing on the desktop.

See also
addToDesktop, removeFromDesktop

Referenced by juce::AccessibilityNativeHandle::isFragmentRoot().

◆ isOpaque()

bool juce::Component::isOpaque ( ) const
noexceptinherited

Returns true if no parts of this component are transparent.

Returns
the value that was set by setOpaque, (the default being false)
See also
setOpaque

◆ isPaintingUnclipped()

bool juce::Component::isPaintingUnclipped ( ) const
noexceptinherited

Returns true if this component doesn't require its graphics context to be clipped when it is being painted.

◆ isParentOf()

bool juce::Component::isParentOf ( const Component possibleChild) const
noexceptinherited

Checks whether a component is anywhere inside this component or its children.

This will recursively check through this component's children to see if the given component is anywhere inside.

◆ isPopupMenuCurrentlyActive()

bool juce::TextEditor::isPopupMenuCurrentlyActive ( ) const
inlinenoexcept

Returns true if a popup-menu is currently being displayed.

◆ isPopupMenuEnabled()

bool juce::TextEditor::isPopupMenuEnabled ( ) const
inlinenoexcept

Returns true if the right-click menu is enabled.

See also
setPopupMenuEnabled

◆ isReadOnly()

bool juce::TextEditor::isReadOnly ( ) const
noexcept

Returns true if the editor is in read-only mode.

◆ isShowing()

bool juce::Component::isShowing ( ) const
inherited

Tests whether this component and all its parents are visible.

Returns
true only if this component and all its parents are visible.
See also
isVisible

Referenced by juce::CarbonViewWrapperComponent::componentVisibilityChanged(), and juce::CarbonViewWrapperComponent::timerCallback().

◆ isTabKeyUsedAsCharacter()

bool juce::TextEditor::isTabKeyUsedAsCharacter ( ) const
inline

Returns true if the tab key is being used for input.

See also
setTabKeyUsedAsCharacter

◆ isTextInputActive()

bool juce::TextEditor::isTextInputActive ( ) const
overridevirtual

Implements juce::TextInputTarget.

◆ isTransformed()

bool juce::Component::isTransformed ( ) const
noexceptinherited

Returns true if a non-identity transform is being applied to this component.

For more details about transforms, see setTransform().

See also
setTransform

◆ isVisible()

bool juce::Component::isVisible ( ) const
inlinenoexceptinherited

Tests whether the component is visible or not.

this doesn't necessarily tell you whether this comp is actually on the screen because this depends on whether all the parent components are also visible - use isShowing() to find this out.

See also
isShowing, setVisible

References juce::gl::flags.

◆ isWhitespaceUnderlined()

bool juce::TextEditor::isWhitespaceUnderlined ( ) const
inlinenoexcept

Returns true if whitespace is underlined for underlined fonts.

See also
setWhitespaceIsUnderlined

◆ keyPressed()

bool juce::TextEditor::keyPressed ( const KeyPress )
overridevirtual

Reimplemented from juce::Component.

◆ keyStateChanged()

bool juce::TextEditor::keyStateChanged ( bool  )
overridevirtual

Reimplemented from juce::Component.

◆ localAreaToGlobal() [1/2]

Rectangle<float> juce::Component::localAreaToGlobal ( Rectangle< float localArea) const
inherited

Converts a rectangle from this component's coordinate space to a screen coordinate.

If you've used setTransform() to apply one or more transforms to components, then the source rectangle may not actually be rectangular when converted to the target space, so in that situation this will return the smallest rectangle that fully contains the transformed area.

See also
getLocalPoint, localPointToGlobal

◆ localAreaToGlobal() [2/2]

Rectangle<int> juce::Component::localAreaToGlobal ( Rectangle< int localArea) const
inherited

Converts a rectangle from this component's coordinate space to a screen coordinate.

If you've used setTransform() to apply one or more transforms to components, then the source rectangle may not actually be rectangular when converted to the target space, so in that situation this will return the smallest rectangle that fully contains the transformed area.

See also
getLocalPoint, localPointToGlobal

◆ localPointToGlobal() [1/2]

Point<float> juce::Component::localPointToGlobal ( Point< float localPoint) const
inherited

Converts a point relative to this component's top-left into a screen coordinate.

See also
getLocalPoint, localAreaToGlobal

◆ localPointToGlobal() [2/2]

Point<int> juce::Component::localPointToGlobal ( Point< int localPoint) const
inherited

Converts a point relative to this component's top-left into a screen coordinate.

See also
getLocalPoint, localAreaToGlobal

◆ lookAndFeelChanged()

void juce::TextEditor::lookAndFeelChanged ( )
overridevirtual

Reimplemented from juce::Component.

◆ minimisationStateChanged()

virtual void juce::Component::minimisationStateChanged ( bool  isNowMinimised)
virtualinherited

Called for a desktop component which has just been minimised or un-minimised.

This will only be called for components on the desktop.

See also
getPeer, ComponentPeer::setMinimised, ComponentPeer::isMinimised

◆ modifierKeysChanged()

virtual void juce::Component::modifierKeysChanged ( const ModifierKeys modifiers)
virtualinherited

Called when a modifier key is pressed or released.

Whenever the shift, control, alt or command keys are pressed or released, this method will be called.

The component that is currently under the main mouse pointer will be tried first and, if there is no component currently under the pointer, the component that currently has the keyboard focus will have this method called. Remember that a component will only be given the focus if its setWantsKeyboardFocus() method has been used to enable this.

The default implementation of this method actually calls its parent's modifierKeysChanged method, so that focused components which aren't interested in this will give their parents a chance to act on the event instead.

See also
keyStateChanged, ModifierKeys

Reimplemented in juce::Slider.

◆ mouseDoubleClick()

void juce::TextEditor::mouseDoubleClick ( const MouseEvent )
overridevirtual

Reimplemented from juce::Component.

◆ mouseDown()

void juce::TextEditor::mouseDown ( const MouseEvent )
overridevirtual

Reimplemented from juce::Component.

◆ mouseDrag()

void juce::TextEditor::mouseDrag ( const MouseEvent )
overridevirtual

Reimplemented from juce::Component.

◆ mouseEnter()

void juce::Component::mouseEnter ( const MouseEvent event)
overridevirtualinherited

Called when the mouse first enters a component.

If the mouse button isn't pressed and the mouse moves into a component, this will be called to let the component react to this.

When the mouse button is pressed and held down while being moved in or out of a component, no mouseEnter or mouseExit callbacks are made - only mouseDrag messages are sent to the component that the mouse was originally clicked on, until the button is released.

Parameters
eventdetails about the position and status of the mouse event, including the source component in which it occurred
See also
mouseExit, mouseDrag, mouseMove, contains

Reimplemented from juce::MouseListener.

Reimplemented in juce::Slider, juce::TableHeaderComponent, juce::ResizableBorderComponent, juce::TooltipWindow, and juce::MenuBarComponent.

◆ mouseExit()

void juce::Component::mouseExit ( const MouseEvent event)
overridevirtualinherited

Called when the mouse moves out of a component.

This will be called when the mouse moves off the edge of this component.

If the mouse button was pressed, and it was then dragged off the edge of the component and released, then this callback will happen when the button is released, after the mouseUp callback.

Parameters
eventdetails about the position and status of the mouse event, including the source component in which it occurred
See also
mouseEnter, mouseDrag, mouseMove, contains

Reimplemented from juce::MouseListener.

Reimplemented in juce::Slider, juce::TableHeaderComponent, and juce::MenuBarComponent.

◆ mouseMagnify()

void juce::Component::mouseMagnify ( const MouseEvent event,
float  scaleFactor 
)
overridevirtualinherited

Called when a pinch-to-zoom mouse-gesture is used.

If not overridden, a component will forward this message to its parent, so that parent components can collect gesture messages that are unused by child components.

Parameters
eventdetails about the mouse event
scaleFactora multiplier to indicate by how much the size of the target should be changed. A value of 1.0 would indicate no change, values greater than 1.0 mean it should be enlarged.

Reimplemented from juce::MouseListener.

◆ mouseMove()

void juce::Component::mouseMove ( const MouseEvent event)
overridevirtualinherited

Called when the mouse moves inside a component.

If the mouse button isn't pressed and the mouse moves over a component, this will be called to let the component react to this.

A component will always get a mouseEnter callback before a mouseMove.

Parameters
eventdetails about the position and status of the mouse event, including the source component in which it occurred
See also
mouseEnter, mouseExit, mouseDrag, contains

Reimplemented from juce::MouseListener.

Reimplemented in juce::Slider, juce::TableHeaderComponent, juce::ResizableBorderComponent, and juce::MenuBarComponent.

◆ mouseUp()

void juce::TextEditor::mouseUp ( const MouseEvent )
overridevirtual

Reimplemented from juce::Component.

◆ mouseWheelMove()

void juce::TextEditor::mouseWheelMove ( const MouseEvent ,
const MouseWheelDetails  
)
overridevirtual

Reimplemented from juce::Component.

◆ moveCaret()

void juce::TextEditor::moveCaret ( int  newCaretPos)
private

◆ moveCaretDown()

bool juce::TextEditor::moveCaretDown ( bool  selecting)

◆ moveCaretLeft()

bool juce::TextEditor::moveCaretLeft ( bool  moveInWholeWordSteps,
bool  selecting 
)

◆ moveCaretRight()

bool juce::TextEditor::moveCaretRight ( bool  moveInWholeWordSteps,
bool  selecting 
)

◆ moveCaretTo()

void juce::TextEditor::moveCaretTo ( int  newPosition,
bool  isSelecting 
)
private

◆ moveCaretToEnd() [1/2]

void juce::TextEditor::moveCaretToEnd ( )

◆ moveCaretToEnd() [2/2]

bool juce::TextEditor::moveCaretToEnd ( bool  selecting)

◆ moveCaretToEndOfLine()

bool juce::TextEditor::moveCaretToEndOfLine ( bool  selecting)

◆ moveCaretToStartOfLine()

bool juce::TextEditor::moveCaretToStartOfLine ( bool  selecting)

◆ moveCaretToTop()

bool juce::TextEditor::moveCaretToTop ( bool  selecting)

◆ moveCaretUp()

bool juce::TextEditor::moveCaretUp ( bool  selecting)

◆ moveCaretWithTransaction()

bool juce::TextEditor::moveCaretWithTransaction ( int  newPos,
bool  selecting 
)
private

◆ moved()

virtual void juce::Component::moved ( )
virtualinherited

Called when this component's position has been changed.

This is called when the position relative to its parent changes, not when its absolute position on the screen changes (so it won't be called for all child components when a parent component is moved).

The method is called synchronously as a result of the setBounds, setTopLeftPosition or any of the other repositioning methods, and like resized(), it will be called each time those methods are called.

If the component is a top-level window on the desktop, its position could also be changed by operating-system factors beyond the application's control.

See also
resized, setBounds

Reimplemented in juce::ResizableWindow, juce::SidePanel, and juce::CallOutBox.

◆ moveKeyboardFocusToSibling()

void juce::Component::moveKeyboardFocusToSibling ( bool  moveToNext)
inherited

Tries to move the keyboard focus to one of this component's siblings.

This will try to move focus to either the next or previous component, as determined by the getNextComponent() and getPreviousComponent() implementations of the ComponentTraverser returned by createKeyboardFocusTraverser().

This is the method that is used when shifting focus by pressing the tab key.

Parameters
moveToNextif true, the focus will move forwards; if false, it will move backwards
See also
grabKeyboardFocus, giveAwayKeyboardFocus, setFocusContainerType, setWantsKeyboardFocus

◆ newTransaction()

void juce::TextEditor::newTransaction ( )
protected

Begins a new transaction in the UndoManager.

◆ pageDown()

bool juce::TextEditor::pageDown ( bool  selecting)

◆ pageUp()

bool juce::TextEditor::pageUp ( bool  selecting)

◆ paint()

void juce::TextEditor::paint ( Graphics )
overridevirtual

Reimplemented from juce::Component.

◆ paintEntireComponent()

void juce::Component::paintEntireComponent ( Graphics context,
bool  ignoreAlphaLevel 
)
inherited

Draws this component and all its subcomponents onto the specified graphics context.

You should very rarely have to use this method, it's simply there in case you need to draw a component with a custom graphics context for some reason, e.g. for creating a snapshot of the component.

It calls paint(), paintOverChildren() and recursively calls paintEntireComponent() on its children in order to render the entire tree.

The graphics context may be left in an undefined state after this method returns, so you may need to reset it if you're going to use it again.

If ignoreAlphaLevel is false, then the component will be drawn with the opacity level specified by getAlpha(); if ignoreAlphaLevel is true, then this will be ignored and an alpha of 1.0 will be used.

◆ paintOverChildren()

void juce::TextEditor::paintOverChildren ( Graphics )
overridevirtual

Reimplemented from juce::Component.

◆ parentHierarchyChanged()

void juce::TextEditor::parentHierarchyChanged ( )
overridevirtual

Reimplemented from juce::Component.

◆ parentSizeChanged()

virtual void juce::Component::parentSizeChanged ( )
virtualinherited

Called when this component's immediate parent has been resized.

If the component is a top-level window, this indicates that the screen size has changed.

See also
childBoundsChanged, moved, resized

Reimplemented in juce::ResizableWindow, and juce::JUCESplashScreen.

◆ paste()

void juce::TextEditor::paste ( )

Pastes the contents of the clipboard into the editor at the caret position.

See also
cut, copy, SystemClipboard

◆ pasteFromClipboard()

bool juce::TextEditor::pasteFromClipboard ( )

◆ performPopupMenuAction()

virtual void juce::TextEditor::performPopupMenuAction ( int  menuItemID)
virtual

This is called to perform one of the items that was shown on the popup menu.

If you've overridden addPopupMenuItems(), you should also override this to perform the actions that you've added.

If you've overridden addPopupMenuItems() but have still left the default items on the menu, remember to call the superclass's performPopupMenuAction() so that it can perform the default actions if that's what the user clicked on.

See also
addPopupMenuItems, setPopupMenuEnabled, isPopupMenuEnabled

◆ postCommandMessage()

void juce::Component::postCommandMessage ( int  commandId)
inherited

Dispatches a numbered message to this component.

This is a quick and cheap way of allowing simple asynchronous messages to be sent to components. It's also safe, because if the component that you send the message to is a null or dangling pointer, this won't cause an error.

The command ID is later delivered to the component's handleCommandMessage() method by the application's message queue.

See also
handleCommandMessage

◆ proportionOfHeight()

int juce::Component::proportionOfHeight ( float  proportion) const
noexceptinherited

Returns a proportion of the component's height.

This is a handy equivalent of (getHeight() * proportion).

◆ proportionOfWidth()

int juce::Component::proportionOfWidth ( float  proportion) const
noexceptinherited

Returns a proportion of the component's width.

This is a handy equivalent of (getWidth() * proportion).

◆ reallyContains() [1/2]

bool juce::Component::reallyContains ( Point< float localPoint,
bool  returnTrueIfWithinAChild 
)
inherited

Returns true if a given point lies in this component, taking any overlapping siblings into account.

Parameters
localPointthe coordinate to test, relative to this component's top-left.
returnTrueIfWithinAChildif the point actually lies within a child of this component, this determines whether that is counted as a hit.
See also
contains, getComponentAt

◆ reallyContains() [2/2]

bool juce::Component::reallyContains ( Point< int localPoint,
bool  returnTrueIfWithinAChild 
)
inherited

Returns true if a given point lies in this component, taking any overlapping siblings into account.

Parameters
localPointthe coordinate to test, relative to this component's top-left.
returnTrueIfWithinAChildif the point actually lies within a child of this component, this determines whether that is counted as a hit.
See also
contains, getComponentAt

◆ recreateCaret()

void juce::TextEditor::recreateCaret ( )
private

◆ redo()

bool juce::TextEditor::redo ( )

◆ reinsert()

void juce::TextEditor::reinsert ( int  insertIndex,
const OwnedArray< UniformTextSection > &   
)
private

◆ remove()

void juce::TextEditor::remove ( Range< int ,
UndoManager ,
int  caretPositionToMoveTo 
)
private

◆ removeAllChildren()

void juce::Component::removeAllChildren ( )
inherited

Removes all this component's children.

Note that this won't delete them! To do that, use deleteAllChildren() instead.

◆ removeChildComponent() [1/2]

void juce::Component::removeChildComponent ( Component childToRemove)
inherited

Removes one of this component's child-components.

If the child passed-in isn't actually a child of this component (either because it's invalid or is the child of a different parent), then no action is taken.

Note that removing a child will not delete it! But it's ok to delete a component without first removing it - doing so will automatically remove it and send out the appropriate notifications before the deletion completes.

See also
addChildComponent, ComponentListener::componentChildrenChanged

◆ removeChildComponent() [2/2]

Component* juce::Component::removeChildComponent ( int  childIndexToRemove)
inherited

Removes one of this component's child-components by index.

This will return a pointer to the component that was removed, or null if the index was out-of-range.

Note that removing a child will not delete it! But it's ok to delete a component without first removing it - doing so will automatically remove it and send out the appropriate notifications before the deletion completes.

See also
addChildComponent, ComponentListener::componentChildrenChanged

◆ removeColour()

void juce::Component::removeColour ( int  colourID)
inherited

If a colour has been set with setColour(), this will remove it.

This allows you to make a colour revert to its default state.

◆ removeComponentListener()

void juce::Component::removeComponentListener ( ComponentListener listenerToRemove)
inherited

Removes a component listener.

See also
addComponentListener

◆ removeFromDesktop()

void juce::Component::removeFromDesktop ( )
inherited

If the component is currently showing on the desktop, this will hide it.

You can also use setVisible() to hide a desktop window temporarily, but removeFromDesktop() will free any system resources that are being used up.

See also
addToDesktop, isOnDesktop

◆ removeKeyListener()

void juce::Component::removeKeyListener ( KeyListener listenerToRemove)
inherited

Removes a previously-registered key listener.

See also
addKeyListener

◆ removeListener()

void juce::TextEditor::removeListener ( Listener listenerToRemove)

Deregisters a listener.

See also
addListener

◆ removeMouseListener()

void juce::Component::removeMouseListener ( MouseListener listenerToRemove)
inherited

Deregisters a mouse listener.

See also
addMouseListener, MouseListener

◆ repaint() [1/3]

void juce::Component::repaint ( )
inherited

Marks the whole component as needing to be redrawn.

Calling this will not do any repainting immediately, but will mark the component as 'dirty'. At some point in the near future the operating system will send a paint message, which will redraw all the dirty regions of all components. There's no guarantee about how soon after calling repaint() the redraw will actually happen, and other queued events may be delivered before a redraw is done.

If the setBufferedToImage() method has been used to cause this component to use a buffer, the repaint() call will invalidate the cached buffer. If setCachedComponentImage() has been used to provide a custom image cache, that cache will be invalidated appropriately.

To redraw just a subsection of the component rather than the whole thing, use the repaint (int, int, int, int) method.

See also
paint

Referenced by juce::OpenGLContext::NativeContext::NativeContext().

◆ repaint() [2/3]

void juce::Component::repaint ( int  x,
int  y,
int  width,
int  height 
)
inherited

Marks a subsection of this component as needing to be redrawn.

Calling this will not do any repainting immediately, but will mark the given region of the component as 'dirty'. At some point in the near future the operating system will send a paint message, which will redraw all the dirty regions of all components. There's no guarantee about how soon after calling repaint() the redraw will actually happen, and other queued events may be delivered before a redraw is done.

The region that is passed in will be clipped to keep it within the bounds of this component.

See also
repaint()

◆ repaint() [3/3]

void juce::Component::repaint ( Rectangle< int area)
inherited

Marks a subsection of this component as needing to be redrawn.

Calling this will not do any repainting immediately, but will mark the given region of the component as 'dirty'. At some point in the near future the operating system will send a paint message, which will redraw all the dirty regions of all components. There's no guarantee about how soon after calling repaint() the redraw will actually happen, and other queued events may be delivered before a redraw is done.

The region that is passed in will be clipped to keep it within the bounds of this component.

See also
repaint()

◆ repaintText()

void juce::TextEditor::repaintText ( Range< int )
private

◆ resized()

void juce::TextEditor::resized ( )
overridevirtual

Reimplemented from juce::Component.

◆ returnPressed()

virtual void juce::TextEditor::returnPressed ( )
protectedvirtual

Can be overridden to intercept return key presses directly.

◆ runModalLoop()

int juce::Component::runModalLoop ( )
inherited

Runs a component modally, waiting until the loop terminates.

This method first makes the component visible, brings it to the front and gives it the keyboard focus.

It then runs a loop, dispatching messages from the system message queue, but blocking all mouse or keyboard messages from reaching any components other than this one and its children.

This loop continues until the component's exitModalState() method is called (or the component is deleted), and then this method returns, returning the value passed into exitModalState().

Note that you SHOULD NEVER USE THIS METHOD! Modal loops are a dangerous construct because things that happen during the events that they dispatch could affect the state of objects which are currently in use somewhere on the stack, so when the loop finishes and the stack unwinds, horrible problems can occur. This is especially bad in plugins, where the host may choose to delete the plugin during runModalLoop(), so that when it returns, the entire DLL could have been unloaded from memory! Also, some OSes deliberately make it impossible to run modal loops (e.g. Android), so this method won't even exist on some platforms.

See also
enterModalState, exitModalState, isCurrentlyModal, getCurrentlyModalComponent, isCurrentlyBlockedByAnotherModalComponent, ModalComponentManager

◆ scrollByLines()

void juce::TextEditor::scrollByLines ( int  deltaLines)
private

◆ scrollDown()

bool juce::TextEditor::scrollDown ( )

◆ scrollEditorToPositionCaret()

void juce::TextEditor::scrollEditorToPositionCaret ( int  desiredCaretX,
int  desiredCaretY 
)

Attempts to scroll the text editor so that the caret ends up at a specified position.

This won't affect the caret's position within the text, it tries to scroll the entire editor vertically and horizontally so that the caret is sitting at the given position (relative to the top-left of this component).

Depending on the amount of text available, it might not be possible to scroll far enough for the caret to reach this exact position, but it will go as far as it can in that direction.

◆ scrollToMakeSureCursorIsVisible()

void juce::TextEditor::scrollToMakeSureCursorIsVisible ( )
protected

Scrolls the minimum distance needed to get the caret into view.

◆ scrollUp()

bool juce::TextEditor::scrollUp ( )

◆ selectAll()

bool juce::TextEditor::selectAll ( )

◆ sendLookAndFeelChange()

void juce::Component::sendLookAndFeelChange ( )
inherited

Calls the lookAndFeelChanged() method in this component and all its children.

This will recurse through the children and their children, calling lookAndFeelChanged() on them all.

See also
lookAndFeelChanged

◆ setAccessible()

void juce::Component::setAccessible ( bool  shouldBeAccessible)
inherited

Sets whether this component and its children are visible to accessibility clients.

If this flag is set to false then the getAccessibilityHandler() method will return nullptr and this component and its children will not be visible to any accessibility clients.

By default this is set to true.

See also
isAccessible, getAccessibilityHandler

◆ setAlpha()

void juce::Component::setAlpha ( float  newAlpha)
inherited

Changes the transparency of this component.

When painted, the entire component and all its children will be rendered with this as the overall opacity level, where 0 is completely invisible, and 1.0 is fully opaque (i.e. normal).

See also
getAlpha, alphaChanged

◆ setAlwaysOnTop()

void juce::Component::setAlwaysOnTop ( bool  shouldStayOnTop)
inherited

Sets whether the component should always be kept at the front of its siblings.

See also
isAlwaysOnTop

◆ setBorder()

void juce::TextEditor::setBorder ( BorderSize< int border)

Changes the size of border left around the edge of the component.

See also
getBorder

◆ setBounds() [1/2]

void juce::Component::setBounds ( int  x,
int  y,
int  width,
int  height 
)
inherited

Changes the component's position and size.

The coordinates are relative to the top-left of the component's parent, or relative to the origin of the screen if the component is on the desktop.

If this method changes the component's top-left position, it will make a synchronous call to moved(). If it changes the size, it will also make a call to resized().

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to whatever bounds you set for it.

See also
setTopLeftPosition, setSize, ComponentListener::componentMovedOrResized

Referenced by juce::LassoComponent< SelectableItemType >::dragLasso(), juce::StandalonePluginHolder::SettingsComponent::resized(), juce::StandaloneFilterWindow::resized(), juce::StandaloneFilterWindow::MainContentComponent::resized(), and juce::StandaloneFilterWindow::MainContentComponent::NotificationArea::resized().

◆ setBounds() [2/2]

void juce::Component::setBounds ( Rectangle< int newBounds)
inherited

Changes the component's position and size.

The coordinates are relative to the top-left of the component's parent, or relative to the origin of the screen if the component is on the desktop.

If this method changes the component's top-left position, it will make a synchronous call to moved(). If it changes the size, it will also make a call to resized().

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to whatever bounds you set for it.

See also
setBounds

◆ setBoundsInset()

void juce::Component::setBoundsInset ( BorderSize< int borders)
inherited

Changes the component's position and size based on the amount of space to leave around it.

This will position the component within its parent, leaving the specified number of pixels around each edge.

See also
setBounds

◆ setBoundsRelative() [1/2]

void juce::Component::setBoundsRelative ( float  proportionalX,
float  proportionalY,
float  proportionalWidth,
float  proportionalHeight 
)
inherited

Changes the component's position and size in terms of fractions of its parent's size.

The values are factors of the parent's size, so for example setBoundsRelative (0.2f, 0.2f, 0.5f, 0.5f) would give it half the width and height of the parent, with its top-left position 20% of the way across and down the parent.

See also
setBounds

◆ setBoundsRelative() [2/2]

void juce::Component::setBoundsRelative ( Rectangle< float proportionalArea)
inherited

Changes the component's position and size in terms of fractions of its parent's size.

The values are factors of the parent's size, so for example setBoundsRelative ({ 0.2f, 0.2f, 0.5f, 0.5f }) would give it half the width and height of the parent, with its top-left position 20% of the way across and down the parent.

See also
setBounds

◆ setBoundsToFit()

void juce::Component::setBoundsToFit ( Rectangle< int targetArea,
Justification  justification,
bool  onlyReduceInSize 
)
inherited

Positions the component within a given rectangle, keeping its proportions unchanged.

If onlyReduceInSize is false, the component will be resized to fill as much of the rectangle as possible without changing its aspect ratio (the component's current size is used to determine its aspect ratio, so a zero-size component won't work here). If onlyReduceInSize is true, it will only be resized if it's too big to fit inside the rectangle.

It will then be positioned within the rectangle according to the justification flags specified.

See also
setBounds

◆ setBroughtToFrontOnMouseClick()

void juce::Component::setBroughtToFrontOnMouseClick ( bool  shouldBeBroughtToFront)
noexceptinherited

Indicates whether the component should be brought to the front when clicked.

Setting this flag to true will cause the component to be brought to the front when the mouse is clicked somewhere inside it or its child components.

Note that a top-level desktop window might still be brought to the front by the operating system when it's clicked, depending on how the OS works.

By default this is set to false.

See also
setMouseClickGrabsKeyboardFocus

◆ setBufferedToImage()

void juce::Component::setBufferedToImage ( bool  shouldBeBuffered)
inherited

Makes the component use an internal buffer to optimise its redrawing.

Setting this flag to true will cause the component to allocate an internal buffer into which it paints itself and all its child components, so that when asked to redraw itself, it can use this buffer rather than actually calling the paint() method.

Parts of the buffer are invalidated when repaint() is called on this component or its children. The buffer is then repainted at the next paint() callback.

See also
repaint, paint, createComponentSnapshot

◆ setCachedComponentImage()

void juce::Component::setCachedComponentImage ( CachedComponentImage newCachedImage)
inherited

Gives the component a CachedComponentImage that should be used to buffer its painting.

The object that is passed-in will be owned by this component, and will be deleted automatically later on.

See also
setBufferedToImage

◆ setCaretPosition()

void juce::TextEditor::setCaretPosition ( int  newIndex)

Moves the caret to be in front of a given character.

See also
getCaretPosition, moveCaretToEnd

◆ setCaretVisible()

void juce::TextEditor::setCaretVisible ( bool  shouldBeVisible)

Makes the caret visible or invisible.

By default the caret is visible.

See also
setCaretColour, setCaretPosition

◆ setCentrePosition() [1/2]

void juce::Component::setCentrePosition ( int  x,
int  y 
)
inherited

Changes the position of the component's centre.

Leaves the component's size unchanged, but sets the position of its centre relative to its parent's top-left.

See also
setBounds

◆ setCentrePosition() [2/2]

void juce::Component::setCentrePosition ( Point< int newCentrePosition)
inherited

Changes the position of the component's centre.

Leaves the component's size unchanged, but sets the position of its centre relative to its parent's top-left.

See also
setBounds

◆ setCentreRelative()

void juce::Component::setCentreRelative ( float  x,
float  y 
)
inherited

Changes the position of the component's centre.

Leaves the size unchanged, but positions its centre relative to its parent's size. E.g. setCentreRelative (0.5f, 0.5f) would place it centrally in its parent.

◆ setColour()

void juce::Component::setColour ( int  colourID,
Colour  newColour 
)
inherited

Registers a colour to be used for a particular purpose.

Changing a colour will cause a synchronous callback to the colourChanged() method, which your component can override if it needs to do something when colours are altered.

For more details about colour IDs, see the comments for findColour().

See also
findColour, isColourSpecified, colourChanged, LookAndFeel::findColour, LookAndFeel::setColour

Referenced by juce::StandaloneFilterWindow::MainContentComponent::NotificationArea::NotificationArea().

◆ setComponentEffect()

void juce::Component::setComponentEffect ( ImageEffectFilter newEffect)
inherited

Adds an effect filter to alter the component's appearance.

When a component has an effect filter set, then this is applied to the results of its paint() method. There are a few preset effects, such as a drop-shadow or glow, but they can be user-defined as well.

The effect that is passed in will not be deleted by the component - the caller must take care of deleting it.

To remove an effect from a component, pass a null pointer in as the parameter.

See also
ImageEffectFilter, DropShadowEffect, GlowEffect

◆ setComponentID()

void juce::Component::setComponentID ( const String newID)
inherited

Sets the component's ID string.

You can retrieve the ID using getComponentID().

See also
getComponentID, findChildWithID

◆ setDescription()

void juce::Component::setDescription ( const String newDescription)
inherited

Sets the description for this component.

If this component supports accessibility using the default AccessibilityHandler implementation, this string will be passed to accessibility clients requesting a description and may be read out by a screen reader.

See also
getDescription, getAccessibilityHandler

◆ setEnabled()

void juce::Component::setEnabled ( bool  shouldBeEnabled)
inherited

Enables or disables this component.

Disabling a component will also cause all of its child components to become disabled.

Similarly, enabling a component which is inside a disabled parent component won't make any difference until the parent is re-enabled.

See also
isEnabled, enablementChanged

◆ setEscapeAndReturnKeysConsumed()

void juce::TextEditor::setEscapeAndReturnKeysConsumed ( bool  shouldBeConsumed)
noexcept

This can be used to change whether escape and return keypress events are propagated up to the parent component.

The default here is true, meaning that these events are not allowed to reach the parent, but you may want to allow them through so that they can trigger other actions, e.g. closing a dialog box, etc.

◆ setExplicitFocusOrder()

void juce::Component::setExplicitFocusOrder ( int  newFocusOrderIndex)
inherited

Sets the focus order of this component.

The focus order is used by the default traverser implementation returned by createFocusTraverser() as part of its algorithm for deciding the order in which components should be traversed. A value of 0 or less is taken to mean that no explicit order is wanted, and that traversal should use other factors, like the component's position.

See also
getExplicitFocusOrder, FocusTraverser, createFocusTraverser

◆ setFocusContainerType()

void juce::Component::setFocusContainerType ( FocusContainerType  containerType)
noexceptinherited

Sets whether this component is a container for components that can have their focus traversed, and the type of focus traversal that it supports.

See also
FocusContainerType, isFocusContainer, isKeyboardFocusContainer, FocusTraverser, createFocusTraverser, KeyboardFocusTraverser, createKeyboardFocusTraverser

◆ setFont()

void juce::TextEditor::setFont ( const Font newFont)

Sets the font to use for newly added text.

This will change the font that will be used next time any text is added or entered into the editor. It won't change the font of any existing text - to do that, use applyFontToAllText() instead.

See also
applyFontToAllText

◆ setHasFocusOutline()

void juce::Component::setHasFocusOutline ( bool  hasFocusOutline)
inlinenoexceptinherited

Use this to indicate that the component should have an outline drawn around it when it has keyboard focus.

If this is set to true, then when the component gains keyboard focus the LookAndFeel::createFocusOutlineForComponent() method will be used to draw an outline around it.

See also
FocusOutline, hasFocusOutline

References juce::gl::flags.

◆ setHelpText()

void juce::Component::setHelpText ( const String newHelpText)
inherited

Sets the help text for this component.

If this component supports accessibility using the default AccessibilityHandler implementation, this string will be passed to accessibility clients requesting help text and may be read out by a screen reader.

See also
getHelpText, getAccessibilityHandler

◆ setHighlightedRegion()

void juce::TextEditor::setHighlightedRegion ( const Range< int > &  newSelection)
overridevirtual

Selects a section of the text.

Implements juce::TextInputTarget.

◆ setIndents()

void juce::TextEditor::setIndents ( int  newLeftIndent,
int  newTopIndent 
)

Changes the size of the gap at the top and left-edge of the editor.

By default there's a gap of 4 pixels.

◆ setInputFilter()

void juce::TextEditor::setInputFilter ( InputFilter newFilter,
bool  takeOwnership 
)

Sets an input filter that should be applied to this editor.

The filter can be nullptr, to remove any existing filters. If takeOwnership is true, then the filter will be owned and deleted by the editor when no longer needed.

◆ setInputRestrictions()

void juce::TextEditor::setInputRestrictions ( int  maxTextLength,
const String allowedCharacters = String() 
)

Sets limits on the characters that can be entered.

This is just a shortcut that passes an instance of the LengthAndCharacterRestriction class to setInputFilter().

Parameters
maxTextLengthif this is > 0, it sets a maximum length limit; if 0, no limit is set
allowedCharactersif this is non-empty, then only characters that occur in this string are allowed to be entered into the editor.

◆ setInterceptsMouseClicks()

void juce::Component::setInterceptsMouseClicks ( bool  allowClicksOnThisComponent,
bool  allowClicksOnChildComponents 
)
noexceptinherited

Changes the default return value for the hitTest() method.

Setting this to false is an easy way to make a component pass all its mouse events (not just clicks) through to the components behind it.

When a component is created, the default setting for this is true.

Parameters
allowClicksOnThisComponentif true, hitTest() will always return true; if false, it will return false (or true for child components if allowClicksOnChildComponents is true)
allowClicksOnChildComponentsif this is true and allowClicksOnThisComponent is false, then child components can be clicked on as normal but clicks on this component pass straight through; if this is false and allowClicksOnThisComponent is false, then neither this component nor any child components can be clicked on
See also
hitTest, getInterceptsMouseClicks

◆ setJustification()

void juce::TextEditor::setJustification ( Justification  newJustification)

Modifies the justification of the text within the editor window.

◆ setKeyboardType()

void juce::TextEditor::setKeyboardType ( VirtualKeyboardType  type)
inlinenoexcept

References juce::gl::type.

◆ setLineSpacing()

void juce::TextEditor::setLineSpacing ( float  newLineSpacing)
inlinenoexcept

Sets the line spacing of the TextEditor.

The default (and minimum) value is 1.0 and values > 1.0 will increase the line spacing as a multiple of the line height e.g. for double-spacing call this method with an argument of 2.0.

References juce::gl::f, and juce::jmax().

◆ setLookAndFeel()

void juce::Component::setLookAndFeel ( LookAndFeel newLookAndFeel)
inherited

Sets the look and feel to use for this component.

This will also change the look and feel for any child components that haven't had their look set explicitly.

The object passed in will not be deleted by the component, so it's the caller's responsibility to manage it. It may be used at any time until this component has been deleted.

Calling this method will also invoke the sendLookAndFeelChange() method.

See also
getLookAndFeel, lookAndFeelChanged

◆ setMouseClickGrabsKeyboardFocus()

void juce::Component::setMouseClickGrabsKeyboardFocus ( bool  shouldGrabFocus)
inherited

Chooses whether a click on this component automatically grabs the focus.

By default this is set to true, but you might want a component which can be focused, but where you don't want the user to be able to affect it directly by clicking.

◆ setMouseCursor()

void juce::Component::setMouseCursor ( const MouseCursor cursorType)
inherited

Changes the mouse cursor shape to use when the mouse is over this component.

Note that the cursor set by this method can be overridden by the getMouseCursor method.

See also
MouseCursor

◆ setMultiLine()

void juce::TextEditor::setMultiLine ( bool  shouldBeMultiLine,
bool  shouldWordWrap = true 
)

Puts the editor into either multi- or single-line mode.

By default, the editor will be in single-line mode, so use this if you need a multi-line editor.

See also the setReturnKeyStartsNewLine() method, which will also need to be turned on if you want a multi-line editor with line-breaks.

Parameters
shouldBeMultiLinewhether the editor should be multi- or single-line.
shouldWordWrapsets whether long lines should be broken up in multi-line editors. If this is false and scrollbars are enabled a horizontal scrollbar will be shown.
See also
isMultiLine, setReturnKeyStartsNewLine, setScrollbarsShown

◆ setName()

virtual void juce::Component::setName ( const String newName)
virtualinherited

Sets the name of this component.

When the name changes, all registered ComponentListeners will receive a ComponentListener::componentNameChanged() callback.

See also
getName

Reimplemented in juce::DocumentWindow.

◆ setOpaque()

void juce::Component::setOpaque ( bool  shouldBeOpaque)
inherited

Indicates whether any parts of the component might be transparent.

Components that always paint all of their contents with solid colour and thus completely cover any components behind them should use this method to tell the repaint system that they are opaque.

This information is used to optimise drawing, because it means that objects underneath opaque windows don't need to be painted.

By default, components are considered transparent, unless this is used to make it otherwise.

See also
isOpaque

Referenced by juce::StandaloneFilterWindow::MainContentComponent::NotificationArea::NotificationArea(), and juce::StandalonePluginHolder::SettingsComponent::SettingsComponent().

◆ setPaintingIsUnclipped()

void juce::Component::setPaintingIsUnclipped ( bool  shouldPaintWithoutClipping)
noexceptinherited

This allows you to indicate that this component doesn't require its graphics context to be clipped when it is being painted.

Most people will never need to use this setting, but in situations where you have a very large number of simple components being rendered, and where they are guaranteed never to do any drawing beyond their own boundaries, setting this to true will reduce the overhead involved in clipping the graphics context that gets passed to the component's paint() callback.

If you enable this mode, you'll need to make sure your paint method doesn't call anything like Graphics::fillAll(), and doesn't draw beyond the component's bounds, because that'll produce artifacts. This option will have no effect on components that contain any child components.

◆ setPasswordCharacter()

void juce::TextEditor::setPasswordCharacter ( juce_wchar  passwordCharacter)

Changes the password character used to disguise the text.

Parameters
passwordCharacterif this is not zero, this character will be used as a replacement for all characters that are drawn on screen - e.g. to create a password-style textbox containing circular blobs instead of text, you could set this value to 0x25cf, which is the unicode character for a black splodge (not all fonts include this, though), or 0x2022, which is a bullet (probably the best choice for linux).

◆ setPopupMenuEnabled()

void juce::TextEditor::setPopupMenuEnabled ( bool  menuEnabled)

Allows a right-click menu to appear for the editor.

(This defaults to being enabled).

If enabled, right-clicking (or command-clicking on the Mac) will pop up a menu of options such as cut/copy/paste, undo/redo, etc.

◆ setPositioner()

void juce::Component::setPositioner ( Positioner newPositioner)
inherited

Sets a new Positioner object for this component.

If there's currently another positioner set, it will be deleted. The object that is passed in will be deleted automatically by this component when it's no longer required. Pass a null pointer to clear the current positioner.

See also
getPositioner()

◆ setReadOnly()

void juce::TextEditor::setReadOnly ( bool  shouldBeReadOnly)

Changes the editor to read-only mode.

By default, the text editor is not read-only. If you're making it read-only, you might also want to call setCaretVisible (false) to get rid of the caret.

The text can still be highlighted and copied when in read-only mode.

See also
isReadOnly, setCaretVisible

◆ setRepaintsOnMouseActivity()

void juce::Component::setRepaintsOnMouseActivity ( bool  shouldRepaint)
noexceptinherited

Causes automatic repaints when the mouse enters or exits this component.

If turned on, then when the mouse enters/exits, or when the button is pressed/released on the component, it will trigger a repaint.

This is handy for things like buttons that need to draw themselves differently when the mouse moves over them, and it avoids having to override all the different mouse callbacks and call repaint().

See also
mouseEnter, mouseExit, mouseDown, mouseUp

◆ setReturnKeyStartsNewLine()

void juce::TextEditor::setReturnKeyStartsNewLine ( bool  shouldStartNewLine)

Changes the behaviour of the return key.

If set to true, the return key will insert a new-line into the text; if false it will trigger a call to the TextEditor::Listener::textEditorReturnKeyPressed() method. By default this is set to false, and when true it will only insert new-lines when in multi-line mode (see setMultiLine()).

◆ setScrollbarsShown()

void juce::TextEditor::setScrollbarsShown ( bool  shouldBeEnabled)

Enables or disables scrollbars (this only applies when in multi-line mode).

When the text gets too long to fit in the component, a scrollbar can appear to allow it to be scrolled. Even when this is enabled, the scrollbar will be hidden unless it's needed.

By default scrollbars are enabled.

◆ setScrollBarThickness()

void juce::TextEditor::setScrollBarThickness ( int  newThicknessPixels)

Changes the size of the scrollbars that are used.

Handy if you need smaller scrollbars for a small text box.

◆ setScrollToShowCursor()

void juce::TextEditor::setScrollToShowCursor ( bool  shouldScrollToShowCaret)

Used to disable the auto-scrolling which keeps the caret visible.

If true (the default), the editor will scroll when the caret moves offscreen. If set to false, it won't.

◆ setSelectAllWhenFocused()

void juce::TextEditor::setSelectAllWhenFocused ( bool  shouldSelectAll)

If set to true, focusing on the editor will highlight all its text.

(Set to false by default).

This is useful for boxes where you expect the user to re-enter all the text when they focus on the component, rather than editing what's already there.

◆ setSelection()

void juce::TextEditor::setSelection ( Range< int )
privatenoexcept

◆ setSize()

void juce::Component::setSize ( int  newWidth,
int  newHeight 
)
inherited

Changes the size of the component.

A synchronous call to resized() will occur if the size actually changes.

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to whatever bounds you set for it.

Referenced by juce::LassoComponent< SelectableItemType >::beginLasso(), juce::StandaloneFilterWindow::MainContentComponent::componentMovedOrResized(), juce::StandaloneFilterWindow::MainContentComponent::inputMutedChanged(), juce::CarbonViewWrapperComponent::setOurSizeToEmbeddedViewSize(), and juce::StandalonePluginHolder::SettingsComponent::setToRecommendedSize().

◆ setTabKeyUsedAsCharacter()

void juce::TextEditor::setTabKeyUsedAsCharacter ( bool  shouldTabKeyBeUsed)

Indicates whether the tab key should be accepted and used to input a tab character, or whether it gets ignored.

By default the tab key is ignored, so that it can be used to switch keyboard focus between components.

◆ setTemporaryUnderlining()

void juce::TextEditor::setTemporaryUnderlining ( const Array< Range< int >> &  )
overridevirtual

Implements juce::TextInputTarget.

◆ setText()

void juce::TextEditor::setText ( const String newText,
bool  sendTextChangeMessage = true 
)

Sets the entire content of the editor.

This will clear the editor and insert the given text (using the current text colour and font). You can set the current text colour using

Parameters
newTextthe text to add
sendTextChangeMessageif true, this will cause a change message to be sent to all the listeners.
See also
insertTextAtCaret

◆ setTextToShowWhenEmpty()

void juce::TextEditor::setTextToShowWhenEmpty ( const String text,
Colour  colourToUse 
)

When the text editor is empty, it can be set to display a message.

This is handy for things like telling the user what to type in the box - the string is only displayed, it's not taken to actually be the contents of the editor.

◆ setTitle()

void juce::Component::setTitle ( const String newTitle)
inherited

Sets the title for this component.

If this component supports accessibility using the default AccessibilityHandler implementation, this string will be passed to accessibility clients requesting a title and may be read out by a screen reader.

See also
getTitle, getAccessibilityHandler

◆ setTooltip()

virtual void juce::SettableTooltipClient::setTooltip ( const String newTooltip)
inlinevirtualinherited

Assigns a new tooltip to this object.

Reimplemented in juce::ComboBox, juce::Button, and juce::FilenameComponent.

◆ setTopLeftPosition() [1/2]

void juce::Component::setTopLeftPosition ( int  x,
int  y 
)
inherited

Moves the component to a new position.

Changes the component's top-left position (without changing its size). The position is relative to the top-left of the component's parent.

If the component actually moves, this method will make a synchronous call to moved().

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to whatever bounds you set for it.

See also
setBounds, ComponentListener::componentMovedOrResized

◆ setTopLeftPosition() [2/2]

void juce::Component::setTopLeftPosition ( Point< int newTopLeftPosition)
inherited

Moves the component to a new position.

Changes the component's top-left position (without changing its size). The position is relative to the top-left of the component's parent.

If the component actually moves, this method will make a synchronous call to moved().

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to whatever bounds you set for it.

See also
setBounds, ComponentListener::componentMovedOrResized

◆ setTopRightPosition()

void juce::Component::setTopRightPosition ( int  x,
int  y 
)
inherited

Moves the component to a new position.

Changes the position of the component's top-right corner (keeping it the same size). The position is relative to the top-left of the component's parent.

If the component actually moves, this method will make a synchronous call to moved().

Note that if you've used setTransform() to apply a transform, then the component's bounds will no longer be a direct reflection of the position at which it appears within its parent, as the transform will be applied to whatever bounds you set for it.

◆ setTransform()

void juce::Component::setTransform ( const AffineTransform transform)
inherited

Sets a transform matrix to be applied to this component.

If you set a transform for a component, the component's position will be warped by it, relative to the component's parent's top-left origin. This means that the values you pass into setBounds() will no longer reflect the actual area within the parent that the component covers, as the bounds will be transformed and the component will probably end up actually appearing somewhere else within its parent.

When using transforms you need to be extremely careful when converting coordinates between the coordinate spaces of different components or the screen - you should always use getLocalPoint(), getLocalArea(), etc to do this, and never just manually add a component's position to a point in order to convert it between different components (but I'm sure you would never have done that anyway...).

Currently, transforms are not supported for desktop windows, so the transform will be ignored if you put a component on the desktop.

To remove a component's transform, simply pass AffineTransform() as the parameter to this method.

◆ setViewportIgnoreDragFlag()

void juce::Component::setViewportIgnoreDragFlag ( bool  ignoreDrag)
inlinenoexceptinherited

Sets a flag to indicate whether mouse drag events on this Component should be ignored when it is inside a Viewport with drag-to-scroll functionality enabled.

This is useful for Components such as sliders that should not move when their parent Viewport when dragged.

References juce::gl::flags.

◆ setVisible()

virtual void juce::Component::setVisible ( bool  shouldBeVisible)
virtualinherited

Makes the component visible or invisible.

This method will show or hide the component. Note that components default to being non-visible when first created. Also note that visible components won't be seen unless all their parent components are also visible.

This method will call visibilityChanged() and also componentVisibilityChanged() for any component listeners that are interested in this component.

Parameters
shouldBeVisiblewhether to show or hide the component
See also
isVisible, isShowing, visibilityChanged, ComponentListener::componentVisibilityChanged

Reimplemented in juce::ScrollBar.

Referenced by juce::LassoComponent< SelectableItemType >::dragLasso(), juce::LassoComponent< SelectableItemType >::endLasso(), and juce::StandaloneFilterWindow::MainContentComponent::inputMutedChanged().

◆ setWantsKeyboardFocus()

void juce::Component::setWantsKeyboardFocus ( bool  wantsFocus)
noexceptinherited

Sets a flag to indicate whether this component wants keyboard focus or not.

By default components aren't actually interested in gaining the keyboard focus, but this method can be used to turn this on.

See the grabKeyboardFocus() method for details about the way a component is chosen to receive the focus.

See also
grabKeyboardFocus, giveAwayKeyboardFocus, getWantsKeyboardFocus

◆ setWhitespaceUnderlined()

void juce::TextEditor::setWhitespaceUnderlined ( bool  shouldUnderlineWhitespace)
inlinenoexcept

Sets whether whitespace should be underlined when the editor font is underlined.

See also
isWhitespaceUnderlined

◆ splitSection()

void juce::TextEditor::splitSection ( int  sectionIndex,
int  charToSplitAt 
)
private

◆ textChanged()

void juce::TextEditor::textChanged ( )
protected

Used internally to dispatch a text-change message.

◆ textWasChangedByValue()

void juce::TextEditor::textWasChangedByValue ( )
private

◆ timerCallbackInt()

void juce::TextEditor::timerCallbackInt ( )
private

◆ toBack()

void juce::Component::toBack ( )
inherited

Changes this component's z-order to be at the back of all its siblings.

If the component is set to be 'always-on-top', it will only be moved to the back of the other other 'always-on-top' components.

See also
toFront, toBehind, setAlwaysOnTop

◆ toBehind()

void juce::Component::toBehind ( Component other)
inherited

Changes this component's z-order so that it's just behind another component.

See also
toFront, toBack

◆ toFront()

void juce::Component::toFront ( bool  shouldAlsoGainKeyboardFocus)
inherited

Brings the component to the front of its siblings.

If some of the component's siblings have had their 'always-on-top' flag set, then they will still be kept in front of this one (unless of course this one is also 'always-on-top').

Parameters
shouldAlsoGainKeyboardFocusif true, this will also try to assign keyboard focus to the component (see grabKeyboardFocus() for more details)
See also
toBack, toBehind, setAlwaysOnTop

Referenced by juce::CarbonViewWrapperComponent::carbonEventHandler().

◆ undo()

bool juce::TextEditor::undo ( )

◆ undoOrRedo()

bool juce::TextEditor::undoOrRedo ( bool  shouldUndo)
private

◆ unfocusAllComponents()

static void juce::Component::unfocusAllComponents ( )
staticinherited

If any component has keyboard focus, this will defocus it.

◆ updateCaretPosition()

void juce::TextEditor::updateCaretPosition ( )
private

◆ updateMouseCursor()

void juce::Component::updateMouseCursor ( ) const
inherited

Forces the current mouse cursor to be updated.

If you're overriding the getMouseCursor() method to control which cursor is displayed, then this will only be checked each time the user moves the mouse. So if you want to force the system to check that the cursor being displayed is up-to-date (even if the mouse is just sitting there), call this method.

(If you're changing the cursor using setMouseCursor(), you don't need to bother calling this).

◆ updateValueFromText()

void juce::TextEditor::updateValueFromText ( )
private

◆ userTriedToCloseWindow()

virtual void juce::Component::userTriedToCloseWindow ( )
virtualinherited

For components on the desktop, this is called if the system wants to close the window.

This is a signal that either the user or the system wants the window to close. The default implementation of this method will trigger an assertion to warn you that your component should do something about it, but you can override this to ignore the event if you want.

Reimplemented in juce::AlertWindow.

◆ visibilityChanged()

virtual void juce::Component::visibilityChanged ( )
virtualinherited

Called when this component's visibility changes.

See also
setVisible, isVisible

Reimplemented in juce::ListBox, juce::Button, juce::ResizableWindow, juce::TopLevelWindow, juce::WebBrowserComponent, and juce::ProgressBar.

Member Data Documentation

◆ borderSize

BorderSize<int> juce::TextEditor::borderSize { 1, 1, 1, 3 }
private

◆ caret

std::unique_ptr<CaretComponent> juce::TextEditor::caret
private

◆ caretPosition

int juce::TextEditor::caretPosition = 0
private

◆ caretVisible

bool juce::TextEditor::caretVisible = true
private

◆ colourForTextWhenEmpty

Colour juce::TextEditor::colourForTextWhenEmpty
private

◆ consumeEscAndReturnKeys

bool juce::TextEditor::consumeEscAndReturnKeys = true
private

◆ currentFont

Font juce::TextEditor::currentFont { 14.0f }
private

◆ dragType

DragType juce::TextEditor::dragType = notDragging
private

◆ inputFilter

OptionalScopedPointer<InputFilter> juce::TextEditor::inputFilter
private

◆ justification

Justification juce::TextEditor::justification { Justification::topLeft }
private

◆ keepCaretOnScreen

bool juce::TextEditor::keepCaretOnScreen = true
private

◆ keyboardType

VirtualKeyboardType juce::TextEditor::keyboardType = TextInputTarget::textKeyboard
private

◆ lastTransactionTime

unsigned int juce::TextEditor::lastTransactionTime = 0
private

◆ leftIndent

int juce::TextEditor::leftIndent = 4
private

◆ lineSpacing

float juce::TextEditor::lineSpacing = 1.0f
private

◆ listeners

ListenerList<Listener> juce::TextEditor::listeners
private

◆ menuActive

bool juce::TextEditor::menuActive = false
private

◆ multiline

bool juce::TextEditor::multiline = false
private

◆ onEscapeKey

std::function<void()> juce::TextEditor::onEscapeKey

You can assign a lambda to this callback object to have it called when the escape key is pressed.

◆ onFocusLost

std::function<void()> juce::TextEditor::onFocusLost

You can assign a lambda to this callback object to have it called when the editor loses key focus.

◆ onReturnKey

std::function<void()> juce::TextEditor::onReturnKey

You can assign a lambda to this callback object to have it called when the return key is pressed.

◆ onTextChange

std::function<void()> juce::TextEditor::onTextChange

You can assign a lambda to this callback object to have it called when the text is changed.

◆ passwordCharacter

juce_wchar juce::TextEditor::passwordCharacter
private

◆ popupMenuEnabled

bool juce::TextEditor::popupMenuEnabled = true
private

◆ readOnly

bool juce::TextEditor::readOnly = false
private

◆ returnKeyStartsNewLine

bool juce::TextEditor::returnKeyStartsNewLine = false
private

◆ scrollbarVisible

bool juce::TextEditor::scrollbarVisible = true
private

◆ sections

OwnedArray<UniformTextSection> juce::TextEditor::sections
private

◆ selectAllTextWhenFocused

bool juce::TextEditor::selectAllTextWhenFocused = false
private

◆ selection

Range<int> juce::TextEditor::selection
private

◆ tabKeyUsed

bool juce::TextEditor::tabKeyUsed = false
private

◆ textHolder

TextHolderComponent* juce::TextEditor::textHolder
private

◆ textToShowWhenEmpty

String juce::TextEditor::textToShowWhenEmpty
private

◆ textValue

Value juce::TextEditor::textValue
private

◆ tooltipString

String juce::SettableTooltipClient::tooltipString
privateinherited

◆ topIndent

int juce::TextEditor::topIndent = 4
private

◆ totalNumChars

int juce::TextEditor::totalNumChars = 0
mutableprivate

◆ underlinedSections

Array<Range<int> > juce::TextEditor::underlinedSections
private

◆ underlineWhitespace

bool juce::TextEditor::underlineWhitespace = true
private

◆ undoManager

UndoManager juce::TextEditor::undoManager
private

◆ valueTextNeedsUpdating

bool juce::TextEditor::valueTextNeedsUpdating = false
private

◆ viewport

std::unique_ptr<Viewport> juce::TextEditor::viewport
private

◆ wasFocused

bool juce::TextEditor::wasFocused = false
private

◆ wordWrap

bool juce::TextEditor::wordWrap = false
private

The documentation for this class was generated from the following file:
juce::TextEditor::textColourId
@ textColourId
The colour that will be used when text is added to the editor.
Definition: juce_TextEditor.h:212
juce::Component::setColour
void setColour(int colourID, Colour newColour)
Registers a colour to be used for a particular purpose.