Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
Public Member Functions | Protected Member Functions | List of all members
CWidgetFloorplan Class Reference

Description

Floorplan widget.

This is a mini view of the floorplan with 256x128 pixels.

Definition at line 129 of file floorplan.H.

#include "floorplan.H"

Inheritance diagram for CWidgetFloorplan:
Inheritance graph
[legend]

Public Member Functions

void Setup (int x0, int y0, class CFloorplan *_floorplan=NULL, TTicks _tInterval=FP_UPDATE_INTERVAL)
 Setup the widget.
 
void Activate (bool on=true)
 (De-)Activate automatic updates of the mini-floorplan. More...
 
- 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.
 
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.
 
- Public Member Functions inherited from CTimer
 CTimer (FTimerCallback *_func, void *_data=NULL, void *_creator=NULL)
 Construct with a callback function.
 
 CTimer (TTicks _time, TTicks _interval=0, FTimerCallback *_func=NULL, void *_data=NULL, void *_creator=NULL)
 Construct with a time/interval specification and eventually a callback function.
 
void Set (FTimerCallback *_func, void *_data=NULL, void *_creator=NULL)
 Setup timer without (re-)scheduling it.
 
void Set (TTicks _time, TTicks _interval=0, FTimerCallback *_func=NULL, void *_data=NULL, void *_creator=NULL)
 Setup and (re-)schedule timer. More...
 
void Reschedule (TTicks _time, TTicks _interval=0)
 Change a timer (like 'Set'), but leave function and creator unchanged.
 
void Clear ()
 Remove timer from the event list.
 
bool Pending ()
 Indicate whether the timer is pending and may be executed in the future. More...
 

Protected Member Functions

virtual void OnTime ()
 [T:timer] Virtual function called when the timer triggers.
 
virtual SDL_Surface * GetSurface ()
 Get an up-to-date surface or 'NULL' if none is available.
 
- 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.
 

Additional Inherited Members

- Static Public Member Functions inherited from CTimer
static void DelByCreator (void *_creator)
 Remove all timers created by _creator from the event list.
 

Member Function Documentation

◆ Activate()

void CWidgetFloorplan::Activate ( bool  on = true)

(De-)Activate automatic updates of the mini-floorplan.

This implies (un-)claiming the attached floorplan object. I.e., when active, an automatic timer runs 'CFloorplan::Iterate ()', and during activation, the floorplan's view level is set accordingly. This method should be called from the owning screen's Activate() method accordingly.


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