78 InputForm(InputBox * inputBox_)
83 void init(
uiApp * app_,
bool modalDialog_);
85 virtual void addControls() = 0;
86 virtual void calcRequiredSize() = 0;
87 virtual void finalize() { }
88 virtual void show() { }
90 void doExit(
int value);
95 static constexpr int BUTTONS = 6;
101 char const * titleText;
104 FontInfo
const * font;
115 uiWindow * controlToFocus;
126struct InputApp :
public uiApp {
127 InputApp(InputForm * form_) { form = form_; }
128 virtual void init() { form->init(
this,
false); }
140struct TextInputForm :
public InputForm {
141 TextInputForm(InputBox * inputBox_)
142 : InputForm(inputBox_)
147 void calcRequiredSize();
150 char const * labelText;
167struct MessageForm :
public InputForm {
168 MessageForm(InputBox * inputBox_)
169 : InputForm(inputBox_)
174 void calcRequiredSize();
177 char const * messageText;
188struct SelectForm :
public InputForm {
189 SelectForm(InputBox * inputBox_)
190 : InputForm(inputBox_)
195 void calcRequiredSize();
198 int countItems(
size_t * maxLength);
200 char const * messageText;
203 StringList * itemsList;
218struct ProgressForm :
public InputForm {
219 ProgressForm(InputBox * inputBox_)
220 : InputForm(inputBox_)
225 void calcRequiredSize();
228 bool update(
int percentage,
char const * format, ...);
230 static const int progressBarHeight = 16;
233 Delegate<ProgressForm*> execFunc;
246struct FileBrowserForm :
public InputForm {
247 static constexpr int SIDE_BUTTONS_WIDTH = 65;
248 static constexpr int SIDE_BUTTONS_HEIGHT = 18;
249 static constexpr int CTRLS_DIST = 4;
250 static constexpr int BROWSER_WIDTH = 150;
251 static constexpr int BROWSER_HEIGHT = 242;
252 static constexpr int MAXNAME = 32;
254 FileBrowserForm(InputBox * inputBox_)
255 : InputForm(inputBox_)
266 void calcRequiredSize();
269 char const * directory;
271 char * srcDirectory =
nullptr;
272 char * srcFilename =
nullptr;
287struct FileSelectorForm :
public InputForm {
288 static constexpr int CTRLS_DIST = 4;
289 static constexpr int BROWSER_WIDTH = 180;
290 static constexpr int BROWSER_HEIGHT = 150;
291 static constexpr int MINIMUM_EDIT_WIDTH = 64;
293 FileSelectorForm(InputBox * inputBox_)
294 : InputForm(inputBox_)
299 void calcRequiredSize();
302 char const * labelText;
303 char * inOutDirectory;
304 int maxDirectoryLength;
305 char * inOutFilename;
306 int maxFilenameLength;
343 void begin(
char const * modeline =
nullptr,
int viewPortWidth = -1,
int viewPortHeight = -1,
int displayColors = 16);
371 RGB888 backgroundColor() {
return m_backgroundColor; }
392 void setupButton(
int index,
char const * text,
char const * subItems =
nullptr,
int subItemsHeight = 80);
401 int minButtonsWidth() {
return m_minButtonsWidth; }
403 char const * buttonText(
int index) {
return m_buttonText[index]; }
405 char const * buttonSubItems(
int index) {
return m_buttonSubItems[index]; }
407 int buttonsSubItemsHeight(
int index) {
return m_buttonSubItemsHeight[index]; }
448 InputResult textInput(
char const * titleText,
char const * labelText,
char * inOutString,
int maxLength,
char const * buttonCancelText =
"Cancel",
char const * buttonOKText =
"OK",
bool passwordMode =
false);
472 InputResult message(
char const * titleText,
char const * messageText,
char const * buttonCancelText =
nullptr,
char const * buttonOKText =
"OK");
494 InputResult messageFmt(
char const * titleText,
char const * buttonCancelText,
char const * buttonOKText,
const char *format, ...);
516 int select(
char const * titleText,
char const * messageText,
char const * itemsText,
char separator =
';',
char const * buttonCancelText =
"Cancel",
char const * buttonOKText =
"OK");
546 InputResult select(
char const * titleText,
char const * messageText, StringList * items,
char const * buttonCancelText =
"Cancel",
char const * buttonOKText =
"OK");
566 int menu(
char const * titleText,
char const * messageText,
char const * itemsText,
char separator =
';');
590 int menu(
char const * titleText,
char const * messageText, StringList * items);
618 template <
typename Func>
620 ProgressForm form(
this);
621 form.execFunc = execFunc;
622 return progressBoxImpl(form, titleText, buttonCancelText, hasProgressBar,
width);
642 InputResult folderBrowser(
char const * titleText,
char const * directory =
"/",
char const * buttonOKText =
"Close");
670 InputResult fileSelector(
char const * titleText,
char const * messageText,
char * inOutDirectory,
int maxDirectoryLength,
char * inOutFilename,
int maxFilenameLength,
char const * buttonCancelText =
"Cancel",
char const * buttonOKText =
"OK");
684 InputResult progressBoxImpl(ProgressForm & form,
char const * titleText,
char const * buttonCancelText,
bool hasProgressBar,
int width);
686 void exec(InputForm * form);
692 uiApp * m_existingApp;
694 int16_t m_buttonSubItem;
695 char const * m_buttonText[InputForm::BUTTONS] = { };
696 char const * m_buttonSubItems[InputForm::BUTTONS] = { };
697 uint16_t m_buttonSubItemsHeight[InputForm::BUTTONS] = { };
699 int16_t m_minButtonsWidth;
Represents the base abstract class for bitmapped display controllers.
Represents the base class for paletted bitmapped controllers like VGA16Controller,...
Represents the whole application base class.
Shows and navigates Virtual Filesystem content.
A frame is a window with a title bar, maximize/minimize/close buttons and that is resizeable or movea...
A label is a static text UI element.
Shows a list of selectable string items.
A panel is used to contain and to group some controls.
A progress bar shows progress percentage using a colored bar.
Represents a text edit control.
This file contains FabGL library configuration settings, like number of supported colors,...
This file contains all classes related to FabGL Graphical User Interface.
This file contains some utility classes and functions.
InputResult
Result of InputBox dialogs helper class.
This file contains fabgl::PS2Controller definition.
Represents a 24 bit RGB color.
Contains details about the key event.
This file contains fabgl::VGAPalettedController definition.