Loading...
Searching...
No Matches
juce::LookAndFeel Class Referenceabstract

## Detailed Description

LookAndFeel objects define the appearance of all the JUCE widgets, and subclasses can be used to apply different 'skins' to the application.

This class is an abstract base-class - for actual look-and-feels that you can instantiate, see LookAndFeel_V1, LookAndFeel_V2 and LookAndFeel_V3.

See also
  LookAndFeel_V1, LookAndFeel_V2, LookAndFeel_V3

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

- juce_gui_basics/lookandfeel/juce_LookAndFeel.h

Inheritance diagram for juce::LookAndFeel:

## Public Member Functions

| LookAndFeel ()
| Creates the default JUCE look and feel.
| ~LookAndFeel () override
| Destructor.
Colour | findColour (int colourId) const noexcept
| Looks for a colour that has been registered with the given colour ID number.
void | setColour (int colourId, Colour colour) noexcept
| Registers a colour to be used for a particular purpose.
bool | isColourSpecified (int colourId) const noexcept
| Returns true if the specified colour ID has been explicitly set using the setColour() method.
virtual Typeface::Ptr | getTypefaceForFont (const Font &)
| Returns the typeface that should be used for a given font.
virtual TypefaceMetricsKind | getDefaultMetricsKind () const
| Widgets can call this to find out the kind of metrics they should use when creating their own fonts.
FontOptions | withDefaultMetrics (FontOptions opt) const
| Returns a copy of the FontOptions with the LookAndFeel's default metrics kind set.
void | setDefaultSansSerifTypeface (Typeface::Ptr newDefaultTypeface)
| Allows you to supply a default typeface that will be returned as the default sans-serif font.
void | setDefaultSansSerifTypefaceName (const String &newName)
| Allows you to change the default sans-serif font.
void | setUsingNativeAlertWindows (bool shouldUseNativeAlerts)
| Sets whether native alert windows (if available) or standard JUCE AlertWindows drawn with AlertWindow::LookAndFeelMethods will be used.
bool | isUsingNativeAlertWindows ()
| Returns true if native alert windows will be used (if available).
virtual void | drawSpinningWaitAnimation (Graphics &, const Colour &colour, int x, int y, int w, int h)=0
| Draws a small image that spins to indicate that something's happening.
virtual Path | getTickShape (float height)=0
| Returns a tick shape for use in yes/no boxes, etc.
virtual Path | getCrossShape (float height)=0
| Returns a cross shape for use in yes/no boxes, etc.
virtual std::unique_ptr< DropShadower > | createDropShadowerForComponent (Component &)=0
| Creates a drop-shadower for a given component, if required.
virtual std::unique_ptr< FocusOutline > | createFocusOutlineForComponent (Component &)=0
| Creates a focus outline for a given component, if required.
virtual MouseCursor | getMouseCursorFor (Component &)
| Override this to get the chance to swap a component's mouse cursor for a customised one.
virtual std::unique_ptr< LowLevelGraphicsContext > | createGraphicsContext (const Image &imageToRenderOn, Point< int > origin, const RectangleList< int > &initialClip)
| Creates a new graphics context object.
virtual void | playAlertSound ()
| Plays the system's default 'beep' noise, to alert the user about something very important.
Public Member Functions inherited from juce::ScrollBar::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual bool | areScrollbarButtonsVisible ()=0
virtual void | drawScrollbarButton (Graphics &g, ScrollBar &scrollbar, int width, int height, int buttonDirection, bool isScrollbarVertical, bool isMouseOverButton, bool isButtonDown)=0
| Draws one of the buttons on a scrollbar.
virtual void | drawScrollbar (Graphics &g, ScrollBar &scrollbar, int x, int y, int width, int height, bool isScrollbarVertical, int thumbStartPosition, int thumbSize, bool isMouseOver, bool isMouseDown)=0
| Draws the thumb area of a scrollbar.
virtual ImageEffectFilter * | getScrollbarEffect ()=0
| Returns the component effect to use for a scrollbar.
virtual int | getMinimumScrollbarThumbSize (ScrollBar &)=0
| Returns the minimum length in pixels to use for a scrollbar thumb.
virtual int | getDefaultScrollbarWidth ()=0
| Returns the default thickness to use for a scrollbar.
virtual int | getScrollbarButtonSize (ScrollBar &)=0
| Returns the length in pixels to use for a scrollbar button.
Public Member Functions inherited from juce::Button::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawButtonBackground (Graphics &, Button &, const Colour &backgroundColour, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)=0
virtual Font | getTextButtonFont (TextButton &, int buttonHeight)=0
virtual int | getTextButtonWidthToFitText (TextButton &, int buttonHeight)=0
virtual void | drawButtonText (Graphics &, TextButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)=0
| Draws the text for a TextButton.
virtual void | drawToggleButton (Graphics &, ToggleButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)=0
| Draws the contents of a standard ToggleButton.
virtual void | changeToggleButtonWidthToFitText (ToggleButton &)=0
virtual void | drawTickBox (Graphics &, Component &, float x, float y, float w, float h, bool ticked, bool isEnabled, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)=0
virtual void | drawDrawableButton (Graphics &, DrawableButton &, bool shouldDrawButtonAsHighlighted, bool shouldDrawButtonAsDown)=0
Public Member Functions inherited from juce::ImageButton::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawImageButton (Graphics &, Image *, int imageX, int imageY, int imageW, int imageH, const Colour &overlayColour, float imageOpacity, ImageButton &)=0
Public Member Functions inherited from juce::TextEditor::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | fillTextEditorBackground (Graphics &, int width, int height, TextEditor &)=0
virtual void | drawTextEditorOutline (Graphics &, int width, int height, TextEditor &)=0
virtual CaretComponent * | createCaretComponent (Component *keyFocusOwner)=0
Public Member Functions inherited from juce::FileBrowserComponent::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual const Drawable * | getDefaultFolderImage ()=0
virtual const Drawable * | getDefaultDocumentFileImage ()=0
virtual AttributedString | createFileChooserHeaderText (const String &title, const String &instructions)=0
virtual void | drawFileBrowserRow (Graphics &, int width, int height, const File &file, const String &filename, Image *optionalIcon, const String &fileSizeDescription, const String &fileTimeDescription, bool isDirectory, bool isItemSelected, int itemIndex, DirectoryContentsDisplayComponent &)=0
virtual Button * | createFileBrowserGoUpButton ()=0
virtual void | layoutFileBrowserComponent (FileBrowserComponent &browserComp, DirectoryContentsDisplayComponent *fileListComponent, FilePreviewComponent *previewComp, ComboBox *currentPathBox, TextEditor *filenameBox, Button *goUpButton)=0
Public Member Functions inherited from juce::TreeView::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawTreeviewPlusMinusBox (Graphics &, const Rectangle< float > &area, Colour backgroundColour, bool isItemOpen, bool isMouseOver)=0
virtual bool | areLinesDrawnForTreeView (TreeView &)=0
virtual int | getTreeViewIndentSize (TreeView &)=0
Public Member Functions inherited from juce::BubbleComponent::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawBubble (Graphics &g, BubbleComponent &bubbleComponent, const Point< float > &positionOfTip, const Rectangle< float > &body)=0
| Override this method to draw a speech-bubble pointing at a specific location on the screen.
virtual void | setComponentEffectForBubbleComponent (BubbleComponent &bubbleComponent)=0
| Override this method to set effects, such as a drop-shadow, on a BubbleComponent.
Public Member Functions inherited from juce::AlertWindow::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual AlertWindow * | createAlertWindow (const String &title, const String &message, const String &button1, const String &button2, const String &button3, MessageBoxIconType iconType, int numButtons, Component *associatedComponent)=0
virtual void | drawAlertBox (Graphics &, AlertWindow &, const Rectangle< int > &textArea, TextLayout &)=0
virtual int | getAlertBoxWindowFlags ()=0
virtual Array< int > | getWidthsForTextButtons (AlertWindow &, const Array< TextButton * > &)=0
virtual int | getAlertWindowButtonHeight ()=0
virtual Font | getAlertWindowTitleFont ()=0
virtual Font | getAlertWindowMessageFont ()=0
virtual Font | getAlertWindowFont ()=0
Public Member Functions inherited from juce::PopupMenu::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawPopupMenuBackground (Graphics &, int width, int height)
| Fills the background of a popup menu component.
virtual void | drawPopupMenuBackgroundWithOptions (Graphics &, int width, int height, const Options &)=0
| Fills the background of a popup menu component.
virtual void | drawPopupMenuItem (Graphics &, const Rectangle< int > &area, bool isSeparator, bool isActive, bool isHighlighted, bool isTicked, bool hasSubMenu, const String &text, const String &shortcutKeyText, const Drawable *icon, const Colour *textColour)
| Draws one of the items in a popup menu.
virtual void | drawPopupMenuItemWithOptions (Graphics &, const Rectangle< int > &area, bool isHighlighted, const Item &item, const Options &)=0
| Draws one of the items in a popup menu.
virtual void | drawPopupMenuSectionHeader (Graphics &, const Rectangle< int > &, const String &)
virtual void | drawPopupMenuSectionHeaderWithOptions (Graphics &, const Rectangle< int > &area, const String &sectionName, const Options &)=0
virtual Font | getPopupMenuFont ()=0
| Returns the size and style of font to use in popup menus.
virtual void | drawPopupMenuUpDownArrow (Graphics &, int width, int height, bool isScrollUpArrow)
virtual void | drawPopupMenuUpDownArrowWithOptions (Graphics &, int width, int height, bool isScrollUpArrow, const Options &)=0
virtual void | getIdealPopupMenuItemSize (const String &text, bool isSeparator, int standardMenuItemHeight, int &idealWidth, int &idealHeight)
| Finds the best size for an item in a popup menu.
virtual void | getIdealPopupMenuItemSizeWithOptions (const String &text, bool isSeparator, int standardMenuItemHeight, int &idealWidth, int &idealHeight, const Options &)=0
| Finds the best size for an item in a popup menu.
virtual void | getIdealPopupMenuSectionHeaderSizeWithOptions (const String &text, int standardMenuItemHeight, int &idealWidth, int &idealHeight, const Options &)=0
virtual int | getMenuWindowFlags ()=0
virtual void | drawMenuBarBackground (Graphics &, int width, int height, bool isMouseOverBar, MenuBarComponent &)=0
virtual int | getDefaultMenuBarHeight ()=0
virtual int | getMenuBarItemWidth (MenuBarComponent &, int itemIndex, const String &itemText)=0
virtual Font | getMenuBarFont (MenuBarComponent &, int itemIndex, const String &itemText)=0
virtual void | drawMenuBarItem (Graphics &, int width, int height, int itemIndex, const String &itemText, bool isMouseOverItem, bool isMenuOpen, bool isMouseOverBar, MenuBarComponent &)=0
virtual Component * | getParentComponentForMenuOptions (const Options &options)=0
virtual void | preparePopupMenuWindow (Component &newWindow)=0
virtual bool | shouldPopupMenuScaleWithTargetComponent (const Options &options)=0
| Return true if you want your popup menus to scale with the target component's AffineTransform or scale factor.
virtual int | getPopupMenuBorderSize ()
virtual int | getPopupMenuBorderSizeWithOptions (const Options &)=0
virtual void | drawPopupMenuColumnSeparatorWithOptions (Graphics &g, const Rectangle< int > &bounds, const Options &)=0
| Implement this to draw some custom decoration between the columns of the popup menu.
virtual int | getPopupMenuColumnSeparatorWidthWithOptions (const Options &)=0
| Return the amount of space that should be left between popup menu columns.
Public Member Functions inherited from juce::ComboBox::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawComboBox (Graphics &, int width, int height, bool isButtonDown, int buttonX, int buttonY, int buttonW, int buttonH, ComboBox &)=0
virtual Font | getComboBoxFont (ComboBox &)=0
virtual Label * | createComboBoxTextBox (ComboBox &)=0
virtual void | positionComboBoxText (ComboBox &, Label &labelToPosition)=0
virtual PopupMenu::Options | getOptionsForComboBoxPopupMenu (ComboBox &, Label &)=0
virtual void | drawComboBoxTextWhenNothingSelected (Graphics &, ComboBox &, Label &)=0
Public Member Functions inherited from juce::Label::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawLabel (Graphics &, Label &)=0
virtual Font | getLabelFont (Label &)=0
virtual BorderSize< int > | getLabelBorderSize (Label &)=0
Public Member Functions inherited from juce::Slider::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawLinearSlider (Graphics &, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, Slider::SliderStyle, Slider &)=0
virtual void | drawLinearSliderBackground (Graphics &, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, Slider::SliderStyle, Slider &)=0
virtual void | drawLinearSliderOutline (Graphics &, int x, int y, int width, int height, Slider::SliderStyle, Slider &)=0
virtual void | drawLinearSliderThumb (Graphics &, int x, int y, int width, int height, float sliderPos, float minSliderPos, float maxSliderPos, Slider::SliderStyle, Slider &)=0
virtual int | getSliderThumbRadius (Slider &)=0
virtual void | drawRotarySlider (Graphics &, int x, int y, int width, int height, float sliderPosProportional, float rotaryStartAngle, float rotaryEndAngle, Slider &)=0
virtual Button * | createSliderButton (Slider &, bool isIncrement)=0
virtual Label * | createSliderTextBox (Slider &)=0
virtual ImageEffectFilter * | getSliderEffect (Slider &)=0
virtual Font | getSliderPopupFont (Slider &)=0
virtual int | getSliderPopupPlacement (Slider &)=0
virtual SliderLayout | getSliderLayout (Slider &)=0
Public Member Functions inherited from juce::ResizableWindow::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawCornerResizer (Graphics &, int w, int h, bool isMouseOver, bool isMouseDragging)=0
virtual void | drawResizableFrame (Graphics &, int w, int h, const BorderSize< int > &)=0
virtual void | fillResizableWindowBackground (Graphics &, int w, int h, const BorderSize< int > &, ResizableWindow &)=0
virtual void | drawResizableWindowBorder (Graphics &, int w, int h, const BorderSize< int > &border, ResizableWindow &)=0
Public Member Functions inherited from juce::DocumentWindow::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawDocumentWindowTitleBar (DocumentWindow &, Graphics &, int w, int h, int titleSpaceX, int titleSpaceW, const Image *icon, bool drawTitleTextOnLeft)=0
virtual Button * | createDocumentWindowButton (int buttonType)=0
virtual void | positionDocumentWindowButtons (DocumentWindow &, int titleBarX, int titleBarY, int titleBarW, int titleBarH, Button *minimiseButton, Button *maximiseButton, Button *closeButton, bool positionTitleBarButtonsOnLeft)=0
Public Member Functions inherited from juce::TooltipWindow::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual Rectangle< int > | getTooltipBounds (const String &tipText, Point< int > screenPos, Rectangle< int > parentArea)=0
| returns the bounds for a tooltip at the given screen coordinate, constrained within the given desktop area.
virtual void | drawTooltip (Graphics &, const String &text, int width, int height)=0
Public Member Functions inherited from juce::TabbedButtonBar::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual int | getTabButtonSpaceAroundImage ()=0
virtual int | getTabButtonOverlap (int tabDepth)=0
virtual int | getTabButtonBestWidth (TabBarButton &, int tabDepth)=0
virtual Rectangle< int > | getTabButtonExtraComponentBounds (const TabBarButton &, Rectangle< int > &textArea, Component &extraComp)=0
virtual void | drawTabButton (TabBarButton &, Graphics &, bool isMouseOver, bool isMouseDown)=0
virtual Font | getTabButtonFont (TabBarButton &, float height)=0
virtual void | drawTabButtonText (TabBarButton &, Graphics &, bool isMouseOver, bool isMouseDown)=0
virtual void | drawTabbedButtonBarBackground (TabbedButtonBar &, Graphics &)=0
virtual void | drawTabAreaBehindFrontButton (TabbedButtonBar &, Graphics &, int w, int h)=0
virtual void | createTabButtonShape (TabBarButton &, Path &path, bool isMouseOver, bool isMouseDown)=0
virtual void | fillTabButtonShape (TabBarButton &, Graphics &, const Path &path, bool isMouseOver, bool isMouseDown)=0
virtual Button * | createTabBarExtrasButton ()=0
Public Member Functions inherited from juce::PropertyComponent::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawPropertyPanelSectionHeader (Graphics &, const String &name, bool isOpen, int width, int height)=0
virtual void | drawPropertyComponentBackground (Graphics &, int width, int height, PropertyComponent &)=0
virtual void | drawPropertyComponentLabel (Graphics &, int width, int height, PropertyComponent &)=0
virtual Rectangle< int > | getPropertyComponentContentPosition (PropertyComponent &)=0
virtual int | getPropertyPanelSectionHeaderHeight (const String &sectionTitle)=0
Public Member Functions inherited from juce::FilenameComponent::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual Button * | createFilenameComponentBrowseButton (const String &text)=0
virtual void | layoutFilenameComponent (FilenameComponent &, ComboBox *filenameBox, Button *browseButton)=0
Public Member Functions inherited from juce::GroupComponent::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawGroupComponentOutline (Graphics &, int w, int h, const String &text, const Justification &, GroupComponent &)=0
Public Member Functions inherited from juce::TableHeaderComponent::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawTableHeaderBackground (Graphics &, TableHeaderComponent &)=0
virtual void | drawTableHeaderColumn (Graphics &, TableHeaderComponent &, const String &columnName, int columnId, int width, int height, bool isMouseOver, bool isMouseDown, int columnFlags)=0
Public Member Functions inherited from juce::CallOutBox::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawCallOutBoxBackground (CallOutBox &, Graphics &, const Path &, Image &)=0
virtual int | getCallOutBoxBorderSize (const CallOutBox &)=0
virtual float | getCallOutBoxCornerSize (const CallOutBox &)=0
Public Member Functions inherited from juce::Toolbar::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | paintToolbarBackground (Graphics &, int width, int height, Toolbar &)=0
virtual Button * | createToolbarMissingItemsButton (Toolbar &)=0
virtual void | paintToolbarButtonBackground (Graphics &, int width, int height, bool isMouseOver, bool isMouseDown, ToolbarItemComponent &)=0
virtual void | paintToolbarButtonLabel (Graphics &, int x, int y, int width, int height, const String &text, ToolbarItemComponent &)=0
Public Member Functions inherited from juce::ConcertinaPanel::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawConcertinaPanelHeader (Graphics &, const Rectangle< int > &area, bool isMouseOver, bool isMouseDown, ConcertinaPanel &, Component &)=0
Public Member Functions inherited from juce::ProgressBar::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawProgressBar (Graphics &, ProgressBar &, int width, int height, double progress, const String &textToShow)=0
| Draws a progress bar.
virtual bool | isProgressBarOpaque (ProgressBar &)=0
virtual Style | getDefaultProgressBarStyle (const ProgressBar &)=0
| Returns the default style a progress bar should use if one hasn't been set.
Public Member Functions inherited from juce::StretchableLayoutResizerBar::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual void | drawStretchableLayoutResizerBar (Graphics &, int w, int h, bool isVerticalBar, bool isMouseOver, bool isMouseDragging)=0
Public Member Functions inherited from juce::ExtraLookAndFeelBaseClasses::KeyMappingEditorComponentMethods
virtual | ~KeyMappingEditorComponentMethods ()=default
virtual void | drawKeymapChangeButton (Graphics &, int width, int height, Button &, const String &keyDescription)=0
Public Member Functions inherited from juce::ExtraLookAndFeelBaseClasses::AudioDeviceSelectorComponentMethods
virtual | ~AudioDeviceSelectorComponentMethods ()=default
virtual void | drawLevelMeter (Graphics &, int width, int height, float level)=0
Public Member Functions inherited from juce::ExtraLookAndFeelBaseClasses::LassoComponentMethods
virtual | ~LassoComponentMethods ()=default
virtual void | drawLasso (Graphics &, Component &lassoComp)=0
Public Member Functions inherited from juce::SidePanel::LookAndFeelMethods
virtual | ~LookAndFeelMethods ()=default
virtual Font | getSidePanelTitleFont (SidePanel &)=0
virtual Justification | getSidePanelTitleJustification (SidePanel &)=0
virtual Path | getSidePanelDismissButtonShape (SidePanel &)=0

