Home2L - C/C++ API v1.4-2-g83f4c (2025-08-23)
Smart Tools for a Private Home
Loading...
Searching...
No Matches
List of all members
CSlider Class Reference

Description

Macro to define a trampoline to another class.

<

The class must define a method:

void CLASS_NAME::METHOD_NAME (CSlider *slider, int val, int lastVal)

If the method is protected, the following line may be added to the class:

friend CB_NAME (CButton *, int, int, void *);

To the slider, the trampoline must be passed by a call like:

CSlider::SetCbValueChanged (CB_NAME, <class object pointer>)

Slider widget.

Definition at line 984 of file ui_widgets.H.

#include "ui_widgets.H"

Inheritance diagram for CSlider:
Inheritance graph
[legend]

Public Member Functions

Setup...
void SetInterval (int _val0, int _val1, bool _continuousUpdate=true)
 Set the logical range of values; Possible values for 'val' are then '_val0 <= val <= _val1'.
 
Read and set value...
void SetValue (int _val, bool callOnValueChanged=false)
 Set the current value; The passed value will be clipped to the allowed range.
 
Action callbacks...
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 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.
 
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.
 
void ClearTexture ()
 Clear the internally cached texture object to save memory.
 
- 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: