Home2L - C/C++ API  v1.2-2-ga4fe (2023-04-15)
Smart Tools for a Private Home
List of all members
CSlider Class Reference

Description

Slider widget.

Definition at line 996 of file ui_widgets.H.

#include "ui_widgets.H"

Inheritance diagram for CSlider:
Inheritance graph
[legend]

Public Member Functions

Setup...
void SetFormat (TColor _colSlider, TColor _colBarLower, TColor _colBarUpper, TColor _colBack=TRANSPARENT, int _sliderW=SLIDER_WIDTH, int _barH=SLIDER_BAR_HEIGHT)
 
void SetArea (SDL_Rect _area)
 
void SetInterval (int _val0, int _val1, bool _continuousUpdate=true)
 Set the logical range of values; Possible values for 'val' are then '_val0 <= val <= _val1'. More...
 
Read and set value...
int GetValue ()
 
void SetValue (int _val, bool callOnValueChanged=false)
 Set the current value; The passed value will be clipped to the allowed range.
 
Action callbacks...
virtual void OnValueChanged (int val, int lastVal)
 
void SetCbValueChanged (void(*_cbValueChanged)(class CSlider *, int, int, void *), void *_data=NULL)
 
Callbacks...
virtual SDL_Surface * GetSurface ()
 Get an up-to-date surface or 'NULL' if none is available.
 
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.
 

Protected Member Functions

Change management...
void ChangedSurface ()
 
void Changed ()
 
- 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.
 

Member Function Documentation

◆ SetInterval()

void CSlider::SetInterval ( int  _val0,
int  _val1,
bool  _continuousUpdate = true 
)

Set the logical range of values; Possible values for 'val' are then '_val0 <= val <= _val1'.

If '_continuousUpdate' is false, OnValueChanged() is only called when the slider is released. No action callback is invoked, even if the value has been clipped.


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