## Static Public Member Functions

static LookAndFeel & | getDefaultLookAndFeel () noexcept
| Returns the current default look-and-feel for a component to use when it hasn't got one explicitly set.
static void | setDefaultLookAndFeel (LookAndFeel *newDefaultLookAndFeel) noexcept
| Changes the default look-and-feel.

## Constructors and Destructors

## LookAndFeel()

juce::LookAndFeel::LookAndFeel | ( |  | ) |

Creates the default JUCE look and feel.

Referenced by getDefaultLookAndFeel(), and setDefaultLookAndFeel().

## ~LookAndFeel()

juce::LookAndFeel::~LookAndFeel | ( |  | ) |

override

Destructor.

## Member Functions

## getDefaultLookAndFeel()

LookAndFeel & juce::LookAndFeel::getDefaultLookAndFeel | ( |  | ) |

static noexcept

Returns the current default look-and-feel for a component to use when it hasn't got one explicitly set.

See also
  setDefaultLookAndFeel

References LookAndFeel().

## setDefaultLookAndFeel()

void juce::LookAndFeel::setDefaultLookAndFeel | ( | LookAndFeel * | newDefaultLookAndFeel | ) |

static noexcept

Changes the default look-and-feel.

Parameters

  newDefaultLookAndFeel | the new look-and-feel object to use - if this is set to null, it will revert to using the default one. The object passed-in must be deleted by the caller when it's no longer needed.

