Jamba  3.2.0
pongasoft::VST::GUI::Views::TextButtonView Class Reference

#include <TextButtonView.h>

Inherits pongasoft::VST::GUI::Views::CustomViewAdapter< CTextButton >.

Classes

class  Creator
 

Public Types

using OnClickListener = std::function< void()>
 

Public Member Functions

virtual void click ()
 
void draw (CDrawContext *context) override
 
GradientPtr getDisabledGradient () const
 
CColor const & getDisabledTextColor () const
 
BitmapPtr getImage () const
 
bool getImageHasDisabledState () const
 
int32_t getTitleTag () const
 
virtual void onClick ()
 
void registerParameters () override
 
virtual void setDisabledGradient (GradientPtr iGradient)
 
virtual void setDisabledTextColor (CColor const &iColor)
 
void setImage (BitmapPtr iImage)
 
void setImageHasDisabledState (bool iValue)
 
void setMouseEnabled (bool bEnable) override
 
void setOnClickListener (OnClickListener iListener)
 
virtual void setTitleTag (int32_t iValue)
 
 TextButtonView (const CRect &iSize)
 
virtual void unClick ()
 
void valueChanged () override
 
- Public Member Functions inherited from pongasoft::VST::GUI::Views::CustomViewAdapter< CTextButton >
 CustomViewAdapter (const CRect &iSize, Args... args)
 
int32_t getCustomViewTag () const
 
void markDirty ()
 
void onParameterChange (ParamID iParamID) override
 
void setCustomViewTag (int32_t iTag)
 
- Public Member Functions inherited from pongasoft::VST::GUI::Params::GUIParamCxAware
bool __internal__registerRawVstControl (int32_t iParamID, ParamValue &oControlValue, GUIRawVstParam &oGUIRawVstParam)
 
template<typename T >
bool __internal__registerVstControl (int32_t iParamID, T &oControlValue, GUIVstParam< T > &oParam)
 
bool __internal__registerVstControl (int32_t iParamID, ParamValue &oControlValue, GUIRawVstParam &oParam)
 
virtual void initState (GUIState *iGUIState)
 
void invokeAll ()
 
