Bind
C++ UI toolkit for Arduino
 
Loading...
Searching...
No Matches
BindSeekBar Class Reference

Represents a SeekBar object in the Bind framework. More...

#include <BindSeekBar.hpp>

Inheritance diagram for BindSeekBar:
BindView

Public Member Functions

 BindSeekBar ()
 Default constructor to create a BindSeekBar with default properties.
 
void setCallback (void(*callback)(int16_t))
 Set the Callback function for the SeekBar.
 
void invokeCallback (int16_t valueIn)
 
uint16_t getBytes (uint8_t *out) override
 Serialize the SeekBar data into a byte array.
 

Public Attributes

int16_t x
 X-coordinate position of the SeekBar.
 
int16_t y
 Y-coordinate position of the SeekBar.
 
uint8_t cmdId = 0
 Command identifier. See the notes for possible cmdId values.
 
int16_t value = 0
 Current value selected on the SeekBar.
 
int16_t maxValue = 100
 Maximum value of the SeekBar.
 
int16_t width = 200
 Width of the SeekBar.
 
- Public Attributes inherited from BindView
int16_t tag
 

Detailed Description

Represents a SeekBar object in the Bind framework.

BindSeekBar

The BindSeekBar class defines a SeekBar object that can be used in the Bind framework. SeekBars are typically used to select a value within a specified range (determined by maxValue) by dragging a slider. This class provides methods to configure SeekBars on the screen.

Note
Possible cmdId values for a BindView and corresponding effects:
  • BIND_ADD_OR_REFRESH_CMD: Adds the object to the canvas (screen) or refreshes the existing one.
  • BIND_DATA_ONLY_CMD: Refreshes the existing object without moving or resizing; updates data, such as text.
  • BIND_REMOVE_CMD: Removes the object from the canvas (screen).
  • BIND_DISABLE_CMD: Disables the object.
  • BIND_ENABLE_CMD: Enables the object.
  • BIND_HIDE_CMD: Hides the object.
  • BIND_VISIBLE_CMD: Restores the object's visibility.

Member Function Documentation

◆ getBytes()

uint16_t BindSeekBar::getBytes ( uint8_t *  out)
inlineoverridevirtual

Serialize the SeekBar data into a byte array.

This function serializes the SeekBar's properties and data into a byte array for communication with the Bind framework.

Note
This function should not be called directly by users, Bind calls it internally.
Parameters
outA pointer to the output byte array.
Returns
The number of bytes written to the output array.

Reimplemented from BindView.

◆ setCallback()

void BindSeekBar::setCallback ( void(*)(int16_t)  callback)
inline

Set the Callback function for the SeekBar.

This callback function is called when the SeekBar value is changed. The signature of the callback function should be like:

void callback(int16_t value)
int16_t value
Current value selected on the SeekBar.
Definition BindSeekBar.hpp:37
Parameters
callback

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