See also
  getDefaultLookAndFeel

References LookAndFeel(), and setDefaultLookAndFeel().

Referenced by setDefaultLookAndFeel().

## findColour()

Colour juce::LookAndFeel::findColour | ( | int | colourId | ) | const

noexcept

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, it will just return Colours::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.

If you're looking up a colour for use in drawing a component, it's usually best not to call this directly, but to use the Component::findColour() method instead. That will first check whether a suitable colour has been registered directly with the component, and will fall-back on calling the component's LookAndFeel's findColour() method if none is found.

See also
  setColour, Component::findColour, Component::setColour

References findColour().

Referenced by findColour().

## setColour()

void juce::LookAndFeel::setColour | ( | int | colourId,
|  | Colour | colour )

noexcept

Registers a colour to be used for a particular purpose.

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

See also
  findColour, Component::findColour, Component::setColour

References setColour().

Referenced by setColour().

## isColourSpecified()

bool juce::LookAndFeel::isColourSpecified | ( | int | colourId | ) | const

noexcept

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

References isColourSpecified().

Referenced by isColourSpecified().

## getTypefaceForFont()

virtual Typeface::Ptr juce::LookAndFeel::getTypefaceForFont | ( | const Font & |  | ) |

virtual

Returns the typeface that should be used for a given font.

