Difference between revisions of "Component: Display Manager (Graphical Library)"
| Line 5: | Line 5: | ||
|- | |- | ||
| width="20%" style="color:gray;" | Version | | width="20%" style="color:gray;" | Version | ||
| − | | | + | | 24.0 |
|- | |- | ||
| width="20%" style="color:gray;" | Category | | width="20%" style="color:gray;" | Category | ||
| Line 27: | Line 27: | ||
20, 2.1, 06-08-24, BR, Fixed a problem where slider value could be set with out of range value | 20, 2.1, 06-08-24, BR, Fixed a problem where slider value could be set with out of range value | ||
21, 2.1, 06-08-24, BR, Fixed problem where SetTextNumber would reset an ESP32 | 21, 2.1, 06-08-24, BR, Fixed problem where SetTextNumber would reset an ESP32 | ||
| − | 22, 22.0, 19-03-25, MW, Added | + | 22, 22.0, 19-03-25, MW, Added keypad creation function |
| − | + | ||
| + | |||
==Detailed description== | ==Detailed description== | ||
| Line 114: | Line 115: | ||
==Macro reference== | ==Macro reference== | ||
| + | |||
| + | ===CheckCollision=== | ||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CheckCollision''' | ||
| + | |- | ||
| + | | colspan="2" | Checks to see if two objects bounding boxes are colliding, Useful when implementing 2D games. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | ID1 | ||
| + | |- | ||
| + | | colspan="2" | ID of Object or Widget to check | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| + | | width="90%" | ID2 | ||
| + | |- | ||
| + | | colspan="2" | ID of Object or Widget to check | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-bool-icon.png]] - BOOL | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
===CheckForTouch=== | ===CheckForTouch=== | ||
| Line 170: | Line 195: | ||
| width="90%" | ObjectType | | width="90%" | ObjectType | ||
|- | |- | ||
| − | | colspan="2" | 0=Hidden, 1=Rect, 2= | + | | colspan="2" | 0=Hidden, 1=Rect, 2=RoundedRect, 3=Ellipse, 4=Line, 8=Bitmap |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| Line 193: | Line 218: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" | | + | | width="90%" | LineWidth |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Number of pixels thick to draw outer border lines |
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Colours | ||
| + | |- | ||
| + | | colspan="2" | Byte array containing FgColour RGB [0-2], Bg Colour RGB [3-5], Text Colour RGB [6-8] | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
| Line 213: | Line 243: | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateObjectArray''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CreateObjectArray''' | ||
|- | |- | ||
| − | | colspan="2" | Creates a 2d array of objects that can be used to create things like | + | | colspan="2" | Creates a 2d array of objects that can be used to create things like table data. Returns the ID of the first object, the following objects have incremental IDs going column by column and then row by row. |
|- | |- | ||
|- | |- | ||
| Line 242: | Line 272: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| − | | width="90%" | | + | | width="90%" | ObjectWidth |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Widget width in pixels |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| − | | width="90%" | | + | | width="90%" | ObjectHeight |
|- | |- | ||
| − | | colspan="2" | Object | + | | colspan="2" | Object height in pixels |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" | SpacingX | | width="90%" | SpacingX | ||
|- | |- | ||
| − | | colspan="2" | Horizontal spacing between the | + | | colspan="2" | Horizontal spacing between the objects |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| width="90%" | SpacingY | | width="90%" | SpacingY | ||
|- | |- | ||
| − | | colspan="2" | Vertical spacing between the | + | | colspan="2" | Vertical spacing between the objects |
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | LineWidth | ||
| + | |- | ||
| + | | colspan="2" | Number of pixels thick to draw outer border lines | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" | | + | | width="90%" | Colours |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Byte array containing FgColour RGB [0-2], Bg Colour RGB [3-5], Text Colour RGB [6-8] |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 321: | Line 356: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" | | + | | width="90%" | Colours |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Byte array containing FgColour RGB [0-2], Bg Colour RGB [3-5], Text Colour RGB [6-8] |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 352: | Line 387: | ||
| width="90%" | WidgetType | | width="90%" | WidgetType | ||
|- | |- | ||
| − | | colspan="2" | 0=WidgetHidden, 1=WidgetRect, 2=WidgetRoundedRect, 3=WidgetEllipse, 4=VSlider, 5=HSlider, 6=VSliderRound, 7=HSliderRound | + | | colspan="2" | 0=WidgetHidden, 1=WidgetRect, 2=WidgetRoundedRect, 3=WidgetEllipse, 4=VSlider, 5=HSlider, 6=VSliderRound, 7=HSliderRound, 8=Bitmap |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| Line 375: | Line 410: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" | | + | | width="90%" | LineWidth |
| + | |- | ||
| + | | colspan="2" | Number of pixels thick to draw outer border lines | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | Colours | ||
| + | |- | ||
| + | | colspan="2" | Byte array containing FgColour RGB [0-2], Bg Colour RGB [3-5], Text Colour RGB [6-8], Hl Colour RGB [9-11] | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | DrawHighlight | ||
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Draws the highlight on buttons, also used for thumb width on sliders |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
| Line 424: | Line 469: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| − | | width="90%" | | + | | width="90%" | WidgetWidth |
|- | |- | ||
| − | | colspan="2" | Widget | + | | colspan="2" | Widget width in pixels |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| − | | width="90%" | | + | | width="90%" | WidgetHeight |
|- | |- | ||
| − | | colspan="2" | Widget | + | | colspan="2" | Widget height in pixels |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | ||
| Line 444: | Line 489: | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" | | + | | width="90%" | LineWidth |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Number of pixels thick to draw outer border lines |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| − | | width="90%" | | + | | width="90%" | Colours |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | , Hl Colour RGB [9-11] |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| Line 462: | Line 507: | ||
|- | |- | ||
| colspan="2" | A comma seperated text field with the text for each widget e.g. "1,2,3,.." | | colspan="2" | A comma seperated text field with the text for each widget e.g. "1,2,3,.." | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | DrawHighlight | ||
| + | |- | ||
| + | | colspan="2" | Draws the highlight on buttons, also used for thumb width on sliders | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | ||
| Line 495: | Line 545: | ||
|- | |- | ||
| colspan="2" | Unique ID of the Object or Widget | | colspan="2" | Unique ID of the Object or Widget | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | ===DrawScene=== | ||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''DrawScene''' | ||
| + | |- | ||
| + | | colspan="2" | Clears the screen and adds and draws the objects and widgets from the layout editor. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | SceneIndex | ||
| + | |- | ||
| + | | colspan="2" | Select which screen to draw. Range: 0 to Scene Count - 1 | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 548: | Line 617: | ||
| − | === | + | ===ModifyBitmap=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ModifyBitmap''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Allows the bitmap image to be swapped out |
|- | |- | ||
|- | |- | ||
| Line 560: | Line 629: | ||
| width="90%" | ID | | width="90%" | ID | ||
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Object or Widget ID to update |
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | ||
| + | | width="90%" | Filename | ||
| + | |- | ||
| + | | colspan="2" | Bitmap filename in 8.3 file format | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
| − | | width="90%" | | + | | width="90%" | Scaling |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | 0=Native, 1=Stretch |
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
| − | | width="90%" | | + | | width="90%" | Transparancy |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | 0=Disabled, 1=Enabled |
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
| − | | width="90%" | | + | | width="90%" | Redraw |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 582: | Line 656: | ||
| − | === | + | ===ModifyColour=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ModifyColour''' |
|- | |- | ||
| − | | colspan="2" | Changes the | + | | colspan="2" | Changes the theme index of the selected Object or Widget. |
|- | |- | ||
|- | |- | ||
| Line 596: | Line 670: | ||
| colspan="2" | Unique ID of the object or Widget | | colspan="2" | Unique ID of the object or Widget | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE |
| − | | width="90%" | | + | | width="90%" | Index |
| + | |- | ||
| + | | colspan="2" | 0=Foreground, 1=Background, 2=TextColour, 3=Highlight(Widgets Only) | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | R | ||
| + | |- | ||
| + | | colspan="2" | Colour Channels | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | G | ||
| + | |- | ||
| + | | colspan="2" | Colour Channels | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" | B | ||
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Colour Channels |
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
| − | | width="90%" | | + | | width="90%" | Redraw |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Redraws the component straight away in the new colours |
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 611: | Line 700: | ||
| − | === | + | ===ModifyPosition=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ModifyPosition''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Moves an existing object or Widget to absolute coordinates on the screen. |
|- | |- | ||
|- | |- | ||
| Line 625: | Line 714: | ||
| colspan="2" | Unique ID of the object or Widget | | colspan="2" | Unique ID of the object or Widget | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT |
| − | | width="90%" | | + | | width="90%" | X |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| − | | width="10%" align="center | + | | width="10%" align="center" | [[File:Fc9-s16-icon.png]] - INT |
| − | | width="90%" | + | | width="90%" | Y |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | | | + | | colspan="2" | |
| − | |||
|- | |- | ||
| − | | | + | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL |
| + | | width="90%" | Relative | ||
|- | |- | ||
| + | | colspan="2" | 0=Absolute Positioning, 1=Relative Positioning | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 649: | Line 734: | ||
| − | === | + | ===ModifyScale=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''ModifyScale''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Changes the width and height of the selected Object or Widget. |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| − | | width="90%" | | + | | width="90%" | ID |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Unique ID of the object or Widget |
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| − | | width="90%" | | + | | width="90%" | Width |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | |
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT |
| − | | width="90%" | | + | | width="90%" | Height |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 698: | Line 763: | ||
| − | === | + | ===NoTouch=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''NoTouch''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Called when no touch is present, Allows the repeat rate counter to be cleared allowing for better responses to fast touches. |
|- | |- | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 800: | Line 800: | ||
|- | |- | ||
| colspan="2" | 0=Do not redraw, 1=Redraw | | colspan="2" | 0=Do not redraw, 1=Redraw | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| Line 898: | Line 839: | ||
|- | |- | ||
| colspan="2" | 0=Top, 1=Middle, 2=Bottom | | colspan="2" | 0=Top, 1=Middle, 2=Bottom | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | | width="10%" align="center" | [[File:Fc9-bool-icon.png]] - BOOL | ||
| Line 995: | Line 877: | ||
|- | |- | ||
| colspan="2" | Number of pixels to move away from an edge when calling | | colspan="2" | Number of pixels to move away from an edge when calling | ||
| + | |- | ||
| + | | width="10%" align="center" | [[File:Fc9-type-1-icon.png]] | ||
| + | | width="90%" | Background Colour | ||
| + | |- | ||
| + | | colspan="2" | Default background colour to use when clearing the display and applied as the default when creating new display creator scenes. | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| Line 1,004: | Line 891: | ||
|- | |- | ||
| colspan="2" | The total number of primitive objects allowed on the screen at once. Sets the size of the RAM buffers used to track the various screen elements. Each object requires 10 bytes of RAM to stores things like size, location and type. | | colspan="2" | The total number of primitive objects allowed on the screen at once. Sets the size of the RAM buffers used to track the various screen elements. Each object requires 10 bytes of RAM to stores things like size, location and type. | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| Line 1,052: | Line 906: | ||
| colspan="2" | Sets the period for touch repeats in terms of calls of the CheckForTouch macro. Widgets will only register a repeat touch after x calls if continually held down. Sliders will always register a touch. The touch count can be cleared using the NoTouch macro if no touch is detected. | | colspan="2" | Sets the period for touch repeats in terms of calls of the CheckForTouch macro. Widgets will only register a repeat touch after x calls if continually held down. Sliders will always register a touch. The touch count can be cleared using the NoTouch macro if no touch is detected. | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9- | + | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] |
| − | | width="90%" | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Display Creator |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| − | |||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] |
| − | | width="90%" | | + | | width="90%" | Enabled |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Enable the display creator (WYSIWYG) scene panels. |
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Settings |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] |
| − | | width="90%" | | + | | width="90%" | Enable Callbacks |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Allows the widgets to define their own callback macros to simplify the act of processing touches |
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-21-icon.png]] |
| − | | width="90%" | | + | | width="90%" | Scene Count |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Defines the number of invididual scene layout, display creator scenes available to draw |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|- | |- | ||
| width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
| − | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | | + | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Scene Data |
|- | |- | ||
|- | |- | ||
| − | | width="10%" align="center" | [[File:Fc9-type- | + | | width="10%" align="center" | [[File:Fc9-type-26-icon.png]] |
| − | | width="90%" | | + | | width="90%" | Scene 0 |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | |
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
|} | |} | ||
Latest revision as of 14:13, 22 October 2025
| Author | MatrixTSL |
| Version | 24.0 |
| Category | Graphical Library |
Contents
- 1 Display Manager component
- 2 Version information
- 3 Detailed description
- 4 Examples
- 5 Macro reference
- 5.1 CheckCollision
- 5.2 CheckForTouch
- 5.3 ClearAll
- 5.4 CreateObject
- 5.5 CreateObjectArray
- 5.6 CreateTextField
- 5.7 CreateWidget
- 5.8 CreateWidgetArray
- 5.9 DrawAll
- 5.10 DrawItem
- 5.11 DrawScene
- 5.12 GetLastTouchID
- 5.13 GetSliderValue
- 5.14 Initialise
- 5.15 ModifyBitmap
- 5.16 ModifyColour
- 5.17 ModifyPosition
- 5.18 ModifyScale
- 5.19 NoTouch
- 5.20 SetSliderValue
- 5.21 SetTextLabel
- 6 Property reference
- 7 Component Source Code
Display Manager component
A component designed to simplify the process of drawing primitives and text onto a graphical display. Keeps track of coordinates so you don't have to. Also works great as a base layer for gLCD based games as it will check for collisions and perform movement.
Version information
Library Version, Component Version, Date, Author, Info 13, 2.0, 22-05-24, BR, Added text alignment options 14, 2.1, 14-06-24, BR, Renamed Button to Widget to better include things like sliders 15, 2.1, 26-07-24, BR, Added SetTextFloat and AddTextNumber macros 16, 2.1, 29-07-24, BR, Renamed Themes to ObjectThemes and WidgetThemes 17, 2.1, 29-07-24, BR, Added CreateTextField macro which automates creating a simple textbox 18, 2.1, 06-08-24, BR, Fixed a problem with updating values, theme, text on IDs 19, 2.1, 06-08-24, BR, Textfield now uses hidden object type instead of rectangle 20, 2.1, 06-08-24, BR, Fixed a problem where slider value could be set with out of range value 21, 2.1, 06-08-24, BR, Fixed problem where SetTextNumber would reset an ESP32 22, 22.0, 19-03-25, MW, Added keypad creation function
Detailed description
Objects
The component can create the following objects.
- Object_Hidden - 0 - A hidden area with no graphics.
- Object_Rectangle - 1 - A simple rectangular box.
- Object_Line - 2 - A simple straight line.
- Object_Ellipse - 3 - A simple ellipse or circle.
- Object_EllipseFilled - 4 - A filled ellipse or circle.
- Object_RectangeFilled - 5 - A filled rectangular box.
TextField
There is also an additional TextField object which consists of an Object_Rectangle that is pre-populated with text.
Widgets
The component can also create the following interactive buttons and sliders.
- Widget_Hidden - 0 - A hidden area with no graphics.
- Widget_Rectangle - 1 - A rectangular box with a shadow.
- Widget_RoundedRectangle - 2 - A rounded rectangular box with a shadow.
- Widget_Ellipse - 3 - A simple ellipse or circle with a shadow.
- Widget_VSlider - 4 - A vertical slider with a square thumb.
- Widget_HSlider - 5 - A horizontal slider with a square thumb.
- Widget_VSlider_Round - 6 - A vertical slider with a round thumb.
- Widget_HSlider_Round - 7 - A horizontal slider with a round thumb.
The type can be entered by using the component's public constants. Begin with the Display Manager handle name followed by :: and the list of the public variables will be displayed.
For example... DisplayManager1::Object_Rectangle or DisplayManager1::Widget_VSlider
Touch Repeat Rate for Button Widgets
The Touch Repeat Rate property applies to button based widgets and sets the frequency that a valid touch will be detected for a held button. This is similar to holding down a single key on a keyboard and acts to reduce the frequency of positive button detections when touching the button. For example if you had a button that incremented a value, without the repeat rate the value would increment much faster then anticipated in an uncontrollable manner. When no touch is detected it is recommended to call the NoTouch macro to clear the touch counters and allow a more responsive user experience.
Example of implementing touch repeat rate
Examples
Basic Example
An example showing how to use the display manager with a gLCD and a touch interface to create a full HMI.
The example shows how to create a simple menu system as well as a toggle switch and a slider used to control a PWM output.
Keypad Example
An example showing how you can use the CreateWigitArray component to create a touch keypad for your gLCD.
The CreateWidgetArray function macro has a number of parameters to allow high flexibility in what you can create:
There are also tooltips for each parameter to help.
Note: if you get a unable to run simulation error then make sure you have the latest components downloaded.
How the key touch is detected
The first widget is automatically assigned a unique widget ID e.g. the first widget with text 1 on it is assigned 24.
All the following widgets ID is then incremented from 24, e.g. widget with text 6 on is assigned 24+ 5 = 29.
The widget button pressed can then be calculated from 29 – 24 + 1 = 6.
Display Manager Widget Array Keypad Example
Macro reference
CheckCollision
CheckForTouch
ClearAll
| ClearAll | |
| Removes all objects and Widgets from memory. Also clears the screen if required. | |
| ClearScreen | |
| 0=Don't clear the screen, 1=Clear the screen | |
| Return | |
CreateObject
CreateObjectArray
CreateTextField
CreateWidget
CreateWidgetArray
DrawAll
| DrawAll | |
| Redraws all of the defined Objects and Widgets. Doesn't draw text, this is done using the SetText macros. | |
| Return | |
DrawItem
DrawScene
| DrawScene | |
| Clears the screen and adds and draws the objects and widgets from the layout editor. | |
| SceneIndex | |
| Select which screen to draw. Range: 0 to Scene Count - 1 | |
| Return | |
GetLastTouchID
| GetLastTouchID | |
| Gets the ID of the last Widget that returned a valid press via the CheckForTouch macro. Returns 0 for no valid touch recorded. | |
| Return | |
GetSliderValue
| GetSliderValue | |
| Reads the value of one of the sliders ranging between 0 and 1. | |
| WidgetID | |
| Return | |
Initialise
| Initialise | |
| Initialises the object and Widget control variables and sets up the default themes. | |
| Return | |
ModifyBitmap
ModifyColour
ModifyPosition
ModifyScale
| ModifyScale | |
| Changes the width and height of the selected Object or Widget. | |
| ID | |
| Unique ID of the object or Widget | |
| Width | |
| Height | |
| Return | |
NoTouch
| NoTouch | |
| Called when no touch is present, Allows the repeat rate counter to be cleared allowing for better responses to fast touches. | |
| Return | |
SetSliderValue
SetTextLabel
Property reference
| Properties | |
| Graphical Display | |
| Graphical Display to draw our objects on | |
| DM Library | |
| Display Manager compatible GLCD library component. e.g. Bitmap drawer components. | |
| Ram Usage Bytes | |
| The calculated number of bytes of RAM required by the display manager. | |
| Text Align Offset | |
| Number of pixels to move away from an edge when calling | |
| Background Colour | |
| Default background colour to use when clearing the display and applied as the default when creating new display creator scenes. | |
| Objects | |
| Max Objects | |
| The total number of primitive objects allowed on the screen at once. Sets the size of the RAM buffers used to track the various screen elements. Each object requires 10 bytes of RAM to stores things like size, location and type. | |
| Widgets | |
| Max Widgets | |
| The total number of touchable interactibe objects allowed on the screen at once e.g. Widgets and sliders. Sets the size of the RAM buffers used to track the various screen elements Each Widget requires 18 bytes of RAM to stores things like size, location, value and type. | |
| Touch Repeat Rate | |
| Sets the period for touch repeats in terms of calls of the CheckForTouch macro. Widgets will only register a repeat touch after x calls if continually held down. Sliders will always register a touch. The touch count can be cleared using the NoTouch macro if no touch is detected. | |
| Display Creator | |
| Enabled | |
| Enable the display creator (WYSIWYG) scene panels. | |
| Settings | |
| Enable Callbacks | |
| Allows the widgets to define their own callback macros to simplify the act of processing touches | |
| Scene Count | |
| Defines the number of invididual scene layout, display creator scenes available to draw | |
| Scene Data | |
| File:Fc9-type-26-icon.png | Scene 0 |
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Lib_DisplayManager.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Lib_DisplayManager.fcfx



