GUIslice  0.16.0
Embedded GUI in C
XKeyPad_Alpha.h
Go to the documentation of this file.
1 #ifndef _GUISLICE_EX_XKEYPAD_ALPHA_H_
2 #define _GUISLICE_EX_XKEYPAD_ALPHA_H_
3 
4 #include "GUIslice.h"
5 
6 #include "elem/XKeyPad.h"
7 
8 // =======================================================================
9 // GUIslice library extension: XKeyPad control (alphanumeric entry)
10 // - Paul Conti, Calvin Hass
11 // - https://www.impulseadventure.com/elec/guislice-gui.html
12 // - https://github.com/ImpulseAdventure/GUIslice
13 // =======================================================================
14 //
15 // The MIT License
16 //
17 // Copyright 2016-2020 Calvin Hass
18 //
19 // Permission is hereby granted, free of charge, to any person obtaining a copy
20 // of this software and associated documentation files (the "Software"), to deal
21 // in the Software without restriction, including without limitation the rights
22 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
23 // copies of the Software, and to permit persons to whom the Software is
24 // furnished to do so, subject to the following conditions:
25 //
26 // The above copyright notice and this permission notice shall be included in
27 // all copies or substantial portions of the Software.
28 //
29 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
30 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
31 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
32 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
33 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
34 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
35 // THE SOFTWARE.
36 //
37 // =======================================================================
39 
40 #ifdef __cplusplus
41 extern "C" {
42 #endif // __cplusplus
43 
44 
45 // ============================================================================
46 // Extended Element: KeyPad Alphanumeric entry
47 // - NOTE: The XKeyPad_Alpha extends the XKeyPad base element
48 // ============================================================================
49 
50 // Variant XKeyPad config structure
51 typedef struct {
52  // Common configuration
54 
55  // Variant-specific configuration
56 
57  // Variant-specific state
58 
60 
75  gslc_tsElemRef* gslc_ElemXKeyPadCreate_Alpha(gslc_tsGui* pGui, int16_t nElemId, int16_t nPage,
76  gslc_tsXKeyPad* pXData, int16_t nX0, int16_t nY0, int8_t nFontId, gslc_tsXKeyPadCfg_Alpha* pConfig);
77 
78 
87 
95  void gslc_ElemXKeyPadReset_Alpha(void* pvConfig);
96 
97 
111  void gslc_ElemXKeyPadTxtInit_Alpha(void* pvKeyPad);
112 
113 
126  void gslc_ElemXKeyPadLabelGet_Alpha(void* pvKeyPad,uint8_t nId,uint8_t nStrMax,char* pStr);
127 
128 
148  void gslc_ElemXKeyPadStyleGet_Alpha(void* pvKeyPad,uint8_t nId, bool* pbVisible, gslc_tsColor* pcolTxt, gslc_tsColor* pcolFrame, gslc_tsColor* pcolFill, gslc_tsColor* pcolGlow);
149 
150 
165  void gslc_ElemXKeyPadBtnEvt_Alpha(void* pvKeyPad,uint8_t nId,gslc_tsXKeyPadResult* psResult);
166 
167 // ============================================================================
168 
169 #ifdef __cplusplus
170 }
171 #endif // __cplusplus
172 #endif // _GUISLICE_EX_XKEYPAD_ALPHA_H_
173 
void gslc_ElemXKeyPadTxtInit_Alpha(void *pvKeyPad)
Callback function to update internal state whenever the text field is manually set via gslc_ElemXKeyP...
Definition: XKeyPad_Alpha.c:91
void gslc_ElemXKeyPadLabelGet_Alpha(void *pvKeyPad, uint8_t nId, uint8_t nStrMax, char *pStr)
Callback function to retrieve the label associated with a KeyPad button.
Definition: XKeyPad_Alpha.c:106
gslc_tsXKeyPadCfg_Alpha gslc_ElemXKeyPadCfgInit_Alpha()
Initialize the KeyPad config structure.
Definition: XKeyPad_Alpha.c:256
Configuration for the KeyPad.
Definition: XKeyPad.h:155
Extended data for KeyPad element.
Definition: XKeyPad.h:195
Element reference structure.
Definition: GUIslice.h:578
void gslc_ElemXKeyPadStyleGet_Alpha(void *pvKeyPad, uint8_t nId, bool *pbVisible, gslc_tsColor *pcolTxt, gslc_tsColor *pcolFrame, gslc_tsColor *pcolFill, gslc_tsColor *pcolGlow)
Callback function to retrieve the style associated with a KeyPad button.
Definition: XKeyPad_Alpha.c:151
Definition: XKeyPad_Alpha.h:51
void gslc_ElemXKeyPadReset_Alpha(void *pvConfig)
Callback function to reset internal state.
Definition: XKeyPad_Alpha.c:79
Return status for XKeyPad.
Definition: XKeyPad.h:94
void gslc_ElemXKeyPadBtnEvt_Alpha(void *pvKeyPad, uint8_t nId, gslc_tsXKeyPadResult *psResult)
Callback function activated when a key has been pressed.
Definition: XKeyPad_Alpha.c:197
GUI structure.
Definition: GUIslice.h:716
Color structure. Defines RGB triplet.
Definition: GUIslice.h:534
gslc_tsElemRef * gslc_ElemXKeyPadCreate_Alpha(gslc_tsGui *pGui, int16_t nElemId, int16_t nPage, gslc_tsXKeyPad *pXData, int16_t nX0, int16_t nY0, int8_t nFontId, gslc_tsXKeyPadCfg_Alpha *pConfig)
Create a KeyPad Element.
Definition: XKeyPad_Alpha.c:292
gslc_tsXKeyPadCfg sBaseCfg
KeyPad base config struct.
Definition: XKeyPad_Alpha.h:53