The default implementation just does what you'd expect it to, but you can override this if you want to intercept fonts and use your own custom typeface object.

See also
  setDefaultTypeface

References getTypefaceForFont().

Referenced by getTypefaceForFont().

## getDefaultMetricsKind()

virtual TypefaceMetricsKind juce::LookAndFeel::getDefaultMetricsKind | ( |  | ) | const

inline virtual

Widgets can call this to find out the kind of metrics they should use when creating their own fonts.

The default implementation returns the portable metrics kind, but you can override this if you want to use the legacy metrics kind instead, to avoid rendering changes in existing projects. Switching between metrics kinds may cause text to render at a different size, so you should check that text in your app still renders at an appropriate size, and potentially adjust font sizes where necessary after overriding this function.

References getDefaultMetricsKind(), and juce::portable.

Referenced by getDefaultMetricsKind(), and withDefaultMetrics().

## withDefaultMetrics()

FontOptions juce::LookAndFeel::withDefaultMetrics | ( | FontOptions | opt | ) | const

inline

Returns a copy of the FontOptions with the LookAndFeel's default metrics kind set.

References getDefaultMetricsKind(), and juce::FontOptions::withMetricsKind().

## setDefaultSansSerifTypeface()

void juce::LookAndFeel::setDefaultSansSerifTypeface | ( | Typeface::Ptr | newDefaultTypeface | ) |

