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,
152typedef 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) {
801enum 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) {
1042enum 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;
3008struct ModalWindowState {
3010 uiWindow * prevFocusedWindow;
3011 uiWindow * prevActiveWindow;
3012 uiWindow * prevModal;
3017typedef 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;
3547using fabgl::uiTimerHandle;
3563using 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...
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.
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.