43#include "freertos/FreeRTOS.h"
44#include "freertos/queue.h"
45#include "freertos/timers.h"
98#define FABGLIB_UI_EVENTS_QUEUE_SIZE 300
112 UIEVT_GENPAINTEVENTS,
118 UIEVT_MOUSEBUTTONDOWN,
144 UIEVT_CHILDKILLFOCUS,
153typedef void * uiTimerHandle;
185 union uiEventParams {
187 uiMouseEventInfo mouse;
195 char const * debugMsg;
199 uiTimerHandle timerHandle;
205 uiFocusInfo focusInfo;
210 uiEvent() : dest(nullptr), id(UIEVT_NULL) { }
211 uiEvent(uiEvent
const & e) { dest = e.dest;
id = e.id; params = e.params; }
212 uiEvent(uiEvtHandler * dest_, uiEventID id_) : dest(dest_), id(id_) { }
313 virtual void processEvent(uiEvent * event);
325 void setApp(
uiApp * value) { m_app = value; }
378 void adaptToDisplayColors(
int displayColors) {
379 if (displayColors < 4) {
383 }
else if (displayColors < 16) {
401#define UIWINDOW_PARENTCENTER Point(-1000, -1000)
424 virtual void processEvent(uiEvent * event);
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);
710 uiWindowProps m_windowProps;
712 uiWindowState m_state;
718 uint8_t m_styleClassID;
720 uint8_t m_isMouseOver;
722 uint8_t m_parentProcessKbdEvents;
746 void adaptToDisplayColors(
int displayColors) {
747 if (displayColors < 4) {
756 }
else if (displayColors < 16) {
798enum class uiFrameItem : uint8_t {
838 virtual void processEvent(uiEvent * event);
845 char const *
title() {
return m_title; }
881 int getNextFreeFocusIndex() {
return m_nextFreeFocusIndex++; }
943 Size minWindowSize();
944 int titleBarHeight();
950 int paintButtons(
Rect const & bkgRect);
951 void movingCapturedMouse(
int mouseX,
int mouseY,
bool mouseIsDown);
952 void movingFreeMouse(
int mouseX,
int mouseY);
953 uiFrameItem getFrameItemAt(
int x,
int y);
954 Rect getBtnRect(
int buttonIndex);
955 void handleButtonsClick(
int x,
int y,
bool doubleClick);
956 void drawTextWithEllipsis(FontInfo
const * fontInfo,
int X,
int Y,
char const * text,
int maxX);
957 void drawReshapingBox(
Rect boxRect);
960 static constexpr int CORNERSENSE = 10;
970 uiFrameItem m_mouseDownFrameItem;
971 uiFrameItem m_mouseMoveFrameItem;
973 Rect m_lastReshapingBox;
975 int m_nextFreeFocusIndex;
977 Point m_mouseDownPos;
979 Rect m_savedScreenRect;
981 Size m_sizeAtMouseDown;
1012 virtual void processEvent(uiEvent * event);
1028 void adaptToDisplayColors(
int displayColors) {
1029 if (displayColors < 16) {
1039enum class uiScrollBarItem {
1074 virtual void processEvent(uiEvent * event);
1168 virtual void setScrollBar(
uiOrientation orientation,
int position,
int visible,
int range,
bool repaintScrollbar =
true);
1173 void paintScrollableControl();
1174 void paintScrollBars();
1175 Rect getVScrollBarRects(
Rect * topButton =
nullptr,
Rect * bottonButton =
nullptr,
Rect * bar =
nullptr);
1176 Rect getHScrollBarRects(
Rect * leftButton =
nullptr,
Rect * rightButton =
nullptr,
Rect * bar =
nullptr);
1177 uiScrollBarItem getItemAt(
int x,
int y);
1179 void handleFreeMouseMove(
int mouseX,
int mouseY);
1180 void handleCapturedMouseMove(
int mouseX,
int mouseY);
1181 void handleButtonsScroll();
1182 void handlePageScroll();
1186 int16_t m_HScrollBarPosition;
1187 int16_t m_HScrollBarVisible;
1188 int16_t m_HScrollBarRange;
1189 int16_t m_VScrollBarPosition;
1190 int16_t m_VScrollBarVisible;
1191 int16_t m_VScrollBarRange;
1197 int16_t m_mouseDownHScrollBarPosition;
1198 int16_t m_mouseDownVScrollBarPosition;
1200 uiScrollBarItem m_mouseOverItem;
1203 uiTimerHandle m_scrollTimer;
1205 Point m_mouseDownPos;
1228 void adaptToDisplayColors(
int displayColors) {
1229 if (displayColors < 4) {
1234 }
else if (displayColors < 16) {
1276 virtual void processEvent(uiEvent * event);
1285 void setText(
char const * value);
1292 char const *
text() {
return m_text; }
1354 void paintContent(
Rect const &
rect);
1389 void adaptToDisplayColors(
int displayColors) {
1390 if (displayColors < 16) {
1436 virtual void processEvent(uiEvent * event);
1459 void setText(
char const * value);
1475 char const *
text() {
return m_text; }
1494 virtual Rect getEditRect();
1498 void paintTextEdit();
1499 void paintContent();
1501 uint8_t
const * getCharInfo(
char ch,
int *
width);
1502 int charColumnToWindowX(
int col);
1504 void moveCursor(
int col,
int selCol);
1505 int getColFromMouseX(
int mouseX);
1507 void checkAllocatedSpace(
int requiredLength);
1508 void insert(
char c);
1510 int getWordPosAtLeft();
1511 int getWordPosAtRight();
1512 void selectWordAt(
int mouseX);
1535 CodePage
const * m_codepage;
1552 void adaptToDisplayColors(
int displayColors) {
1553 if (displayColors < 16) {
1578 virtual void processEvent(uiEvent * event);
1587 void setText(
char const * value);
1603 char const *
text() {
return m_text; }
1652 void adaptToDisplayColors(
int displayColors) {
1653 if (displayColors < 16) {
1675 virtual void processEvent(uiEvent * event);
1685 void setText(
char const * value);
1692 char const *
text() {
return m_text; }
1714 char const * m_text;
1730 void adaptToDisplayColors(
int displayColors) {
1731 if (displayColors < 16) {
1756 virtual void processEvent(uiEvent * event);
1805 void adaptToDisplayColors(
int displayColors) {
1806 if (displayColors < 16) {
1830 virtual void processEvent(uiEvent * event);
1858 void adaptToDisplayColors(
int displayColors) {
1859 if (displayColors < 16) {
1883 virtual void processEvent(uiEvent * event);
1906 void paintPaintBox();
1936 virtual void processEvent(uiEvent * event);
1954 void paintColorBox();
1977 void adaptToDisplayColors(
int displayColors) {
1978 if (displayColors < 4) {
2020 virtual void processEvent(uiEvent * event);
2057 void selectItem(
int index,
bool add =
false,
bool range =
false);
2109 int getItemAtMousePos(
int mouseX,
int mouseY);
2112 virtual int items_getCount() = 0;
2113 virtual void items_deselectAll() = 0;
2114 virtual void items_select(
int index,
bool select) = 0;
2115 virtual bool items_selected(
int index) = 0;
2116 virtual void items_draw(
int index,
const Rect & itemRect) = 0;
2120 void paintListBox();
2121 void mouseDownSelect(
int mouseX,
int mouseY);
2122 void mouseMoveSelect(
int mouseX,
int mouseY);
2124 void makeItemVisible(
int index);
2129 int m_firstVisibleItem;
2162 StringList &
items() {
return m_items; }
2166 virtual int items_getCount() {
return m_items.count(); }
2167 virtual void items_deselectAll() { m_items.deselectAll(); }
2168 virtual void items_select(
int index,
bool select) { m_items.select(index, select); }
2169 virtual bool items_selected(
int index) {
return m_items.selected(index); }
2170 virtual void items_draw(
int index,
const Rect & itemRect);
2244 void processEvent(uiEvent * event);
2261 virtual int items_getCount() {
return m_dir.
count(); }
2262 virtual void items_deselectAll() { m_selected = -1; }
2263 virtual void items_select(
int index,
bool select);
2264 virtual bool items_selected(
int index) {
return index == m_selected; }
2265 virtual void items_draw(
int index,
const Rect & itemRect);
2306 virtual int items_getCount() {
return 16; }
2307 virtual void items_deselectAll() { }
2308 virtual void items_select(
int index,
bool select) {
if (select) m_selectedColor = (
Color)index; }
2309 virtual bool items_selected(
int index) {
return index == (int)m_selectedColor; }
2310 virtual void items_draw(
int index,
const Rect & itemRect);
2315 Color m_selectedColor;
2329 void adaptToDisplayColors(
int displayColors) {
2330 if (displayColors < 16) {
2367 virtual void processEvent(uiEvent * event);
2419 virtual void updateEditControl() = 0;
2421 Size getEditControlSize();
2423 virtual void openListBox();
2424 virtual void closeListBox();
2425 void switchListBox();
2427 virtual void paintButton();
2428 Rect getButtonRect();
2430 uiWindow * getListBoxParent() {
return m_listBoxParent; }
2432 bool isListBoxOpen() {
return m_listBoxParent->
state().
visible; }
2439 int16_t m_listHeight;
2440 int16_t m_loseFocusBy;
2442 uiComboBoxProps m_comboBoxProps;
2516 uiControl * editcontrol() {
return m_textEdit; }
2517 void updateEditControl();
2569 uiControl * editcontrol() {
return m_colorBox; }
2570 void updateEditControl();
2592 void adaptToDisplayColors(
int displayColors) {
2593 if (displayColors < 4) {
2594 }
else if (displayColors < 16) {
2634 virtual void processEvent(uiEvent * event);
2693 void paintCheckBox();
2695 void unCheckGroup();
2701 int16_t m_groupIndex;
2720 void adaptToDisplayColors(
int displayColors) {
2721 if (displayColors < 4) {
2726 }
else if (displayColors < 16) {
2753 virtual void processEvent(uiEvent * event);
2812 void moveGripTo(
int x,
int y);
2822 int16_t m_ticksFrequency;
2838 void adaptToDisplayColors(
int displayColors) {
2839 if (displayColors < 4) {
2841 }
else if (displayColors < 8) {
2877 virtual void processEvent(uiEvent * event);
2903 void paintProgressBar();
2942 StringList &
items() {
return m_items; }
2944 virtual void processEvent(uiEvent * event);
2958 virtual int items_getCount() {
return m_items.count(); }
2959 virtual void items_deselectAll() { m_items.deselectAll(); }
2960 virtual void items_select(
int index,
bool select) { m_items.select(index, select); }
2961 virtual bool items_selected(
int index) {
return m_items.selected(index); }
2962 virtual void items_draw(
int index,
const Rect & itemRect);
3007 void processEvent(uiEvent * event);
3023 uiControl * editcontrol() {
return m_button; }
3024 void updateEditControl();
3025 virtual void openListBox();
3026 virtual void paintButton();
3041 virtual void setStyle(
uiObject *
object, uint32_t styleClassID) = 0;
3083struct ModalWindowState {
3085 uiWindow * prevFocusedWindow;
3086 uiWindow * prevActiveWindow;
3087 uiWindow * prevModal;
3092typedef pair<uiEvtHandler *, TimerHandle_t> uiTimerAssoc;
3146 void quit(
int exitCode);
3166 void postDebugMsg(
char const * msg);
3168 virtual void processEvent(uiEvent * event);
3246 void captureMouse(
uiWindow * window);
3386 void combineMouseMoveEvents(
bool value) { m_combineMouseMoveEvents = value; }
3388 void showCaret(uiWindow * window);
3390 void setCaret(
bool value);
3392 void setCaret(Point
const & pos);
3394 void setCaret(Rect
const & rect);
3407 uiTimerHandle
setTimer(uiEvtHandler * dest,
int periodMS);
3418 void killEvtHandlerTimers(uiEvtHandler * dest);
3434 void cleanWindowReferences(
uiWindow * window);
3474 uiMessageBoxResult inputBox(
char const * title,
char const * text,
char * inOutString,
int maxLength,
char const * button1Text,
char const * button2Text =
nullptr);
3491 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);
3496 virtual void init();
3512 Keyboard * keyboard() {
return m_keyboard; }
3514 Mouse * mouse() {
return m_mouse; }
3516 BitmappedDisplayController * displayController() {
return m_displayController; }
3518 int displayColors() {
return m_displayColors; }
3520 Canvas * canvas() {
return m_canvas; }
3543 bool getEvent(uiEvent * event,
int timeOutMS);
3544 bool peekEvent(uiEvent * event,
int timeOutMS);
3549 void preprocessEvent(uiEvent * event);
3550 void preprocessMouseEvent(uiEvent * event);
3551 void preprocessKeyboardEvent(uiEvent * event);
3552 void filterModalEvent(uiEvent * event);
3554 static void timerFunc(TimerHandle_t xTimer);
3556 static void asyncRunTask(
void * arg);
3558 void blinkCaret(
bool forceOFF =
false);
3559 void suspendCaret(
bool value);
3564 int m_displayColors;
3574 QueueHandle_t m_eventsQueue;
3590 bool m_combineMouseMoveEvents;
3596 uiTimerHandle m_caretTimer;
3597 int m_caretInvertState;
3599 int m_lastMouseUpTimeMS;
3600 Point m_lastMouseUpPos;
3604 int m_lastUserActionTimeMS;
3607 list<uiTimerAssoc> m_timers;
3610 SemaphoreHandle_t m_asyncRunWait;
3622using fabgl::uiTimerHandle;
3639using fabgl::uiStyle;
This file contains fabgl::Canvas definition.
Represents the base abstract class for bitmapped display controllers.
A class with a set of drawing methods.
int count()
Determines number of files in current directory.
char const * directory()
Determines absolute path of current directory.
FileBrowser allows basic file system operations (dir, mkdir, remove and rename)
The PS2 Keyboard controller class.
The PS2 Mouse controller class.
void killTimer(uiTimerHandle handle)
Kills a timer.
virtual void init()
Method to inherit to implement an application.
int run(BitmappedDisplayController *displayController, Keyboard *keyboard=nullptr, Mouse *mouse=nullptr)
Initializes application and executes the main event loop.
void resizeWindow(uiWindow *window, int width, int height)
Resizes a window.
bool postEvent(uiEvent const *event)
Places an event in the event queue and returns without waiting for the receiver to process the event.
void destroyWindow(uiWindow *window)
Destroys a window.
uiWindow * screenToWindow(Point &point)
Determines which window a point belongs to.
uiWindow * capturedMouseWindow()
Determines which window is capturing mouse.
int showModalWindow(uiWindow *window)
Makes a window visible and handles it has a modal window.
uiWindow * moveFocus(int delta)
Move focus to a control with current focus index plus a delta.
void showWindow(uiWindow *window, bool value)
Makes a window visible or invisible.
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.
void repaintRect(Rect const &rect)
Repaints a screen area.
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.
int endModalWindow(ModalWindowState *state)
Ends modal window processing.
uiWindow * setFocusedWindow(uiWindow *value)
Sets the focused window (control)
void enableKeyboardAndMouseEvents(bool value)
Enables or disables mouse and keyboard events.
void quit(int exitCode)
Terminates application and free resources.
ModalWindowState * initModalWindow(uiWindow *window)
Begins modal window processing.
uiWindow * activeWindow()
Gets a pointer to the currently active window.
uiTimerHandle setTimer(uiEvtHandler *dest, int periodMS)
Setups a timer.
int lastUserActionTime()
Returns time when last user action (mouse/keyboard) has been received, measured in milliseconds since...
uiAppProps & appProps()
Sets or gets application properties.
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.
uiStyle * style()
Gets current application controls style.
Delegate< uiTimerHandle > onTimer
Timer event delegate.
void joinAsyncRun()
Waits for runAsync termination.
uiFrame * rootWindow()
Gets a pointer to the root window.
void setStyle(uiStyle *value)
Sets application controls style.
void repaintWindow(uiWindow *window)
Repaints a window.
uiWindow * setActiveWindow(uiWindow *value)
Sets the active window.
void processEvents()
Processes all events in queue.
void minimizeFrame(uiFrame *frame, bool value)
Minimizes or restores a frame.
uiWindow * focusedWindow()
Gets the focused window (control)
void reshapeWindow(uiWindow *window, Rect const &rect)
Reshapes a window.
void moveWindow(uiWindow *window, int x, int y)
Moves a window.
uiApp & runAsync(BitmappedDisplayController *displayController, int taskStack=3000, Keyboard *keyboard=nullptr, Mouse *mouse=nullptr)
Initializes application and executes asynchronously the main event loop.
bool insertEvent(uiEvent const *event)
Inserts (first position) an event in the event queue and returns without waiting for the receiver to ...
void maximizeFrame(uiFrame *frame, bool value)
Maximizes or restores a frame.
bool processModalWindowEvents(ModalWindowState *state, int timeout)
Processes all messages from modal window.
Represents the whole application base class.
void setChecked(bool value)
Sets current checkbox or radiobutton checked status.
bool checked()
Determines whether the checkbox or radiobutton is checked.
Delegate onChange
Change event delegate.
void setGroupIndex(int value)
Sets radiobutton group index.
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 onClick
Mouse click event delegate.
uiCheckBoxStyle & checkBoxStyle()
Sets or gets checkbox style.
int groupIndex()
Determines radiobutton group index.
Represents a checkbox or a radiobutton.
Color color()
Gets current colorbox color.
void setColor(Color value)
Sets current colorbox color.
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.
A color box is a control that shows a single color.
uiColorComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
void selectColor(Color value)
Sets current selected color.
Color selectedColor()
Determines current selected color.
This is a combination of a color listbox and a colorbox.
Color color()
Currently selected color.
uiColorListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Shows a list of 16 colors, one selectable.
StringList & items()
A list of strings representing items of the combobox.
uiTextEditStyle & textEditStyle()
Sets or gets text edit style.
char const * text()
Gets current content 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.
uiTextEditProps & textEditProps()
Sets or gets text edit properties.
void setText(char const *value)
Replaces current text.
This is a combination of a listbox and a single-line editable textbox.
uiControl(uiWindow *parent, const Point &pos, const Size &size, bool visible, uint32_t styleClassID=0)
Creates an instance of the object.
This is the base class for all controls. A control can have focus and is not activable.
uiComboBoxProps & comboBoxProps()
Sets or gets combobox properties.
Delegate onChange
Change event delegate.
uiListBoxStyle & listBoxStyle()
Sets or gets listbox style.
uiComboBoxStyle & comboBoxStyle()
Sets or gets combobox style.
uiCustomComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible, uint32_t styleClassID)
Creates an instance of the object.
int selectedItem()
Represents currently selected item.
void selectItem(int index)
Selects an item.
This is a combination of a listbox and another component, base of all combobox components.
uiCustomListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
int firstSelectedItem()
Gets the first selected item.
Delegate onKillFocus
Kill focus event delegate.
void deselectAll()
Deselects all selected items.
int lastSelectedItem()
Gets the last selected item.
Delegate onChange
Change event delegate.
uiListBoxStyle & listBoxStyle()
Sets or gets listbox style.
Delegate onClick
Mouse click event delegate.
Delegate< uiKeyEventInfo const & > onKeyUp
Key-up event delegate.
uiListBoxProps & listBoxProps()
Sets or gets list box properties.
void selectItem(int index, bool add=false, bool range=false)
Selects a listbox item.
Delegate< uiKeyEventInfo const & > onKeyType
Key-type event delegate.
Delegate onDblClick
Mouse double click event delegate.
void setScrollBar(uiOrientation orientation, int position, int visible, int range, bool repaintScrollbar)
Sets scrollbar position, visible portion and range.
Shows generic a list of selectable items.
uiApp * app()
Determines the app that owns this object.
Base class of all UI elements that can receive events.
FileBrowser & content()
Contains current directory representation.
void changeDirectory(char const *path)
Changes current directory as relative path.
void setDirectory(char const *path)
Sets current directory as absolute path.
char const * filename()
Currently selected filename.
int count()
Determines number of files in current directory.
bool isDirectory()
Determines whether currently selected item is a directory.
void update()
Reloads current directory content and repaints.
char const * directory()
Determines current directory.
uiFileBrowser(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Shows and navigates Virtual Filesystem content.
void setTitle(char const *value)
Sets window title.
Delegate onHide
Hide window event delegate.
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.
Delegate onShow
Show window event delegate.
uiFrameProps & frameProps()
Sets or gets frame properties.
Delegate onPaint
Paint event delegate.
Delegate< uiKeyEventInfo const & > onKeyDown
Key-down event delegate.
void setTitleFmt(const char *format,...)
Sets window title as formatted text.
Delegate< uiKeyEventInfo const & > onKeyUp
Key-up event delegate.
Delegate onResize
Resize window event delegate.
uiFrameStyle & frameStyle()
Sets or gets frame style.
Delegate< uiTimerHandle > onTimer
Timer event delegate.
uiFrameState frameState()
Determines the frame state.
char const * title()
Determines the window title.
Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
A frame is a window with a title bar, maximize/minimize/close buttons and that is resizeable or movea...
Bitmap const * bitmap()
Gets image bitmap.
uiImageStyle & imageStyle()
Sets or gets image style.
void setBitmap(Bitmap const *bitmap)
Sets image bitmap.
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.
Image control to display a static bitmap.
char const * text()
Determines label text.
void setTextFmt(const char *format,...)
Sets label formatted text.
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.
Delegate onClick
Mouse click event delegate.
void update()
Updates the label content.
void setText(char const *value)
Sets label text.
uiLabelStyle & labelStyle()
Sets or gets label style.
A label is a static text UI element.
StringList & items()
A list of strings representing the listbox content.
uiListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Shows a list of selectable string items.
uiObjectType & objectType()
Determines the object type.
Base class of all UI elements like windows and controls.
Delegate< Rect const & > onPaint
Paint event delegate.
uiPaintBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
uiPaintBoxStyle & paintBoxStyle()
Sets or gets paintbox style.
A paintbox control allows applications to perform custom drawings providing uiPaintBox....
uiPanelStyle & panelStyle()
Sets or gets panel style.
uiPanel(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
A panel is used to contain and to group some controls.
void setPercentage(int value)
Sets percentage.
uiProgressBarStyle & progressBarStyle()
Sets or gets progress bar style.
uiProgressBarProps & progressBarProps()
Sets or gets progress bar properties.
uiProgressBar(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
A progress bar shows progress percentage using a colored bar.
void setup(int min, int max, int ticksFrequency)
Sets minimum, maximum position and ticks frequency.
void setPosition(int value)
Sets the slider position.
uiSliderStyle & sliderStyle()
Sets or gets slider style.
Delegate onChange
Slider changed event delegate.
uiSlider(uiWindow *parent, const Point &pos, const Size &size, uiOrientation orientation, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
int max()
Gets maximum position.
int position()
Determines slider position.
int min()
Gets minimum position.
A slider or track bar is a graphical control element with which a user may set a value by moving an i...
char const * text()
Determines label text.
uiStaticLabelStyle & labelStyle()
Sets or gets label style.
uiStaticLabel(uiWindow *parent, char const *text, const Point &pos, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
void update()
Updates the label content.
void setText(char const *value)
Sets label text.
A staticlabel is a light version of uiLabel (text must be static). uiStaticLabel has lower memory foo...
uiTextEditStyle & textEditStyle()
Sets or gets text edit style.
char const * text()
Gets current content of the text edit.
Delegate onChange
Text edit event delegate.
void setTextFmt(const char *format,...)
Replaces current text.
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.
uiTextEditProps & textEditProps()
Sets or gets text edit properties.
Delegate< uiKeyEventInfo const & > onKeyType
Key-type event delegate.
void setText(char const *value)
Replaces current text.
Represents a text edit control.
uiWindow * prev()
Gets previous sibling.
uiAnchors & anchors()
Allows to switch on or off anchors.
bool hasChildren()
Determines whether this window has children.
uiWindow * firstChild()
Gets first child.
bool isMouseOver()
Determines whether the mouse is over this window.
void bringOnTop()
Brings this window on top.
void exitModal(int modalResult)
Exits from a modal window.
Rect transformRect(Rect const &rect, uiWindow *baseWindow)
Transforms rectangle origins from current window to another one.
void setStyleClassID(uint16_t value)
Sets style class for this UI element.
uiWindow * parentFrame()
Determines the parent frame.
Point pos()
Determines the window position relative to parent window.
Rect rect(uiOrigin origin)
Determines the window bounding box.
uiWindow * next()
Gets next sibling.
void setFocusIndex(int value)
Sets the focus index (aka tab-index)
uiWindow * lastChild()
Gets last child.
uint16_t styleClassID()
Determines current style class for this UI element.
void setParentProcessKbdEvents(bool value)
Enables a child window to send keyboard events to its parent.
Size size()
Determines the window size.
uiWindowProps & windowProps()
Sets or gets window properties.
uiWindowStyle & windowStyle()
Sets or gets window style.
int focusIndex()
Determines the focus index (aka tab-index)
Size clientSize()
Determines the client area size.
bool isActiveWindow()
Determines wheter this window is the active window.
void repaint()
Repaints this window.
void bringAfter(uiWindow *insertionPoint)
Brings this window after another one.
bool hasFocus()
Determines whether this window or control has focus.
uiWindow * parent()
Determines the parent window.
uiWindow(uiWindow *parent, const Point &pos, const Size &size, bool visible, uint32_t styleClassID=0)
Creates an instance of the object.
Point clientPos()
Determines position of the client area.
uiWindowState state()
Determines the window state.
virtual Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
Base class for all visible UI elements (Frames and Controls)
This file contains codepages declarations.
This file contains fabgl::BitmappedDisplayController definition.
This file contains FabGL library configuration settings, like number of supported colors,...
This file contains some utility classes and functions.
uiButtonKind
Specifies the button kind.
uiMessageBoxResult
Return values from uiApp.messageBox() method.
uiHAlign
Text horizontal alignment.
uiOrientation
Item direction/orientation.
uiMessageBoxIcon
Icon displayed by the uiApp.messageBox() method.
Color
This enum defines named colors.
CursorName
This enum defines a set of predefined mouse cursors.
@ CursorPointerSimpleReduced
uiCheckBoxKind
Specifies the combobox behaviour.
VirtualKey
Represents each possible real or derived (SHIFT + real) key.
uiOrigin
Specifies window rectangle origin.
Describes mouse absolute position, scroll wheel delta and buttons status.
Represents the coordinate of a point.
Represents a 24 bit RGB color.
Represents a bidimensional size.
Contains anchors enable/disable switches.
uint16_t caretBlinkingTime
Properties of the application.
RGB888 mouseOverForegroundColor
RGB888 checkedBackgroundColor
RGB888 mouseOverBackgroundColor
Contains the checkbox style.
Properties of the combobox.
RGB888 buttonBackgroundColor
Contains the listbox style.
uint8_t hasMaximizeButton
uint8_t hasMinimizeButton
Specifies current frame state.
RGB888 mouseOverButtonColor
RGB888 activeTitleBackgroundColor
RGB888 mouseOverBackgroundButtonColor
FontInfo const * titleFont
RGB888 titleBackgroundColor
Contains the image style.
Contains details about the key event.
FontInfo const * textFont
Contains the label style.
uint8_t selectOnMouseOver
Properties of the list box.
FontInfo const * textFont
RGB888 selectedBackgroundColor
RGB888 focusedSelectedBackgroundColor
RGB888 focusedBackgroundColor
Contains the listbox style.
Contains details about the mouse event.
Specifies the object type.
Contains the paintbox style.
Contains the panel style.
Properties of the progress bar.
FontInfo const * textFont
Contains the progress bar style.
RGB888 mouseOverGripColor
Contains the slider style.
FontInfo const * textFont
Contains the label style.
Properties of the text edit.
FontInfo const * textFont
RGB888 mouseOverBackgroundColor
RGB888 focusedBackgroundColor
Sets or gets text edit style.
Contains some window options.
Specifies current window state.
RGB888 focusedBorderColor
uint8_t focusedBorderSize
Contains the window style.