FabGL
ESP32 Display Controller and Graphics Library
fabui.h
Go to the documentation of this file.
1 /*
2  Created by Fabrizio Di Vittorio (fdivitto2013@gmail.com) - <http://www.fabgl.com>
3  Copyright (c) 2019-2020 Fabrizio Di Vittorio.
4  All rights reserved.
5 
6  This file is part of FabGL Library.
7 
8  FabGL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  FabGL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with FabGL. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 
23 #pragma once
24 
25 
34 #include <stdint.h>
35 #include <stddef.h>
36 
37 #include "freertos/FreeRTOS.h"
38 #include "freertos/queue.h"
39 #include "freertos/timers.h"
40 
41 #include "fabglconf.h"
42 #include "fabutils.h"
43 #include "displaycontroller.h"
44 #include "canvas.h"
45 #include "fabfonts.h"
46 
47 
48 
49 /*
50 
51  *uiObject
52  *uiEvtHandler
53  *uiApp
54  *uiWindow
55  *uiFrame
56  *uiControl
57  *uiButton
58  *uiLabel
59  *uiImage
60  *uiPanel
61  *uiTextEdit
62  *uiScrollableControl
63  *uiPaintBox
64  *uiCustomListBox
65  *uiListBox
66  *uiColorListBox
67  *uiFileBrowser
68  uiMemoEdit
69  *uiCheckBox
70  *uiCustomComboBox
71  *uiComboBox
72  *uiColorComboBox
73  uiMenu
74  uiGauge
75  *uiSlider
76  uiSpinButton
77  *uiColorBox
78 
79 */
80 
81 
82 namespace fabgl {
83 
84 
85 
86 // increase in case of garbage between windows!
87 #define FABGLIB_UI_EVENTS_QUEUE_SIZE 256
88 
89 
90 
92 // uiEvent
93 
94 enum uiEventID {
95  UIEVT_NULL,
96  UIEVT_DEBUGMSG,
97  UIEVT_APPINIT,
98  UIEVT_GENPAINTEVENTS,
99  UIEVT_PAINT,
100  UIEVT_ACTIVATE,
101  UIEVT_DEACTIVATE,
102  UIEVT_MOUSEMOVE,
103  UIEVT_MOUSEWHEEL,
104  UIEVT_MOUSEBUTTONDOWN,
105  UIEVT_MOUSEBUTTONUP,
106  UIEVT_SETPOS,
107  UIEVT_SETSIZE,
108  UIEVT_RESHAPEWINDOW,
109  UIEVT_MOUSEENTER,
110  UIEVT_MOUSELEAVE,
111  UIEVT_MAXIMIZE, // Request for maximize
112  UIEVT_MINIMIZE, // Request for minimize
113  UIEVT_RESTORE, // Restore from UIEVT_MAXIMIZE or UIEVT_MINIMIZE
114  UIEVT_SHOW,
115  UIEVT_HIDE,
116  UIEVT_SETFOCUS,
117  UIEVT_KILLFOCUS,
118  UIEVT_KEYDOWN,
119  UIEVT_KEYUP,
120  UIEVT_TIMER,
121  UIEVT_CLICK,
122  UIEVT_DBLCLICK,
123  UIEVT_EXITMODAL,
124  UIEVT_DESTROY,
125  UIEVT_CLOSE, // Request to close (frame Close button)
126  UIEVT_QUIT, // Quit the application
127  UIEVT_CREATE,
128  UIEVT_CHILDSETFOCUS, // a UIEVT_SETFOCUS has been sent to a child
129  UIEVT_CHILDKILLFOCUS, // a UIEVT_KILLFOCUS has been sent to a child
130 };
131 
132 
133 class uiEvtHandler;
134 class uiApp;
135 class uiWindow;
136 
137 
138 typedef void * uiTimerHandle;
139 
140 
144  uint8_t LALT : 1;
145  uint8_t RALT : 1;
146  uint8_t CTRL : 1;
147  uint8_t SHIFT : 1;
148  uint8_t GUI : 1;
149 };
150 
151 
155  uint8_t changedButton;
156 };
157 
158 
159 struct uiFocusInfo {
160  uiWindow * oldFocused;
161  uiWindow * newFocused;
162 };
163 
164 
165 struct uiEvent {
166  uiEvtHandler * dest;
167  uiEventID id;
168 
169  union uiEventParams {
170  // event: UIEVT_MOUSEMOVE, UIEVT_MOUSEWHEEL, UIEVT_MOUSEBUTTONDOWN, UIEVT_MOUSEBUTTONUP, UIEVT_CLICK, UIEVT_DBLCLICK
171  uiMouseEventInfo mouse;
172  // event: UIEVT_PAINT, UIEVT_GENPAINTEVENTS, UIEVT_RESHAPEWINDOW
173  Rect rect;
174  // event: UIEVT_SETPOS
175  Point pos;
176  // event: UIEVT_SETSIZE
177  Size size;
178  // event: UIEVT_DEBUGMSG
179  char const * debugMsg;
180  // event: UIEVT_KEYDOWN, UIEVT_KEYUP
181  uiKeyEventInfo key;
182  // event: UIEVT_TIMER
183  uiTimerHandle timerHandle;
184  // event: UIEVT_EXITMODAL
185  int modalResult;
186  // event: UIEVT_QUIT
187  int exitCode;
188  // event: UIEVT_SETFOCUS, UIEVT_KILLFOCUS, UIEVT_CHILDKILLFOCUS, UIEVT_CHILDSETFOCUS
189  uiFocusInfo focusInfo;
190 
191  uiEventParams() { }
192  } params;
193 
194  uiEvent() : dest(nullptr), id(UIEVT_NULL) { }
195  uiEvent(uiEvent const & e) { dest = e.dest; id = e.id; params = e.params; }
196  uiEvent(uiEvtHandler * dest_, uiEventID id_) : dest(dest_), id(id_) { }
197 };
198 
199 
200 
204 enum class uiOrientation {
205  Vertical,
206  Horizontal,
207 };
208 
209 
210 
212 // uiObject
213 
214 
216 struct uiObjectType {
217  uint32_t uiApp : 1;
218  uint32_t uiEvtHandler : 1;
219  uint32_t uiWindow : 1;
220  uint32_t uiFrame : 1;
221  uint32_t uiControl : 1;
222  uint32_t uiScrollableControl : 1;
223  uint32_t uiButton : 1;
224  uint32_t uiTextEdit : 1;
225  uint32_t uiLabel : 1;
226  uint32_t uiImage : 1;
227  uint32_t uiPanel : 1;
228  uint32_t uiPaintBox : 1;
229  uint32_t uiCustomListBox : 1;
230  uint32_t uiListBox : 1;
231  uint32_t uiFileBrowser : 1;
232  uint32_t uiComboBox : 1;
233  uint32_t uiCheckBox : 1;
234  uint32_t uiSlider : 1;
235  uint32_t uiColorListBox : 1;
236  uint32_t uiCustomComboBox : 1;
237  uint32_t uiColorBox : 1;
238  uint32_t uiColorComboBox : 1;
239 
243  { }
244 };
245 
246 
248 class uiObject {
249 
250 public:
251 
252  uiObject();
253 
254  virtual ~uiObject();
255 
261  uiObjectType & objectType() { return m_objectType; }
262 
263 private:
264  uiObjectType m_objectType;
265 };
266 
267 
268 
270 // uiEvtHandler
271 
272 
274 class uiEvtHandler : public uiObject {
275 
276 public:
277 
279 
280  virtual ~uiEvtHandler();
281 
282  virtual void processEvent(uiEvent * event);
283 
289  uiApp * app() { return m_app; }
290 
291 
292 protected:
293 
294  void setApp(uiApp * value) { m_app = value; }
295 
296 
297 private:
298 
299  uiApp * m_app;
300 };
301 
302 
303 
305 // uiWindow
306 
310 enum class uiOrigin {
311  Screen,
312  Parent,
313  Window,
314 };
315 
316 
319  uint8_t visible : 1;
320  uint8_t maximized : 1;
321  uint8_t minimized : 1;
322  uint8_t active : 1;
323 };
324 
325 
328  uint8_t activable : 1;
329  uint8_t focusable : 1;
331  uiWindowProps() :
332  activable(true),
333  focusable(false)
334  { }
335 };
336 
337 
341  RGB888 borderColor = RGB888(128, 128, 128);
342  RGB888 activeBorderColor = RGB888(128, 128, 255);
344  uint8_t borderSize = 3;
345  uint8_t focusedBorderSize = 1;
346 };
347 
348 
350 struct uiAnchors {
351  uint8_t left : 1;
352  uint8_t top : 1;
353  uint8_t right : 1;
354  uint8_t bottom : 1;
356  uiAnchors() : left(true), top(true), right(false), bottom(false) { }
357 };
358 
359 
360 #define UIWINDOW_PARENTCENTER Point(-1000, -1000)
361 
362 
364 class uiWindow : public uiEvtHandler {
365 
366 friend class uiApp;
367 
368 public:
369 
379  uiWindow(uiWindow * parent, const Point & pos, const Size & size, bool visible, uint32_t styleClassID = 0);
380 
381  virtual ~uiWindow();
382 
383  virtual void processEvent(uiEvent * event);
384 
385  void setCanvas(Canvas * canvas) { m_canvas = canvas; }
386 
394  uiWindow * next() { return m_next; }
395 
403  uiWindow * prev() { return m_prev; }
404 
410  uiWindow * firstChild() { return m_firstChild; }
411 
417  uiWindow * lastChild() { return m_lastChild; }
418 
424  bool hasChildren() { return m_firstChild != nullptr; }
425 
429  void bringOnTop();
430 
436  void bringAfter(uiWindow * insertionPoint);
437 
445  Point pos() { return m_pos; }
446 
452  Point clientPos();
453 
461  Size size() { return m_size; }
462 
468  Size clientSize();
469 
479  Rect rect(uiOrigin origin);
480 
488  virtual Rect clientRect(uiOrigin origin);
489 
497  uiWindowState state() { return m_state; }
498 
504  uiWindowProps & windowProps() { return m_windowProps; }
505 
511  uiWindowStyle & windowStyle() { return m_windowStyle; }
512 
518  uiWindow * parent() { return m_parent; }
519 
525  uiWindow * parentFrame();
526 
532  Point mouseDownPos() { return m_mouseDownPos; }
533 
542  Rect transformRect(Rect const & rect, uiWindow * baseWindow);
543 
549  void repaint(Rect const & rect);
550 
554  void repaint();
555 
563  bool isMouseOver() { return m_isMouseOver; }
564 
572  void exitModal(int modalResult);
573 
581  bool hasFocus();
582 
588  uiAnchors & anchors() { return m_anchors; }
589 
595  void setFocusIndex(int value) { m_focusIndex = value; }
596 
604  int focusIndex() { return m_focusIndex; }
605 
606  Canvas * canvas() { return m_canvas; }
607 
613  void setStyleClassID(uint32_t value) { m_styleClassID = value; }
614 
620  uint32_t styleClassID() { return m_styleClassID; }
621 
629  void setParentProcessKbdEvents(bool value) { m_parentProcessKbdEvents = value; }
630 
631 
632  // Delegates
633 
639  Delegate<> onClick;
640 
647  Delegate<> onDblClick;
648 
649 
650 protected:
651 
652  void addChild(uiWindow * child);
653  void insertAfter(uiWindow * child, uiWindow * underlyingChild);
654  void freeChildren();
655  void removeChild(uiWindow * child, bool freeChild = true);
656  void moveChildOnTop(uiWindow * child);
657  void moveAfter(uiWindow * child, uiWindow * underlyingChild);
658  bool isChild(uiWindow * window);
659 
660  Size sizeAtMouseDown() { return m_sizeAtMouseDown; }
661  Point posAtMouseDown() { return m_posAtMouseDown; }
662 
663  virtual Size minWindowSize() { return Size(0, 0); }
664 
665  void beginPaint(uiEvent * paintEvent, Rect const & clippingRect);
666 
667  void generatePaintEvents(Rect const & paintRect);
668  void reshape(Rect const & r);
669 
670  bool isFocusable();
671 
672 private:
673 
674  void paintWindow();
675 
676  uiWindow * findChildWithFocusIndex(int focusIndex, int * maxIndex);
677 
678 
679  uiWindow * m_parent;
680 
681  Canvas * m_canvas;
682 
683  Point m_pos;
684  Size m_size;
685 
686  // saved screen rect before Maximize or Minimize
687  Rect m_savedScreenRect;
688 
689  uiWindowState m_state;
690 
691  uiWindowProps m_windowProps;
692 
693  uiWindowStyle m_windowStyle;
694 
695  Point m_mouseDownPos; // mouse position when mouse down event has been received
696 
697  Point m_posAtMouseDown; // used to resize
698  Size m_sizeAtMouseDown; // used to resize
699 
700  bool m_isMouseOver; // true after mouse entered, false after mouse left
701 
702  uiAnchors m_anchors;
703 
704  int16_t m_focusIndex; // -1 = doesn't partecipate to focus trip
705 
706  // double linked list, order is: bottom (first items) -> up (last items)
707  uiWindow * m_next;
708  uiWindow * m_prev;
709  uiWindow * m_firstChild;
710  uiWindow * m_lastChild;
711 
712  uint32_t m_styleClassID;
713 
714  // if true parent processes keyboard events
715  bool m_parentProcessKbdEvents;
716 };
717 
718 
719 
721 // uiFrame
722 
723 
727 struct uiFrameStyle {
728  RGB888 backgroundColor = RGB888(255, 255, 255);
729  RGB888 titleBackgroundColor = RGB888(128, 128, 128);
731  RGB888 titleColor = RGB888(0, 0, 0);
732  RGB888 activeTitleColor = RGB888(255, 255, 255);
733  FontInfo const * titleFont = &FONT_std_12;
734  RGB888 buttonColor = RGB888(64, 64, 64);
735  RGB888 activeButtonColor = RGB888(255, 255, 255);
737  RGB888 mouseOverButtonColor = RGB888(255, 255, 255);
738 };
739 
740 
744 struct uiFrameProps {
745  uint8_t resizeable : 1;
746  uint8_t moveable : 1;
747  uint8_t hasCloseButton : 1;
748  uint8_t hasMaximizeButton : 1;
749  uint8_t hasMinimizeButton : 1;
750  uint8_t fillBackground : 1;
752  uiFrameProps() :
753  resizeable(true),
754  moveable(true),
755  hasCloseButton(true),
756  hasMaximizeButton(true),
757  hasMinimizeButton(true),
758  fillBackground(true)
759  { }
760 };
761 
762 
763 enum class uiFrameItem : uint8_t {
764  None,
765  MoveArea,
766  TopLeftResize,
767  TopCenterResize,
768  TopRightResize,
769  CenterLeftResize,
770  CenterRightResize,
771  BottomLeftResize,
772  BottomCenterResize,
773  BottomRightResize,
774  CloseButton,
775  MaximizeButton,
776  MinimizeButton,
777 };
778 
779 
785 class uiFrame : public uiWindow {
786 
787 public:
788 
799  uiFrame(uiWindow * parent, char const * title, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
800 
801  virtual ~uiFrame();
802 
803  virtual void processEvent(uiEvent * event);
804 
810  char const * title() { return m_title; }
811 
819  void setTitle(char const * value);
820 
828  void setTitleFmt(const char *format, ...);
829 
835  uiFrameStyle & frameStyle() { return m_frameStyle; }
836 
842  uiFrameProps & frameProps() { return m_frameProps; }
843 
844  Rect clientRect(uiOrigin origin);
845 
846  int getNextFreeFocusIndex() { return m_nextFreeFocusIndex++; }
847 
848 
849  // Delegates
850 
856  Delegate<> onShow;
857 
863  Delegate<> onHide;
864 
870  Delegate<> onResize;
871 
878  Delegate<uiTimerHandle> onTimer;
879 
883  Delegate<uiKeyEventInfo> onKeyDown;
884 
888  Delegate<uiKeyEventInfo> onKeyUp;
889 
893  Delegate<> onPaint;
894 
895 
896 protected:
897 
898  Size minWindowSize();
899  int titleBarHeight();
900  Rect titleBarRect();
901 
902 private:
903 
904  void paintFrame();
905  int paintButtons(Rect const & bkgRect);
906  void movingCapturedMouse(int mouseX, int mouseY, bool mouseIsDown);
907  void movingFreeMouse(int mouseX, int mouseY);
908  uiFrameItem getFrameItemAt(int x, int y);
909  Rect getBtnRect(int buttonIndex);
910  void handleButtonsClick(int x, int y, bool doubleClick);
911  void drawTextWithEllipsis(FontInfo const * fontInfo, int X, int Y, char const * text, int maxX);
912  void drawReshapingBox(Rect boxRect);
913 
914 
915  static constexpr int CORNERSENSE = 10;
916 
917 
918  uiFrameStyle m_frameStyle;
919 
920  uiFrameProps m_frameProps;
921 
922  char * m_title;
923  int m_titleLength;
924 
925  uiFrameItem m_mouseDownFrameItem; // frame item on mouse down
926  uiFrameItem m_mouseMoveFrameItem; // frame item on mouse move
927 
928  Rect m_lastReshapingBox; // last reshaping box painted by drawReshapingBox(), (0,0,0,0) if there isn't any
929 
930  int m_nextFreeFocusIndex;
931 
932 };
933 
934 
935 
937 // uiControl
938 
939 
943 class uiControl : public uiWindow {
944 
945 public:
946 
956  uiControl(uiWindow * parent, const Point & pos, const Size & size, bool visible, uint32_t styleClassID = 0);
957 
958  virtual ~uiControl();
959 
960  virtual void processEvent(uiEvent * event);
961 };
962 
963 
964 
966 // uiScrollableControl
967 
968 
974  uint8_t scrollBarSize = 11;
975 };
976 
977 
978 enum class uiScrollBarItem {
979  None,
980  LeftButton,
981  RightButton,
982  TopButton,
983  BottomButton,
984  HBar,
985  VBar,
986  PageUp,
987  PageDown,
988  PageLeft,
989  PageRight,
990 };
991 
992 
997 
998 public:
999 
1009  uiScrollableControl(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1010 
1011  virtual ~uiScrollableControl();
1012 
1013  virtual void processEvent(uiEvent * event);
1014 
1015  Rect clientRect(uiOrigin origin);
1016 
1022  uiScrollableControlStyle & scrollableControlStyle() { return m_scrollableControlStyle; }
1023 
1032  int HScrollBarPos() { return m_HScrollBarPosition; }
1033 
1041  int HScrollBarVisible() { return m_HScrollBarVisible; }
1042 
1051  int HScrollBarRange() { return m_HScrollBarRange; }
1052 
1061  int VScrollBarPos() { return m_VScrollBarPosition; }
1062 
1070  int VScrollBarVisible() { return m_VScrollBarVisible; }
1071 
1080  int VScrollBarRange() { return m_VScrollBarRange; }
1081 
1082 
1083  // Delegates
1084 
1089 
1094 
1095 
1096 protected:
1097 
1107  virtual void setScrollBar(uiOrientation orientation, int position, int visible, int range, bool repaintScrollbar = true);
1108 
1109 
1110 private:
1111 
1112  void paintScrollableControl();
1113  void paintScrollBars();
1114  Rect getVScrollBarRects(Rect * topButton = nullptr, Rect * bottonButton = nullptr, Rect * bar = nullptr);
1115  Rect getHScrollBarRects(Rect * leftButton = nullptr, Rect * rightButton = nullptr, Rect * bar = nullptr);
1116  uiScrollBarItem getItemAt(int x, int y);
1117  void repaintScrollBar(uiOrientation orientation);
1118  void handleFreeMouseMove(int mouseX, int mouseY);
1119  void handleCapturedMouseMove(int mouseX, int mouseY);
1120  void handleButtonsScroll();
1121  void handlePageScroll();
1122 
1123  uiScrollableControlStyle m_scrollableControlStyle;
1124 
1125  int16_t m_HScrollBarPosition;
1126  int16_t m_HScrollBarVisible; // it means the "visible" area (how big is the bar)
1127  int16_t m_HScrollBarRange;
1128  int16_t m_VScrollBarPosition;
1129  int16_t m_VScrollBarVisible; // it means the "visible" area (how big is the bar)
1130  int16_t m_VScrollBarRange;
1131 
1132  // values updated by getVScrollBarRects() and getHScrollBarRects()
1133  int16_t m_HBarArea;
1134  int16_t m_VBarArea;
1135 
1136  int16_t m_mouseDownHScrollBarPosition;
1137  int16_t m_mouseDownVScrollBarPosition;
1138 
1139  uiScrollBarItem m_mouseOverItem;
1140 
1141  // a timer is active while mouse is down and the mouse is over a button
1142  uiTimerHandle m_scrollTimer;
1143 };
1144 
1145 
1146 
1148 // uiButton
1149 
1150 
1153  RGB888 backgroundColor = RGB888(128, 128, 128);
1154  RGB888 downBackgroundColor = RGB888(255, 255, 255);
1157  RGB888 textColor = RGB888(0, 0, 0);
1158  FontInfo const * textFont = &FONT_std_14;
1159  uint8_t bitmapTextSpace = 4;
1160  Bitmap const * bitmap = nullptr;
1161  Bitmap const * downBitmap = nullptr;
1162 };
1163 
1164 
1168 enum class uiButtonKind {
1169  Button,
1170  Switch,
1171 };
1172 
1173 
1175 class uiButton : public uiControl {
1176 
1177 public:
1178 
1190  uiButton(uiWindow * parent, char const * text, const Point & pos, const Size & size, uiButtonKind kind = uiButtonKind::Button, bool visible = true, uint32_t styleClassID = 0);
1191 
1192  virtual ~uiButton();
1193 
1194  virtual void processEvent(uiEvent * event);
1195 
1203  void setText(char const * value);
1204 
1210  char const * text() { return m_text; }
1211 
1217  uiButtonStyle & buttonStyle() { return m_buttonStyle; }
1218 
1226  bool down() { return m_down; }
1227 
1235  void setDown(bool value);
1236 
1237 
1238  // Delegates
1239 
1245  Delegate<> onChange;
1246 
1247 
1248 private:
1249 
1250  void paintButton();
1251  void paintContent(Rect const & rect);
1252 
1253  void trigger();
1254 
1255 
1256  uiButtonStyle m_buttonStyle;
1257 
1258  char * m_text;
1259  int m_textExtent; // calculated by setText(). TODO: changing font doesn't update m_textExtent!
1260 
1261  bool m_down;
1262 
1263  uiButtonKind m_kind;
1264 
1265 };
1266 
1267 
1268 
1270 // uiTextEdit
1271 // single line text edit
1272 
1273 
1280  RGB888 backgroundColor = RGB888(128, 128, 128);
1283  RGB888 textColor = RGB888(0, 0, 0);
1284  FontInfo const * textFont = &FONT_std_14;
1285 };
1286 
1287 
1292  uint8_t hasCaret : 1;
1293  uint8_t allowEdit : 1;
1295  uiTextEditProps()
1296  : hasCaret(true),
1297  allowEdit(true)
1298  {
1299  }
1300 };
1301 
1302 
1308 class uiTextEdit : public uiControl {
1309 
1310 public:
1311 
1322  uiTextEdit(uiWindow * parent, char const * text, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1323 
1324  virtual ~uiTextEdit();
1325 
1326  virtual void processEvent(uiEvent * event);
1327 
1333  uiTextEditStyle & textEditStyle() { return m_textEditStyle; }
1334 
1340  uiTextEditProps & textEditProps() { return m_textEditProps; }
1341 
1349  void setText(char const * value);
1350 
1356  char const * text() { return m_text; }
1357 
1358 
1359  // Delegates
1360 
1364  Delegate<> onChange;
1365 
1366 
1367 protected:
1368 
1369  virtual Rect getEditRect();
1370 
1371 private:
1372 
1373  void paintTextEdit();
1374  void paintContent();
1375 
1376  uint8_t const * getCharInfo(char ch, int * width);
1377  int charColumnToWindowX(int col);
1378  void updateCaret();
1379  void moveCursor(int col, int selCol);
1380  int getColFromMouseX(int mouseX);
1381  void handleKeyDown(uiKeyEventInfo key);
1382  void checkAllocatedSpace(int requiredLength);
1383  void insert(char c);
1384  void removeSel();
1385  int getWordPosAtLeft();
1386  int getWordPosAtRight();
1387  void selectWordAt(int mouseX);
1388 
1389 
1390  uiTextEditStyle m_textEditStyle;
1391  uiTextEditProps m_textEditProps;
1392 
1393  char * m_text;
1394  int m_textLength; // text length NOT including ending zero
1395  int m_textSpace; // actual space allocated including ending zero
1396 
1397  // rectangle where text will be painted (this is also the text clipping rect)
1398  Rect m_contentRect; // updated on painting
1399 
1400  // where text starts to be painted. Values less than m_contentRect.X1 are used to show characters which do not fit in m_contentRect
1401  int m_viewX;
1402 
1403  // character index of cursor position (0 = at first char)
1404  int m_cursorCol;
1405 
1406  // character index at start of selection (not included if < m_cursorCol, included if > m_cursorCol)
1407  int m_selCursorCol;
1408 
1409 };
1410 
1411 
1412 
1414 // uiLabel
1415 
1416 
1419  FontInfo const * textFont = &FONT_std_14;
1420  RGB888 backgroundColor = RGB888(255, 255, 255);
1421  RGB888 textColor = RGB888(0, 0, 0);
1422 };
1423 
1424 
1426 class uiLabel : public uiControl {
1427 
1428 public:
1429 
1440  uiLabel(uiWindow * parent, char const * text, const Point & pos, const Size & size = Size(0, 0), bool visible = true, uint32_t styleClassID = 0);
1441 
1442  virtual ~uiLabel();
1443 
1444  virtual void processEvent(uiEvent * event);
1445 
1453  void setText(char const * value);
1454 
1462  void setTextFmt(const char *format, ...);
1463 
1469  char const * text() { return m_text; }
1470 
1476  uiLabelStyle & labelStyle() { return m_labelStyle; }
1477 
1483  void update();
1484 
1485 
1486 private:
1487 
1488  void paintLabel();
1489 
1490 
1491  char * m_text;
1492 
1493  uiLabelStyle m_labelStyle;
1494 
1495  uint16_t m_textExtent; // calculated by setText()
1496 
1497  uint8_t m_autoSize;
1498 
1499 };
1500 
1501 
1502 
1504 // uiImage
1505 
1506 
1509  RGB888 backgroundColor = RGB888(255, 255, 255);
1510 };
1511 
1512 
1514 class uiImage : public uiControl {
1515 
1516 public:
1517 
1528  uiImage(uiWindow * parent, Bitmap const * bitmap, const Point & pos, const Size & size = Size(0, 0), bool visible = true, uint32_t styleClassID = 0);
1529 
1530  virtual ~uiImage();
1531 
1532  virtual void processEvent(uiEvent * event);
1533 
1541  void setBitmap(Bitmap const * bitmap);
1542 
1548  Bitmap const * bitmap() { return m_bitmap; }
1549 
1555  uiImageStyle & imageStyle() { return m_imageStyle; }
1556 
1557 
1558 private:
1559 
1560  void paintImage();
1561 
1562 
1563  Bitmap const * m_bitmap;
1564 
1565  uiImageStyle m_imageStyle;
1566 
1567  bool m_autoSize;
1568 
1569 };
1570 
1571 
1572 
1574 // uiPanel
1575 
1576 
1579  RGB888 backgroundColor = RGB888(128, 128, 128);
1580 };
1581 
1582 
1584 class uiPanel : public uiControl {
1585 
1586 public:
1587 
1597  uiPanel(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1598 
1599  virtual ~uiPanel();
1600 
1601  virtual void processEvent(uiEvent * event);
1602 
1608  uiPanelStyle & panelStyle() { return m_panelStyle; }
1609 
1610 
1611 private:
1612 
1613  void paintPanel();
1614 
1615 
1616  uiPanelStyle m_panelStyle;
1617 };
1618 
1619 
1620 
1622 // uiPaintBox
1623 
1624 
1627  RGB888 backgroundColor = RGB888(128, 128, 128);
1628 };
1629 
1630 
1633 
1634 public:
1635 
1645  uiPaintBox(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1646 
1647  virtual ~uiPaintBox();
1648 
1649  virtual void processEvent(uiEvent * event);
1650 
1656  uiPaintBoxStyle & paintBoxStyle() { return m_paintBoxStyle; }
1657 
1659 
1660  // Delegates
1661 
1667  Delegate<Rect> onPaint;
1668 
1669 
1670 private:
1671 
1672  void paintPaintBox();
1673 
1674 
1675  uiPaintBoxStyle m_paintBoxStyle;
1676 };
1677 
1678 
1679 
1681 // uiColorBox
1682 
1684 class uiColorBox : public uiControl {
1685 
1686 public:
1687 
1698  uiColorBox(uiWindow * parent, const Point & pos, const Size & size, Color color = Color::BrightWhite, bool visible = true, uint32_t styleClassID = 0);
1699 
1700  virtual ~uiColorBox();
1701 
1702  virtual void processEvent(uiEvent * event);
1703 
1709  Color color() { return m_color; }
1710 
1716  void setColor(Color value);
1717 
1718 private:
1719 
1720  void paintColorBox();
1721 
1722 
1723  Color m_color;
1724 };
1725 
1726 
1727 
1729 // uiCustomListBox
1730 
1731 
1734  RGB888 backgroundColor = RGB888(128, 128, 128);
1738  int itemHeight = 16;
1739  FontInfo const * textFont = &FONT_std_14;
1740  RGB888 textColor = RGB888(0, 0, 0);
1741  RGB888 selectedTextColor = RGB888(255, 255, 255);
1742 };
1743 
1744 
1747 
1748 public:
1749 
1759  uiCustomListBox(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1760 
1761  virtual ~uiCustomListBox();
1762 
1763  virtual void processEvent(uiEvent * event);
1764 
1770  uiListBoxStyle & listBoxStyle() { return m_listBoxStyle; }
1771 
1777  int firstSelectedItem();
1778 
1784  int lastSelectedItem();
1785 
1793  void selectItem(int index, bool add = false, bool range = false);
1794 
1798  void deselectAll();
1799 
1800 
1801  // Delegates
1802 
1808  Delegate<> onChange;
1809 
1813  Delegate<> onKillFocus;
1814 
1818  Delegate<uiKeyEventInfo> onKeyUp;
1819 
1820 
1821 protected:
1822 
1823  void setScrollBar(uiOrientation orientation, int position, int visible, int range, bool repaintScrollbar);
1824 
1825  // must be implemented by inherited class
1826  virtual int items_getCount() = 0;
1827  virtual void items_deselectAll() = 0;
1828  virtual void items_select(int index, bool select) = 0;
1829  virtual bool items_selected(int index) = 0;
1830  virtual void items_draw(int index, const Rect & itemRect) = 0;
1831 
1832 private:
1833 
1834  void paintListBox();
1835  int getItemAtMousePos(int mouseX, int mouseY);
1836  void handleMouseDown(int mouseX, int mouseY);
1837  void handleKeyDown(uiKeyEventInfo key);
1838  void makeItemVisible(int index);
1839 
1840 
1841  uiListBoxStyle m_listBoxStyle;
1842  int m_firstVisibleItem; // the item on the top
1843 };
1844 
1845 
1846 
1848 // uiListBox
1849 
1851 class uiListBox : public uiCustomListBox {
1852 
1853 public:
1854 
1864  uiListBox(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1865 
1874  StringList & items() { return m_items; }
1875 
1876 protected:
1877 
1878  virtual int items_getCount() { return m_items.count(); }
1879  virtual void items_deselectAll() { m_items.deselectAll(); }
1880  virtual void items_select(int index, bool select) { m_items.select(index, select); }
1881  virtual bool items_selected(int index) { return m_items.selected(index); }
1882  virtual void items_draw(int index, const Rect & itemRect);
1883 
1884 
1885 private:
1886 
1887  StringList m_items;
1888 };
1889 
1890 
1892 // uiFileBrowser
1893 
1896 
1897 public:
1898 
1908  uiFileBrowser(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
1909 
1917  void setDirectory(char const * path);
1918 
1926  void changeDirectory(char const * path);
1927 
1933  char const * directory() { return m_dir.directory(); }
1934 
1940  int count() { return m_dir.count(); }
1941 
1947  char const * filename();
1948 
1954  bool isDirectory();
1955 
1956  void processEvent(uiEvent * event);
1957 
1961  void update();
1962 
1968  FileBrowser & content() { return m_dir; }
1969 
1970 
1971 protected:
1972 
1973  virtual int items_getCount() { return m_dir.count(); }
1974  virtual void items_deselectAll() { m_selected = -1; }
1975  virtual void items_select(int index, bool select);
1976  virtual bool items_selected(int index) { return index == m_selected; }
1977  virtual void items_draw(int index, const Rect & itemRect);
1978 
1979 private:
1980 
1981  void enterSubDir();
1982 
1983  FileBrowser m_dir;
1984  int m_selected; // -1 = no sel
1985 
1986 };
1987 
1988 
1990 // uiColorListBox
1991 
1994 
1995 public:
1996 
2006  uiColorListBox(uiWindow * parent, const Point & pos, const Size & size, bool visible = true, uint32_t styleClassID = 0);
2007 
2013  Color color();
2014 
2015 
2016 protected:
2017 
2018  virtual int items_getCount() { return 16; }
2019  virtual void items_deselectAll() { }
2020  virtual void items_select(int index, bool select) { if (select) m_selectedColor = (Color)index; }
2021  virtual bool items_selected(int index) { return index == (int)m_selectedColor; }
2022  virtual void items_draw(int index, const Rect & itemRect);
2023 
2024 
2025 private:
2026 
2027  Color m_selectedColor;
2028 };
2029 
2030 
2031 
2033 // uiCustomComboBox
2034 
2035 
2039  RGB888 buttonColor = RGB888(128, 128, 128);
2040 };
2041 
2042 
2045  uint8_t openOnFocus : 1;
2047  uiComboBoxProps()
2048  : openOnFocus(true)
2049  {
2050  }
2051 };
2052 
2053 
2056 {
2057 
2058 public:
2059 
2070  uiCustomComboBox(uiWindow * parent, const Point & pos, const Size & size, int listHeight, bool visible, uint32_t styleClassID);
2071 
2072  ~uiCustomComboBox();
2073 
2074  virtual void processEvent(uiEvent * event);
2075 
2081  uiComboBoxStyle & comboBoxStyle() { return m_comboBoxStyle; }
2082 
2088  uiListBoxStyle & listBoxStyle() { return listbox()->listBoxStyle(); }
2089 
2095  uiComboBoxProps & comboBoxProps() { return m_comboBoxProps; }
2096 
2102  int selectedItem() { return listbox()->firstSelectedItem(); }
2103 
2109  void selectItem(int index);
2110 
2111 
2112  // Delegates
2113 
2119  Delegate<> onChange;
2120 
2121 
2122 protected:
2123 
2124  virtual uiCustomListBox * listbox() = 0;
2125  virtual uiControl * editcontrol() = 0;
2126  virtual void updateEditControl() = 0;
2127 
2128  Size getEditControlSize();
2129 
2130 private:
2131 
2132  void paintComboBox();
2133  Rect getButtonRect();
2134  void openListBox();
2135  void closeListBox();
2136  void switchListBox();
2137  int buttonWidth();
2138 
2139 
2140  int m_listHeight;
2141  uiComboBoxStyle m_comboBoxStyle;
2142  uiComboBoxProps m_comboBoxProps;
2143 };
2144 
2145 
2146 
2147 
2149 // uiComboBox
2150 
2151 
2154 {
2155 
2156 public:
2157 
2168  uiComboBox(uiWindow * parent, const Point & pos, const Size & size, int listHeight, bool visible = true, uint32_t styleClassID = 0);
2169 
2170  ~uiComboBox();
2171 
2179  StringList & items() { return m_listBox->items(); }
2180 
2186  uiTextEditStyle & textEditStyle() { return m_textEdit->textEditStyle(); }
2187 
2193  uiTextEditProps & textEditProps() { return m_textEdit->textEditProps(); }
2194 
2202  void setText(char const * value) { m_textEdit->setText(value); }
2203 
2209  char const * text() { return m_textEdit->text(); }
2210 
2211 
2212 protected:
2213 
2214  uiCustomListBox * listbox() { return m_listBox; }
2215  uiControl * editcontrol() { return m_textEdit; }
2216  void updateEditControl();
2217 
2218 private:
2219  uiTextEdit * m_textEdit;
2220  uiListBox * m_listBox;
2221 
2222 };
2223 
2224 
2225 
2227 // uiColorComboBox
2228 
2229 
2232 {
2233 
2234 public:
2235 
2246  uiColorComboBox(uiWindow * parent, const Point & pos, const Size & size, int listHeight, bool visible = true, uint32_t styleClassID = 0);
2247 
2248  ~uiColorComboBox();
2249 
2255  void selectColor(Color value) { selectItem((int)value); }
2256 
2263 
2264 
2265 protected:
2266 
2267  uiCustomListBox * listbox() { return m_colorListBox; }
2268  uiControl * editcontrol() { return m_colorBox; }
2269  void updateEditControl();
2270 
2271 private:
2272  uiColorBox * m_colorBox;
2273  uiColorListBox * m_colorListBox;
2274 
2275 };
2276 
2277 
2278 
2280 // uiCheckBox
2281 
2282 
2285  RGB888 backgroundColor = RGB888(128, 128, 128);
2289 };
2290 
2291 
2295 enum class uiCheckBoxKind : int8_t {
2296  CheckBox,
2297  RadioButton,
2298 };
2299 
2300 
2307 class uiCheckBox : public uiControl {
2308 
2309 public:
2310 
2321  uiCheckBox(uiWindow * parent, const Point & pos, const Size & size, uiCheckBoxKind kind = uiCheckBoxKind::CheckBox, bool visible = true, uint32_t styleClassID = 0);
2322 
2323  virtual ~uiCheckBox();
2324 
2325  virtual void processEvent(uiEvent * event);
2326 
2332  uiCheckBoxStyle & checkBoxStyle() { return m_checkBoxStyle; }
2333 
2339  bool checked() { return m_checked; }
2340 
2348  void setChecked(bool value);
2349 
2355  int groupIndex() { return m_groupIndex; }
2356 
2362  void setGroupIndex(int value) { m_groupIndex = value; }
2363 
2364 
2365  // Delegates
2366 
2372  Delegate<> onChange;
2373 
2374 
2375 private:
2376 
2377  void paintCheckBox();
2378  void trigger();
2379  void unCheckGroup();
2380 
2381 
2382  uiCheckBoxStyle m_checkBoxStyle;
2383  bool m_checked;
2384  uiCheckBoxKind m_kind;
2385  int16_t m_groupIndex; // -1 = no group
2386 
2387 };
2388 
2389 
2390 
2392 // uiSlider
2393 
2394 
2397  RGB888 backgroundColor = RGB888(255, 255, 255);
2398  RGB888 slideColor = RGB888(0, 128, 128);
2399  RGB888 rangeColor = RGB888(0, 128, 255);
2400  RGB888 gripColor = RGB888(0, 0, 255);
2401  RGB888 ticksColor = RGB888(255, 255, 255);
2402 };
2403 
2404 
2406 class uiSlider : public uiControl {
2407 
2408 public:
2409 
2420  uiSlider(uiWindow * parent, const Point & pos, const Size & size, uiOrientation orientation, bool visible = true, uint32_t styleClassID = 0);
2421 
2422  virtual ~uiSlider();
2423 
2424  virtual void processEvent(uiEvent * event);
2425 
2431  uiSliderStyle & sliderStyle() { return m_sliderStyle; }
2432 
2438  int position() { return m_position; }
2439 
2445  void setPosition(int value);
2446 
2452  int min() { return m_min; }
2453 
2459  int max() { return m_max; }
2460 
2468  void setup(int min, int max, int ticksFrequency);
2469 
2470 
2476  Delegate<> onChange;
2477 
2478 
2479 private:
2480 
2481  void paintSlider();
2482  Rect getGripRect();
2483  void moveGripTo(int x, int y);
2484  void handleKeyDown(uiKeyEventInfo key);
2485 
2486 
2487  uiSliderStyle m_sliderStyle;
2488  uiOrientation m_orientation;
2489 
2490  int16_t m_position;
2491  int16_t m_min;
2492  int16_t m_max;
2493  int16_t m_ticksFrequency;
2494 };
2495 
2496 
2497 
2499 // uiStyle
2500 
2501 struct uiStyle {
2502  virtual void setStyle(uiObject * object, uint32_t styleClassID) = 0;
2503 };
2504 
2505 
2506 
2508 // uiApp
2509 
2510 
2512 struct uiAppProps {
2513  uint16_t caretBlinkingTime = 500;
2514  uint16_t doubleClickTime = 250;
2515  bool realtimeReshaping = false;
2516 };
2517 
2518 
2523  Cancel,
2524  Button1,
2525  Button2,
2526  Button3,
2527 };
2528 
2529 
2533 enum class uiMessageBoxIcon {
2534  None,
2535  Question,
2536  Info,
2537  Warning,
2538  Error,
2539 };
2540 
2541 
2542 struct ModalWindowState {
2543  uiWindow * window;
2544  uiWindow * prevFocusedWindow;
2545  uiWindow * prevActiveWindow;
2546  uiWindow * prevModal;
2547  int modalResult;
2548 };
2549 
2550 
2551 class Keyboard;
2552 class Mouse;
2553 
2554 
2561 class uiApp : public uiEvtHandler {
2562 
2563 public:
2564 
2565  uiApp();
2566 
2567  virtual ~uiApp();
2568 
2578  int run(BitmappedDisplayController * displayController, Keyboard * keyboard = nullptr, Mouse * mouse = nullptr);
2579 
2590  void runAsync(BitmappedDisplayController * displayController, int taskStack = 3000, Keyboard * keyboard = nullptr, Mouse * mouse = nullptr);
2591 
2597  void quit(int exitCode);
2598 
2606  bool postEvent(uiEvent const * event);
2607 
2615  bool insertEvent(uiEvent const * event);
2616 
2617  void postDebugMsg(char const * msg);
2618 
2619  virtual void processEvent(uiEvent * event);
2620 
2626  void processEvents();
2627 
2636  uiFrame * rootWindow() { return m_rootWindow; }
2637 
2646  uiWindow * activeWindow() { return m_activeWindow; }
2647 
2657  uiWindow * setActiveWindow(uiWindow * value);
2658 
2671  uiWindow * focusedWindow() { return m_focusedWindow; }
2672 
2683  uiWindow * setFocusedWindow(uiWindow * value);
2684 
2695  uiWindow * moveFocus(int delta);
2696 
2697  void captureMouse(uiWindow * window);
2698 
2706  uiWindow * capturedMouseWindow() { return m_capturedMouseWindow; }
2707 
2713  void repaintWindow(uiWindow * window);
2714 
2720  void repaintRect(Rect const & rect);
2721 
2729  void moveWindow(uiWindow * window, int x, int y);
2730 
2738  void resizeWindow(uiWindow * window, int width, int height);
2739 
2746  void resizeWindow(uiWindow * window, Size size);
2747 
2754  void reshapeWindow(uiWindow * window, Rect const & rect);
2755 
2763  uiWindow * screenToWindow(Point & point);
2764 
2771  void showWindow(uiWindow * window, bool value);
2772 
2784  int showModalWindow(uiWindow * window);
2785 
2795  ModalWindowState * initModalWindow(uiWindow * window);
2796 
2807  bool processModalWindowEvents(ModalWindowState * state, int timeout);
2808 
2819  int endModalWindow(ModalWindowState * state);
2820 
2827  void maximizeWindow(uiWindow * window, bool value);
2828 
2835  void minimizeWindow(uiWindow * window, bool value);
2836 
2837  void combineMouseMoveEvents(bool value) { m_combineMouseMoveEvents = value; }
2838 
2839  void showCaret(uiWindow * window);
2840 
2841  void setCaret(bool value);
2842 
2843  void setCaret(Point const & pos);
2844 
2845  void setCaret(Rect const & rect);
2846 
2858  uiTimerHandle setTimer(uiEvtHandler * dest, int periodMS);
2859 
2867  void killTimer(uiTimerHandle handle);
2868 
2874  uiAppProps & appProps() { return m_appProps; }
2875 
2881  void destroyWindow(uiWindow * window);
2882 
2883  void cleanWindowReferences(uiWindow * window);
2884 
2892  void enableKeyboardAndMouseEvents(bool value);
2893 
2906  uiMessageBoxResult messageBox(char const * title, char const * text, char const * button1Text, char const * button2Text = nullptr, char const * button3Text = nullptr, uiMessageBoxIcon icon = uiMessageBoxIcon::Question);
2907 
2923  uiMessageBoxResult inputBox(char const * title, char const * text, char * inOutString, int maxLength, char const * button1Text, char const * button2Text = nullptr);
2924 
2928  virtual void init();
2929 
2935  void setStyle(uiStyle * value) { m_style = value; }
2936 
2942  uiStyle * style() { return m_style; }
2943 
2944 
2945  // delegates
2946 
2953  Delegate<uiTimerHandle> onTimer;
2954 
2955  Keyboard * keyboard() { return m_keyboard; }
2956 
2957  Mouse * mouse() { return m_mouse; }
2958 
2959  BitmappedDisplayController * displayController() { return m_displayController; }
2960 
2961  Canvas * canvas() { return m_canvas; }
2962 
2963 
2964 protected:
2965 
2966  bool getEvent(uiEvent * event, int timeOutMS);
2967  bool peekEvent(uiEvent * event, int timeOutMS);
2968 
2969 
2970 private:
2971 
2972  void preprocessEvent(uiEvent * event);
2973  void preprocessMouseEvent(uiEvent * event);
2974  void preprocessKeyboardEvent(uiEvent * event);
2975  void filterModalEvent(uiEvent * event);
2976 
2977  static void timerFunc(TimerHandle_t xTimer);
2978 
2979  static void asyncRunTask(void * arg);
2980 
2981  void blinkCaret(bool forceOFF = false);
2982  void suspendCaret(bool value);
2983 
2984 
2985  BitmappedDisplayController * m_displayController;
2986 
2987  Canvas * m_canvas;
2988 
2989  Keyboard * m_keyboard;
2990 
2991  Mouse * m_mouse;
2992 
2993  uiAppProps m_appProps;
2994 
2995  QueueHandle_t m_eventsQueue;
2996 
2997  uiFrame * m_rootWindow;
2998 
2999  uiWindow * m_activeWindow; // foreground window. Also gets keyboard events (other than focused window)
3000 
3001  uiWindow * m_focusedWindow; // window that captures keyboard events (other than active window)
3002 
3003  uiWindow * m_capturedMouseWindow; // window that has captured mouse
3004 
3005  uiWindow * m_freeMouseWindow; // window where mouse is over
3006 
3007  uiWindow * m_modalWindow; // current modal window
3008 
3009  bool m_combineMouseMoveEvents;
3010 
3011  uiWindow * m_caretWindow; // nullptr = caret is not visible
3012  Rect m_caretRect; // caret rect relative to m_caretWindow
3013  uiTimerHandle m_caretTimer;
3014  int m_caretInvertState; // -1 = suspended, 1 = rect reversed (cat visible), 0 = rect not reversed (caret invisible)
3015 
3016  int m_lastMouseUpTimeMS; // time (MS) at mouse up. Used to measure double clicks
3017  Point m_lastMouseUpPos; // screen position of last mouse up
3018 
3019  uiStyle * m_style;
3020 };
3021 
3022 
3023 
3024 
3025 } // end of namespace
3026 
3027 
3028 
Represents a 24 bit RGB color.
uiLabelStyle & labelStyle()
Sets or gets label style.
Definition: fabui.h:1476
uiWindow * setActiveWindow(uiWindow *value)
Sets the active window.
Definition: fabui.cpp:572
uiWindowStyle & windowStyle()
Sets or gets window style.
Definition: fabui.h:511
RGB888 selectedTextColor
Definition: fabui.h:1741
void selectItem(int index, bool add=false, bool range=false)
Selects a listbox item.
Definition: fabui.cpp:3712
Delegate onChange
Change event delegate.
Definition: fabui.h:2119
uiTextEditStyle & textEditStyle()
Sets or gets text edit style.
Definition: fabui.h:2186
bool down()
Determines whether the switch button is down or up.
Definition: fabui.h:1226
int selectedItem()
Represents currently selected item.
Definition: fabui.h:2102
A class with a set of drawing methods.
Definition: canvas.h:66
uiComboBoxStyle & comboBoxStyle()
Sets or gets combobox style.
Definition: fabui.h:2081
Delegate onDblClick
Mouse double click event delegate.
Definition: fabui.h:647
Shows a list of 16 colors, one selectable.
Definition: fabui.h:1993
Delegate onChangeVScrollBar
Vertical scrollbar change event delegate.
Definition: fabui.h:1093
uint8_t borderSize
Definition: fabui.h:344
A frame is a window with a title bar, maximize/minimize/close buttons and that is resizeable or movea...
Definition: fabui.h:785
uint8_t left
Definition: fabui.h:351
int lastSelectedItem()
Gets the last selected item.
Definition: fabui.cpp:3820
Contains details about the key event.
Definition: fabui.h:142
Rect rect(uiOrigin origin)
Determines the window bounding box.
Definition: fabui.cpp:1371
ModalWindowState * initModalWindow(uiWindow *window)
Begins modal window processing.
Definition: fabui.cpp:738
uiTextEditStyle & textEditStyle()
Sets or gets text edit style.
Definition: fabui.h:1333
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.
Definition: fabui.cpp:2483
Bitmap const * bitmap
Definition: fabui.h:1160
uiOrientation
Item direction/orientation.
Definition: fabui.h:204
void setScrollBar(uiOrientation orientation, int position, int visible, int range, bool repaintScrollbar)
Sets scrollbar position, visible portion and range.
Definition: fabui.cpp:3829
int firstSelectedItem()
Gets the first selected item.
Definition: fabui.cpp:3810
Represents the whole application base class.
Definition: fabui.h:2561
char const * text()
Determines button text.
Definition: fabui.h:1210
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.
Definition: fabui.cpp:961
bool insertEvent(uiEvent const *event)
Inserts (first position) an event in the event queue and returns without waiting for the receiver to ...
Definition: fabui.cpp:525
RGB888 downBackgroundColor
Definition: fabui.h:1154
uint8_t activable
Definition: fabui.h:328
This is a combination of a listbox and another component, base of all combobox components.
Definition: fabui.h:2055
uiStyle * style()
Gets current application controls style.
Definition: fabui.h:2942
A scrollable control is a control with optionally vertical and/or horizontal scrollbars.
Definition: fabui.h:996
void setText(char const *value)
Sets label text.
Definition: fabui.cpp:2948
char const * text()
Gets current content of the text edit.
Definition: fabui.h:1356
VirtualKey VK
Definition: fabui.h:143
void selectItem(int index)
Selects an item.
Definition: fabui.cpp:4083
Base class for all visible UI elements (Frames and Controls)
Definition: fabui.h:364
void update()
Reloads current directory content and repaints.
Definition: fabui.cpp:4015
FileBrowser & content()
Contains current directory representation.
Definition: fabui.h:1968
int run(BitmappedDisplayController *displayController, Keyboard *keyboard=nullptr, Mouse *mouse=nullptr)
Initializes application and executes the main event loop.
Definition: fabui.cpp:191
char const * directory()
Determines current directory.
Definition: fabui.h:1933
void setup(int min, int max, int ticksFrequency)
Sets minimum, maximum position and ticks frequency.
Definition: fabui.cpp:4508
A color box is a control that shows a single color.
Definition: fabui.h:1684
void setParentProcessKbdEvents(bool value)
Enables a child window to send keyboard events to its parent.
Definition: fabui.h:629
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.
Definition: fabui.cpp:3205
RGB888 mouseOverScrollBarForegroundColor
Definition: fabui.h:973
uiColorComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:4290
FontInfo const * textFont
Definition: fabui.h:1739
Shows a list of selectable string items.
Definition: fabui.h:1851
Bitmap const * bitmap()
Gets image bitmap.
Definition: fabui.h:1548
int16_t Y
void bringAfter(uiWindow *insertionPoint)
Brings this window after another one.
Definition: fabui.cpp:1332
RGB888 mouseDownBackgroundColor
Definition: fabui.h:1156
Size size()
Determines the window size.
Definition: fabui.h:461
RGB888 mouseOverBackgroundButtonColor
Definition: fabui.h:736
uiPanelStyle & panelStyle()
Sets or gets panel style.
Definition: fabui.h:1608
virtual void init()
Method to inherit to implement an application.
Definition: fabui.cpp:514
Contains the listbox style.
Definition: fabui.h:1733
RGB888 buttonColor
Definition: fabui.h:734
Contains the slider style.
Definition: fabui.h:2396
uiWindow * parent()
Determines the parent window.
Definition: fabui.h:518
uint16_t doubleClickTime
Definition: fabui.h:2514
void setFocusIndex(int value)
Sets the focus index (aka tab-index)
Definition: fabui.h:595
int count()
Determines number of files in current directory.
Definition: fabui.h:1940
uint8_t visible
Definition: fabui.h:319
uiAppProps & appProps()
Sets or gets application properties.
Definition: fabui.h:2874
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.
Definition: fabui.cpp:3023
RGB888 mouseOverBackgroundColor
Definition: fabui.h:1155
This file contains fabgl::BitmappedDisplayController definition.
Base class of all UI elements that can receive events.
Definition: fabui.h:274
Sets or gets text edit style.
Definition: fabui.h:1279
void quit(int exitCode)
Terminates application and free resources.
Definition: fabui.cpp:326
uint8_t active
Definition: fabui.h:322
Contains the paintbox style.
Definition: fabui.h:1626
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.
Definition: fabui.cpp:2923
FontInfo const * textFont
Definition: fabui.h:1158
uiButton(uiWindow *parent, char const *text, const Point &pos, const Size &size, uiButtonKind kind=uiButtonKind::Button, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:2334
uiColorListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3910
int showModalWindow(uiWindow *window)
Makes a window visible and handles it has a modal window.
Definition: fabui.cpp:798
Properties of the combobox.
Definition: fabui.h:2044
int position()
Determines slider position.
Definition: fabui.h:2438
The PS2 Keyboard controller class.
Definition: keyboard.h:166
Represents the base abstract class for bitmapped display controllers.
Delegate onClick
Mouse click event delegate.
Definition: fabui.h:639
Color color()
Currently selected color.
This file contains fabgl::Canvas definition.
Size clientSize()
Determines the client area size.
Definition: fabui.cpp:1394
uiWindow * lastChild()
Gets last child.
Definition: fabui.h:417
A panel is used to contain and to group some controls.
Definition: fabui.h:1584
RGB888 backgroundColor
Definition: fabui.h:1627
Represents a checkbox or a radiobutton.
Definition: fabui.h:2307
VirtualKey
Represents each possible real or derived (SHIFT + real) key.
Definition: fabutils.h:951
void moveWindow(uiWindow *window, int x, int y)
Moves a window.
Definition: fabui.cpp:703
void destroyWindow(uiWindow *window)
Destroys a window.
Definition: fabui.cpp:922
uint16_t caretBlinkingTime
Definition: fabui.h:2513
Delegate onResize
Resize window event delegate.
Definition: fabui.h:870
uiButtonStyle & buttonStyle()
Sets or gets button style.
Definition: fabui.h:1217
uiCheckBoxKind
Specifies the combobox behaviour.
Definition: fabui.h:2295
uint8_t bottom
Definition: fabui.h:354
void setTitleFmt(const char *format,...)
Sets window title as formatted text.
Definition: fabui.cpp:1780
Delegate onChangeHScrollBar
Horizontal scrollbar change event delegate.
Definition: fabui.h:1088
Color selectedColor()
Determines current selected color.
Definition: fabui.h:2262
void update()
Updates the label content.
Definition: fabui.cpp:2973
void setColor(Color value)
Sets current colorbox color.
Definition: fabui.cpp:3225
uiWindowProps & windowProps()
Sets or gets window properties.
Definition: fabui.h:504
Properties of the application.
Definition: fabui.h:2512
int VScrollBarRange()
Determines vertical scrollbar range.
Definition: fabui.h:1080
void setTextFmt(const char *format,...)
Sets label formatted text.
Definition: fabui.cpp:2957
Contains the scrollable control style.
Definition: fabui.h:970
uiCustomComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible, uint32_t styleClassID)
Creates an instance of the object.
Definition: fabui.cpp:4062
RGB888 backgroundColor
Definition: fabui.h:1579
Represents a button control. A button can have text and optionally a bitmap.
Definition: fabui.h:1175
uint8_t moveable
Definition: fabui.h:746
void setStyle(uiStyle *value)
Sets application controls style.
Definition: fabui.h:2935
Point mouseDownPos()
Determines mouse position when left button was down.
Definition: fabui.h:532
bool processModalWindowEvents(ModalWindowState *state, int timeout)
Processes all messages from modal window.
Definition: fabui.cpp:756
RGB888 focusedSelectedBackgroundColor
Definition: fabui.h:1737
int VScrollBarVisible()
Determines vertical scrollbar visible portion (aka thumb size) of the scrollable content.
Definition: fabui.h:1070
uiButtonKind
Specifies the button kind.
Definition: fabui.h:1168
Delegate< Rect > onPaint
Paint event delegate.
Definition: fabui.h:1667
uiWindow * parentFrame()
Determines the parent frame.
Definition: fabui.cpp:1732
Contains the label style.
Definition: fabui.h:1418
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.
Definition: fabui.cpp:1060
Describes mouse absolute position, scroll wheel delta and buttons status.
Definition: fabutils.h:242
void deselectAll()
Deselects all selected items.
Definition: fabui.cpp:3752
uiFrameProps & frameProps()
Sets or gets frame properties.
Definition: fabui.h:842
Delegate onChange
Change event delegate.
Definition: fabui.h:1808
uiCustomListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3613
uint8_t focusable
Definition: fabui.h:329
uiTextEditProps & textEditProps()
Sets or gets text edit properties.
Definition: fabui.h:2193
RGB888 buttonBackgroundColor
Definition: fabui.h:2038
int groupIndex()
Determines radiobutton group index.
Definition: fabui.h:2355
uiFrameStyle & frameStyle()
Sets or gets frame style.
Definition: fabui.h:835
uiListBoxStyle & listBoxStyle()
Sets or gets listbox style.
Definition: fabui.h:2088
RGB888 activeBorderColor
Definition: fabui.h:342
Represents the coordinate of a point.
Definition: fabutils.h:158
Represents an image.
uiAnchors & anchors()
Allows to switch on or off anchors.
Definition: fabui.h:588
Contains the window style.
Definition: fabui.h:339
Properties of the frame.
Definition: fabui.h:744
void setPosition(int value)
Sets the slider position.
Definition: fabui.cpp:4498
This is a combination of a color listbox and a colorbox.
Definition: fabui.h:2231
This file contains some utility classes and functions.
uint8_t right
Definition: fabui.h:353
Delegate< uiTimerHandle > onTimer
Timer event delegate.
Definition: fabui.h:878
RGB888 mouseOverBackgroundColor
Definition: fabui.h:2287
uiSliderStyle & sliderStyle()
Sets or gets slider style.
Definition: fabui.h:2431
uiSlider(uiWindow *parent, const Point &pos, const Size &size, uiOrientation orientation, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:4472
uiPaintBoxStyle & paintBoxStyle()
Sets or gets paintbox style.
Definition: fabui.h:1656
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.
Definition: fabui.cpp:1750
Definition: canvas.cpp:31
uiControl(uiWindow *parent, const Point &pos, const Size &size, bool visible, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:2302
uiOrigin
Specifies window rectangle origin.
Definition: fabui.h:310
uint8_t top
Definition: fabui.h:352
Rect transformRect(Rect const &rect, uiWindow *baseWindow)
Transforms rectangle origins from current window to another one.
Definition: fabui.cpp:1349
Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
Definition: fabui.cpp:3594
Specifies the object type.
Definition: fabui.h:216
MouseStatus status
Definition: fabui.h:154
Contains some window options.
Definition: fabui.h:327
uint8_t minimized
Definition: fabui.h:321
Color color()
Gets current colorbox color.
Definition: fabui.h:1709
uiScrollableControlStyle & scrollableControlStyle()
Sets or gets control style.
Definition: fabui.h:1022
CursorName defaultCursor
Definition: fabui.h:340
uiPaintBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3148
Contains the button style.
Definition: fabui.h:1152
void setDown(bool value)
Sets button state of a switch button.
Definition: fabui.cpp:2463
char const * filename()
Currently selected filename.
Definition: fabui.cpp:3989
uiMessageBoxResult
Return values from uiApp.messageBox() method.
Definition: fabui.h:2522
Represents a rectangle.
Definition: fabutils.h:191
uiWindow * screenToWindow(Point &point)
Determines which window a point belongs to.
Definition: fabui.cpp:495
uint8_t focusedBorderSize
Definition: fabui.h:345
RGB888 activeButtonColor
Definition: fabui.h:735
void maximizeWindow(uiWindow *window, bool value)
Maximizes or restores a window.
Definition: fabui.cpp:807
Delegate< uiTimerHandle > onTimer
Timer event delegate.
Definition: fabui.h:2953
RGB888 titleColor
Definition: fabui.h:731
int HScrollBarPos()
Determines position of the horizontal scrollbar thumb.
Definition: fabui.h:1032
Represents a text edit control.
Definition: fabui.h:1308
void minimizeWindow(uiWindow *window, bool value)
Minimizes or restores a window.
Definition: fabui.cpp:814
uiWindow * prev()
Gets previous sibling.
Definition: fabui.h:403
void repaintWindow(uiWindow *window)
Repaints a window.
Definition: fabui.cpp:688
uiTextEditProps & textEditProps()
Sets or gets text edit properties.
Definition: fabui.h:1340
bool realtimeReshaping
Definition: fabui.h:2515
Contains details about the mouse event.
Definition: fabui.h:153
RGB888 backgroundColor
Definition: fabui.h:2285
RGB888 mouseOverButtonColor
Definition: fabui.h:737
CursorName
This enum defines a set of predefined mouse cursors.
int focusIndex()
Determines the focus index (aka tab-index)
Definition: fabui.h:604
RGB888 mouseOverBackgroundColor
Definition: fabui.h:1281
FontInfo const * textFont
Definition: fabui.h:1419
uiWindow * firstChild()
Gets first child.
Definition: fabui.h:410
Bitmap const * downBitmap
Definition: fabui.h:1161
uiCheckBoxStyle & checkBoxStyle()
Sets or gets checkbox style.
Definition: fabui.h:2332
char const * directory()
Determines absolute path of current directory.
Definition: fabutils.h:503
uint8_t hasMaximizeButton
Definition: fabui.h:748
void reshapeWindow(uiWindow *window, Rect const &rect)
Reshapes a window.
Definition: fabui.cpp:722
FontInfo const * titleFont
Definition: fabui.h:733
StringList & items()
A list of strings representing items of the combobox.
Definition: fabui.h:2179
RGB888 activeTitleBackgroundColor
Definition: fabui.h:730
uiWindow * setFocusedWindow(uiWindow *value)
Sets the focused window (control)
Definition: fabui.cpp:615
This file contains FabGL library configuration settings, like number of supported colors...
RGB888 backgroundColor
Definition: fabui.h:1509
Base class of all UI elements like windows and controls.
Definition: fabui.h:248
int16_t X
void setBitmap(Bitmap const *bitmap)
Sets image bitmap.
Definition: fabui.cpp:3046
A paintbox control allows applications to perform custom drawings providing uiPaintBox.onPaint delegate. A paintbox can have horizontal and vertical scrollbars.
Definition: fabui.h:1632
RGB888 foregroundColor
Definition: fabui.h:2288
StringList & items()
A list of strings representing the listbox content.
Definition: fabui.h:1874
Point pos()
Determines the window position relative to parent window.
Definition: fabui.h:445
virtual Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
Definition: fabui.cpp:1387
void setChecked(bool value)
Sets current checkbox or radiobutton checked status.
Definition: fabui.cpp:4436
Represents a bidimensional size.
Definition: fabutils.h:176
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.
Definition: fabui.cpp:4326
Delegate onKillFocus
Kill focus event delegate.
Definition: fabui.h:1813
RGB888 backgroundColor
Definition: fabui.h:1280
uiComboBoxProps & comboBoxProps()
Sets or gets combobox properties.
Definition: fabui.h:2095
int VScrollBarPos()
Determines position of the vertical scrollbar thumb.
Definition: fabui.h:1061
RGB888 textColor
Definition: fabui.h:1421
uint8_t fillBackground
Definition: fabui.h:750
uiObjectType & objectType()
Determines the object type.
Definition: fabui.h:261
bool hasChildren()
Determines whether this window has children.
Definition: fabui.h:424
Delegate< uiKeyEventInfo > onKeyUp
Key-up event delegate.
Definition: fabui.h:888
RGB888 focusedBorderColor
Definition: fabui.h:343
Delegate onShow
Show window event delegate.
Definition: fabui.h:856
uiTimerHandle setTimer(uiEvtHandler *dest, int periodMS)
Setups a timer.
Definition: fabui.cpp:831
bool isDirectory()
Determines whether currently selected item is a directory.
Definition: fabui.cpp:3995
int max()
Gets maximum position.
Definition: fabui.h:2459
RGB888 backgroundColor
Definition: fabui.h:1153
uiApp * app()
Determines the app that owns this object.
Definition: fabui.h:289
Contains the listbox style.
Definition: fabui.h:2037
FontInfo const * textFont
Definition: fabui.h:1284
void resizeWindow(uiWindow *window, int width, int height)
Resizes a window.
Definition: fabui.cpp:709
int endModalWindow(ModalWindowState *state)
Ends modal window processing.
Definition: fabui.cpp:786
bool postEvent(uiEvent const *event)
Places an event in the event queue and returns without waiting for the receiver to process the event...
Definition: fabui.cpp:519
uint32_t styleClassID()
Determines current style class for this UI element.
Definition: fabui.h:620
uiScrollableControl(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3267
A label is a static text UI element.
Definition: fabui.h:1426
void processEvents()
Processes all events in queue.
Definition: fabui.cpp:313
Properties of the text edit.
Definition: fabui.h:1291
uiComboBox(uiWindow *parent, const Point &pos, const Size &size, int listHeight, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:4249
uiListBox(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3883
virtual void setScrollBar(uiOrientation orientation, int position, int visible, int range, bool repaintScrollbar=true)
Sets scrollbar position, visible portion and range.
Definition: fabui.cpp:3295
uint8_t hasCloseButton
Definition: fabui.h:747
void bringOnTop()
Brings this window on top.
Definition: fabui.cpp:1326
uint8_t changedButton
Definition: fabui.h:155
Contains the image style.
Definition: fabui.h:1508
uiWindowState state()
Determines the window state.
Definition: fabui.h:497
uiPanel(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3094
void setGroupIndex(int value)
Sets radiobutton group index.
Definition: fabui.h:2362
Rect clientRect(uiOrigin origin)
Determines the client area bounding box.
Definition: fabui.cpp:1810
RGB888 borderColor
Definition: fabui.h:341
uiWindow * moveFocus(int delta)
Move focus to a control with current focus index plus a delta.
Definition: fabui.cpp:665
RGB888 checkedBackgroundColor
Definition: fabui.h:2286
void repaintRect(Rect const &rect)
Repaints a screen area.
Definition: fabui.cpp:694
This is the base class for all controls. A control can have focus and is not activable.
Definition: fabui.h:943
RGB888 titleBackgroundColor
Definition: fabui.h:729
bool hasFocus()
Determines whether this window or control has focus.
Definition: fabui.cpp:1699
uiWindow * capturedMouseWindow()
Determines which window is capturing mouse.
Definition: fabui.h:2706
int HScrollBarRange()
Determines horizontal scrollbar range.
Definition: fabui.h:1051
RGB888 activeTitleColor
Definition: fabui.h:732
char const * text()
Gets current content of the text edit.
Definition: fabui.h:2209
void repaint()
Repaints this window.
Definition: fabui.cpp:1365
uiFileBrowser(uiWindow *parent, const Point &pos, const Size &size, bool visible=true, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:3940
Contains anchors enable/disable switches.
Definition: fabui.h:350
char const * title()
Determines the window title.
Definition: fabui.h:810
RGB888 selectedBackgroundColor
Definition: fabui.h:1736
RGB888 backgroundColor
Definition: fabui.h:1420
Delegate onPaint
Paint event delegate.
Definition: fabui.h:893
RGB888 focusedBackgroundColor
Definition: fabui.h:1282
Shows generic a list of selectable items.
Definition: fabui.h:1746
uiWindow * next()
Gets next sibling.
Definition: fabui.h:394
Delegate onHide
Hide window event delegate.
Definition: fabui.h:863
void setDirectory(char const *path)
Sets current directory as absolute path.
Definition: fabui.cpp:3973
uiListBoxStyle & listBoxStyle()
Sets or gets listbox style.
Definition: fabui.h:1770
uint8_t height
Delegate onChange
Button changed event delegate.
Definition: fabui.h:1245
Delegate onChange
Change event delegate.
Definition: fabui.h:2372
RGB888 backgroundColor
Definition: fabui.h:1734
void setStyleClassID(uint32_t value)
Sets style class for this UI element.
Definition: fabui.h:613
RGB888 backgroundColor
Definition: fabui.h:2397
Delegate< uiKeyEventInfo > onKeyUp
Key-up event delegate.
Definition: fabui.h:1818
void setText(char const *value)
Replaces current text.
Definition: fabui.cpp:2513
void selectColor(Color value)
Sets current selected color.
Definition: fabui.h:2255
uiWindow * activeWindow()
Gets a pointer to the currently active window.
Definition: fabui.h:2646
Delegate< uiKeyEventInfo > onKeyDown
Key-down event delegate.
Definition: fabui.h:883
A slider or track bar is a graphical control element with which a user may set a value by moving an i...
Definition: fabui.h:2406
Point clientPos()
Determines position of the client area.
Definition: fabui.cpp:1400
uiWindow(uiWindow *parent, const Point &pos, const Size &size, bool visible, uint32_t styleClassID=0)
Creates an instance of the object.
Definition: fabui.cpp:1178
uiFrame * rootWindow()
Gets a pointer to the root window.
Definition: fabui.h:2636
Specifies current window state.
Definition: fabui.h:318
void runAsync(BitmappedDisplayController *displayController, int taskStack=3000, Keyboard *keyboard=nullptr, Mouse *mouse=nullptr)
Initializes application and executes asynchronously the main event loop.
Definition: fabui.cpp:300
RGB888 backgroundColor
Definition: fabui.h:728
void setText(char const *value)
Replaces current text.
Definition: fabui.h:2202
This is a combination of a listbox and a single-line editable textbox.
Definition: fabui.h:2153
Shows and navigates Virtual Filesystem content.
Definition: fabui.h:1895
The PS2 Mouse controller class.
Definition: mouse.h:99
uint8_t maximized
Definition: fabui.h:320
uiImageStyle & imageStyle()
Sets or gets image style.
Definition: fabui.h:1555
int count()
Determines number of files in current directory.
Definition: fabutils.h:510
Contains the checkbox style.
Definition: fabui.h:2284
Delegate onChange
Text edit event delegate.
Definition: fabui.h:1364
bool isMouseOver()
Determines whether the mouse is over this window.
Definition: fabui.h:563
int HScrollBarVisible()
Determines horizontal scrollbar visible portion (aka thumb size) of the scrollable content...
Definition: fabui.h:1041
void showWindow(uiWindow *window, bool value)
Makes a window visible or invisible.
Definition: fabui.cpp:730
uint8_t hasMinimizeButton
Definition: fabui.h:749
RGB888 focusedBackgroundColor
Definition: fabui.h:1735
void exitModal(int modalResult)
Exits from a modal window.
Definition: fabui.cpp:1691
Contains the panel style.
Definition: fabui.h:1578
uint8_t width
uiWindow * focusedWindow()
Gets the focused window (control)
Definition: fabui.h:2671
void changeDirectory(char const *path)
Changes current directory as relative path.
Definition: fabui.cpp:3981
uint8_t bitmapTextSpace
Definition: fabui.h:1159
void setText(char const *value)
Sets button text.
Definition: fabui.cpp:2363
char const * text()
Determines label text.
Definition: fabui.h:1469
uint8_t resizeable
Definition: fabui.h:745
void setTitle(char const *value)
Sets window title.
Definition: fabui.cpp:1772
uiMessageBoxIcon
Icon displayed by the uiApp.messageBox() method.
Definition: fabui.h:2533
void enableKeyboardAndMouseEvents(bool value)
Enables or disables mouse and keyboard events.
Definition: fabui.cpp:1149
bool checked()
Determines whether the checkbox or radiobutton is checked.
Definition: fabui.h:2339
int min()
Gets minimum position.
Definition: fabui.h:2452
Image control to display a static bitmap.
Definition: fabui.h:1514
void killTimer(uiTimerHandle handle)
Kills a timer.
Definition: fabui.cpp:839
FileBrowser allows basic file system operations (dir, mkdir, remove and rename)
Definition: fabutils.h:469
Delegate onChange
Slider changed event delegate.
Definition: fabui.h:2476