Simple GUI Library
Sgl::DefaultSkins::ButtonBaseSkin Class Reference
Inheritance diagram for Sgl::DefaultSkins::ButtonBaseSkin:
Collaboration diagram for Sgl::DefaultSkins::ButtonBaseSkin:

Classes

struct  InteractionStyle
 
struct  StaticStyle
 

Public Member Functions

 ButtonBaseSkin (Sgl::Button *button, const StaticStyle *staticStyle, const InteractionStyle *idleStyle, const InteractionStyle *hoveredStyle, const InteractionStyle *pressedStyle)
 
 ButtonBaseSkin (const StaticStyle *staticStyle, const InteractionStyle *idleStyle, const InteractionStyle *hoveredStyle, const InteractionStyle *pressedStyle)
 
virtual void dispose () override
 Should be called by Control when this skin is replaced. More...
 
virtual void attach (Button *button) override
 
virtual void prerenderControl () override
 
virtual const ControlgetControl () const override
 
virtual ControlgetModifiableControl () override
 
virtual int32_t computePrefHeight (int32_t width=-1) const override
 
virtual int32_t computePrefWidth (int32_t height=-1) const override
 
virtual void layoutChildren () override
 
void applyInteractionStyle (InteractionStyle::Type type)
 
- Public Member Functions inherited from Sgl::Skin
virtual ComponentgetHitComponent (int32_t x, int32_t y)
 
virtual int32_t computeMinHeight (int32_t width=-1) const
 
virtual int32_t computeMinWidth (int32_t height=-1) const
 
virtual int32_t computeMaxHeight (int32_t width=-1) const
 
virtual int32_t computeMaxWidth (int32_t height=-1) const
 

Protected Member Functions

int32_t getMargin () const
 
void applyStaticStyle ()
 

Protected Attributes

const StaticStylem_StaticStyle = nullptr
 
const InteractionStylem_IdleStyle = nullptr
 
const InteractionStylem_HoveredStyle = nullptr
 
const InteractionStylem_PressedStyle = nullptr
 
Sgl::Buttonm_Button = nullptr
 
ButtonBaseSkinEventListenerm_Handler = nullptr
 
Sgl::Text m_Text
 
Sgl::ImageView m_Icon
 

Detailed Description

Definition at line 38 of file default_skins.h.

Constructor & Destructor Documentation

◆ ButtonBaseSkin() [1/2]

Sgl::DefaultSkins::ButtonBaseSkin::ButtonBaseSkin ( Sgl::Button button,
const StaticStyle staticStyle,
const InteractionStyle idleStyle,
const InteractionStyle hoveredStyle,
const InteractionStyle pressedStyle 
)

Definition at line 112 of file default_skins.cpp.

◆ ButtonBaseSkin() [2/2]

Sgl::DefaultSkins::ButtonBaseSkin::ButtonBaseSkin ( const StaticStyle staticStyle,
const InteractionStyle idleStyle,
const InteractionStyle hoveredStyle,
const InteractionStyle pressedStyle 
)

Definition at line 102 of file default_skins.cpp.

Member Function Documentation

◆ applyInteractionStyle()

void Sgl::DefaultSkins::ButtonBaseSkin::applyInteractionStyle ( InteractionStyle::Type  type)

Definition at line 246 of file default_skins.cpp.

◆ applyStaticStyle()

void Sgl::DefaultSkins::ButtonBaseSkin::applyStaticStyle ( )
protected

Definition at line 217 of file default_skins.cpp.

◆ attach()

void Sgl::DefaultSkins::ButtonBaseSkin::attach ( Button button)
overridevirtual

Implements Sgl::BaseSkin< Button >.

Definition at line 123 of file default_skins.cpp.

◆ computePrefHeight()

int32_t Sgl::DefaultSkins::ButtonBaseSkin::computePrefHeight ( int32_t  width = -1) const
overridevirtual

Reimplemented from Sgl::Skin.

Definition at line 162 of file default_skins.cpp.

◆ computePrefWidth()

int32_t Sgl::DefaultSkins::ButtonBaseSkin::computePrefWidth ( int32_t  height = -1) const
overridevirtual

Reimplemented from Sgl::Skin.

Definition at line 170 of file default_skins.cpp.

◆ dispose()

void Sgl::DefaultSkins::ButtonBaseSkin::dispose ( )
overridevirtual

Should be called by Control when this skin is replaced.

Must do things like removing its Components from the Control's children list, detaching its Listeners from the Control's dispatcher.

Implements Sgl::Skin.

Definition at line 137 of file default_skins.cpp.

◆ getControl()

const Control * Sgl::DefaultSkins::ButtonBaseSkin::getControl ( ) const
overridevirtual

Implements Sgl::Skin.

Definition at line 159 of file default_skins.cpp.

◆ getMargin()

int32_t Sgl::DefaultSkins::ButtonBaseSkin::getMargin ( ) const
protected

Definition at line 212 of file default_skins.cpp.

◆ getModifiableControl()

Control * Sgl::DefaultSkins::ButtonBaseSkin::getModifiableControl ( )
overridevirtual

Implements Sgl::Skin.

Definition at line 160 of file default_skins.cpp.

◆ layoutChildren()

void Sgl::DefaultSkins::ButtonBaseSkin::layoutChildren ( )
overridevirtual

Reimplemented from Sgl::Skin.

Definition at line 182 of file default_skins.cpp.

◆ prerenderControl()

void Sgl::DefaultSkins::ButtonBaseSkin::prerenderControl ( )
overridevirtual

Reimplemented from Sgl::Skin.

Definition at line 146 of file default_skins.cpp.

Member Data Documentation

◆ m_Button

Sgl::Button* Sgl::DefaultSkins::ButtonBaseSkin::m_Button = nullptr
protected

Definition at line 105 of file default_skins.h.

◆ m_Handler

ButtonBaseSkinEventListener* Sgl::DefaultSkins::ButtonBaseSkin::m_Handler = nullptr
protected

Definition at line 106 of file default_skins.h.

◆ m_HoveredStyle

const InteractionStyle* Sgl::DefaultSkins::ButtonBaseSkin::m_HoveredStyle = nullptr
protected

Definition at line 102 of file default_skins.h.

◆ m_Icon

Sgl::ImageView Sgl::DefaultSkins::ButtonBaseSkin::m_Icon
protected

Definition at line 109 of file default_skins.h.

◆ m_IdleStyle

const InteractionStyle* Sgl::DefaultSkins::ButtonBaseSkin::m_IdleStyle = nullptr
protected

Definition at line 101 of file default_skins.h.

◆ m_PressedStyle

const InteractionStyle* Sgl::DefaultSkins::ButtonBaseSkin::m_PressedStyle = nullptr
protected

Definition at line 103 of file default_skins.h.

◆ m_StaticStyle

const StaticStyle* Sgl::DefaultSkins::ButtonBaseSkin::m_StaticStyle = nullptr
protected

Definition at line 99 of file default_skins.h.

◆ m_Text

Sgl::Text Sgl::DefaultSkins::ButtonBaseSkin::m_Text
protected

Definition at line 108 of file default_skins.h.


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