25 lines
957 B
C
25 lines
957 B
C
// widgetTextInput.h -- Text input widget API
|
|
#ifndef WIDGET_TEXTINPUT_H
|
|
#define WIDGET_TEXTINPUT_H
|
|
|
|
#include "../core/dvxWidget.h"
|
|
|
|
typedef struct {
|
|
WidgetT *(*create)(WidgetT *parent, int32_t maxLen);
|
|
WidgetT *(*password)(WidgetT *parent, int32_t maxLen);
|
|
WidgetT *(*masked)(WidgetT *parent, const char *mask);
|
|
WidgetT *(*textArea)(WidgetT *parent, int32_t maxLen);
|
|
} TextInputApiT;
|
|
|
|
static inline const TextInputApiT *dvxTextInputApi(void) {
|
|
static const TextInputApiT *sApi;
|
|
if (!sApi) { sApi = (const TextInputApiT *)wgtGetApi("textinput"); }
|
|
return sApi;
|
|
}
|
|
|
|
#define wgtTextInput(parent, maxLen) dvxTextInputApi()->create(parent, maxLen)
|
|
#define wgtPasswordInput(parent, maxLen) dvxTextInputApi()->password(parent, maxLen)
|
|
#define wgtMaskedInput(parent, mask) dvxTextInputApi()->masked(parent, mask)
|
|
#define wgtTextArea(parent, maxLen) dvxTextInputApi()->textArea(parent, maxLen)
|
|
|
|
#endif // WIDGET_TEXTINPUT_H
|