2024-02-05 12:21:47 -06:00
|
|
|
/*
|
|
|
|
# 2D geometry values
|
|
|
|
|
|
|
|
There are lots of issues when supporting multiple toolkit plugin
|
|
|
|
geometries. The geometries vary widely especially between the
|
|
|
|
graphical displays and the serial console ones. [Graphical Widget](http://en.wikipedia.org/Graphical_Widget)
|
|
|
|
|
|
|
|
|
|
|
|
To simplyfy this, we stick to using the concepts:
|
|
|
|
|
|
|
|
------------------------------ ^
|
|
|
|
| top | |
|
|
|
|
| | |
|
|
|
|
| left right | height
|
|
|
|
| | |
|
|
|
|
| bottom | |
|
|
|
|
------------------------------ v
|
|
|
|
|
|
|
|
<----------- width ---------->
|
|
|
|
|
|
|
|
This way, width & height are always positive numbers.
|
2024-01-11 16:41:37 -06:00
|
|
|
|
2024-02-05 12:21:47 -06:00
|
|
|
The qustion of (top,bottom) & (left,right) becomes problematic.
|
|
|
|
|
|
|
|
In almost every toolkit, right > left. However, top & bottom
|
|
|
|
vary and a choice can not be made easily. Luckily, we maybe do
|
|
|
|
not have to make that decision here and can pass that determination
|
|
|
|
to the toolkits. So, we use excusively:
|
|
|
|
|
|
|
|
geom(left, right, top, bottom)
|
|
|
|
size(width, height)
|
|
|
|
|
|
|
|
# Orientation
|
|
|
|
|
|
|
|
Horizontal means layout widgets like books on a bookshelf
|
|
|
|
|
|
|
|
---------------------------------
|
|
|
|
| W | W | W | W | W | W | W | W |
|
|
|
|
| i | i | i | i | i | i | i | i |
|
|
|
|
| d | d | d | d | d | d | d | d |
|
|
|
|
| g | g | g | g | g | g | g | g |
|
|
|
|
| e | e | e | e | e | e | e | e |
|
|
|
|
| t | t | t | t | t | t | t | t |
|
|
|
|
---------------------------------
|
|
|
|
|
|
|
|
Vertical means layout widgets like books in a stack
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
| Widget |
|
|
|
|
----------
|
|
|
|
*/
|
|
|
|
package widget
|