├── .gitignore ├── docs ├── api │ ├── graph_legend.md5 │ ├── inherit_graph_0.md5 │ ├── inherit_graph_1.md5 │ ├── inherit_graph_2.md5 │ ├── inherit_graph_3.md5 │ ├── classUIArea__coll__graph.md5 │ ├── classUIBitmap__coll__graph.md5 │ ├── classUICards__coll__graph.md5 │ ├── classUICards__inherit__graph.md5 │ ├── classUIColumns__coll__graph.md5 │ ├── classUIDisplay__coll__graph.md5 │ ├── classUIEnvelope__coll__graph.md5 │ ├── classUIRows__coll__graph.md5 │ ├── classUIRows__inherit__graph.md5 │ ├── classUISize__coll__graph.md5 │ ├── classUITextIcon__coll__graph.md5 │ ├── classUITextLine__coll__graph.md5 │ ├── classUIWidget__coll__graph.md5 │ ├── classUIBitmap__inherit__graph.md5 │ ├── classUICheckerboard__coll__graph.md5 │ ├── classUIColumns__inherit__graph.md5 │ ├── classUIDisplay__inherit__graph.md5 │ ├── classUIEnvelope__inherit__graph.md5 │ ├── classUIParent__inherit__graph.md5 │ ├── classUITextIcon__inherit__graph.md5 │ ├── classUITextLine__inherit__graph.md5 │ ├── classUIVerticalLine__coll__graph.md5 │ ├── classUIWidgetGroup__coll__graph.md5 │ ├── classUIWidget__inherit__graph.md5 │ ├── classUICheckerboard__inherit__graph.md5 │ ├── classUIHorizontalLine__coll__graph.md5 │ ├── classUIHorizontalLine__inherit__graph.md5 │ ├── classUIVerticalLine__inherit__graph.md5 │ ├── classUIWidgetGroup__inherit__graph.md5 │ ├── bc_s.png │ ├── bdwn.png │ ├── doc.png │ ├── nav_f.png │ ├── nav_g.png │ ├── nav_h.png │ ├── open.png │ ├── tab_a.png │ ├── tab_b.png │ ├── tab_h.png │ ├── tab_s.png │ ├── closed.png │ ├── sync_on.png │ ├── folderopen.png │ ├── splitbar.png │ ├── sync_off.png │ ├── folderclosed.png │ ├── graph_legend.png │ ├── inherit_graph_0.png │ ├── inherit_graph_1.png │ ├── inherit_graph_2.png │ ├── inherit_graph_3.png │ ├── search │ │ ├── search_l.png │ │ ├── search_m.png │ │ ├── search_r.png │ │ ├── all_12.js │ │ ├── all_13.js │ │ ├── all_f.js │ │ ├── all_1.js │ │ ├── all_11.js │ │ ├── all_6.js │ │ ├── all_b.js │ │ ├── variables_5.js │ │ ├── variables_a.js │ │ ├── variables_c.js │ │ ├── variables_d.js │ │ ├── variables_0.js │ │ ├── variables_1.js │ │ ├── variables_4.js │ │ ├── variables_7.js │ │ ├── variables_b.js │ │ ├── functions_3.js │ │ ├── functions_4.js │ │ ├── variables_8.js │ │ ├── functions_9.js │ │ ├── pages_0.js │ │ ├── variables_2.js │ │ ├── functions_5.js │ │ ├── variables_6.js │ │ ├── all_c.js │ │ ├── all_0.js │ │ ├── all_5.js │ │ ├── functions_0.js │ │ ├── variables_3.js │ │ ├── variables_9.js │ │ ├── all_4.js │ │ ├── all_7.js │ │ ├── all_8.js │ │ ├── functions_6.js │ │ ├── functions_7.js │ │ ├── searchdata.js │ │ ├── functions_2.js │ │ ├── all_9.js │ │ ├── nomatches.html │ │ ├── functions_8.js │ │ ├── all_3.js │ │ ├── all_a.js │ │ ├── functions_a.js │ │ ├── all_d.js │ │ ├── classes_0.js │ │ ├── close.svg │ │ ├── all_0.html │ │ ├── all_1.html │ │ ├── all_2.html │ │ ├── all_3.html │ │ ├── all_4.html │ │ ├── all_5.html │ │ ├── all_6.html │ │ ├── all_7.html │ │ ├── all_8.html │ │ ├── all_9.html │ │ ├── all_a.html │ │ ├── all_b.html │ │ ├── all_c.html │ │ ├── all_d.html │ │ ├── all_e.html │ │ ├── all_f.html │ │ ├── all_10.html │ │ ├── all_11.html │ │ ├── all_12.html │ │ ├── all_13.html │ │ ├── pages_0.html │ │ ├── classes_0.html │ │ ├── functions_0.html │ │ ├── functions_1.html │ │ ├── functions_2.html │ │ ├── functions_3.html │ │ ├── functions_4.html │ │ ├── functions_5.html │ │ ├── functions_6.html │ │ ├── functions_7.html │ │ ├── functions_8.html │ │ ├── functions_9.html │ │ ├── functions_a.html │ │ ├── functions_b.html │ │ ├── functions_c.html │ │ ├── variables_0.html │ │ ├── variables_1.html │ │ ├── variables_2.html │ │ ├── variables_3.html │ │ ├── variables_4.html │ │ ├── variables_5.html │ │ ├── variables_6.html │ │ ├── variables_7.html │ │ ├── variables_8.html │ │ ├── variables_9.html │ │ ├── variables_a.html │ │ ├── variables_b.html │ │ ├── variables_c.html │ │ ├── variables_d.html │ │ ├── all_e.js │ │ ├── functions_b.js │ │ ├── all_2.js │ │ ├── functions_1.js │ │ └── mag_sel.svg │ ├── classUIArea__coll__graph.png │ ├── classUICards__coll__graph.png │ ├── classUIRows__coll__graph.png │ ├── classUISize__coll__graph.png │ ├── classUIBitmap__coll__graph.png │ ├── classUIColumns__coll__graph.png │ ├── classUIDisplay__coll__graph.png │ ├── classUIRows__inherit__graph.png │ ├── classUIWidget__coll__graph.png │ ├── classUIBitmap__inherit__graph.png │ ├── classUICards__inherit__graph.png │ ├── classUIColumns__inherit__graph.png │ ├── classUIDisplay__inherit__graph.png │ ├── classUIEnvelope__coll__graph.png │ ├── classUIParent__inherit__graph.png │ ├── classUITextIcon__coll__graph.png │ ├── classUITextLine__coll__graph.png │ ├── classUIWidget__inherit__graph.png │ ├── classUICheckerboard__coll__graph.png │ ├── classUIEnvelope__inherit__graph.png │ ├── classUITextIcon__inherit__graph.png │ ├── classUITextLine__inherit__graph.png │ ├── classUIVerticalLine__coll__graph.png │ ├── classUIWidgetGroup__coll__graph.png │ ├── classUICheckerboard__inherit__graph.png │ ├── classUIHorizontalLine__coll__graph.png │ ├── classUIVerticalLine__inherit__graph.png │ ├── classUIWidgetGroup__inherit__graph.png │ ├── classUIHorizontalLine__inherit__graph.png │ ├── classUISize__coll__graph.map │ ├── classUIArea__coll__graph.map │ ├── inherit_graph_3.map │ ├── inherit_graph_2.map │ ├── inherit_graph_0.map │ ├── classUICheckerboard__inherit__graph.map │ ├── classUIBitmap__inherit__graph.map │ ├── classUIDisplay__coll__graph.map │ ├── classUIDisplay__inherit__graph.map │ ├── classUIVerticalLine__inherit__graph.map │ ├── classUIHorizontalLine__inherit__graph.map │ ├── classUIWidget__coll__graph.map │ ├── classUIEnvelope__inherit__graph.map │ ├── classUITextIcon__inherit__graph.map │ ├── classUITextLine__inherit__graph.map │ ├── classUIRows__inherit__graph.map │ ├── classUIWidgetGroup__coll__graph.map │ ├── classUICheckerboard__coll__graph.map │ ├── classUICards__inherit__graph.map │ ├── classUIColumns__inherit__graph.map │ ├── classUIBitmap__coll__graph.map │ ├── classUIEnvelope__coll__graph.map │ ├── classUITextLine__coll__graph.map │ ├── classUIVerticalLine__coll__graph.map │ ├── classUIHorizontalLine__coll__graph.map │ ├── classUIRows__coll__graph.map │ ├── classUICards__coll__graph.map │ ├── classUIColumns__coll__graph.map │ ├── classUITextIcon__coll__graph.map │ ├── classUIWidgetGroup__inherit__graph.map │ ├── classUIParent__inherit__graph.map │ ├── classUIWidget__inherit__graph.map │ └── inherit_graph_1.map └── index.html ├── etc └── readme-graphics │ ├── hello-world.jpg │ ├── checkerboard.webp │ ├── buttons-and-led.webp │ ├── mock-weather-title.jpg │ └── mock-weather-station.webp ├── src ├── UIEnums.h ├── UIParent.h ├── UIPoint.cpp ├── UITextIcon.cpp ├── UIPoint.h ├── UICheckerboard.h ├── UIWidget.cpp ├── UIWidgetGroup.cpp ├── UIVerticalLine.h ├── UIHorizontalLine.h ├── UIVerticalLine.cpp ├── UIHorizontalLine.cpp ├── UITextIcon.h ├── UICheckerboard.cpp ├── UiUiUi.h ├── UIColumns.cpp ├── UIRows.h ├── UIColumns.h ├── UIRows.cpp ├── UIBitmap.h ├── UICards.cpp ├── UIWidgetGroup.h ├── UIBitmap.cpp ├── UISize.cpp ├── UIEnvelope.cpp ├── UISize.h ├── UICards.h └── UIEnvelope.h ├── library.properties ├── LICENSE └── examples ├── HelloWorld └── HelloWorld.ino └── EnvelopeAroundChecker └── EnvelopeAroundChecker.ino /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | .*.swp 3 | *.swp 4 | 5 | -------------------------------------------------------------------------------- /docs/api/graph_legend.md5: -------------------------------------------------------------------------------- 1 | f51bf6e9a10430aafef59831b08dcbfe -------------------------------------------------------------------------------- /docs/api/inherit_graph_0.md5: -------------------------------------------------------------------------------- 1 | 9a8272365721266522c7996861a03f61 -------------------------------------------------------------------------------- /docs/api/inherit_graph_1.md5: -------------------------------------------------------------------------------- 1 | 798b6148f5e20571c1a521f49a138cdc -------------------------------------------------------------------------------- /docs/api/inherit_graph_2.md5: -------------------------------------------------------------------------------- 1 | d78b2ebca19580fefec6c461cd807c85 -------------------------------------------------------------------------------- /docs/api/inherit_graph_3.md5: -------------------------------------------------------------------------------- 1 | 686359ae8776f315d9ac28e78a5488bd -------------------------------------------------------------------------------- /docs/api/classUIArea__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 406eaf4ab801db23d27c64ca17883c57 -------------------------------------------------------------------------------- /docs/api/classUIBitmap__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 424b9ea2b2f13c32825bd6f89d99d7c6 -------------------------------------------------------------------------------- /docs/api/classUICards__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 426f7eb7d9e8e9512b401050b7b3289b -------------------------------------------------------------------------------- /docs/api/classUICards__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 998d4517038e6130ecd3711b7e2ee9ec -------------------------------------------------------------------------------- /docs/api/classUIColumns__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 30c16da98cd55741281c4fd482c17e68 -------------------------------------------------------------------------------- /docs/api/classUIDisplay__coll__graph.md5: -------------------------------------------------------------------------------- 1 | b284699766c260ca2f913611120cbf2b -------------------------------------------------------------------------------- /docs/api/classUIEnvelope__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 4af96729733c3f58f4b98f990ba1cd91 -------------------------------------------------------------------------------- /docs/api/classUIRows__coll__graph.md5: -------------------------------------------------------------------------------- 1 | f36b42d4293ff84ccb850a373002e192 -------------------------------------------------------------------------------- /docs/api/classUIRows__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 6fb52f8777124051a22cdedf8b1df360 -------------------------------------------------------------------------------- /docs/api/classUISize__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 2f58f4453c4d3b132214f34bac606b0c -------------------------------------------------------------------------------- /docs/api/classUITextIcon__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 751e0c650e4e68ef8692e802590f5c16 -------------------------------------------------------------------------------- /docs/api/classUITextLine__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 2320556788cf1c43b7acf585b23e5da3 -------------------------------------------------------------------------------- /docs/api/classUIWidget__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 7529015b04d93d591c3e205bfbc75f88 -------------------------------------------------------------------------------- /docs/api/classUIBitmap__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 38eb7231d3308f1bcaea938a740522bd -------------------------------------------------------------------------------- /docs/api/classUICheckerboard__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 59c2e185f1660bf3a0205c4df16d0e11 -------------------------------------------------------------------------------- /docs/api/classUIColumns__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 35dfe5cc915b114e2921fb816724fd32 -------------------------------------------------------------------------------- /docs/api/classUIDisplay__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | b284699766c260ca2f913611120cbf2b -------------------------------------------------------------------------------- /docs/api/classUIEnvelope__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 0c6919a528dc4abaee014ee321b5bbd4 -------------------------------------------------------------------------------- /docs/api/classUIParent__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | fc6036b9189aca11414938ed06ecafbc -------------------------------------------------------------------------------- /docs/api/classUITextIcon__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 1ed843aa564dba367527a99f17a5934f -------------------------------------------------------------------------------- /docs/api/classUITextLine__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 16de8bbb6accb893e691afd444949c84 -------------------------------------------------------------------------------- /docs/api/classUIVerticalLine__coll__graph.md5: -------------------------------------------------------------------------------- 1 | 171d54608de50d3437d2526b3914e6df -------------------------------------------------------------------------------- /docs/api/classUIWidgetGroup__coll__graph.md5: -------------------------------------------------------------------------------- 1 | a439c738578825e45326c5182eb5cb63 -------------------------------------------------------------------------------- /docs/api/classUIWidget__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 05c9742bc8b9dda0d4ea1934f370be5a -------------------------------------------------------------------------------- /docs/api/classUICheckerboard__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | ec3e390c4ca3c8c17efc6f8a17579de4 -------------------------------------------------------------------------------- /docs/api/classUIHorizontalLine__coll__graph.md5: -------------------------------------------------------------------------------- 1 | a4c741572fa2a309930f6c4960fb30aa -------------------------------------------------------------------------------- /docs/api/classUIHorizontalLine__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | f10fc7fa6ca5760a4075d6500e80fe9d -------------------------------------------------------------------------------- /docs/api/classUIVerticalLine__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | 4a52eb683797240756d03415aa3f6923 -------------------------------------------------------------------------------- /docs/api/classUIWidgetGroup__inherit__graph.md5: -------------------------------------------------------------------------------- 1 | d0328d4058d1357b222894219f41ab94 -------------------------------------------------------------------------------- /docs/api/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/bc_s.png -------------------------------------------------------------------------------- /docs/api/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/bdwn.png -------------------------------------------------------------------------------- /docs/api/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/doc.png -------------------------------------------------------------------------------- /docs/api/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/nav_f.png -------------------------------------------------------------------------------- /docs/api/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/nav_g.png -------------------------------------------------------------------------------- /docs/api/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/nav_h.png -------------------------------------------------------------------------------- /docs/api/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/open.png -------------------------------------------------------------------------------- /docs/api/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/tab_a.png -------------------------------------------------------------------------------- /docs/api/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/tab_b.png -------------------------------------------------------------------------------- /docs/api/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/tab_h.png -------------------------------------------------------------------------------- /docs/api/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/tab_s.png -------------------------------------------------------------------------------- /docs/api/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/closed.png -------------------------------------------------------------------------------- /docs/api/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/sync_on.png -------------------------------------------------------------------------------- /docs/api/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/folderopen.png -------------------------------------------------------------------------------- /docs/api/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/splitbar.png -------------------------------------------------------------------------------- /docs/api/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/sync_off.png -------------------------------------------------------------------------------- /docs/api/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/folderclosed.png -------------------------------------------------------------------------------- /docs/api/graph_legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/graph_legend.png -------------------------------------------------------------------------------- /docs/api/inherit_graph_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/inherit_graph_0.png -------------------------------------------------------------------------------- /docs/api/inherit_graph_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/inherit_graph_1.png -------------------------------------------------------------------------------- /docs/api/inherit_graph_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/inherit_graph_2.png -------------------------------------------------------------------------------- /docs/api/inherit_graph_3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/inherit_graph_3.png -------------------------------------------------------------------------------- /docs/api/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/search/search_l.png -------------------------------------------------------------------------------- /docs/api/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/search/search_m.png -------------------------------------------------------------------------------- /docs/api/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/search/search_r.png -------------------------------------------------------------------------------- /etc/readme-graphics/hello-world.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/etc/readme-graphics/hello-world.jpg -------------------------------------------------------------------------------- /docs/api/classUIArea__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIArea__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUICards__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUICards__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIRows__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIRows__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUISize__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUISize__coll__graph.png -------------------------------------------------------------------------------- /etc/readme-graphics/checkerboard.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/etc/readme-graphics/checkerboard.webp -------------------------------------------------------------------------------- /docs/api/classUIBitmap__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIBitmap__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIColumns__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIColumns__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIDisplay__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIDisplay__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIRows__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIRows__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIWidget__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIWidget__coll__graph.png -------------------------------------------------------------------------------- /etc/readme-graphics/buttons-and-led.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/etc/readme-graphics/buttons-and-led.webp -------------------------------------------------------------------------------- /docs/api/classUIBitmap__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIBitmap__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUICards__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUICards__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIColumns__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIColumns__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIDisplay__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIDisplay__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIEnvelope__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIEnvelope__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIParent__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIParent__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUITextIcon__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUITextIcon__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUITextLine__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUITextLine__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIWidget__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIWidget__inherit__graph.png -------------------------------------------------------------------------------- /etc/readme-graphics/mock-weather-title.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/etc/readme-graphics/mock-weather-title.jpg -------------------------------------------------------------------------------- /docs/api/classUICheckerboard__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUICheckerboard__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIEnvelope__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIEnvelope__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUITextIcon__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUITextIcon__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUITextLine__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUITextLine__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIVerticalLine__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIVerticalLine__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIWidgetGroup__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIWidgetGroup__coll__graph.png -------------------------------------------------------------------------------- /etc/readme-graphics/mock-weather-station.webp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/etc/readme-graphics/mock-weather-station.webp -------------------------------------------------------------------------------- /docs/api/classUICheckerboard__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUICheckerboard__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIHorizontalLine__coll__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIHorizontalLine__coll__graph.png -------------------------------------------------------------------------------- /docs/api/classUIVerticalLine__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIVerticalLine__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/classUIWidgetGroup__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIWidgetGroup__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/search/all_12.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_0',['x',['../classUIPoint.html#a1c6c11b63ba474746ca258d649746b35',1,'UIPoint']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/all_13.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['y_0',['y',['../classUIPoint.html#a7f95b0ec8f89cfadb4f4cfc5a5342a93',1,'UIPoint']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/all_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['top_0',['top',['../classUIArea.html#ad24861bd515942b00c83de805bf27b8b',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/classUIHorizontalLine__inherit__graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dirkhillbrecht/UiUiUi/HEAD/docs/api/classUIHorizontalLine__inherit__graph.png -------------------------------------------------------------------------------- /docs/api/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bottom_0',['bottom',['../classUIArea.html#a4357f412f8a1af115225110177858e3e',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/all_11.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['width_0',['width',['../classUISize.html#a02274a0b5cb7333ab2775569625a2428',1,'UISize']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['getsize_0',['getSize',['../classUIArea.html#a9ad02a47195806e1a41e77899c9a7382',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['next_0',['next',['../classUIWidget.html#ae14d2ce95da71cc9e6c7853da51a52fa',1,'UIWidget']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['left_0',['left',['../classUIArea.html#aa0c663457b8d58bb1c9146ed3662ebac',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['top_0',['top',['../classUIArea.html#ad24861bd515942b00c83de805bf27b8b',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['x_0',['x',['../classUIPoint.html#a1c6c11b63ba474746ca258d649746b35',1,'UIPoint']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['y_0',['y',['../classUIPoint.html#a7f95b0ec8f89cfadb4f4cfc5a5342a93',1,'UIPoint']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['bottom_0',['bottom',['../classUIArea.html#a4357f412f8a1af115225110177858e3e',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dim_0',['dim',['../classUIWidget.html#a0261a8f1dd951f42c12389c7b5962235',1,'UIWidget']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['height_0',['height',['../classUISize.html#a0740cac8bf7aa33f48f3428277113da2',1,'UISize']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['next_0',['next',['../classUIWidget.html#ae14d2ce95da71cc9e6c7853da51a52fa',1,'UIWidget']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['width_0',['width',['../classUISize.html#a02274a0b5cb7333ab2775569625a2428',1,'UISize']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['enable_0',['enable',['../classUIDisplay.html#a087a02b48b00b463841740015ae5a7b2',1,'UIDisplay']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['getsize_0',['getSize',['../classUIArea.html#a9ad02a47195806e1a41e77899c9a7382',1,'UIArea']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/variables_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['parent_0',['parent',['../classUIWidget.html#a50b8deca83e58561e5356d57a038bb75',1,'UIWidget']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['preferredsize_0',['preferredSize',['../classUIWidget.html#a498a143bee0d8f51ac729469af2833eb',1,'UIWidget']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/classUISize__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/api/classUIArea__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/api/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['uiuiui_20_2d_20a_20user_20interface_20library_20for_20micro_20controllers_2e_0',['UiUiUi - A User interface library for micro controllers.',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/inherit_graph_3.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/api/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['empty_0',['EMPTY',['../classUIArea.html#a4508d99bdc0feae3f35293921df6f599',1,'UIArea::EMPTY()'],['../classUISize.html#a730a4de404bf2bbc21626f950ed8b20b',1,'UISize::EMPTY()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/inherit_graph_2.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/api/inherit_graph_0.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs/api/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['hasarea_0',['hasArea',['../classUIArea.html#accb79e661fe11db13abd6f90d1981abe',1,'UIArea']]], 4 | ['hide_1',['hide',['../classUICards.html#af8b99bdf216edfe88ee9cffe539a5d35',1,'UICards']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/variables_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5flen_0',['MAX_LEN',['../classUISize.html#ad6235215bc2e2eb04229889b1c466fe5',1,'UISize']]], 4 | ['max_5fsize_1',['MAX_SIZE',['../classUISize.html#a5594598f33d1707482d1bc0f4db4d9aa',1,'UISize']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['parent_0',['parent',['../classUIWidget.html#a50b8deca83e58561e5356d57a038bb75',1,'UIWidget']]], 4 | ['preferredsize_1',['preferredSize',['../classUIWidget.html#a498a143bee0d8f51ac729469af2833eb',1,'UIWidget']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['activate_0',['activate',['../classUIDisplay.html#a4a45740e29438482d2f6a7febd2016e8',1,'UIDisplay']]], 4 | ['alignedtopleft_1',['alignedTopLeft',['../classUIArea.html#a1b5ffe9e381ea98278719f9133c20fea',1,'UIArea']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['firstchild_0',['firstChild',['../classUIWidgetGroup.html#abf0fbb3785c4e9c854f03a761f8425a7',1,'UIWidgetGroup']]], 4 | ['font_1',['font',['../classUITextLine.html#a3bae3b85b6fb25aa7bcef6d0b33a2b55',1,'UITextLine']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['activate_0',['activate',['../classUIDisplay.html#a4a45740e29438482d2f6a7febd2016e8',1,'UIDisplay']]], 4 | ['alignedtopleft_1',['alignedTopLeft',['../classUIArea.html#a1b5ffe9e381ea98278719f9133c20fea',1,'UIArea']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/variables_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['firstchild_0',['firstChild',['../classUIWidgetGroup.html#abf0fbb3785c4e9c854f03a761f8425a7',1,'UIWidgetGroup']]], 4 | ['font_1',['font',['../classUITextLine.html#a3bae3b85b6fb25aa7bcef6d0b33a2b55',1,'UITextLine']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/variables_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['renderchildren_0',['renderChildren',['../classUIWidgetGroup.html#a5e0ef64c1855f617c3831e9cccb463ef',1,'UIWidgetGroup']]], 4 | ['right_1',['right',['../classUIArea.html#a5aae6141e61d5f7bc913a830ffa5ebd0',1,'UIArea']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['empty_0',['EMPTY',['../classUIArea.html#a4508d99bdc0feae3f35293921df6f599',1,'UIArea::EMPTY()'],['../classUISize.html#a730a4de404bf2bbc21626f950ed8b20b',1,'UISize::EMPTY()']]], 4 | ['enable_1',['enable',['../classUIDisplay.html#a087a02b48b00b463841740015ae5a7b2',1,'UIDisplay']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['hasarea_0',['hasArea',['../classUIArea.html#accb79e661fe11db13abd6f90d1981abe',1,'UIArea']]], 4 | ['height_1',['height',['../classUISize.html#a0740cac8bf7aa33f48f3428277113da2',1,'UISize']]], 5 | ['hide_2',['hide',['../classUICards.html#af8b99bdf216edfe88ee9cffe539a5d35',1,'UICards']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/api/classUICheckerboard__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/api/classUIBitmap__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/api/classUIDisplay__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/api/classUIDisplay__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Page Redirection 7 | 8 | 9 | If you are not redirected automatically, follow the link to the documentation. 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/api/classUIVerticalLine__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/api/classUIHorizontalLine__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /docs/api/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['init_0',['init',['../classUIDisplay.html#a7797b9c831714010a4c6639e0a29d982',1,'UIDisplay']]], 4 | ['intersectwith_1',['intersectWith',['../classUIArea.html#a691426d161ef87275f71f1951d23ae24',1,'UIArea']]], 5 | ['isempty_2',['isEmpty',['../classUISize.html#a3b7bd61a2945d5b2a0c51a86a9878385',1,'UISize']]], 6 | ['isupdatingdisplay_3',['isUpdatingDisplay',['../classUIDisplay.html#aabbe87a7a7bd8565a12d033f11021cbb',1,'UIDisplay']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/api/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['init_0',['init',['../classUIDisplay.html#a7797b9c831714010a4c6639e0a29d982',1,'UIDisplay']]], 4 | ['intersectwith_1',['intersectWith',['../classUIArea.html#a691426d161ef87275f71f1951d23ae24',1,'UIArea']]], 5 | ['isempty_2',['isEmpty',['../classUISize.html#a3b7bd61a2945d5b2a0c51a86a9878385',1,'UISize']]], 6 | ['isupdatingdisplay_3',['isUpdatingDisplay',['../classUIDisplay.html#aabbe87a7a7bd8565a12d033f11021cbb',1,'UIDisplay']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/api/search/functions_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['layout_0',['layout',['../classUICards.html#a5a9f46161c0916db8028a8625bcdbc9d',1,'UICards::layout()'],['../classUIColumns.html#a58dd329fe5f380dacef0dc3ea96fac26',1,'UIColumns::layout()'],['../classUIEnvelope.html#ad703f6081e18c459b0c5de4ea1e89767',1,'UIEnvelope::layout()'],['../classUIRows.html#a9c01248440ffc8ea4201d3221093ac3b',1,'UIRows::layout()'],['../classUIWidget.html#a0b9420d40c24fce08a9898e03dfe0bb0',1,'UIWidget::layout()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "abcdefghilmnprstuwxy", 4 | 1: "u", 5 | 2: "acdeghilmprsu", 6 | 3: "bdefhlmnprtwxy", 7 | 4: "u" 8 | }; 9 | 10 | var indexSectionNames = 11 | { 12 | 0: "all", 13 | 1: "classes", 14 | 2: "functions", 15 | 3: "variables", 16 | 4: "pages" 17 | }; 18 | 19 | var indexSectionLabels = 20 | { 21 | 0: "All", 22 | 1: "Classes", 23 | 2: "Functions", 24 | 3: "Variables", 25 | 4: "Pages" 26 | }; 27 | 28 | -------------------------------------------------------------------------------- /src/UIEnums.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | // enum definitions for the UiUiUi library 5 | 6 | #pragma once 7 | 8 | /** Alignment of a widget within another. */ 9 | enum UIAlignment { TopLeft,TopCenter,TopRight,CenterLeft,Center,CenterRight,BottomLeft,BottomCenter,BottomRight }; 10 | 11 | /** Expansion directions if there is more space on the display than preferred. */ 12 | enum UIExpansion { None,Horizontal,Vertical,Both }; 13 | 14 | // end of file 15 | -------------------------------------------------------------------------------- /docs/api/classUIWidget__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/api/classUIEnvelope__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/api/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['deactivate_0',['deactivate',['../classUIDisplay.html#af662231a6dc1fbe05307ad5a3fea64cc',1,'UIDisplay']]], 4 | ['debugprint_1',['debugPrint',['../classUIArea.html#a37ad5783f09be648cf7b596d643a4f94',1,'UIArea::debugPrint()'],['../classUIPoint.html#adf0d1e85b75a645304810e4f93a7801b',1,'UIPoint::debugPrint()'],['../classUISize.html#af1a65ad0333be6966e4af012ddad53aa',1,'UISize::debugPrint()']]], 5 | ['disable_2',['disable',['../classUIDisplay.html#ab7d1bd3a9c1c02457255ad305aa48f8f',1,'UIDisplay']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/api/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['layout_0',['layout',['../classUICards.html#a5a9f46161c0916db8028a8625bcdbc9d',1,'UICards::layout()'],['../classUIColumns.html#a58dd329fe5f380dacef0dc3ea96fac26',1,'UIColumns::layout()'],['../classUIEnvelope.html#ad703f6081e18c459b0c5de4ea1e89767',1,'UIEnvelope::layout()'],['../classUIRows.html#a9c01248440ffc8ea4201d3221093ac3b',1,'UIRows::layout()'],['../classUIWidget.html#a0b9420d40c24fce08a9898e03dfe0bb0',1,'UIWidget::layout()']]], 4 | ['left_1',['left',['../classUIArea.html#aa0c663457b8d58bb1c9146ed3662ebac',1,'UIArea']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/api/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
No Matches
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/api/classUITextIcon__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/api/classUITextLine__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs/api/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5flen_5for_0',['max_len_or',['../classUISize.html#afb4368e31db0a719db1861969299e94d',1,'UISize']]], 4 | ['maxboth_1',['maxBoth',['../classUISize.html#ad1899da490781738223b80d8a38cc286',1,'UISize']]], 5 | ['maxwidthcumulateheight_2',['maxWidthCumulateHeight',['../classUISize.html#a0e63d656709efb35c3ad292c44877271',1,'UISize']]], 6 | ['my_5fmax_3',['my_max',['../classUISize.html#abb918a161be78ff0e805cbba303c15c0',1,'UISize']]], 7 | ['my_5fmin_4',['my_min',['../classUISize.html#ac633b4fa8b0cbfefec55438d504d0012',1,'UISize']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/api/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['deactivate_0',['deactivate',['../classUIDisplay.html#af662231a6dc1fbe05307ad5a3fea64cc',1,'UIDisplay']]], 4 | ['debugprint_1',['debugPrint',['../classUIArea.html#a37ad5783f09be648cf7b596d643a4f94',1,'UIArea::debugPrint()'],['../classUIPoint.html#adf0d1e85b75a645304810e4f93a7801b',1,'UIPoint::debugPrint()'],['../classUISize.html#af1a65ad0333be6966e4af012ddad53aa',1,'UISize::debugPrint()']]], 5 | ['dim_2',['dim',['../classUIWidget.html#a0261a8f1dd951f42c12389c7b5962235',1,'UIWidget']]], 6 | ['disable_3',['disable',['../classUIDisplay.html#ab7d1bd3a9c1c02457255ad305aa48f8f',1,'UIDisplay']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/api/classUIRows__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUIWidgetGroup__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUICheckerboard__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUICards__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUIColumns__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/UIParent.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "UIWidget.h" 7 | 8 | /** Simple abstraction of elements which have at least one child. 9 | * 10 | * This pure virtual class is mainly implemented by UIWidgetGroup, 11 | * as that is the class which contains other widgets as children. 12 | * But as UIDisplay also has a child, it is implemented there, too. 13 | */ 14 | class UIParent { 15 | 16 | public: 17 | 18 | /** Called by any child of this group to indicate that it wants to be rendered. */ 19 | virtual void childNeedsRendering(UIWidget *child)=0; 20 | 21 | }; 22 | 23 | // end of file 24 | -------------------------------------------------------------------------------- /docs/api/classUIBitmap__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUIEnvelope__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUITextLine__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /docs/api/classUIVerticalLine__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/UIPoint.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #include "Arduino.h" 5 | #include "UIPoint.h" 6 | 7 | /* Initialize the point from two values. */ 8 | UIPoint::UIPoint(uint16_t x,uint16_t y): x(x),y(y) {} 9 | 10 | /* Initialize the point as "0,0" */ 11 | UIPoint::UIPoint(): UIPoint(0,0) {} 12 | 13 | /* Set the point from another point. */ 14 | void UIPoint::setFrom(UIPoint p) { x=p.x; y=p.y; } 15 | 16 | /* Debug output of this point with some prepended label. */ 17 | void UIPoint::debugPrint(const char* label) { 18 | Serial.print(label);Serial.print("("); 19 | Serial.print(x);Serial.print(","); 20 | Serial.print(y);Serial.println(")"); 21 | } 22 | 23 | // end of file 24 | -------------------------------------------------------------------------------- /src/UITextIcon.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIEnums.h" 10 | #include "UISize.h" 11 | #include "UIWidget.h" 12 | #include "UITextLine.h" 13 | #include "UITextIcon.h" 14 | 15 | UITextIcon::UITextIcon(const uint8_t* font,UISize preferredSize,UIWidget* next): 16 | UITextLine(font,UIAlignment::Center,next),myPreferredSize(preferredSize) {} 17 | 18 | void UITextIcon::computePreferredSize(U8G2 *display,UISize *preferredSize) { 19 | UITextLine::computePreferredSize(display,preferredSize); // to initialize textSize 20 | preferredSize->set(&myPreferredSize); 21 | } 22 | 23 | // end of file 24 | -------------------------------------------------------------------------------- /docs/api/classUIHorizontalLine__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /library.properties: -------------------------------------------------------------------------------- 1 | name=UiUiUi 2 | version=0.9.2 3 | author=Dirk Hillbrecht 4 | maintainer=Dirk Hillbrecht 5 | sentence=Library for complex user interfaces with automatic layouting and completely static data structures. 6 | paragraph=UiUiUi is a library for complex user interface design. It is based on hierarchically defined widgets which are layouted automatically using layout hints. All data structures are designed statically, no heap space is used. loop()-style and event-driven sketch design is supported. UiUiUi is based on U8g2 and supports all of its displays in all orientations. 7 | category=Display 8 | url=https://github.com/dirkhillbrecht/uiuiui 9 | architectures=* 10 | license=BSD-2-Clause 11 | -------------------------------------------------------------------------------- /docs/api/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['max_5flen_0',['MAX_LEN',['../classUISize.html#ad6235215bc2e2eb04229889b1c466fe5',1,'UISize']]], 4 | ['max_5flen_5for_1',['max_len_or',['../classUISize.html#afb4368e31db0a719db1861969299e94d',1,'UISize']]], 5 | ['max_5fsize_2',['MAX_SIZE',['../classUISize.html#a5594598f33d1707482d1bc0f4db4d9aa',1,'UISize']]], 6 | ['maxboth_3',['maxBoth',['../classUISize.html#ad1899da490781738223b80d8a38cc286',1,'UISize']]], 7 | ['maxwidthcumulateheight_4',['maxWidthCumulateHeight',['../classUISize.html#a0e63d656709efb35c3ad292c44877271',1,'UISize']]], 8 | ['my_5fmax_5',['my_max',['../classUISize.html#abb918a161be78ff0e805cbba303c15c0',1,'UISize']]], 9 | ['my_5fmin_6',['my_min',['../classUISize.html#ac633b4fa8b0cbfefec55438d504d0012',1,'UISize']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /docs/api/classUIRows__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/api/classUICards__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/UIPoint.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | 8 | /** Representation of a point on the display. */ 9 | class UIPoint final { 10 | public: 11 | 12 | /** Initialize the point from two values. */ 13 | UIPoint(uint16_t x,uint16_t y); 14 | 15 | /** Initialize the point as "0,0" */ 16 | UIPoint(); 17 | 18 | /** Set the point from another point. */ 19 | void setFrom(UIPoint p); 20 | 21 | /** Debug output of this point with some prepended label. */ 22 | void debugPrint(const char* label); 23 | 24 | /** X Coordinate of the point, normally 0 is top */ 25 | uint16_t x; 26 | 27 | /** Y Coordinate of the point, normally 0 is left */ 28 | uint16_t y; 29 | 30 | }; 31 | 32 | // end of file 33 | -------------------------------------------------------------------------------- /docs/api/classUIColumns__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/api/classUITextIcon__coll__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /docs/api/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['render_0',['render',['../classUIBitmap.html#aa5eccfbd1dc28f10a1ffc53dc12bcced',1,'UIBitmap::render()'],['../classUICards.html#ae19415333a66c7d6bed0b9d64c56f97b',1,'UICards::render()'],['../classUICheckerboard.html#afc1e0d931060cf0e42be00a68e3d428a',1,'UICheckerboard::render()'],['../classUIDisplay.html#a2131f4385ed0ed211412db2339ca4945',1,'UIDisplay::render()'],['../classUIEnvelope.html#a6bb2ff02abba4cc94917ea59b74aacca',1,'UIEnvelope::render()'],['../classUIHorizontalLine.html#a9a5dc837b3b488d0ec01f0fe91d8e6ad',1,'UIHorizontalLine::render()'],['../classUITextLine.html#a090eae933a51e0ed3a76b9eea60ee8d6',1,'UITextLine::render()'],['../classUIVerticalLine.html#a7f0c9e2beb1bc46e7678dfddec819e74',1,'UIVerticalLine::render()'],['../classUIWidget.html#a0b15cd856970a85d96b25269689a44ff',1,'UIWidget::render()'],['../classUIWidgetGroup.html#a19ffdd7befbf909d00355d9503c633bc',1,'UIWidgetGroup::render()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/api/classUIWidgetGroup__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /docs/api/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['render_0',['render',['../classUIBitmap.html#aa5eccfbd1dc28f10a1ffc53dc12bcced',1,'UIBitmap::render()'],['../classUICards.html#ae19415333a66c7d6bed0b9d64c56f97b',1,'UICards::render()'],['../classUICheckerboard.html#afc1e0d931060cf0e42be00a68e3d428a',1,'UICheckerboard::render()'],['../classUIDisplay.html#a2131f4385ed0ed211412db2339ca4945',1,'UIDisplay::render()'],['../classUIEnvelope.html#a6bb2ff02abba4cc94917ea59b74aacca',1,'UIEnvelope::render()'],['../classUIHorizontalLine.html#a9a5dc837b3b488d0ec01f0fe91d8e6ad',1,'UIHorizontalLine::render()'],['../classUITextLine.html#a090eae933a51e0ed3a76b9eea60ee8d6',1,'UITextLine::render()'],['../classUIVerticalLine.html#a7f0c9e2beb1bc46e7678dfddec819e74',1,'UIVerticalLine::render()'],['../classUIWidget.html#a0b15cd856970a85d96b25269689a44ff',1,'UIWidget::render()'],['../classUIWidgetGroup.html#a19ffdd7befbf909d00355d9503c633bc',1,'UIWidgetGroup::render(U8G2 *display, bool force)']]], 4 | ['renderchildren_1',['renderChildren',['../classUIWidgetGroup.html#a5e0ef64c1855f617c3831e9cccb463ef',1,'UIWidgetGroup']]], 5 | ['right_2',['right',['../classUIArea.html#a5aae6141e61d5f7bc913a830ffa5ebd0',1,'UIArea']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /src/UICheckerboard.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UISize.h" 10 | #include "UIWidget.h" 11 | 12 | 13 | /** A widget drawing a checkerboard into its space. */ 14 | class UICheckerboard : public UIWidget { 15 | 16 | public: 17 | 18 | /** Create a checkerboard widget with the given preferred size and a potential successor. */ 19 | UICheckerboard(UISize preferredSize=UISize(),UIWidget* next=nullptr); 20 | 21 | /** Create a checkerboard widget with the given successor. */ 22 | UICheckerboard(UIWidget* next); 23 | 24 | /** Render the checkerboard pattern. */ 25 | UIArea* render(U8G2* display,bool force); 26 | 27 | protected: 28 | 29 | /** Generate the preferred size from the font size. */ 30 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 31 | 32 | private: 33 | 34 | /** The bit pattern to use for creating the checkerboard pattern. */ 35 | static unsigned char checkerboard_bits[]; 36 | 37 | /** Size of the currently rendered text. */ 38 | UISize preferredSize; 39 | 40 | }; 41 | 42 | // end of file 43 | -------------------------------------------------------------------------------- /docs/api/classUIParent__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /docs/api/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['uiarea_0',['UIArea',['../classUIArea.html',1,'']]], 4 | ['uibitmap_1',['UIBitmap',['../classUIBitmap.html',1,'']]], 5 | ['uicards_2',['UICards',['../classUICards.html',1,'']]], 6 | ['uicheckerboard_3',['UICheckerboard',['../classUICheckerboard.html',1,'']]], 7 | ['uicolumns_4',['UIColumns',['../classUIColumns.html',1,'']]], 8 | ['uidisplay_5',['UIDisplay',['../classUIDisplay.html',1,'']]], 9 | ['uienvelope_6',['UIEnvelope',['../classUIEnvelope.html',1,'']]], 10 | ['uihorizontalline_7',['UIHorizontalLine',['../classUIHorizontalLine.html',1,'']]], 11 | ['uiparent_8',['UIParent',['../classUIParent.html',1,'']]], 12 | ['uipoint_9',['UIPoint',['../classUIPoint.html',1,'']]], 13 | ['uirows_10',['UIRows',['../classUIRows.html',1,'']]], 14 | ['uisize_11',['UISize',['../classUISize.html',1,'']]], 15 | ['uitexticon_12',['UITextIcon',['../classUITextIcon.html',1,'']]], 16 | ['uitextline_13',['UITextLine',['../classUITextLine.html',1,'']]], 17 | ['uiverticalline_14',['UIVerticalLine',['../classUIVerticalLine.html',1,'']]], 18 | ['uiwidget_15',['UIWidget',['../classUIWidget.html',1,'']]], 19 | ['uiwidgetgroup_16',['UIWidgetGroup',['../classUIWidgetGroup.html',1,'']]] 20 | ]; 21 | -------------------------------------------------------------------------------- /src/UIWidget.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | #include "UIEnums.h" 8 | #include "UISize.h" 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | #include "UIParent.h" 12 | 13 | 14 | UIWidget::UIWidget(UIWidget *next): dim(),thePreferredSize(),next(next),parent(nullptr) {} 15 | 16 | UISize UIWidget::preferredSize(U8G2* display) { 17 | if (thePreferredSize.isEmpty()) 18 | computePreferredSize(display,&thePreferredSize); 19 | return thePreferredSize; 20 | } 21 | 22 | void UIWidget::layout(U8G2* display,UIArea* dim) { 23 | this->dim.set(dim); 24 | } 25 | 26 | void UIWidget::clearBox(U8G2* display,UIArea *dimm) { 27 | display->setDrawColor(0); 28 | display->drawBox(dimm->left,dimm->top,(dimm->right-dimm->left),(dimm->bottom-dimm->top)); 29 | } 30 | 31 | void UIWidget::clearFull(U8G2 *display) { 32 | clearBox(display,&dim); 33 | } 34 | 35 | void UIWidget::clip(U8G2 *display) { 36 | display->setClipWindow(dim.left,dim.top,dim.right,dim.bottom); 37 | } 38 | 39 | void UIWidget::setParent(UIParent *parent) { 40 | this->parent=parent; 41 | } 42 | 43 | void UIWidget::signalNeedsRendering() { 44 | if (parent) 45 | parent->childNeedsRendering(this); 46 | } 47 | 48 | // end of file 49 | -------------------------------------------------------------------------------- /src/UIWidgetGroup.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | #include "UIArea.h" 8 | #include "UIWidget.h" 9 | #include "UIWidgetGroup.h" 10 | 11 | /* Create a widget group with a linked list of sub-widgets and a potential successor. */ 12 | UIWidgetGroup::UIWidgetGroup(UIWidget* firstChild,UIWidget* next): 13 | UIWidget(next), firstChild(firstChild), rendered(), renderChildren(false) { 14 | UIWidget* elem=firstChild; 15 | while (elem) { 16 | elem->setParent(this); 17 | elem=elem->next; 18 | } 19 | } 20 | 21 | /* Default implementation of rendering a widget group is to render all of its sub-widgets. */ 22 | UIArea* UIWidgetGroup::render(U8G2* display,bool force) { 23 | rendered.set(0,0,0,0); 24 | if (force || renderChildren) { 25 | UIWidget* elem=firstChild; 26 | while (elem) { 27 | rendered.uniteWith(elem->render(display,force)); 28 | elem=elem->next; 29 | } 30 | renderChildren=false; 31 | } 32 | return &rendered; 33 | } 34 | 35 | /** Called by any child of this group to indicate that it wants to be rendered. */ 36 | void UIWidgetGroup::childNeedsRendering(UIWidget *child) { 37 | if (!renderChildren) { 38 | renderChildren=true; 39 | signalNeedsRendering(); 40 | } 41 | } 42 | 43 | // end of file 44 | -------------------------------------------------------------------------------- /src/UIVerticalLine.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | 12 | /** Vertical line with optional empty border left and right, always spreads as wide as possible to top and bottom. */ 13 | class UIVerticalLine : public UIWidget { 14 | 15 | public: 16 | 17 | /** Create a vertical line. 18 | * 19 | * Defaults are set to an empty border on left and right (default 0), 20 | * a line width (defaults to 1) and an optional successor. */ 21 | UIVerticalLine(uint16_t border=0,uint16_t lineWidth=1,UIWidget* next=nullptr); 22 | 23 | /** Create a vertical line of width 1 with no border on left and right. */ 24 | UIVerticalLine(UIWidget* next); 25 | 26 | /** A line is only rendered if rendering is forced, otherwise it never changes. */ 27 | UIArea* render(U8G2 *display,bool force); 28 | 29 | protected: 30 | 31 | /** The preferred size of a line is 1+2*border in width and "as high as possible" */ 32 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 33 | 34 | private: 35 | 36 | /** Width of the border. */ 37 | uint16_t border; 38 | 39 | /** Width of the line. */ 40 | uint16_t lineWidth; 41 | 42 | }; 43 | 44 | // end of file 45 | -------------------------------------------------------------------------------- /src/UIHorizontalLine.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | 12 | 13 | /** Horizontal line with optional empty border on top and bottom, always spreads as wide as possible to the left and right. */ 14 | class UIHorizontalLine : public UIWidget { 15 | 16 | public: 17 | 18 | /** Create a horizontal line. 19 | * 20 | * Defaults to an empty border on top and bottom (default 0), 21 | * a tiny line width (defaults to 1) and an optional successor. */ 22 | UIHorizontalLine(uint16_t border=0,uint16_t lineWidth=1,UIWidget* next=nullptr); 23 | 24 | /** Create a horizontal line of width 1 with no border on top and bottom. */ 25 | UIHorizontalLine(UIWidget* next); 26 | 27 | /** A line is only rendered if rendering is forced, otherwise it never changes. */ 28 | UIArea* render(U8G2 *display,bool force); 29 | 30 | protected: 31 | 32 | /** The preferred size of a line is 1+2*border in height and "as wide as possible" */ 33 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 34 | 35 | private: 36 | 37 | /** Width of the border. */ 38 | uint16_t border; 39 | 40 | /** Width of the line. */ 41 | uint16_t lineWidth; 42 | 43 | }; 44 | 45 | // end of file 46 | -------------------------------------------------------------------------------- /src/UIVerticalLine.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | #include "UIArea.h" 8 | #include "UIWidget.h" 9 | #include "UIVerticalLine.h" 10 | 11 | /* Create a vertical line with an empty border on left and right (defaults to 0), 12 | * a line width (defaults to 1) and an optional successor. */ 13 | UIVerticalLine::UIVerticalLine(uint16_t border,uint16_t lineWidth,UIWidget* next): 14 | UIWidget(next),border(border) {} 15 | 16 | /* Create a vertical line of width 1 with no border on left and right. */ 17 | UIVerticalLine::UIVerticalLine(UIWidget* next): UIVerticalLine(0,1,next) {} 18 | 19 | /* A line is only rendered if rendering is forced, otherwise it never changes. */ 20 | UIArea* UIVerticalLine::render(U8G2 *display,bool force) { 21 | if (force) { 22 | clip(display); 23 | clearFull(display); 24 | display->setDrawColor(1); 25 | uint16_t x=(dim.left+dim.right)/2; // cannot overflow due to MAX_LEN 26 | display->drawLine(x,dim.top,x,dim.bottom); 27 | return &dim; 28 | } 29 | else 30 | return &UIArea::EMPTY; 31 | } 32 | 33 | /* The preferred size of a line is 1+2*border in width and "as high as possible" */ 34 | void UIVerticalLine::computePreferredSize(U8G2 *display,UISize *preferredSize) { 35 | preferredSize->set(2*border+1,0); 36 | } 37 | 38 | // end of file 39 | -------------------------------------------------------------------------------- /docs/api/search/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 13 | 15 | 16 | 18 | image/svg+xml 19 | 21 | 22 | 23 | 24 | 25 | 27 | 31 | 32 | -------------------------------------------------------------------------------- /src/UIHorizontalLine.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | #include "UIHorizontalLine.h" 12 | 13 | 14 | /* Create a horizontal line with an empty border on top and bottom (defaults to 0), 15 | * a line width (defaults to 1) and an optional successor. */ 16 | UIHorizontalLine::UIHorizontalLine(uint16_t border,uint16_t lineWidth,UIWidget* next): 17 | UIWidget(next),border(border) {} 18 | 19 | /* Create a horizontal line of width 1 with no border on top and bottom. */ 20 | UIHorizontalLine::UIHorizontalLine(UIWidget* next): UIHorizontalLine(0,1,next) {} 21 | 22 | /* A line is only rendered if rendering is forced, otherwise it never changes. */ 23 | UIArea* UIHorizontalLine::render(U8G2 *display,bool force) { 24 | if (force) { 25 | clip(display); 26 | clearFull(display); 27 | display->setDrawColor(1); 28 | uint16_t y=(dim.top+dim.bottom)/2; // cannot overflow due to MAX_LEN 29 | display->drawLine(dim.left,y,dim.right,y); 30 | return &dim; 31 | } 32 | else 33 | return &UIArea::EMPTY; 34 | } 35 | 36 | /* The preferred size of a line is 1+2*border in height and "as wide as possible" */ 37 | void UIHorizontalLine::computePreferredSize(U8G2 *display,UISize *preferredSize) { 38 | preferredSize->set(0,2*border+1); 39 | } 40 | 41 | // end of file 42 | -------------------------------------------------------------------------------- /src/UITextIcon.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIEnums.h" 10 | #include "UISize.h" 11 | #include "UIWidget.h" 12 | #include "UITextLine.h" 13 | 14 | /** Widget which shows an icon by some normal text operation, usually with a font with icons. 15 | * 16 | * This is a specialized text line widget. 17 | * Its main difference is that its preferred size is not "as wide as possible", but 18 | * explicitly given in width and height. 19 | * 20 | * The actual icon to show is given via the inherited UITextLine::setText method. 21 | * Of course, clearText() works also. 22 | */ 23 | class UITextIcon : public UITextLine { 24 | 25 | public: 26 | 27 | /** Create a text icon with a specific font, a preferred size and a potential successor. */ 28 | UITextIcon(const uint8_t* font,UISize preferredSize,UIWidget* next=nullptr); 29 | 30 | protected: 31 | 32 | /** The preferred size is completely determined by the size given at construction time. 33 | * 34 | * The text line's preferred size computation is called nevertheless, 35 | * so that the internal initialisation takes place. 36 | */ 37 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 38 | 39 | private: 40 | 41 | /** The preferred size as given by the constructor. */ 42 | UISize myPreferredSize; 43 | 44 | }; 45 | 46 | // end of file 47 | -------------------------------------------------------------------------------- /src/UICheckerboard.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UISize.h" 10 | #include "UIWidget.h" 11 | #include "UICheckerboard.h" 12 | 13 | 14 | /** Create a checkerboard widget with the given preferred size and a potential successor. */ 15 | UICheckerboard::UICheckerboard(UISize preferredSize,UIWidget* next): 16 | UIWidget(next),preferredSize(preferredSize) {} 17 | 18 | /** Create a checkerboard widget with the given successor. */ 19 | UICheckerboard::UICheckerboard(UIWidget* next): UICheckerboard(UISize(),next) {} 20 | 21 | /** Render the checkerboard pattern. */ 22 | UIArea* UICheckerboard::render(U8G2* display,bool force) { 23 | if (force) { 24 | clip(display); 25 | display->setDrawColor(1); 26 | for (uint16_t y=dim.top;ydrawXBM(x,y,16,16,checkerboard_bits); 29 | return &dim; 30 | } 31 | else 32 | return &UIArea::EMPTY; 33 | } 34 | 35 | /** Generate the preferred size from the font size. */ 36 | void UICheckerboard::computePreferredSize(U8G2 *display,UISize *preferredSize) { 37 | preferredSize->set(&(this->preferredSize)); 38 | } 39 | 40 | unsigned char UICheckerboard::checkerboard_bits[] = { 41 | 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 42 | 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55, 43 | 0xaa, 0xaa, 0x55, 0x55, 0xaa, 0xaa, 0x55, 0x55 }; 44 | 45 | 46 | // end of file 47 | -------------------------------------------------------------------------------- /docs/api/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_11.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_12.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/all_13.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/functions_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/api/search/variables_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /src/UiUiUi.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | /** \mainpage UiUiUi - A User interface library for micro controllers. 7 | * 8 | * UiUiUi is a library for user interfaces. 9 | * It is aimed at micro controller platforms like Arduino, ESP32 or ESP8266. 10 | * It uses U8g2 as foundation for accessing the display hardware 11 | * so it runs on a vast number of displays. 12 | * 13 | * You incorporate UiUiUi into your project by one of two alternative ways: 14 | * 15 | * 1. Include `UiUiUi.h` to access the whole library and all widget types. 16 | * Use this if you design a complex interface and compile time does not matter. 17 | * 2. In smaller projects, you can simply include the header files of the classes 18 | * you need directly. It makes no difference and all subsequently needed files 19 | * will be loaded internally anyway. 20 | * 21 | * For more documentation, read through the widgets or visit the project page on Github. 22 | */ 23 | 24 | // Basic helper classes and definitions 25 | #include "UIEnums.h" 26 | #include "UIPoint.h" 27 | #include "UISize.h" 28 | #include "UIArea.h" 29 | 30 | // Simple widgets 31 | #include "UIWidget.h" 32 | #include "UITextLine.h" 33 | #include "UITextIcon.h" 34 | #include "UIHorizontalLine.h" 35 | #include "UIVerticalLine.h" 36 | #include "UICheckerboard.h" 37 | #include "UIEnvelope.h" 38 | #include "UIBitmap.h" 39 | 40 | // Widget groups 41 | #include "UIWidgetGroup.h" 42 | #include "UIRows.h" 43 | #include "UIColumns.h" 44 | #include "UICards.h" 45 | 46 | // Topmost class 47 | #include "UIDisplay.h" 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This library is licensed under the terms of 2 | the new-bsd license (two-clause bsd license). 3 | See also: http://www.opensource.org/licenses/bsd-license.php 4 | 5 | ============ BSD License for UiUiUi Code ============ 6 | 7 | The UiUiUi user interface library 8 | 9 | Copyright (c) 2022, Dirk Hillbrecht, Germany, dirk@hillbrecht.de 10 | All rights reserved. 11 | 12 | Redistribution and use in source and binary forms, with or without modification, 13 | are permitted provided that the following conditions are met: 14 | 15 | * Redistributions of source code must retain the above copyright notice, this list 16 | of conditions and the following disclaimer. 17 | 18 | * Redistributions in binary form must reproduce the above copyright notice, this 19 | list of conditions and the following disclaimer in the documentation and/or other 20 | materials provided with the distribution. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 23 | CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, 24 | INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 25 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 26 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 27 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 28 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 29 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 32 | STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 34 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35 | 36 | -------------------------------------------------------------------------------- /docs/api/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['set_0',['set',['../classUIArea.html#a1617bf5c5d663431f544ad05d19fd0fb',1,'UIArea::set(uint16_t left, uint16_t top, uint16_t right, uint16_t bottom)'],['../classUIArea.html#a2df3798555f84f9bf93cdb95e06ef9fc',1,'UIArea::set(const UIArea *source)'],['../classUIArea.html#ade8b3e83421758986203819b7761de46',1,'UIArea::set(UIPoint *topLeft, UISize *size)'],['../classUIArea.html#ae088e1e24afe82c89acb73d442edfae1',1,'UIArea::set(UIPoint *topLeft, uint16_t width, uint16_t height)'],['../classUISize.html#ac031e8aa126d50c1e156d9643cc111f4',1,'UISize::set(uint16_t width, uint16_t height)'],['../classUISize.html#a3f013656fe8f1a6cd5c73bb86410f16b',1,'UISize::set(UISize *other)']]], 4 | ['setfrom_1',['setFrom',['../classUIPoint.html#a39126e3bb65f5543fd501ffd91d23737',1,'UIPoint']]], 5 | ['setparent_2',['setParent',['../classUIWidget.html#acc38f64ab731edb952ff28862bc3c739',1,'UIWidget']]], 6 | ['settext_3',['setText',['../classUITextLine.html#a8d9753b7e803a05036e1c2b58513acb7',1,'UITextLine']]], 7 | ['setupdatetiles_4',['setUpdateTiles',['../classUIDisplay.html#a010833082aba3c241378cf00221ccb68',1,'UIDisplay']]], 8 | ['setvisiblewidget_5',['setVisibleWidget',['../classUICards.html#a78edc57ecec545eed27976c0d02445f4',1,'UICards']]], 9 | ['showfirstwidget_6',['showFirstWidget',['../classUICards.html#a78938eb265311d20ddd448dafa8b4784',1,'UICards']]], 10 | ['shrink_7',['shrink',['../classUIArea.html#a59bde38e1f6a1539ec2012e2b5012756',1,'UIArea']]], 11 | ['shrinkto_8',['shrinkTo',['../classUISize.html#a8b8723a86118f59b1e01324ef43f2122',1,'UISize']]], 12 | ['signalneedsrendering_9',['signalNeedsRendering',['../classUIWidget.html#a4b5254b86930c189bf82e511fb8b5e12',1,'UIWidget']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /docs/api/search/functions_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['set_0',['set',['../classUIArea.html#a1617bf5c5d663431f544ad05d19fd0fb',1,'UIArea::set(uint16_t left, uint16_t top, uint16_t right, uint16_t bottom)'],['../classUIArea.html#a2df3798555f84f9bf93cdb95e06ef9fc',1,'UIArea::set(const UIArea *source)'],['../classUIArea.html#ade8b3e83421758986203819b7761de46',1,'UIArea::set(UIPoint *topLeft, UISize *size)'],['../classUIArea.html#ae088e1e24afe82c89acb73d442edfae1',1,'UIArea::set(UIPoint *topLeft, uint16_t width, uint16_t height)'],['../classUISize.html#ac031e8aa126d50c1e156d9643cc111f4',1,'UISize::set(uint16_t width, uint16_t height)'],['../classUISize.html#a3f013656fe8f1a6cd5c73bb86410f16b',1,'UISize::set(UISize *other)']]], 4 | ['setfrom_1',['setFrom',['../classUIPoint.html#a39126e3bb65f5543fd501ffd91d23737',1,'UIPoint']]], 5 | ['setparent_2',['setParent',['../classUIWidget.html#acc38f64ab731edb952ff28862bc3c739',1,'UIWidget']]], 6 | ['settext_3',['setText',['../classUITextLine.html#a8d9753b7e803a05036e1c2b58513acb7',1,'UITextLine']]], 7 | ['setupdatetiles_4',['setUpdateTiles',['../classUIDisplay.html#a010833082aba3c241378cf00221ccb68',1,'UIDisplay']]], 8 | ['setvisiblewidget_5',['setVisibleWidget',['../classUICards.html#a78edc57ecec545eed27976c0d02445f4',1,'UICards']]], 9 | ['showfirstwidget_6',['showFirstWidget',['../classUICards.html#a78938eb265311d20ddd448dafa8b4784',1,'UICards']]], 10 | ['shrink_7',['shrink',['../classUIArea.html#a59bde38e1f6a1539ec2012e2b5012756',1,'UIArea']]], 11 | ['shrinkto_8',['shrinkTo',['../classUISize.html#a8b8723a86118f59b1e01324ef43f2122',1,'UISize']]], 12 | ['signalneedsrendering_9',['signalNeedsRendering',['../classUIWidget.html#a4b5254b86930c189bf82e511fb8b5e12',1,'UIWidget']]] 13 | ]; 14 | -------------------------------------------------------------------------------- /src/UIColumns.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | #include "UIWidgetGroup.h" 12 | #include "UIColumns.h" 13 | 14 | 15 | /* Create a group of column-wise arranged sub-widgets */ 16 | UIColumns::UIColumns(UIWidget* firstChild,UIWidget* next): 17 | UIWidgetGroup(firstChild,next) {} 18 | 19 | /* Layout all the sub-widgets one next to the other. */ 20 | void UIColumns::layout(U8G2* display,UIArea* dim) { 21 | UIWidgetGroup::layout(display,dim); 22 | UIArea stamp=UIArea(dim); 23 | stamp.right=stamp.left; 24 | int extendingWidth=(extendingChildrenCount==0 || fixedWidth>=(dim->right-dim->left)?0:((dim->right-dim->left)-fixedWidth)/extendingChildrenCount); 25 | UIWidget* widget=firstChild; 26 | while (widget && stamp.rightright) { 27 | int requestedWidth=widget->preferredSize(display).width; 28 | stamp.right=min(dim->right,(uint16_t)(stamp.right+(requestedWidth==UISize::MAX_LEN?extendingWidth:requestedWidth))); 29 | widget->layout(display,&stamp); 30 | widget=widget->next; 31 | stamp.left=stamp.right; 32 | } 33 | } 34 | 35 | /* Preferred size of a columns group is computed by attaching the sub-widgets appropriately. */ 36 | void UIColumns::computePreferredSize(U8G2 *display,UISize *preferredSize) { 37 | UIWidget* elem=firstChild; 38 | while (elem) { 39 | UISize otherDim=elem->preferredSize(display); 40 | if (otherDim.width==UISize::MAX_LEN) 41 | extendingChildrenCount+=1; 42 | else 43 | fixedWidth+=otherDim.width; 44 | preferredSize->cumulateWidthMaxHeight(&otherDim); 45 | elem=elem->next; 46 | } 47 | } 48 | 49 | // end of file 50 | -------------------------------------------------------------------------------- /src/UIRows.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | #include "UIWidgetGroup.h" 12 | 13 | 14 | /** Widget group for widgets organized in rows one below the other. 15 | * 16 | * The sub-widgets are layouted one below the other from top to bottom 17 | * in the area the UIRows widgets group gets from the higher layout level. 18 | * 19 | * The preferred size is the sum of the preferred heights of all sub-widgets 20 | * and the maximum of the widths of the sub-widgets. 21 | * 22 | * Sub-widgets can request either a fixed height or "as high as possible" 23 | * by returning UISize::MAX_LEN as preferred height. 24 | * In this case in the layout step the remainder of the assigned widget height 25 | * and all fixed heights of subwidgets 26 | * is split evenly between all "as large as possible" heights. 27 | */ 28 | class UIRows: public UIWidgetGroup { 29 | 30 | public: 31 | 32 | /** Create a group of row-wise arranged sub-widgets */ 33 | UIRows(UIWidget* firstChild,UIWidget* next=nullptr); 34 | 35 | /** Layout all the sub-widgets one below the other. */ 36 | void layout(U8G2* display,UIArea* dim); 37 | 38 | protected: 39 | 40 | /** Preferred size of a rows group is computed by stacking the sub-widgets appropriately. */ 41 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 42 | 43 | private: 44 | 45 | /** Number of sub-widgets which want to be "as high as possible" */ 46 | uint8_t extendingChildrenCount; 47 | 48 | /** Sum of all fixed height preferences (not "as high as possible") of the sub-widgets. */ 49 | uint16_t fixedHeight; 50 | 51 | }; 52 | 53 | // end of file 54 | -------------------------------------------------------------------------------- /src/UIColumns.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | #include "UIWidgetGroup.h" 12 | 13 | 14 | /** Widget group for widgets organized in columns one next to the other. 15 | * 16 | * The sub-widgets are layouted one next to the other from left to right 17 | * in the area the UIColumns widgets group gets from the higher layout level. 18 | * 19 | * The preferred size is the sum of the preferred widths of all sub-widgets 20 | * and the maximum of the heights of the sub-widgets. 21 | * 22 | * Sub-widgets can request either a fixed width or "as wide as possible" by 23 | * returning UISize::MAX_LEN as preferred width. 24 | * In this case in the layout step the remainder of the assigned widget widths 25 | * and all fixed widths of subwidgets 26 | * is split evenly between all "as large as possible" widths. 27 | */ 28 | class UIColumns: public UIWidgetGroup { 29 | 30 | public: 31 | 32 | /** Create a group of column-wise arranged sub-widgets */ 33 | UIColumns(UIWidget* firstChild,UIWidget* next=nullptr); 34 | 35 | /** Layout all the sub-widgets one next to the other. */ 36 | void layout(U8G2* display,UIArea* dim); 37 | 38 | protected: 39 | 40 | /** Preferred size of a columns group is computed by attaching the sub-widgets appropriately. */ 41 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 42 | 43 | private: 44 | 45 | /** Number of sub-widgets which want to be "as high as possible" */ 46 | uint8_t extendingChildrenCount; 47 | 48 | /** Sum of all fixed height preferences (not "as high as possible") of the sub-widgets. */ 49 | uint16_t fixedWidth; 50 | 51 | }; 52 | 53 | // end of file 54 | -------------------------------------------------------------------------------- /src/UIRows.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | #include "UIArea.h" 8 | #include "UIWidget.h" 9 | #include "UIWidgetGroup.h" 10 | #include "UIRows.h" 11 | 12 | 13 | /* Create a group of row-wise arranged sub-widgets */ 14 | UIRows::UIRows(UIWidget* firstChild,UIWidget* next): 15 | UIWidgetGroup(firstChild,next) {} 16 | 17 | /* Layout all the sub-widgets one below the other. */ 18 | void UIRows::layout(U8G2* display,UIArea* dim) { 19 | UIWidgetGroup::layout(display,dim); // Call inherited method. 20 | UIArea stamp=UIArea(dim); // Use this stamp for the areas of the sub-widgets 21 | stamp.bottom=stamp.top; 22 | // extendingHeight is the height which the widgets get who want to be "as high as possible" 23 | int extendingHeight=(extendingChildrenCount==0 || fixedHeight>=(dim->bottom-dim->top)?0:((dim->bottom-dim->top)-fixedHeight)/extendingChildrenCount); 24 | UIWidget* widget=firstChild; 25 | while (widget && stamp.bottombottom) { // Walk through the widgets 26 | int requestedHeight=widget->preferredSize(display).height; 27 | // Bottom is top plus height of the current widget 28 | stamp.bottom=min(dim->bottom,(uint16_t)(stamp.bottom+(requestedHeight==UISize::MAX_LEN?extendingHeight:requestedHeight))); 29 | widget->layout(display,&stamp); 30 | widget=widget->next; 31 | // For next widget, top will be current bottom 32 | stamp.top=stamp.bottom; 33 | } 34 | } 35 | 36 | /* Preferred size of a rows group is computed by stacking the sub-widgets appripriately. */ 37 | void UIRows::computePreferredSize(U8G2 *display,UISize *preferredSize) { 38 | UIWidget* elem=firstChild; 39 | while (elem) { 40 | UISize otherDim=elem->preferredSize(display); 41 | if (otherDim.height==UISize::MAX_LEN) 42 | extendingChildrenCount+=1; 43 | else 44 | fixedHeight+=otherDim.height; 45 | preferredSize->maxWidthCumulateHeight(&otherDim); 46 | elem=elem->next; 47 | } 48 | } 49 | 50 | // end of file 51 | -------------------------------------------------------------------------------- /src/UIBitmap.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2023 Andrew Burks 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIEnums.h" 10 | #include "UIPoint.h" 11 | #include "UISize.h" 12 | #include "UIArea.h" 13 | #include "UIWidget.h" 14 | 15 | 16 | /** A widget containing a bitmap (XBMP) which is set statically during compile time. 17 | * 18 | * Height and width must be supplied to match the XBMP data. 19 | * Alignment can be specified for cases where the bitmap is rendered in a larger area. 20 | */ 21 | class UIBitmap : public UIWidget { 22 | 23 | public: 24 | 25 | /** Create a bitmap with supplied alignment and potential successor. 26 | * 27 | * The supplied width and height must match the bitmap data. 28 | * The bitmap data must be XBMP formated, and compiled into PROGMEM. */ 29 | UIBitmap(uint16_t width, uint16_t height, const uint8_t *bitmap, UIAlignment alignment, UIWidget* next = nullptr); 30 | 31 | /** Create a bitmap with default centered alignment and potential successor. 32 | * 33 | * The supplied width and height must match the bitmap data. 34 | * The bitmap data must be XBMP formated, and compiled into PROGMEM. */ 35 | UIBitmap(uint16_t width, uint16_t height, const uint8_t *bitmap, UIWidget* next = nullptr); 36 | 37 | /** A bitmap is only rendered if the rendering is forced, otherwise it never changes. */ 38 | UIArea* render(U8G2* display,bool force); 39 | 40 | protected: 41 | 42 | /** Generate the preferred size from the bitmap size. */ 43 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 44 | 45 | private: 46 | 47 | /** The image to render, as a pointer to XBMP data in PROGMEM. */ 48 | const uint8_t* bitmap; 49 | 50 | /** Size of the currently rendered text. */ 51 | UISize imageSize; 52 | 53 | /** Alignment of the image in the widget's area */ 54 | UIAlignment alignment; 55 | 56 | /** Top left point of where the text to render. */ 57 | UIPoint topLeft; 58 | 59 | 60 | }; 61 | 62 | // end of file 63 | -------------------------------------------------------------------------------- /src/UICards.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | // Basic helper classes and definitions 10 | #include "UIEnums.h" 11 | #include "UIPoint.h" 12 | #include "UISize.h" 13 | #include "UIArea.h" 14 | 15 | // Simple widgets 16 | #include "UIWidget.h" 17 | #include "UIWidgetGroup.h" 18 | #include "UICards.h" 19 | 20 | 21 | UICards::UICards(UIWidget* firstChild,UIWidget* next): 22 | UIWidgetGroup(firstChild,next),visible(nullptr) {} 23 | 24 | void UICards::layout(U8G2* display,UIArea* dim) { 25 | UIWidgetGroup::layout(display,dim); 26 | UIWidget* widget=firstChild; 27 | while (widget) { 28 | widget->layout(display,dim); 29 | widget=widget->next; 30 | } 31 | } 32 | 33 | void UICards::setVisibleWidget(UIWidget *visible) { 34 | if (this->visible!=visible) { 35 | this->visible=visible; 36 | this->forceInternally=true; 37 | signalNeedsRendering(); 38 | } 39 | } 40 | 41 | void UICards::hide() { 42 | setVisibleWidget(nullptr); 43 | } 44 | 45 | void UICards::showFirstWidget() { 46 | setVisibleWidget(firstChild); 47 | } 48 | 49 | UIArea* UICards::render(U8G2 *display,bool force) { 50 | if (this->forceInternally) { 51 | clip(display); 52 | clearFull(display); 53 | if (visible) 54 | visible->render(display,true); 55 | this->forceInternally=false; 56 | this->renderChildren=false; 57 | return &dim; 58 | } 59 | else if (force || this->renderChildren) { 60 | UIArea *retval=(visible?visible->render(display,force):&UIArea::EMPTY); 61 | this->renderChildren=false; 62 | return retval; 63 | } 64 | else 65 | return &UIArea::EMPTY; 66 | } 67 | 68 | void UICards::computePreferredSize(U8G2 *display,UISize *preferredSize) { 69 | UIWidget* elem=firstChild; 70 | while (elem) { 71 | UISize otherSize=elem->preferredSize(display); 72 | preferredSize->maxBoth(&otherSize); 73 | elem=elem->next; 74 | } 75 | } 76 | 77 | void UICards::childNeedsRendering(UIWidget *child) { 78 | if (child==visible) 79 | UIWidgetGroup::childNeedsRendering(child); 80 | } 81 | 82 | // end of file 83 | -------------------------------------------------------------------------------- /docs/api/classUIWidget__inherit__graph.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/UIWidgetGroup.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIArea.h" 10 | #include "UIWidget.h" 11 | #include "UIParent.h" 12 | 13 | /** Main abstraction of a group of interface widgets. 14 | * 15 | * A widget group organizes a number of widgets in a certain way. 16 | * These organized widgets form a linked list via their "next" pointers. 17 | * The widget group gets the first of these widgets as their "first widget". 18 | * 19 | * As a widget group itself is also a widget, it has itself potentially a successor 20 | * which allows forming another widget group on a "higher level". 21 | * 22 | * Widget groups are the key to create complex interfaces with UiUiUi. 23 | * Be sure to understand the concept behind them. 24 | * 25 | * As with the UIWidget class, UIWidgetGroup itself only implements a tiny portion 26 | * of the business logic. The derived classes actually create a semantic onto the 27 | * grouped widgets, e.g. aligning them horizontally or vertically. 28 | */ 29 | class UIWidgetGroup: public UIWidget, public UIParent { 30 | 31 | public: 32 | 33 | /** Create a widget group with a linked list of sub-widgets and a potential successor. */ 34 | UIWidgetGroup(UIWidget* firstChild,UIWidget* next=nullptr); 35 | 36 | /** Default implementation of rendering a widget group is to render all of its sub-widgets. */ 37 | UIArea* render(U8G2* display,bool force); 38 | 39 | /** Called by any child of this group to indicate that it wants to be rendered. */ 40 | virtual void childNeedsRendering(UIWidget *child); 41 | 42 | protected: 43 | 44 | /** The first of the widgets grouped by this widget group. */ 45 | UIWidget* firstChild; 46 | 47 | /** Flag whether any child of this group needs to be rendered. */ 48 | bool renderChildren; 49 | // Note: This is protected as UICards handles this on its own. 50 | // With a better abstraction, this could be made private. 51 | 52 | private: 53 | 54 | /** Space where the rendering information of all sub-widgets is collected. */ 55 | UIArea rendered; 56 | 57 | }; 58 | 59 | // end of file 60 | -------------------------------------------------------------------------------- /src/UIBitmap.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2023 Andrew Burks 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | #include "UIEnums.h" 8 | #include "UIPoint.h" 9 | #include "UISize.h" 10 | #include "UIArea.h" 11 | #include "UIWidget.h" 12 | #include "UIBitmap.h" 13 | 14 | /* Create a bitmap with the given width, height, XBMP, alignment, and potential successor*/ 15 | UIBitmap::UIBitmap(uint16_t width, uint16_t height, const uint8_t *bitmap, UIAlignment alignment, UIWidget* next): 16 | UIWidget(next),imageSize(width,height),bitmap(bitmap),alignment(alignment) {} 17 | 18 | /* Create a bitmap with the given width, height, XBMP, and potential successor*/ 19 | UIBitmap::UIBitmap(uint16_t width, uint16_t height, const uint8_t *bitmap, UIWidget* next): 20 | UIBitmap(width,height,bitmap,UIAlignment::Center,next) {} 21 | 22 | UIArea* UIBitmap::render(U8G2* display,bool force) { 23 | // Only render image if forced 24 | if (force && dim.hasArea()) { 25 | clip(display); // Clip every drawing to the frame buffer to this component's area. 26 | clearBox(display,&dim); // Clear the entire widget area, even unused buffer/border 27 | display->setDrawColor(1); // Setup painting 28 | display->setBitmapMode(1); 29 | UISize actualSize = dim.getSize();//get the available screen size and check if it is big enough for the bitmap 30 | if(actualSize.width >= imageSize.width && actualSize.height >= imageSize.height){ 31 | topLeft.setFrom(dim.alignedTopLeft(alignment,&imageSize)); 32 | display->drawXBMP(topLeft.x, topLeft.y, imageSize.width, imageSize.height, bitmap);//draw the bitmap 33 | } else { //just draw a box with an X through it if the supplied area is not big enough 34 | display->drawFrame(dim.left, dim.top, actualSize.width, actualSize.height); 35 | display->drawLine(dim.left, dim.top, dim.right-1, dim.bottom-1); 36 | display->drawLine(dim.left, dim.bottom-1, dim.right-1, dim.top); 37 | } 38 | return &dim;//return the entire widget area because the background was cleared 39 | } 40 | else // No need to render: Return empty area 41 | return &UIArea::EMPTY; 42 | } // render() 43 | 44 | void UIBitmap::computePreferredSize(U8G2 *display,UISize *preferredSize) { 45 | preferredSize->set(&imageSize); 46 | } 47 | 48 | // end of file 49 | -------------------------------------------------------------------------------- /src/UISize.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #include "Arduino.h" 5 | #include "UISize.h" 6 | 7 | /** Representation of a size, i.e. a width and a height. */ 8 | 9 | const uint16_t UISize::MAX_LEN=32767; // Half of max value so that addition of two does not overflow 10 | 11 | const UISize MAX_SIZE=UISize(UISize::MAX_LEN,UISize::MAX_LEN); 12 | 13 | const UISize EMPTY=UISize(); 14 | 15 | UISize::UISize(uint16_t width,uint16_t height): width(width), height(height) {} 16 | 17 | UISize::UISize(UISize *other): UISize(other->width,other->height) {} 18 | 19 | UISize::UISize(): UISize(0,0) {} 20 | 21 | void UISize::set(uint16_t width,uint16_t height) { this->width=width; this->height=height; } 22 | 23 | void UISize::set(UISize *other) { set(other->width,other->height); } 24 | 25 | void UISize::cumulateBoth(UISize *other) { 26 | width=max_len_or(width+other->width); 27 | height=max_len_or(height+other->height); 28 | } 29 | 30 | void UISize::maxWidthCumulateHeight(UISize *other) { 31 | width=my_max(width,other->width); 32 | height=max_len_or(height+other->height); 33 | } 34 | 35 | void UISize::cumulateWidthMaxHeight(UISize *other) { 36 | width=max_len_or(width+other->width); 37 | height=my_max(height,other->height); 38 | } 39 | 40 | void UISize::maxBoth(UISize *other) { 41 | width=my_max(width,other->width); 42 | height=my_max(height,other->height); 43 | } 44 | 45 | void UISize::shrinkTo(UISize *other) { 46 | if (other->widthwidth; 48 | if (other->heightheight; 50 | } 51 | 52 | bool UISize::isEmpty() { 53 | return width==0 && height==0; 54 | } 55 | 56 | /* Static helper method: maximum of two given uint16_t fields */ 57 | uint16_t UISize::my_max(uint16_t a,uint16_t b) { 58 | return (a>b?a:b); 59 | } 60 | 61 | /* Static helper method: maximum of two given uint16_t fields */ 62 | uint16_t UISize::my_min(uint16_t a,uint16_t b) { 63 | return (a 21 | 22 | // And we load the complete UiUiUi library with the combining header file 23 | #include 24 | 25 | 26 | // ************************** 27 | // *** Global definitions *** 28 | // ************************** 29 | 30 | // As usual, the representation of the display hardware is defined globally and statically at the begin 31 | 32 | // Define your display here, this is for a Heltec WiFi LoRa 32 33 | U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ 15, /* data=*/ 4, /* reset=*/ 16); 34 | 35 | // *** UI definition *** 36 | 37 | // Now, the UI is defined. This also happens statically and globally. 38 | // We have a very simple UI here: Apart from the display manager, it consists of only one element 39 | 40 | // Line which shows the time, will render itself centered on its space 41 | UITextLine textLine=UITextLine(u8g2_font_6x10_tf); 42 | 43 | // As the time line is the only UI element, just put it into the display representation. 44 | // It will get the complete space and render itself centered in both directions. 45 | UIDisplay displayManager=UIDisplay(&textLine); 46 | 47 | 48 | // ******************** 49 | // *** Main control *** 50 | // ******************** 51 | 52 | /* Setup function: Called once after boot */ 53 | void setup() { 54 | 55 | // Init U8g2, this is done outside of UiUiUi 56 | u8g2.begin(); 57 | 58 | // Set an initial text on the text line. 59 | // As everything in the interface is static, this can even be done 60 | // before the interface itself is initialized. 61 | textLine.setText("Hello World"); 62 | 63 | // Now init the interface including layouting and initial rendering 64 | displayManager.init(&u8g2); 65 | 66 | } 67 | 68 | /* Loop function: Nothing to be done here. */ 69 | void loop() { 70 | delay(1000); 71 | } 72 | 73 | // end of file 74 | -------------------------------------------------------------------------------- /docs/api/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['childneedsrendering_0',['childNeedsRendering',['../classUIDisplay.html#a50eb83c52dacff5d19dcbade92a9b03e',1,'UIDisplay::childNeedsRendering()'],['../classUIEnvelope.html#a8a704af40e1ae1879eac155b59b243b7',1,'UIEnvelope::childNeedsRendering()'],['../classUIParent.html#afb810c16a19d101603cb7b8f80925552',1,'UIParent::childNeedsRendering()'],['../classUIWidgetGroup.html#afe578f6322c50fc3eb898a917fd663ae',1,'UIWidgetGroup::childNeedsRendering()'],['../classUICards.html#a99300a0b4840d4128a3dcc97d7dca858',1,'UICards::childNeedsRendering()']]], 4 | ['clear_1',['clear',['../classUIArea.html#a83f22286aabb4441dc6a580d472c9ce7',1,'UIArea']]], 5 | ['clearbox_2',['clearBox',['../classUIWidget.html#a29e8a19a079bac9039d5d9db26746152',1,'UIWidget']]], 6 | ['clearfull_3',['clearFull',['../classUIWidget.html#ae2e24ff3027c86094ece175376a06b85',1,'UIWidget']]], 7 | ['cleartext_4',['clearText',['../classUITextLine.html#a78916cdade7701203801d395c09e1a44',1,'UITextLine']]], 8 | ['clip_5',['clip',['../classUIWidget.html#a227359ef6c879bbd5fdfee8c2e991a35',1,'UIWidget']]], 9 | ['computepreferredsize_6',['computePreferredSize',['../classUICards.html#a7e233813c55e0fa0a96ee7b397d49dab',1,'UICards::computePreferredSize()'],['../classUIWidget.html#ab3afd35739547f9b32a5da5d7d373383',1,'UIWidget::computePreferredSize()'],['../classUIVerticalLine.html#a289366a90394587d5d07476e08778063',1,'UIVerticalLine::computePreferredSize()'],['../classUITextLine.html#a2c8f5be4b16474bd48bfa7f66a2904d5',1,'UITextLine::computePreferredSize()'],['../classUITextIcon.html#af6608f9a0a55dc1845a3e0a5581d1ec4',1,'UITextIcon::computePreferredSize()'],['../classUIRows.html#a78c8a29833def59f2af3169be1a4b5e3',1,'UIRows::computePreferredSize()'],['../classUIHorizontalLine.html#ad5bd610276a1cf50eaa9a7aeb1b0b4e9',1,'UIHorizontalLine::computePreferredSize()'],['../classUIEnvelope.html#a875c4011fa68895593601a3245fd6c14',1,'UIEnvelope::computePreferredSize()'],['../classUIColumns.html#a8e65d7120199131da3e587257e6b6314',1,'UIColumns::computePreferredSize()'],['../classUICheckerboard.html#a39a7ea37666c2a84b50a2527df70cbb6',1,'UICheckerboard::computePreferredSize()'],['../classUIBitmap.html#a2f4543cb76ca96f6aa290624e7f2f8d6',1,'UIBitmap::computePreferredSize()']]], 10 | ['cumulateboth_7',['cumulateBoth',['../classUISize.html#a3088b8aa55e0dcb530ebfbbbbe48aae5',1,'UISize']]], 11 | ['cumulatewidthmaxheight_8',['cumulateWidthMaxHeight',['../classUISize.html#ae7aa9a6de97badde7a5e671c50ca15b9',1,'UISize']]] 12 | ]; 13 | -------------------------------------------------------------------------------- /docs/api/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['childneedsrendering_0',['childNeedsRendering',['../classUIDisplay.html#a50eb83c52dacff5d19dcbade92a9b03e',1,'UIDisplay::childNeedsRendering()'],['../classUIEnvelope.html#a8a704af40e1ae1879eac155b59b243b7',1,'UIEnvelope::childNeedsRendering()'],['../classUIParent.html#afb810c16a19d101603cb7b8f80925552',1,'UIParent::childNeedsRendering()'],['../classUIWidgetGroup.html#afe578f6322c50fc3eb898a917fd663ae',1,'UIWidgetGroup::childNeedsRendering()'],['../classUICards.html#a99300a0b4840d4128a3dcc97d7dca858',1,'UICards::childNeedsRendering()']]], 4 | ['clear_1',['clear',['../classUIArea.html#a83f22286aabb4441dc6a580d472c9ce7',1,'UIArea']]], 5 | ['clearbox_2',['clearBox',['../classUIWidget.html#a29e8a19a079bac9039d5d9db26746152',1,'UIWidget']]], 6 | ['clearfull_3',['clearFull',['../classUIWidget.html#ae2e24ff3027c86094ece175376a06b85',1,'UIWidget']]], 7 | ['cleartext_4',['clearText',['../classUITextLine.html#a78916cdade7701203801d395c09e1a44',1,'UITextLine']]], 8 | ['clip_5',['clip',['../classUIWidget.html#a227359ef6c879bbd5fdfee8c2e991a35',1,'UIWidget']]], 9 | ['computepreferredsize_6',['computePreferredSize',['../classUICards.html#a7e233813c55e0fa0a96ee7b397d49dab',1,'UICards::computePreferredSize()'],['../classUIWidget.html#ab3afd35739547f9b32a5da5d7d373383',1,'UIWidget::computePreferredSize()'],['../classUIVerticalLine.html#a289366a90394587d5d07476e08778063',1,'UIVerticalLine::computePreferredSize()'],['../classUITextLine.html#a2c8f5be4b16474bd48bfa7f66a2904d5',1,'UITextLine::computePreferredSize()'],['../classUITextIcon.html#af6608f9a0a55dc1845a3e0a5581d1ec4',1,'UITextIcon::computePreferredSize()'],['../classUIRows.html#a78c8a29833def59f2af3169be1a4b5e3',1,'UIRows::computePreferredSize()'],['../classUIHorizontalLine.html#ad5bd610276a1cf50eaa9a7aeb1b0b4e9',1,'UIHorizontalLine::computePreferredSize()'],['../classUIEnvelope.html#a875c4011fa68895593601a3245fd6c14',1,'UIEnvelope::computePreferredSize()'],['../classUIColumns.html#a8e65d7120199131da3e587257e6b6314',1,'UIColumns::computePreferredSize()'],['../classUICheckerboard.html#a39a7ea37666c2a84b50a2527df70cbb6',1,'UICheckerboard::computePreferredSize()'],['../classUIBitmap.html#a2f4543cb76ca96f6aa290624e7f2f8d6',1,'UIBitmap::computePreferredSize()']]], 10 | ['cumulateboth_7',['cumulateBoth',['../classUISize.html#a3088b8aa55e0dcb530ebfbbbbe48aae5',1,'UISize']]], 11 | ['cumulatewidthmaxheight_8',['cumulateWidthMaxHeight',['../classUISize.html#ae7aa9a6de97badde7a5e671c50ca15b9',1,'UISize']]] 12 | ]; 13 | -------------------------------------------------------------------------------- /docs/api/inherit_graph_1.map: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /src/UIEnvelope.cpp: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIEnums.h" 10 | #include "UIPoint.h" 11 | #include "UISize.h" 12 | #include "UIArea.h" 13 | #include "UIWidget.h" 14 | #include "UIEnvelope.h" 15 | 16 | 17 | UIEnvelope::UIEnvelope(UIExpansion expansion,UIAlignment alignment,UISize borderSize,UIWidget* content,UIWidget* next): 18 | UIWidget(next), expansion(expansion), alignment(alignment), borderSize(borderSize), content(content) { 19 | if (content) 20 | content->setParent(this); 21 | } 22 | 23 | UIEnvelope::UIEnvelope(UIExpansion expansion,UIAlignment alignment,UIWidget* content,UIWidget* next): 24 | UIEnvelope(expansion,alignment,UISize(),content,next) {} 25 | 26 | void UIEnvelope::layout(U8G2 *display,UIArea *dim) { 27 | UIWidget::layout(display,dim); 28 | if (content) { 29 | UIArea contentDim=UIArea(dim); 30 | contentDim.shrink(&borderSize); 31 | UISize contentSize=contentDim.getSize(); 32 | UISize preferredContentSize=content->preferredSize(display); 33 | if (preferredContentSize.widthlayout(display,&contentDim); 39 | } 40 | } 41 | 42 | void UIEnvelope::childNeedsRendering(UIWidget *child) { 43 | signalNeedsRendering(); // just pass signal to parent 44 | } 45 | 46 | UIArea* UIEnvelope::render(U8G2 *display,bool force) { 47 | if (force) { 48 | clearFull(display); 49 | if (content) 50 | content->render(display,true); 51 | return &dim; 52 | } 53 | else 54 | return (content?content->render(display,false):&UIArea::EMPTY); 55 | } 56 | 57 | void UIEnvelope::computePreferredSize(U8G2 *display,UISize *preferredSize) { 58 | if (content) { 59 | UISize contentSize=content->preferredSize(display); 60 | preferredSize->set(&contentSize); 61 | } 62 | if (expansion==UIExpansion::Horizontal || expansion==UIExpansion::Both) 63 | preferredSize->width=UISize::MAX_LEN; 64 | if (expansion==UIExpansion::Vertical || expansion==UIExpansion::Both) 65 | preferredSize->height=UISize::MAX_LEN; 66 | preferredSize->cumulateBoth(&borderSize); 67 | preferredSize->cumulateBoth(&borderSize);//double because borderSize dimensions only represent half of the contrinuted thickness 68 | } 69 | 70 | // end of file 71 | -------------------------------------------------------------------------------- /src/UISize.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | 8 | /** Representation of a size, i.e. a width and a height. */ 9 | class UISize final { 10 | public: 11 | /** Less than half of max value so that addition of two does not overflow */ 12 | static const uint16_t MAX_LEN; 13 | 14 | /** UISize representing maximal size in all directions */ 15 | static const UISize MAX_SIZE; 16 | 17 | /** UISize representing an empty size (both directions 0) */ 18 | static const UISize EMPTY; 19 | 20 | /** Initialize a size from a width and a height. */ 21 | UISize(uint16_t width,uint16_t height); 22 | 23 | /** Initialize a size from another size */ 24 | UISize(UISize *other); 25 | 26 | /** Initialize a size without width or height (both 0). */ 27 | UISize(); 28 | 29 | /** Width */ 30 | uint16_t width; 31 | 32 | /** Height */ 33 | uint16_t height; 34 | 35 | /** Set height from a numeric width and height. */ 36 | void set(uint16_t width,uint16_t height); 37 | 38 | /** Set size from another referenced height */ 39 | void set(UISize *other); 40 | 41 | /** Cumulate width and height of this and the referenced size into this size. */ 42 | void cumulateBoth(UISize *other); 43 | 44 | /** Cumulate the heights of this and the other size and take the maximum of both widths, 45 | * write everything into this. */ 46 | void maxWidthCumulateHeight(UISize *other); 47 | 48 | /** Cumulate the widths of this and the other size and take the maximum of both heights, 49 | * write everything into this. */ 50 | void cumulateWidthMaxHeight(UISize *other); 51 | 52 | /** Take the maximum of widths and height of this and the other size and write it into this. */ 53 | void maxBoth(UISize *other); 54 | 55 | /** Shrink this so that neither width nor height is larger than the one of other. */ 56 | void shrinkTo(UISize *other); 57 | 58 | /** Return true if this size is empty, i.e. it has neither width nor height, i.e. both are 0. */ 59 | bool isEmpty(); 60 | 61 | /** Static helper method: maximum of two given uint16_t fields */ 62 | static uint16_t my_max(uint16_t a,uint16_t b); 63 | 64 | /** Static helper method: maximum of two given uint16_t fields */ 65 | static uint16_t my_min(uint16_t a,uint16_t b); 66 | 67 | /** Static helper method: restrict given value to MAX_LEN at most. */ 68 | static uint16_t max_len_or(uint16_t a); 69 | 70 | /** Debug output of this size with some prepended label. */ 71 | void debugPrint(const char* label); 72 | 73 | }; 74 | 75 | // end of file 76 | -------------------------------------------------------------------------------- /docs/api/search/mag_sel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 57 | 63 | 69 | 74 | 75 | -------------------------------------------------------------------------------- /src/UICards.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | // Basic helper classes and definitions 10 | #include "UIEnums.h" 11 | #include "UIPoint.h" 12 | #include "UISize.h" 13 | #include "UIArea.h" 14 | 15 | // Simple widgets 16 | #include "UIWidget.h" 17 | #include "UIWidgetGroup.h" 18 | 19 | 20 | /** Widget group which shows nothing or exactly one of its sub-widgets 21 | * 22 | * UICards takes its widgets and shows exactly one of them covering the whole area. 23 | * This is like a card stack (therefore the name). 24 | * The widget to show is selected by setVisibleWidget(). 25 | * 26 | * If the visible widget is not set or set to null, nothing is shown. 27 | * 28 | * Note that you can use UICards easily to make another widget visible or invisible: 29 | * Just add the widget in question as first (and only) sub-widget to UICards. 30 | * Then, if you make it the visible widget, it is shown, and if you set the visible widget 31 | * to null, it is hidden. 32 | * 33 | * The two methods `hide()` and `showFirstWidget()` act as syntactic sugar for this operation mode. 34 | */ 35 | class UICards: public UIWidgetGroup { 36 | 37 | public: 38 | 39 | /** Initialize the cards widget with the first widget and a potential successor on the same level. */ 40 | UICards(UIWidget* firstChild,UIWidget* next=nullptr); 41 | 42 | /** Layout the cards widget. */ 43 | void layout(U8G2* display,UIArea* dim); 44 | 45 | /** Set the widget to show on the area of the cards widget group. 46 | * 47 | * If nullptr is given, nothing is shown. 48 | * The parameter *must* be one of the sub-widgets of the group. 49 | * If another widget is passed, the results are undefined. 50 | * 51 | * Changing the visible widget leads to the cards widget group being completely re-rendered. 52 | */ 53 | void setVisibleWidget(UIWidget *visible); 54 | 55 | /** Shortcut: Hide all widgets, clear the UICards area on the display. */ 56 | void hide(); 57 | 58 | /** Shortcut: Show first widget. */ 59 | void showFirstWidget(); 60 | 61 | /** Render the cards widget group onto the display. */ 62 | UIArea* render(U8G2 *display,bool force); 63 | 64 | /** UICards will consider the render request from the child only if it is the currently visible child. */ 65 | void childNeedsRendering(UIWidget *child); 66 | 67 | protected: 68 | 69 | /** Compute the preferred size as the maximum envelope of the preferred sizes of all subwidgets. */ 70 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 71 | 72 | private: 73 | 74 | /** Pointer to the visible widget. */ 75 | UIWidget *visible; 76 | 77 | /** Flag whether redraw has to take place. */ 78 | bool forceInternally; 79 | 80 | }; 81 | 82 | // end of file 83 | -------------------------------------------------------------------------------- /src/UIEnvelope.h: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | #pragma once 5 | 6 | #include "Arduino.h" 7 | #include 8 | 9 | #include "UIEnums.h" 10 | #include "UIPoint.h" 11 | #include "UISize.h" 12 | #include "UIArea.h" 13 | #include "UIWidget.h" 14 | #include "UIParent.h" 15 | 16 | 17 | /** Envelope widget which contains exactly one other widget and changes its representation. 18 | * 19 | * The envelope can do the following things: 20 | * 21 | * * If the enclosed widget does not spawn the whole display area it is assigned, 22 | * the envelope can place it with a certain alignment. 23 | * * The envelope can add a border to the inner widget. This border will be empty. 24 | * * If the inner widget prefers to be smaller than it could be, the envelope can report 25 | * a larger area to the caller. 26 | */ 27 | class UIEnvelope : public UIWidget, public UIParent { 28 | public: 29 | 30 | /** Create an envelope widget. 31 | * 32 | * @param expansion Report an enlarged preferred size to the caller for the axes given by this parameter. 33 | * @param alignment Align the content widget this way if it is smaller than the area of the envelope. 34 | * @param borderSize Generate an empty border of this size around the content widget 35 | * @param content The content of the envelope. If empty, the envelope renders an empty area. 36 | * @param next Next widget on the same level as the envelope. 37 | */ 38 | UIEnvelope(UIExpansion expansion,UIAlignment alignment,UISize borderSize=UISize(),UIWidget* content=nullptr,UIWidget* next=nullptr); 39 | 40 | /** Create an envelope widget without border. 41 | * 42 | * @param expansion Report an enlarged preferred size to the caller for the axes given by this parameter. 43 | * @param alignment Align the content widget this way if it is smaller than the area of the envelope. 44 | * @param content The content of the envelope. If empty, the envelope renders an empty area. 45 | * @param next Next widget on the same level as the envelope. 46 | */ 47 | UIEnvelope(UIExpansion expansion,UIAlignment alignment,UIWidget* content,UIWidget* next=nullptr); 48 | 49 | /** Layout the envelope. 50 | * 51 | * This includes shaping the content according to all the constraints. 52 | */ 53 | void layout(U8G2 *display,UIArea *dim); 54 | 55 | /** Render the envelope - which also renders the content if it exists. */ 56 | UIArea* render(U8G2 *display,bool force); 57 | 58 | /** Called by the child of this envelope to indicate that it wants to be rendered. */ 59 | void childNeedsRendering(UIWidget *child); 60 | 61 | protected: 62 | 63 | /** Compute the preferred size which is determined by the content by may be changed by the envelope. */ 64 | void computePreferredSize(U8G2 *display,UISize *preferredSize); 65 | 66 | private: 67 | 68 | /** Expansion strategy during computation of preferred size. */ 69 | UIExpansion expansion; 70 | 71 | /** Alignment of inner content widget. */ 72 | UIAlignment alignment; 73 | 74 | /** Border size of the envelope. */ 75 | UISize borderSize; 76 | 77 | /** Reference to the content widget of the envelope. */ 78 | UIWidget* content; 79 | 80 | }; 81 | 82 | // end of file 83 | -------------------------------------------------------------------------------- /examples/EnvelopeAroundChecker/EnvelopeAroundChecker.ino: -------------------------------------------------------------------------------- 1 | // SPDX-License-Identifier: BSD-2-Clause 2 | // (C) 2022 Dirk Hillbrecht 3 | 4 | // Show how an envelope can be placed around a widget 5 | 6 | // ************************** 7 | // *** Include statements *** 8 | // ************************** 9 | 10 | // You need the U8g2 library 11 | #include 12 | 13 | // And we load the complete UiUiUi library with the combining header file 14 | #include 15 | 16 | 17 | // ************************** 18 | // *** Global definitions *** 19 | // ************************** 20 | 21 | // As usual, the representation of the display hardware is defined globally and statically at the begin 22 | 23 | // Define your display here, this is for a Heltec WiFi LoRa 32 24 | U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ 15, /* data=*/ 4, /* reset=*/ 16); 25 | 26 | // *** UI definition *** 27 | 28 | // The UI is a frame around the whole display, then a border of 10 pixels 29 | // on the left and right and 5 pixels on top and bottom and then a 30 | // checkerboard. 31 | 32 | // This is a static example. It just defines this interface and draws it. 33 | // After that, nothing more happens. If you want to have an example 34 | // with some interaction, use EnvelopedCheckerboardAndButtons 35 | // where you can enable or disable the presentation of the checkerboard. 36 | 37 | // *** Define the UI *** 38 | 39 | // As usual, we define the UI widget from bottom to top. 40 | 41 | // We draw the outer frame out of four lines. This is the bottom one. 42 | UIHorizontalLine bottomLine=UIHorizontalLine(); 43 | 44 | // ...and here is the right one. Note that these lines are 45 | // totally unrelated, they will be connected via the groups later on. 46 | UIVerticalLine rightLine=UIVerticalLine(); 47 | 48 | // Now comes the checkerboard which likes to get as large as possible. 49 | UICheckerboard checkerboard=UICheckerboard(UISize(UISize::MAX_LEN,UISize::MAX_LEN)); 50 | // Note: This should work, too. But for me in my ESP32 development environment, 51 | // this line triggers a linker error. 52 | //UICheckerboard checkerboard=UICheckerboard(UISize::MAX_SIZE); 53 | 54 | // It gets an envelope around it where it is placed in the center 55 | UIEnvelope checkerEnv=UIEnvelope(UIExpansion::Both,UIAlignment::Center,UISize(10,5),&checkerboard,&rightLine); 56 | 57 | // The lieft line of the outer border 58 | UIVerticalLine leftLine=UIVerticalLine(&checkerEnv); 59 | 60 | // The inner group: Connecting left line, enveloped checkerboard and right line 61 | UIColumns centerWidgets=UIColumns(&leftLine,&bottomLine); 62 | 63 | // The top line, the last line still missing 64 | UIHorizontalLine topLine=UIHorizontalLine(¢erWidgets); 65 | 66 | // The outer group: Connecting top line, inner group and bottom line 67 | UIRows fullScreen=UIRows(&topLine); 68 | 69 | // Display representation taking the row group as display-filling child. 70 | UIDisplay displayManager=UIDisplay(&fullScreen); 71 | 72 | 73 | // Now set it up. 74 | void setup() { 75 | Serial.begin(115200); // For debugging purposes only, not used by sketch otherwise 76 | 77 | // Initialize the display 78 | u8g2.begin(); // Init U8g2, this is done outside of UiUiUi 79 | displayManager.init(&u8g2); // Initialize the display manager 80 | 81 | } 82 | 83 | // Each run of loop() draws the checkerboard with a different setting of first and follow update tiles. 84 | void loop() { 85 | delay(1000); 86 | } 87 | 88 | // end of file 89 | --------------------------------------------------------------------------------