GUIRawVstParam registerCallback (RawVstParam const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (VstParam< T > const &iParamDef, Parameters::ChangeCallback1< GUIVstParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
bool registerCallback (GUIJmbParam< T > &iParamDef, Parameters::ChangeCallback1< GUIJmbParam< T >> iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerJmbCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIJmbParam< T > registerJmbParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
bool registerParam (int32_t iParamID, GUIRawVstParam &oGUIRawVstParam)
 
GUIRawVstParam registerParam (RawVstParam const &iParamDef, bool iSubscribeToChanges=true)
 
template<typename T >
GUIVstParam< T > registerParam (VstParam< T > const &iParamDef, bool iSubscribeToChanges=true)
 
template<typename T >
GUIJmbParam< T > registerParam (GUIJmbParam< T > &iParamDef)
 
GUIRawVstParam registerRawVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
GUIRawVstParam registerRawVstParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIVstParam< bool > registerVstBooleanParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
template<typename T >
GUIVstParam< T > registerVstCallback (ParamID iParamID, Parameters::ChangeCallback iChangeCallback, bool iInvokeCallback=false)
 
template<typename T >
GUIVstParam< T > registerVstParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
GUIVstParam< PercentregisterVstPercentParam (ParamID iParamID, bool iSubscribeToChanges=true)
 
void unregisterAll ()
 
bool unregisterParam (ParamID iParamID)
 
GUIRawVstParam unregisterParam (GUIRawVstParam const &iParam)
 
template<typename T >
GUIVstParam< T > unregisterParam (GUIVstParam< T > const &iParam)
 
template<typename T >
GUIJmbParam< T > unregisterParam (GUIJmbParam< T > const &iParam)
 
virtual ~GUIParamCxAware ()
 

Protected Member Functions

virtual void drawButtonImage (CDrawContext *context)
 
virtual void drawButtonText (CDrawContext *context)
 

Protected Attributes

GradientSPtr fDisabledGradient
 
CColor fDisabledTextColor
 
BitmapSPtr fImage {nullptr}
 
bool fImageHasDisabledState {false}
 
OnClickListener fOnClickListener {}
 
GUIJmbParam< UTF8String > fTitle {}
 
int32_t fTitleTag {-1}
 
- Protected Attributes inherited from pongasoft::VST::GUI::Views::CustomViewAdapter< CTextButton >
int32_t fTag
 
- Protected Attributes inherited from pongasoft::VST::GUI::Params::GUIParamCxAware
std::unique_ptr< GUIParamCxMgrfParamCxMgr {}
 

Detailed Description

Extends the CTextButton view to:

  • have a (potentially) dynamic title tied to a parameter (fTitle via fTitleTag)
  • handle click conveniently (either inherit from this class and implement onClick, or provide an onClick listener)
  • optionally handle image (3 states : disabled / off / on)

Member Typedef Documentation

◆ OnClickListener

Constructor & Destructor Documentation

◆ TextButtonView()

pongasoft::VST::GUI::Views::TextButtonView::TextButtonView ( const CRect &  iSize)
inlineexplicit

Member Function Documentation

◆ click()

void pongasoft::VST::GUI::Views::TextButtonView::click ( )
virtual

◆ draw()

void pongasoft::VST::GUI::Views::TextButtonView::draw ( CDrawContext *  context)
override

◆ drawButtonImage()

void pongasoft::VST::GUI::Views::TextButtonView::drawButtonImage ( CDrawContext *  context)
protectedvirtual

Called when the button is simply rendered as an image (

See also
TextButtonView::getImage)

◆ drawButtonText()

void pongasoft::VST::GUI::Views::TextButtonView::drawButtonText ( CDrawContext *  context)
protectedvirtual

Called when the button should be drawn entirely (background + text + icon)

◆ getDisabledGradient()

GradientPtr pongasoft::VST::GUI::Views::TextButtonView::getDisabledGradient ( ) const
inline

◆ getDisabledTextColor()

CColor const& pongasoft::VST::GUI::Views::TextButtonView::getDisabledTextColor ( ) const
inline

◆ getImage()

BitmapPtr pongasoft::VST::GUI::Views::TextButtonView::getImage ( ) const
inline

If you want to replace the entire drawing with an image you can provide a 'button-image'.

If 'button-image-has-disabled-state' is selected then the image should contain the following 3 frames (each is of size image height / 3):

  • at y = 0, the button in its disabled state
  • at y = 1 * image height / 3, the button in its off state
  • at y = 2 * image height / 3, the button in its on state

If 'button-image-has-disabled-state' is NOT selected then the image should contain the following 2 frames (each is of size image height / 2):

  • at y = 0, the button in its off state
  • at y = image height / 2, the button in its on state

◆ getImageHasDisabledState()

bool pongasoft::VST::GUI::Views::TextButtonView::getImageHasDisabledState ( ) const
inline

If the image contains a disabled state (3 frames) or not (2 frames)

◆ getTitleTag()

int32_t pongasoft::VST::GUI::Views::TextButtonView::getTitleTag ( ) const
inline

◆ onClick()

void pongasoft::VST::GUI::Views::TextButtonView::onClick ( )
virtual

◆ registerParameters()

void pongasoft::VST::GUI::Views::TextButtonView::registerParameters ( )
overridevirtual

Subclasses should override this method to register each parameter

Reimplemented from pongasoft::VST::GUI::Params::GUIParamCxAware.

◆ setDisabledGradient()

virtual void pongasoft::VST::GUI::Views::TextButtonView::setDisabledGradient ( GradientPtr  iGradient)
inlinevirtual

◆ setDisabledTextColor()

virtual void pongasoft::VST::GUI::Views::TextButtonView::setDisabledTextColor ( CColor const &  iColor)
inlinevirtual

◆ setImage()

void pongasoft::VST::GUI::Views::TextButtonView::setImage ( BitmapPtr  iImage)
inline

◆ setImageHasDisabledState()

void pongasoft::VST::GUI::Views::TextButtonView::setImageHasDisabledState ( bool  iValue)
inline

◆ setMouseEnabled()

void pongasoft::VST::GUI::Views::TextButtonView::setMouseEnabled ( bool  bEnable)
override

◆ setOnClickListener()

void pongasoft::VST::GUI::Views::TextButtonView::setOnClickListener ( OnClickListener  iListener)
inline

◆ setTitleTag()

void pongasoft::VST::GUI::Views::TextButtonView::setTitleTag ( int32_t  iValue)
virtual

◆ unClick()

void pongasoft::VST::GUI::Views::TextButtonView::unClick ( )
virtual

◆ valueChanged()

void pongasoft::VST::GUI::Views::TextButtonView::valueChanged ( )
override

Member Data Documentation

◆ fDisabledGradient

GradientSPtr pongasoft::VST::GUI::Views::TextButtonView::fDisabledGradient
protected

◆ fDisabledTextColor

CColor pongasoft::VST::GUI::Views::TextButtonView::fDisabledTextColor
protected

◆ fImage

BitmapSPtr pongasoft::VST::GUI::Views::TextButtonView::fImage {nullptr}
protected

◆ fImageHasDisabledState

bool pongasoft::VST::GUI::Views::TextButtonView::fImageHasDisabledState {false}
protected

◆ fOnClickListener

OnClickListener pongasoft::VST::GUI::Views::TextButtonView::fOnClickListener {}
protected

◆ fTitle

GUIJmbParam<UTF8String> pongasoft::VST::GUI::Views::TextButtonView::fTitle {}
protected

◆ fTitleTag

int32_t pongasoft::VST::GUI::Views::TextButtonView::fTitleTag {-1}
protected

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