4 #include "include/usbld.h"
6 // UI dialog item definition
8 // terminates the definition of dialog. Mandatory
14 // Break to next line, draw line splitter
16 // A spacer of a few pixels
19 UI_OK
, // Just a shortcut for BUTTON with OK label and id 1!
20 // Universal button (display's label, returns id on X)
22 // draw integer input box
24 // draw string input box
26 // draw password string input box
28 // bool value (On/Off). (Uses int value for storage)
30 // enumeration (multiple strings)
36 // UI item definition (for dialogues)
39 int id
; // id of this item
41 int hintId
; // shown if not NULL
42 int fixedWidth
; // 0: no fixed width, >0: width in pixels, <0: width in %
48 int stringId
; // if zero, the text is used
51 struct { // integer value
57 // if UI_ENUM is used, this contains enumeration values
58 const char **enumvalues
; // last one has to be NULL
61 struct { // fixed 32 character string
65 int (*handler
)(char *text
, int maxLen
);
77 int diaExecuteDialog(struct UIItem
*ui
, int uiId
, short inMenu
, int (*updater
)(int modified
));
78 void diaRenderUI(struct UIItem
*ui
, short inMenu
, struct UIItem
*cur
, int haveFocus
);
79 int diaShowKeyb(char* text
, int maxLen
);
80 void diaSetEnabled(struct UIItem
* ui
, int id
, int enabled
);
81 int diaGetInt(struct UIItem
* ui
, int id
, int *value
);
82 int diaSetInt(struct UIItem
* ui
, int id
, int value
);
83 int diaGetString(struct UIItem
* ui
, int id
, char *value
);
84 int diaSetString(struct UIItem
* ui
, int id
, const char *text
);
85 int diaGetColor(struct UIItem
* ui
, int id
, unsigned char *col
);
86 int diaSetColor(struct UIItem
* ui
, int id
, const unsigned char *col
);
87 int diaSetU64Color(struct UIItem
* ui
, int id
, u64 col
);
88 // set label pointer into the label's text (must be valid while rendering dialog)
89 int diaSetLabel(struct UIItem
* ui
, int id
, const char *text
);
90 // sets the current enum value list for given control
91 int diaSetEnum(struct UIItem
* ui
, int id
, const char **enumvals
);