Allows you to supply a default typeface that will be returned as the default sans-serif font.

Instead of a typeface object, you can specify a typeface by name using the setDefaultSansSerifTypefaceName() method.

You can perform more complex typeface substitutions by overloading getTypefaceForFont() but this lets you easily set a global typeface.

## setDefaultSansSerifTypefaceName()

void juce::LookAndFeel::setDefaultSansSerifTypefaceName | ( | const String & | newName | ) |

Allows you to change the default sans-serif font.

If you need to supply your own Typeface object for any of the default fonts, rather than just supplying the name (e.g. if you want to use an embedded font), then you can instead call setDefaultSansSerifTypeface() with an object to use.

## setUsingNativeAlertWindows()

void juce::LookAndFeel::setUsingNativeAlertWindows | ( | bool | shouldUseNativeAlerts | ) |

Sets whether native alert windows (if available) or standard JUCE AlertWindows drawn with AlertWindow::LookAndFeelMethods will be used.

See also
  isUsingNativeAlertWindows

## isUsingNativeAlertWindows()

bool juce::LookAndFeel::isUsingNativeAlertWindows | ( |  | ) |

Returns true if native alert windows will be used (if available).

The default setting for this is false.

See also
  setUsingNativeAlertWindows

## drawSpinningWaitAnimation()

