43 #include "freertos/FreeRTOS.h" 44 #include "freertos/queue.h" 45 #include "freertos/timers.h" 97 #define FABGLIB_UI_EVENTS_QUEUE_SIZE 300 111 UIEVT_GENPAINTEVENTS,
117 UIEVT_MOUSEBUTTONDOWN,
143 UIEVT_CHILDKILLFOCUS,
152 typedef void * uiTimerHandle;
184 union uiEventParams {
186 uiMouseEventInfo mouse;
194 char const * debugMsg;
198 uiTimerHandle timerHandle;
204 uiFocusInfo focusInfo;
209 uiEvent() : dest(nullptr), id(UIEVT_NULL) { }
210 uiEvent(uiEvent
const & e) { dest = e.dest;
id = e.id; params = e.params; }
211 uiEvent(uiEvtHandler * dest_, uiEventID id_) : dest(dest_), id(id_) { }
311 virtual void processEvent(uiEvent * event);
323 void setApp(
uiApp * value) { m_app = value; }
376 void adaptToDisplayColors(
int displayColors) {
377 if (displayColors < 4) {
381 }
else if (displayColors < 16) {
399 #define UIWINDOW_PARENTCENTER Point(-1000, -1000) 422 virtual void processEvent(uiEvent * event);
424 void setCanvas(
Canvas * canvas) { m_canvas = canvas; }
645 Canvas * canvas() {
return m_canvas; }
676 void removeChild(
uiWindow * child,
bool freeChild =
true);
677 void moveChildOnTop(
uiWindow * child);
681 virtual Size minWindowSize() {
return Size(0, 0); }
683 void beginPaint(uiEvent * paintEvent, Rect
const & clippingRect);
685 void generatePaintEvents(Rect
const & paintRect);
686 void reshape(Rect
const & r);
704 uiWindowState m_state;
706 uiWindowProps m_windowProps;
714 int16_t m_focusIndex;
716 uint16_t m_styleClassID;
725 bool m_parentProcessKbdEvents;
749 void adaptToDisplayColors(
int displayColors) {
750 if (displayColors < 4) {
759 }
else if (displayColors < 16) {
801 enum class uiFrameItem : uint8_t {
841 virtual void processEvent(uiEvent * event);
848 char const *
title() {
return m_title; }
884 int getNextFreeFocusIndex() {
return m_nextFreeFocusIndex++; }
946 Size minWindowSize();
947 int titleBarHeight();
953 int paintButtons(
Rect const & bkgRect);
954 void movingCapturedMouse(
int mouseX,
int mouseY,
bool mouseIsDown);
955 void movingFreeMouse(
int mouseX,
int mouseY);
956 uiFrameItem getFrameItemAt(
int x,
int y);
957 Rect getBtnRect(
int buttonIndex);
958 void handleButtonsClick(
int x,
int y,
bool doubleClick);
959 void drawTextWithEllipsis(FontInfo
const * fontInfo,
int X,
int Y,
char const * text,
int maxX);
960 void drawReshapingBox(
Rect boxRect);
963 static constexpr
int CORNERSENSE = 10;
973 uiFrameItem m_mouseDownFrameItem;
974 uiFrameItem m_mouseMoveFrameItem;
976 Rect m_lastReshapingBox;
978 int m_nextFreeFocusIndex;
980 Point m_mouseDownPos;
982 Rect m_savedScreenRect;
984 Size m_sizeAtMouseDown;
1015 virtual void processEvent(uiEvent * event);
1031 void adaptToDisplayColors(
int displayColors) {
1032 if (displayColors < 16) {
1042 enum class uiScrollBarItem {
1077 virtual void processEvent(uiEvent * event);
1171 virtual void setScrollBar(
uiOrientation orientation,
int position,
int visible,
int range,
bool repaintScrollbar =
true);
1176 void paintScrollableControl();
1177 void paintScrollBars();
1178 Rect getVScrollBarRects(
Rect * topButton =
nullptr,
Rect * bottonButton =
nullptr,
Rect * bar =
nullptr);
1179 Rect getHScrollBarRects(
Rect * leftButton =
nullptr,
Rect * rightButton =
nullptr,
Rect * bar =
nullptr);
1180 uiScrollBarItem getItemAt(
int x,
int y);
1182 void handleFreeMouseMove(
int mouseX,
int mouseY);
1183 void handleCapturedMouseMove(
int mouseX,
int mouseY);
1184 void handleButtonsScroll();
1185 void handlePageScroll();
1189 int16_t m_HScrollBarPosition;
1190 int16_t m_HScrollBarVisible;
1191 int16_t m_HScrollBarRange;
1192 int16_t m_VScrollBarPosition;
1193 int16_t m_VScrollBarVisible;
1194 int16_t m_VScrollBarRange;
1200 int16_t m_mouseDownHScrollBarPosition;
1201 int16_t m_mouseDownVScrollBarPosition;
1203 uiScrollBarItem m_mouseOverItem;
1206 uiTimerHandle m_scrollTimer;
1208 Point m_mouseDownPos;
1231 void adaptToDisplayColors(
int displayColors) {
1232 if (displayColors < 4) {
1237 }
else if (displayColors < 16) {
1279 virtual void processEvent(uiEvent * event);
1288 void setText(
char const * value);
1295 char const *
text() {
return m_text; }
1357 void paintContent(
Rect const &
rect);
1392 void adaptToDisplayColors(
int displayColors) {
1393 if (displayColors < 16) {
1439 virtual void processEvent(uiEvent * event);
1462 void setText(
char const * value);
1478 char const *
text() {
return m_text; }
1497 virtual Rect getEditRect();
1501 void paintTextEdit();
1502 void paintContent();
1504 uint8_t
const * getCharInfo(
char ch,
int *
width);
1505 int charColumnToWindowX(
int col);
1507 void moveCursor(
int col,
int selCol);
1508 int getColFromMouseX(
int mouseX);
1510 void checkAllocatedSpace(
int requiredLength);
1511 void insert(
char c);
1513 int getWordPosAtLeft();
1514 int getWordPosAtRight();
1515 void selectWordAt(
int mouseX);
1538 CodePage
const * m_codepage;
1555 void adaptToDisplayColors(
int displayColors) {
1556 if (displayColors < 16) {
1581 virtual void processEvent(uiEvent * event);
1590 void setText(
char const * value);
1606 char const *
text() {
return m_text; }
1639 uint16_t m_textExtent;
1655 void adaptToDisplayColors(
int displayColors) {
1656 if (displayColors < 16) {
1681 virtual void processEvent(uiEvent * event);
1730 void adaptToDisplayColors(
int displayColors) {
1731 if (displayColors < 16) {
1755 virtual void processEvent(uiEvent * event);
1783 void adaptToDisplayColors(
int displayColors) {
1784 if (displayColors < 16) {
1808 virtual void processEvent(uiEvent * event);
1831 void paintPaintBox();
1861 virtual void processEvent(uiEvent * event);
1879 void paintColorBox();
1902 void adaptToDisplayColors(
int displayColors) {
1903 if (displayColors < 4) {
1945 virtual void processEvent(uiEvent * event);
1982 void selectItem(
int index,
bool add =
false,
bool range =
false);
2034 int getItemAtMousePos(
int mouseX,
int mouseY);
2037 virtual int items_getCount() = 0;
2038 virtual void items_deselectAll() = 0;
2039 virtual void items_select(
int index,
bool select) = 0;
2040 virtual bool items_selected(
int index) = 0;
2041 virtual void items_draw(
int index,
const Rect & itemRect) = 0;
2045 void paintListBox();
2046 void mouseDownSelect(
int mouseX,
int mouseY);
2047 void mouseMoveSelect(
int mouseX,
int mouseY);
2049 void makeItemVisible(
int index);
2054 int m_firstVisibleItem;
2087 StringList &
items() {
return m_items; }
2091 virtual int items_getCount() {
return m_items.count(); }
2092 virtual void items_deselectAll() { m_items.deselectAll(); }
2093 virtual void items_select(
int index,
bool select) { m_items.select(index, select); }
2094 virtual bool items_selected(
int index) {
return m_items.selected(index); }
2095 virtual void items_draw(
int index,
const Rect & itemRect);
2169 void processEvent(uiEvent * event);
2186 virtual int items_getCount() {
return m_dir.
count(); }
2187 virtual void items_deselectAll() { m_selected = -1; }
2188 virtual void items_select(
int index,
bool select);
2189 virtual bool items_selected(
int index) {
return index == m_selected; }
2190 virtual void items_draw(
int index,
const Rect & itemRect);
2231 virtual int items_getCount() {
return 16; }
2232 virtual void items_deselectAll() { }
2233 virtual void items_select(
int index,
bool select) {
if (select) m_selectedColor = (
Color)index; }
2234 virtual bool items_selected(
int index) {
return index == (int)m_selectedColor; }
2235 virtual void items_draw(
int index,
const Rect & itemRect);
2240 Color m_selectedColor;
2254 void adaptToDisplayColors(
int displayColors) {
2255 if (displayColors < 16) {
2292 virtual void processEvent(uiEvent * event);
2344 virtual void updateEditControl() = 0;
2346 Size getEditControlSize();
2348 virtual void openListBox();
2349 virtual void closeListBox();
2350 void switchListBox();
2352 virtual void paintButton();
2353 Rect getButtonRect();
2355 uiWindow * getListBoxParent() {
return m_listBoxParent; }
2357 bool isListBoxOpen() {
return m_listBoxParent->
state().
visible; }
2364 int16_t m_listHeight;
2365 int16_t m_loseFocusBy;
2367 uiComboBoxProps m_comboBoxProps;
2441 uiControl * editcontrol() {
return m_textEdit; }
2442 void updateEditControl();
2494 uiControl * editcontrol() {
return m_colorBox; }
2495 void updateEditControl();
2517 void adaptToDisplayColors(
int displayColors) {
2518 if (displayColors < 4) {
2519 }
else if (displayColors < 16) {
2559 virtual void processEvent(uiEvent * event);
2618 void paintCheckBox();
2620 void unCheckGroup();
2626 int16_t m_groupIndex;
2645 void adaptToDisplayColors(
int displayColors) {
2646 if (displayColors < 4) {
2651 }
else if (displayColors < 16) {
2678 virtual void processEvent(uiEvent * event);
2737 void moveGripTo(
int x,
int y);
2747 int16_t m_ticksFrequency;
2763 void adaptToDisplayColors(
int displayColors) {
2764 if (displayColors < 4) {
2766 }
else if (displayColors < 8) {
2802 virtual void processEvent(uiEvent * event);
2828 void paintProgressBar();
2867 StringList &
items() {
return m_items; }
2869 virtual void processEvent(uiEvent * event);
2883 virtual int items_getCount() {
return m_items.count(); }
2884 virtual void items_deselectAll() { m_items.deselectAll(); }
2885 virtual void items_select(
int index,
bool select) { m_items.select(index, select); }
2886 virtual bool items_selected(
int index) {
return m_items.selected(index); }
2887 virtual void items_draw(
int index,
const Rect & itemRect);
2932 void processEvent(uiEvent * event);
2948 uiControl * editcontrol() {
return m_button; }
2949 void updateEditControl();
2950 virtual void openListBox();
2951 virtual void paintButton();
2966 virtual void setStyle(
uiObject *
object, uint32_t styleClassID) = 0;
3008 struct ModalWindowState {
3010 uiWindow * prevFocusedWindow;
3011 uiWindow * prevActiveWindow;
3012 uiWindow * prevModal;
3017 typedef pair<uiEvtHandler *, TimerHandle_t> uiTimerAssoc;
3071 void quit(
int exitCode);
3091 void postDebugMsg(
char const * msg);
3093 virtual void processEvent(uiEvent * event);
3171 void captureMouse(
uiWindow * window);
3311 void combineMouseMoveEvents(
bool value) { m_combineMouseMoveEvents = value; }
3313 void showCaret(uiWindow * window);
3315 void setCaret(
bool value);
3317 void setCaret(Point
const & pos);
3319 void setCaret(Rect
const & rect);
3332 uiTimerHandle
setTimer(uiEvtHandler * dest,
int periodMS);
3343 void killEvtHandlerTimers(uiEvtHandler * dest);
3359 void cleanWindowReferences(
uiWindow * window);
3399 uiMessageBoxResult inputBox(
char const * title,
char const * text,
char * inOutString,
int maxLength,
char const * button1Text,
char const * button2Text =
nullptr);
3416 uiMessageBoxResult fileDialog(
char const * title,
char * inOutDirectory,
int maxDirNameSize,
char * inOutFilename,
int maxFileNameSize,
char const * buttonOKText,
char const * buttonCancelText,
int frameWidth = 200,
int frameHeight = 250);
3421 virtual void init();
3437 Keyboard * keyboard() {
return m_keyboard; }
3439 Mouse * mouse() {
return m_mouse; }
3441 BitmappedDisplayController * displayController() {
return m_displayController; }
3443 int displayColors() {
return m_displayColors; }
3445 Canvas * canvas() {
return m_canvas; }
3468 bool getEvent(uiEvent * event,
int timeOutMS);
3469 bool peekEvent(uiEvent * event,
int timeOutMS);
3474 void preprocessEvent(uiEvent * event);
3475 void preprocessMouseEvent(uiEvent * event);
3476 void preprocessKeyboardEvent(uiEvent * event);
3477 void filterModalEvent(uiEvent * event);
3479 static void timerFunc(TimerHandle_t xTimer);
3481 static void asyncRunTask(
void * arg);
3483 void blinkCaret(
bool forceOFF =
false);
3484 void suspendCaret(
bool value);
3489 int m_displayColors;
3499 QueueHandle_t m_eventsQueue;
3515 bool m_combineMouseMoveEvents;
3521 uiTimerHandle m_caretTimer;
3522 int m_caretInvertState;
3524 int m_lastMouseUpTimeMS;
3525 Point m_lastMouseUpPos;
3529 int m_lastUserActionTimeMS;
3532 list<uiTimerAssoc> m_timers;
3535 SemaphoreHandle_t m_asyncRunWait;
3547 using fabgl::uiTimerHandle;
3563 using fabgl::uiStyle;
RGB888 mouseOverGripColor
Represents a 24 bit RGB color.
uiLabelStyle & labelStyle()
Sets or gets label style.
uiWindow * setActiveWindow(uiWindow *value)
Sets the active window.
uiWindowStyle & windowStyle()
Sets or gets window style.
void selectItem(int index, bool add=false, bool range=false)
Selects a listbox item.
Delegate onChange
Change event delegate.
uiTextEditStyle & textEditStyle()
Sets or gets text edit style.
int selectedItem()
Represents currently selected item.
A class with a set of drawing methods.
uiComboBoxStyle & comboBoxStyle()
Sets or gets combobox style.
Shows a list of 16 colors, one selectable.
A frame is a window with a title bar, maximize/minimize/close buttons and that is resizeable or movea...
int lastSelectedItem()
Gets the last selected item.
Contains details about the key event.
Rect rect(uiOrigin origin)
Determines the window bounding box.
uiMessageBoxResult fileDialog(char const *title, char *inOutDirectory, int maxDirNameSize, char *inOutFilename, int maxFileNameSize, char const *buttonOKText, char const *buttonCancelText, int frameWidth=200, int frameHeight=250)
Displays a modal open/save dialog box.
ModalWindowState * initModalWindow(uiWindow *window)
Begins modal window processing.
uiTextEditStyle & textEditStyle()
Sets or gets text edit style.
uiTextEdit(uiWindow *parent, char const *text, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiOrientation
Item direction/orientation.
uiApp & runAsync(BitmappedDisplayController *displayController, int taskStack=3000, Keyboard *keyboard=nullptr, Mouse *mouse=nullptr)
Initializes application and executes asynchronously the main event loop.
void setScrollBar(uiOrientation orientation, int position, int visible, int range, bool repaintScrollbar)
Sets scrollbar position, visible portion and range.
int firstSelectedItem()
Gets the first selected item.
Represents the whole application base class.
uint16_t styleClassID()
Determines current style class for this UI element.
uiMessageBoxResult messageBox(char const *title, char const *text, char const *button1Text, char const *button2Text=nullptr, char const *button3Text=nullptr, uiMessageBoxIcon icon=uiMessageBoxIcon::Question)
Displays a modal dialog box with an icon, text and some buttons.
bool insertEvent(uiEvent const *event)
Inserts (first position) an event in the event queue and returns without waiting for the receiver to ...
Delegate onClick
Mouse click event delegate.
This is a combination of a listbox and another component, base of all combobox components.
uiStyle * style()
Gets current application controls style.
void setText(char const *value)
Sets label text.
int lastUserActionTime()
Returns time when last user action (mouse/keyboard) has been received, measured in milliseconds since...
char const * text()
Gets current content of the text edit.
void selectItem(int index)
Selects an item.
Base class for all visible UI elements (Frames and Controls)
void update()
Reloads current directory content and repaints.
FileBrowser & content()
Contains current directory representation.
int run(BitmappedDisplayController *displayController, Keyboard *keyboard=nullptr, Mouse *mouse=nullptr)
Initializes application and executes the main event loop.
char const * directory()
Determines current directory.
void setup(int min, int max, int ticksFrequency)
Sets minimum, maximum position and ticks frequency.
A color box is a control that shows a single color.
void setParentProcessKbdEvents(bool value)
Enables a child window to send keyboard events to its parent.
uiColorBox(uiWindow *parent, const Point &pos, const Size &size, Color color=Color::BrightWhite, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiColorComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Delegate< Rect const & > onPaint
Paint event delegate.
FontInfo const * textFont
Shows a list of selectable string items.
uiListBoxProps & listBoxProps()
Sets or gets list box properties.
Bitmap const * bitmap()
Gets image bitmap.
void bringAfter(uiWindow *insertionPoint)
Brings this window after another one.
Size size()
Determines the window size.
RGB888 mouseOverBackgroundButtonColor
uiPanelStyle & panelStyle()
Sets or gets panel style.
virtual void init()
Method to inherit to implement an application.
Contains the listbox style.
Contains the slider style.
uiWindow * parent()
Determines the parent window.
void setFocusIndex(int value)
Sets the focus index (aka tab-index)
int count()
Determines number of files in current directory.
uiAppProps & appProps()
Sets or gets application properties.
uiImage(uiWindow *parent, Bitmap const *bitmap, const Point &pos, const Size &size=Size(0, 0), bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
This file contains fabgl::BitmappedDisplayController definition.
Base class of all UI elements that can receive events.
Sets or gets text edit style.
void quit(int exitCode)
Terminates application and free resources.
Contains the paintbox style.
Color
This enum defines named colors.
uiLabel(uiWindow *parent, char const *text, const Point &pos, const Size &size=Size(0, 0), bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiColorListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
int showModalWindow(uiWindow *window)
Makes a window visible and handles it has a modal window.
uiFrameState frameState()
Determines the frame state.
Properties of the combobox.
Delegate< uiKeyEventInfo const & > onKeyType
Key-type event delegate.
int position()
Determines slider position.
uiProgressBarProps & progressBarProps()
Sets or gets progress bar properties.
The PS2 Keyboard controller class.
Represents the base abstract class for bitmapped display controllers.
Color color()
Currently selected color.
This file contains fabgl::Canvas definition.
Size clientSize()
Determines the client area size.
uiWindow * lastChild()
Gets last child.
A panel is used to contain and to group some controls.
Represents a checkbox or a radiobutton.
Specifies current frame state.
VirtualKey
Represents each possible real or derived (SHIFT + real) key.
RGB888 mouseOverForegroundColor
void moveWindow(uiWindow *window, int x, int y)
Moves a window.
void destroyWindow(uiWindow *window)
Destroys a window.
uint16_t caretBlinkingTime
Delegate onResize
Resize window event delegate.
Contains the progress bar style.
uiCheckBoxKind
Specifies the combobox behaviour.
void setTitleFmt(const char *format,...)
Sets window title as formatted text.
Color selectedColor()
Determines current selected color.
void setStyleClassID(uint16_t value)
Sets style class for this UI element.
void update()
Updates the label content.
void setColor(Color value)
Sets current colorbox color.
uiWindowProps & windowProps()
Sets or gets window properties.
Properties of the application.
void setTextFmt(const char *format,...)
Sets label formatted text.
uiCustomComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible, uint32_t styleClassID)
Creates an instance of the object.
void setStyle(uiStyle *value)
Sets application controls style.
bool processModalWindowEvents(ModalWindowState *state, int timeout)
Processes all messages from modal window.
RGB888 focusedSelectedBackgroundColor
This file contains codepages declarations.
void setTextFmt(const char *format,...)
Replaces current text.
uiButtonKind
Specifies the button kind.
uiWindow * parentFrame()
Determines the parent frame.
Contains the label style.
uiMessageBoxResult inputBox(char const *title, char const *text, char *inOutString, int maxLength, char const *button1Text, char const *button2Text=nullptr)
Displays a modal dialog box with a text, a text edit and up to two buttons.
Describes mouse absolute position, scroll wheel delta and buttons status.
void deselectAll()
Deselects all selected items.
uiFrameProps & frameProps()
Sets or gets frame properties.
Delegate onChange
Change event delegate.
uiCustomListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
void minimizeFrame(uiFrame *frame, bool value)
Minimizes or restores a frame.
uiTextEditProps & textEditProps()
Sets or gets text edit properties.
RGB888 buttonBackgroundColor
int groupIndex()
Determines radiobutton group index.
uiFrameStyle & frameStyle()
Sets or gets frame style.
void maximizeFrame(uiFrame *frame, bool value)
Maximizes or restores a frame.
uiListBoxStyle & listBoxStyle()
Sets or gets listbox style.
Represents the coordinate of a point.
Delegate onClick
Mouse click event delegate.
uiAnchors & anchors()
Allows to switch on or off anchors.
Contains the window style.
void setPosition(int value)
Sets the slider position.
This is a combination of a color listbox and a colorbox.
This file contains some utility classes and functions.
Delegate< uiTimerHandle > onTimer
Timer event delegate.
RGB888 mouseOverBackgroundColor
uiSliderStyle & sliderStyle()
Sets or gets slider style.
uiSlider(uiWindow *parent, const Point &pos, const Size &size, uiOrientation orientation, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiPaintBoxStyle & paintBoxStyle()
Sets or gets paintbox style.
uiFrame(uiWindow *parent, char const *title, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiControl(uiWindow *parent, const Point &pos, const Size &size, bool visible, uint32_t styleClassID=0)
Creates an instance of the object.
uiOrigin
Specifies window rectangle origin.
Rect transformRect(Rect const &rect, uiWindow *baseWindow)
Transforms rectangle origins from current window to another one.
Specifies the object type.
Contains some window options.
Color color()
Gets current colorbox color.
Delegate onClick
Mouse click event delegate.
Delegate< uiKeyEventInfo const & > onKeyDown
Key-down event delegate.
uiPaintBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
char const * filename()
Currently selected filename.
uiMessageBoxResult
Return values from uiApp.messageBox() method.
uiWindow * screenToWindow(Point &point)
Determines which window a point belongs to.
uint8_t focusedBorderSize
Delegate< uiTimerHandle > onTimer
Timer event delegate.
uiHAlign
Text horizontal alignment.
Delegate onDblClick
Mouse double click event delegate.
Represents a text edit control.
uiWindow * prev()
Gets previous sibling.
void repaintWindow(uiWindow *window)
Repaints a window.
uiTextEditProps & textEditProps()
Sets or gets text edit properties.
Contains details about the mouse event.
RGB888 mouseOverButtonColor
CursorName
This enum defines a set of predefined mouse cursors.
int focusIndex()
Determines the focus index (aka tab-index)
RGB888 mouseOverBackgroundColor
FontInfo const * textFont
uiWindow * firstChild()
Gets first child.
void setPercentage(int value)
Sets percentage.
uiCheckBoxStyle & checkBoxStyle()
Sets or gets checkbox style.
char const * directory()
Determines absolute path of current directory.
uint8_t hasMaximizeButton
void reshapeWindow(uiWindow *window, Rect const &rect)
Reshapes a window.
FontInfo const * titleFont
StringList & items()
A list of strings representing items of the combobox.
RGB888 activeTitleBackgroundColor
uiWindow * setFocusedWindow(uiWindow *value)
Sets the focused window (control)
This file contains FabGL library configuration settings, like number of supported colors...
Base class of all UI elements like windows and controls.
void setBitmap(Bitmap const *bitmap)
Sets image bitmap.
Delegate< uiKeyEventInfo const & > onKeyUp
Key-up event delegate.
A paintbox control allows applications to perform custom drawings providing uiPaintBox.onPaint delegate. A paintbox can have horizontal and vertical scrollbars.
StringList & items()
A list of strings representing the listbox content.
Point pos()
Determines the window position relative to parent window.
virtual Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
void setChecked(bool value)
Sets current checkbox or radiobutton checked status.
Represents a bidimensional size.
uiCheckBox(uiWindow *parent, const Point &pos, const Size &size, uiCheckBoxKind kind=uiCheckBoxKind::CheckBox, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Delegate onKillFocus
Kill focus event delegate.
uiComboBoxProps & comboBoxProps()
Sets or gets combobox properties.
uiObjectType & objectType()
Determines the object type.
bool hasChildren()
Determines whether this window has children.
RGB888 focusedBorderColor
Delegate onShow
Show window event delegate.
uiTimerHandle setTimer(uiEvtHandler *dest, int periodMS)
Setups a timer.
bool isDirectory()
Determines whether currently selected item is a directory.
int max()
Gets maximum position.
uiApp * app()
Determines the app that owns this object.
Contains the listbox style.
FontInfo const * textFont
void resizeWindow(uiWindow *window, int width, int height)
Resizes a window.
int endModalWindow(ModalWindowState *state)
Ends modal window processing.
bool postEvent(uiEvent const *event)
Places an event in the event queue and returns without waiting for the receiver to process the event...
A label is a static text UI element.
void processEvents()
Processes all events in queue.
uiProgressBar(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Properties of the text edit.
uiComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
void bringOnTop()
Brings this window on top.
Contains the image style.
uiWindowState state()
Determines the window state.
uiPanel(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
void setGroupIndex(int value)
Sets radiobutton group index.
Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
uiWindow * moveFocus(int delta)
Move focus to a control with current focus index plus a delta.
RGB888 checkedBackgroundColor
void repaintRect(Rect const &rect)
Repaints a screen area.
This is the base class for all controls. A control can have focus and is not activable.
RGB888 titleBackgroundColor
Properties of the progress bar.
bool hasFocus()
Determines whether this window or control has focus.
uiWindow * capturedMouseWindow()
Determines which window is capturing mouse.
Properties of the list box.
uint8_t selectOnMouseOver
char const * text()
Gets current content of the text edit.
void repaint()
Repaints this window.
uiFileBrowser(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Contains anchors enable/disable switches.
uiProgressBarStyle & progressBarStyle()
Sets or gets progress bar style.
char const * title()
Determines the window title.
RGB888 selectedBackgroundColor
Delegate onPaint
Paint event delegate.
RGB888 focusedBackgroundColor
Shows generic a list of selectable items.
uiWindow * next()
Gets next sibling.
Delegate onHide
Hide window event delegate.
void setDirectory(char const *path)
Sets current directory as absolute path.
uiListBoxStyle & listBoxStyle()
Sets or gets listbox style.
A progress bar shows progress percentage using a colored bar.
Delegate onChange
Change event delegate.
void setText(char const *value)
Replaces current text.
void selectColor(Color value)
Sets current selected color.
uiWindow * activeWindow()
Gets a pointer to the currently active window.
A slider or track bar is a graphical control element with which a user may set a value by moving an i...
Point clientPos()
Determines position of the client area.
uiWindow(uiWindow *parent, const Point &pos, const Size &size, bool visible, uint32_t styleClassID=0)
Creates an instance of the object.
uiFrame * rootWindow()
Gets a pointer to the root window.
Specifies current window state.
void setText(char const *value)
Replaces current text.
Delegate< uiKeyEventInfo const & > onKeyUp
Key-up event delegate.
This is a combination of a listbox and a single-line editable textbox.
Shows and navigates Virtual Filesystem content.
The PS2 Mouse controller class.
uiImageStyle & imageStyle()
Sets or gets image style.
int count()
Determines number of files in current directory.
Contains the checkbox style.
Delegate onChange
Text edit event delegate.
bool isMouseOver()
Determines whether the mouse is over this window.
void joinAsyncRun()
Waits for runAsync termination.
void showWindow(uiWindow *window, bool value)
Makes a window visible or invisible.
uint8_t hasMinimizeButton
RGB888 focusedBackgroundColor
void exitModal(int modalResult)
Exits from a modal window.
Contains the panel style.
uiWindow * focusedWindow()
Gets the focused window (control)
bool isActiveWindow()
Determines wheter this window is the active window.
void changeDirectory(char const *path)
Changes current directory as relative path.
char const * text()
Determines label text.
void setTitle(char const *value)
Sets window title.
uiMessageBoxIcon
Icon displayed by the uiApp.messageBox() method.
FontInfo const * textFont
void enableKeyboardAndMouseEvents(bool value)
Enables or disables mouse and keyboard events.
bool checked()
Determines whether the checkbox or radiobutton is checked.
int min()
Gets minimum position.
Image control to display a static bitmap.
void killTimer(uiTimerHandle handle)
Kills a timer.
Delegate< uiKeyEventInfo const & > onKeyType
Key-type event delegate.
FileBrowser allows basic file system operations (dir, mkdir, remove and rename)
Delegate onChange
Slider changed event delegate.