Krotos Modules 3
Loading...
Searching...
No Matches
krotos::ImagePopup Class Reference

A component with images, a header and a description used for info popup messages. More...

#include <ImagePopup.h>

Inheritance diagram for krotos::ImagePopup:

Classes

struct  LookAndFeelMethods
 

Public Types

enum  ColourIds { headerTextColourId = 0x1004280 , descriptionTextColourId = 0x1004281 , outlineColourId = 0x1001820 }
 

Public Member Functions

 ImagePopup (const String &headerText, const int &numOfHeaderLines, const String &descriptionText, Image *primaryImage, const String &buttonText, Justification justification=Justification::centredLeft, float headerFontSize=18.6f, float descriptionFontSize=15.2f)
 
 ~ImagePopup ()
 
void resized () override
 
void paint (Graphics &g) override
 
ImageComponent & getPrimaryImage ()
 
Label & getHeaderLabel ()
 
Label & getDescriptionLabel ()
 
Button & getButton ()
 
void setHeaderText (const String &text)
 
void setDescriptionText (const String &text)
 
void setLayout (float imageSize, int headerMargin, Rectangle< int > headerSize, Rectangle< int > descriptionSize, Rectangle< int > buttonBounds)
 

Private Attributes

float m_headerFontSize
 
float m_descriptionFontSize
 
const int m_numberOfHeaderLines {1}
 
float m_primaryImagePropotion {0.575f}
 
int m_headerDescriptionMargin {12}
 
Rectangle< int > m_headerSize {18, 16, 16, 38}
 
Rectangle< int > m_descriptionMargins {18, 66, 18, 45}
 
Rectangle< int > m_buttonBounds {12, 12, 72, 22}
 
ImageComponent m_image
 
Label m_header
 
Label m_description
 
TextButton m_button
 
std::unique_ptr< DrawableButton > m_closePopupButton
 
std::unique_ptr< Drawable > m_closeBtnDrawableDefault
 
std::unique_ptr< Drawable > m_closeBtnDrawableHover
 
std::unique_ptr< Drawable > m_closeBtnDrawableSelected
 
Justification m_justification {Justification::centredLeft}
 
Rectangle< int > m_imageBounds
 
Krotos_LookAndFeel::LinkButtonLAF m_buttonLAF
 

Detailed Description

A component with images, a header and a description used for info popup messages.

Member Enumeration Documentation

◆ ColourIds

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

These constants can be used either via the Component::setColour(), or LookAndFeel::setColour() methods.

Note that you can also use the constants from TextEditor::ColourIds to change the colour of the text editor that is opened when a label is editable.

See also
Component::setColour, Component::findColour, LookAndFeel::setColour, LookAndFeel::findColour
Enumerator
headerTextColourId 

The background colour to fill the label with.

descriptionTextColourId 

The colour for the text.

outlineColourId 

An optional colour to use to draw a border around the window.

Constructor & Destructor Documentation

◆ ImagePopup()

krotos::ImagePopup::ImagePopup ( const String & headerText,
const int & numOfHeaderLines,
const String & descriptionText,
Image * primaryImage,
const String & buttonText,
Justification justification = Justification::centredLeft,
float headerFontSize = 18.6f,
float descriptionFontSize = 15.2f )

◆ ~ImagePopup()

krotos::ImagePopup::~ImagePopup ( )

Member Function Documentation

◆ getButton()

Button & krotos::ImagePopup::getButton ( )
inline

◆ getDescriptionLabel()

Label & krotos::ImagePopup::getDescriptionLabel ( )
inline

◆ getHeaderLabel()

Label & krotos::ImagePopup::getHeaderLabel ( )
inline

◆ getPrimaryImage()

ImageComponent & krotos::ImagePopup::getPrimaryImage ( )
inline

◆ paint()

void krotos::ImagePopup::paint ( Graphics & g)
override

◆ resized()

void krotos::ImagePopup::resized ( )
override

◆ setDescriptionText()

void krotos::ImagePopup::setDescriptionText ( const String & text)
inline

◆ setHeaderText()

void krotos::ImagePopup::setHeaderText ( const String & text)
inline

◆ setLayout()

void krotos::ImagePopup::setLayout ( float imageSize,
int headerMargin,
Rectangle< int > headerSize,
Rectangle< int > descriptionSize,
Rectangle< int > buttonBounds )
inline

Member Data Documentation

◆ m_button

TextButton krotos::ImagePopup::m_button
private

◆ m_buttonBounds

Rectangle<int> krotos::ImagePopup::m_buttonBounds {12, 12, 72, 22}
private

◆ m_buttonLAF

Krotos_LookAndFeel::LinkButtonLAF krotos::ImagePopup::m_buttonLAF
private

◆ m_closeBtnDrawableDefault

std::unique_ptr<Drawable> krotos::ImagePopup::m_closeBtnDrawableDefault
private

◆ m_closeBtnDrawableHover

std::unique_ptr<Drawable> krotos::ImagePopup::m_closeBtnDrawableHover
private

◆ m_closeBtnDrawableSelected

std::unique_ptr<Drawable> krotos::ImagePopup::m_closeBtnDrawableSelected
private

◆ m_closePopupButton

std::unique_ptr<DrawableButton> krotos::ImagePopup::m_closePopupButton
private

◆ m_description

Label krotos::ImagePopup::m_description
private

◆ m_descriptionFontSize

float krotos::ImagePopup::m_descriptionFontSize
private

◆ m_descriptionMargins

Rectangle<int> krotos::ImagePopup::m_descriptionMargins {18, 66, 18, 45}
private

◆ m_header

Label krotos::ImagePopup::m_header
private

◆ m_headerDescriptionMargin

int krotos::ImagePopup::m_headerDescriptionMargin {12}
private

◆ m_headerFontSize

float krotos::ImagePopup::m_headerFontSize
private

◆ m_headerSize

Rectangle<int> krotos::ImagePopup::m_headerSize {18, 16, 16, 38}
private

◆ m_image

ImageComponent krotos::ImagePopup::m_image
private

◆ m_imageBounds

Rectangle<int> krotos::ImagePopup::m_imageBounds
private

◆ m_justification

Justification krotos::ImagePopup::m_justification {Justification::centredLeft}
private

◆ m_numberOfHeaderLines

const int krotos::ImagePopup::m_numberOfHeaderLines {1}
private

◆ m_primaryImagePropotion

float krotos::ImagePopup::m_primaryImagePropotion {0.575f}
private

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