virtual void juce::LookAndFeel::drawSpinningWaitAnimation | ( | Graphics & | ,
|  | const Colour & | colour,
|  | int | x,
|  | int | y,
|  | int | w,
|  | int | h )

pure virtual

Draws a small image that spins to indicate that something's happening.

This method should use the current time to animate itself, so just keep repainting it every so often.

Implemented in juce::LookAndFeel_V2.

References h, w, x, and y.

## getTickShape()

virtual Path juce::LookAndFeel::getTickShape | ( | float | height | ) |

pure virtual

Returns a tick shape for use in yes/no boxes, etc.

Implemented in juce::LookAndFeel_V2, juce::LookAndFeel_V3, and juce::LookAndFeel_V4.

## getCrossShape()

virtual Path juce::LookAndFeel::getCrossShape | ( | float | height | ) |

pure virtual

Returns a cross shape for use in yes/no boxes, etc.

Implemented in juce::LookAndFeel_V2, juce::LookAndFeel_V3, and juce::LookAndFeel_V4.

## createDropShadowerForComponent()

virtual std::unique_ptr< DropShadower > juce::LookAndFeel::createDropShadowerForComponent | ( | Component & |  | ) |

pure virtual

Creates a drop-shadower for a given component, if required.

See also
  DropShadower

