Base class for the different layers support by DumbDisplay; created with various layer creation methods of DumbDisplay, DumbDisplay::createLedGridLayer()
More...
#include <dumbdisplay.h>
|
void | border (float size, const String &color, const String &shape="flat", float extraSize=0) |
|
void | noBorder () |
|
void | padding (float size) |
|
void | padding (float left, float top, float right, float bottom) |
|
void | noPadding () |
|
void | margin (float size) |
|
void | margin (float left, float top, float right, float bottom) |
|
void | noMargin () |
|
void | backgroundColor (const String &color, int opacity=100) |
|
void | noBackgroundColor () |
|
void | visible (bool visible) |
|
void | transparent (bool transparent) |
|
void | disabled (bool disabled=true) |
|
void | opacity (int opacity) |
|
void | alpha (int alpha) |
|
void | blend (const String &color, int alpha=255, const String &mode="darken") |
|
void | noblend () |
|
void | clear () |
| clear the layer
|
|
void | flash () |
| normally used for "feedback" – flash the default way (layer + border)
|
|
void | flashArea (int x, int y) |
| normally used for "feedback" – flash the area (x, y) where the layer is clicked
|
|
void | explicitFeedback (int16_t x=0, int16_t y=0, const String &text="", DDFeedbackType type=CLICK, const String &option="") |
|
const String & | getLayerId () const |
|
void | setFeedbackHandler (DDFeedbackHandler handler, const String &autoFeedbackMethod="", const String &allowFeedbackTypes="") |
|
void | enableFeedback (const String &autoFeedbackMethod="", const String &allowFeedbackTypes="") |
|
void | disableFeedback () |
| disable "feedback"
|
|
const DDFeedback * | getFeedback () |
|
void | debugOnly (int i) |
| for debug use
|
|
DDFeedbackManager * | getFeedbackManager () const |
|
DDFeedbackHandler | getFeedbackHandler () const |
|
|
| DDLayer (int8_t layerId) |
|
void | _enableFeedback () |
|
|
String | layerId |
|
DDFeedbackManager * | pFeedbackManager |
|
DDFeedbackHandler | feedbackHandler |
|
|
int8_t | objectType |
| object type – DD_OBJECT_TYPE_LAYER or DD_OBJECT_TYPE_TUNNEL
|
|
String | customData |
| custom data
|
|
Base class for the different layers support by DumbDisplay; created with various layer creation methods of DumbDisplay, DumbDisplay::createLedGridLayer()
◆ alpha()
void DDLayer::alpha |
( |
int |
alpha | ) |
|
set layer's alpha channel; it combines with opacity
- Parameters
-
- Note
- layer property
◆ backgroundColor()
void DDLayer::backgroundColor |
( |
const String & |
color, |
|
|
int |
opacity = 100 |
|
) |
| |
set layer background color
- Parameters
-
color | DD_COLOR_XXX; DD_RGB_COLOR(...); can also be common "color name" |
opacity | background opacity (0 - 100); it combines with layer opacity and alpha |
- Note
- layer property
◆ blend()
void DDLayer::blend |
( |
const String & |
color, |
|
|
int |
alpha = 255 , |
|
|
const String & |
mode = "darken" |
|
) |
| |
blending with "film" of color over the layer
- Parameters
-
color | |
alpha | |
mode | xfermode "darken" / "lighten" / "screen" / "overlay" / "" (no xfermode) |
- Note
- layer property
◆ border()
void DDLayer::border |
( |
float |
size, |
|
|
const String & |
color, |
|
|
const String & |
shape = "flat" , |
|
|
float |
extraSize = 0 |
|
) |
| |
set border for each size
- Parameters
-
size | size unit is pixel:
- LcdLayer – each character is composed of pixels
- 7SegmentRowLayer – each 7-segment is composed of fixed 220 x 320 pixels
- LedGridLayer – a LED is considered as a pixel
|
color | DD_COLOR_XXX; DD_RGB_COLOR(...); can also be common "color name" |
shape | can be "flat", "hair", "round", "raised" or "sunken"
|
extraSize | simply add to size; however if shape is "round", it affects the "roundness" |
- Note
- layer property
◆ disabled()
void DDLayer::disabled |
( |
bool |
disabled = true | ) |
|
set layer disabled or not; if disabled, layer will not have "feedback", and its appearance will be like disabled
- Note
- layer property
◆ enableFeedback()
void DDLayer::enableFeedback |
( |
const String & |
autoFeedbackMethod = "" , |
|
|
const String & |
allowFeedbackTypes = "" |
|
) |
| |
rely on getFeedback() being called
- Parameters
-
autoFeedbackMethod |
- "" – no auto feedback flash (the default)
- "f" – flash the standard way (layer + border)
- "fl" – flash the layer
- "fa" – flash the area where the layer is clicked
- "fas" – flash the area (as a spot) where the layer is clicked
- "fs" – flash the spot where the layer is clicked (regardless of any area boundary)
|
allowedFeedbackType | can be comma-delimited list of "CLICK", "LONGPRESS" and "DOUBLECLICK" |
- Note
- if you will not be making use of "feedback", you can disable it by defining DD_NO_FEEDBACK in order to reduce footprint
◆ explicitFeedback()
void DDLayer::explicitFeedback |
( |
int16_t |
x = 0 , |
|
|
int16_t |
y = 0 , |
|
|
const String & |
text = "" , |
|
|
DDFeedbackType |
type = CLICK , |
|
|
const String & |
option = "" |
|
) |
| |
trigger explicit "feedback" to the layer (similar to implicit "feedback" when layer is clicked)
- Parameters
-
type | other than CLICK etc, can be CUSTOM (which is only possible with explicit "feedback"); |
option | can be "" / "keys" / "numkeys" / "confirm";
- in case of "keys" / "numkeys", input box will be popped up for user to enter the "text" of the "feedback"; and the "text" in the parameter will be the "hint"
- in case of "confirm", a confirmation dialog will be popped up with "text" as the message, and the "feedback" "text" will be "Yes" or "No";
|
- Note
- feedback must be enabled for this to work
◆ getFeedback()
get "feedback" DDFeedback
- Returns
- NULL if no pending "feedback"
◆ getFeedbackHandler()
◆ getFeedbackManager()
DDFeedbackManager * DDLayer::getFeedbackManager |
( |
| ) |
const |
|
inline |
◆ margin() [1/2]
void DDLayer::margin |
( |
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
◆ margin() [2/2]
void DDLayer::margin |
( |
float |
size | ) |
|
set margin for all sides
- Parameters
-
- Note
- layer property
◆ noBackgroundColor()
void DDLayer::noBackgroundColor |
( |
| ) |
|
set no layer background color
- Note
- layer property
◆ noblend()
void DDLayer::noblend |
( |
| ) |
|
no blending
- Note
- layer property
◆ noBorder()
void DDLayer::noBorder |
( |
| ) |
|
set no border
- Note
- layer property
◆ noMargin()
void DDLayer::noMargin |
( |
| ) |
|
set no margin
- Note
- layer property
◆ noPadding()
void DDLayer::noPadding |
( |
| ) |
|
set no padding
- Note
- layer property
◆ opacity()
void DDLayer::opacity |
( |
int |
opacity | ) |
|
set layer opacity percentage
- Parameters
-
- Note
- layer property
◆ padding() [1/2]
void DDLayer::padding |
( |
float |
left, |
|
|
float |
top, |
|
|
float |
right, |
|
|
float |
bottom |
|
) |
| |
set padding for each side; for unit, see border()
- Note
- layer property
◆ padding() [2/2]
void DDLayer::padding |
( |
float |
size | ) |
|
set padding for all sides
- Parameters
-
- Note
- layer property
◆ setFeedbackHandler()
void DDLayer::setFeedbackHandler |
( |
DDFeedbackHandler |
handler, |
|
|
const String & |
autoFeedbackMethod = "" , |
|
|
const String & |
allowFeedbackTypes = "" |
|
) |
| |
set explicit (and more responsive) "feedback" handler (and enable feedback)
- Parameters
-
- Note
- if you will not be making use of "feedback", you can disable it by defining DD_NO_FEEDBACK in order to reduce footprint
◆ transparent()
void DDLayer::transparent |
( |
bool |
transparent | ) |
|
set whether layer is transparent
- Note
- layer property
◆ visible()
void DDLayer::visible |
( |
bool |
visible | ) |
|
set whether layer visible (not visible means hidden)
- Note
- layer property