Home2L - C/C++ API v1.4-0-g38cc (2024-05-25)
Smart Tools for a Private Home
Public Member Functions | List of all members
CFlatButton Class Reference

Description

Flat Push-button widget.

This is a piece of text without a visible button, which behaves just like a push-button. Examples are the launch buttons on the home screen.

Definition at line 310 of file ui_widgets.H.

#include "ui_widgets.H"

Inheritance diagram for CFlatButton:
Inheritance graph
[legend]

Public Member Functions

virtual SDL_Surface * GetSurface ()
 Get an up-to-date surface or 'NULL' if none is available.
 
- Public Member Functions inherited from CButton
void Set (SDL_Rect _area, TColor _color=GREY)
 
void Set (SDL_Rect _area, TColor _color, SDL_Surface *_icon)
 
void Set (SDL_Rect _area, TColor _color, const char *text, TColor textColor=WHITE, TTF_Font *font=NULL)
 
void Set (SDL_Rect _area, TColor _color, SDL_Surface *_icon, const char *text, TColor textColor=WHITE, TTF_Font *font=NULL)
 
void SetArea (SDL_Rect _area)
 
void SetColor (TColor _colNorm)
 
void SetColor (TColor _colNorm, TColor _colDown)
 
void SetLabel (SDL_Surface *_icon, SDL_Rect *srcRect=NULL, bool takeOwnership=false)
 Set '_icon' as the button label. More...
 
void SetLabel (const char *text, TColor textColor=WHITE, TTF_Font *font=NULL)
 Set a text-only label.
 
void SetLabel (SDL_Surface *_icon, const char *text, TColor textColor=WHITE, TTF_Font *font=NULL)
 Set icon (and optionally text) label. The icon has its own color(s).
 
void SetLabel (TColor color, const char *iconName, const char *text=NULL, TTF_Font *font=NULL)
 Set icon (and optionally text) label. Both have the same color.
 
void ClearLabel ()
 Remove label.
 
void SetLabelAlignment (int _hAlign=0, int _vAlign=0)
 Set/change label alignment.
 
void SetHotkey (SDL_Keycode _hotkey)
 Set hotkey which activates the button callback.
 
virtual void OnPushed (bool longPush)
 
void SetCbPushed (FCbButtonPushed *cb, void *_data=NULL)
 
void * GetCbPushedData ()
 
virtual bool HandleEvent (SDL_Event *ev)
 Handle an event and return 'true' if the event was consumed and is to be ignored by later widgets.
 
- Public Member Functions inherited from CWidget
void Set (SDL_Surface *_surf, int x0, int y0)
 
void SetArea (SDL_Rect _area)
 
SDL_Rect * GetArea ()
 
class CScreenGetScreen ()
 
bool IsOnScreen (class CScreen *_screen)
 
class CCanvasGetCanvas ()
 
void LocalToScreenCoords (int *x, int *y)
 
void ScreenToLocalCoords (int *x, int *y)
 
void GetMouseEventPos (SDL_Event *ev, int *x, int *y)
 
void SetSurface (SDL_Surface *_surface)
 Set the static surface to display. The caller stays owner of surface, must not delete it as long as it is set here. The surface dimensions must match 'area'.
 
void GetRenderArea (SDL_Rect *ra)
 Transpose 'area' to the current screen coordinates to be passed to all SDL rendering functions.
 
virtual SDL_Texture * GetTexture ()
 Return an up-to-date texture. More...
 
void SetTextureBlendMode (SDL_BlendMode _sdlBlendMode)
 Set the blend mode for the texture created by the default implementation of GetTexture(). The default is SDL_BLENDMODE_NONE.
 
virtual void Render (SDL_Renderer *ren)
 Render this widget. More...
 
void ClearTexture ()
 Clear the internally cached texture object to save memory.
 

Additional Inherited Members

- Protected Member Functions inherited from CButton
void ChangedSurface ()
 
- Protected Member Functions inherited from CWidget
void ChangedSurface ()
 Mark (only) the surface as changed to trigger a redrawing at next occasion.
 
void Changed ()
 Anything may have changed: Trigger a redrawing at next occasion.
 

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