Implemented in juce::LookAndFeel_V2.

## createFocusOutlineForComponent()

virtual std::unique_ptr< FocusOutline > juce::LookAndFeel::createFocusOutlineForComponent | ( | Component & |  | ) |

pure virtual

Creates a focus outline for a given component, if required.

See also
  FocusOutline

Implemented in juce::LookAndFeel_V2.

## getMouseCursorFor()

virtual MouseCursor juce::LookAndFeel::getMouseCursorFor | ( | Component & |  | ) |

virtual

Override this to get the chance to swap a component's mouse cursor for a customised one.

See also
  MouseCursor

## createGraphicsContext()

virtual std::unique_ptr< LowLevelGraphicsContext > juce::LookAndFeel::createGraphicsContext | ( | const Image & | imageToRenderOn,
|  | Point< int > | origin,
|  | const RectangleList< int > & | initialClip )

virtual

Creates a new graphics context object.

## playAlertSound()

virtual void juce::LookAndFeel::playAlertSound | ( |  | ) |

virtual

Plays the system's default 'beep' noise, to alert the user about something very important.

This is only supported on some platforms.

### Purchase

Get JUCE

### Discover

What's New in JUCE Features

### Learn

Documentaion Tutorials Made with JUCE Resources

### Support

JUCE Forum Newsletter Archive

### About

Contact Us JUCE Legal JUCE Licensing FAQ

### Events

Audio Developer Conference
© Raw Material Software Limited