Component: Display Manager Dummy (Graphical Library)

From Flowcode Help
Revision as of 14:13, 22 October 2025 by Wiki bot (talk | contribs) (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | MatrixTSL |- | width="20%" style="color:gray;" | Version | 1.0 |- | width="20%" style="color:gray;...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search
Author MatrixTSL
Version 1.0
Category Graphical Library


Display Manager Dummy 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.

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

ButtonRepeatRate.jpg

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.

FC6 Icon.png Display Manager Demo

Keypad Example

An example showing how you can use the CreateWigitArray component to create a touch keypad for your gLCD.

Updated Display Manager1.png

The CreateWidgetArray function macro has a number of parameters to allow high flexibility in what you can create:

Updated Display Manager2.png

There are also tooltips for each parameter to help.

Updated Display Manager3.png

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.


FC6 Icon.png Display Manager Widget Array Keypad Example

Macro reference

GetSliderValue

Fc9-comp-macro.png GetSliderValue
Reads the value of one of the sliders ranging between 0 and 1. 
Fc9-u16-icon.png - UINT WidgetID
 
Fc9-f32-icon.png - FLOAT Return


ModifyBitmap

Fc9-comp-macro.png ModifyBitmap
Allows the bitmap image to be swapped out 
Fc9-u16-icon.png - UINT ID
Object or Widget ID to update 
Fc9-string-icon.png - STRING Filename
Bitmap filename in 8.3 file format 
Fc9-bool-icon.png - BOOL Scaling
0=Native, 1=Stretch 
Fc9-bool-icon.png - BOOL Transparancy
0=Disabled, 1=Enabled 
Fc9-bool-icon.png - BOOL Redraw
 
Fc9-void-icon.png - VOID Return


ModifyColour

Fc9-comp-macro.png ModifyColour
Changes the theme index of the selected Object or Widget. 
Fc9-u16-icon.png - UINT ID
Unique ID of the object or Widget 
Fc9-u8-icon.png - BYTE Index
0=Foreground, 1=Background, 2=Highlight 
Fc9-u8-icon.png - BYTE R
 
Fc9-u8-icon.png - BYTE G
 
Fc9-u8-icon.png - BYTE B
 
Fc9-bool-icon.png - BOOL Redraw
 
Fc9-void-icon.png - VOID Return


ModifyPosition

Fc9-comp-macro.png ModifyPosition
Moves an existing object or Widget to absolute coordinates on the screen. 
Fc9-u16-icon.png - UINT ID
Unique ID of the object or Widget 
Fc9-s16-icon.png - INT X
 
Fc9-s16-icon.png - INT Y
 
Fc9-bool-icon.png - BOOL Relative
0=Absolute Positioning, 1=Relative Positioning 
Fc9-void-icon.png - VOID Return


ModifyScale

Fc9-comp-macro.png ModifyScale
Changes the width and height of the selected Object or Widget. 
Fc9-u16-icon.png - UINT ID
Unique ID of the object or Widget 
Fc9-u16-icon.png - UINT Width
 
Fc9-u16-icon.png - UINT Height
 
Fc9-void-icon.png - VOID Return


SetSliderValue

Fc9-comp-macro.png SetSliderValue
Sets the value of one of the sliders and optionally redraws the slider to reflect the value change. 
Fc9-u16-icon.png - UINT WidgetID
 
Fc9-f32-icon.png - FLOAT Value
Range: 0 to 1 
Fc9-bool-icon.png - BOOL RedrawSlider
0=Do not redraw, 1=Redraw 
Fc9-void-icon.png - VOID Return


SetTextLabel

Fc9-comp-macro.png SetTextLabel
Draws a single line of text onto an object or Widget location. Useful for labelling Widgets such as buttons or having name, value statistics. Drawn using the object themes. 
Fc9-u16-icon.png - UINT ID
Unique identifier of object or Widget. 
Fc9-string-icon.png - STRING Text
Text string to set as the label 
Fc9-u8-icon.png - BYTE Font
GLCD Font Index to use 
Fc9-u8-icon.png - BYTE HAlignment
0=Left, 1=Center, 2=Right 
Fc9-u8-icon.png - BYTE VAlignment
0=Top, 1=Middle, 2=Bottom 
Fc9-bool-icon.png - BOOL Transparent
0=Background Colour Drawn, 1=Don't Draw Background Colour 
Fc9-void-icon.png - VOID Return


Property reference

Fc9-prop-icon.png Properties

Component Source Code

Please click here to download the component source project: FC_Comp_Source_Lib_DisplayManagerDummy.fcfx

Please click here to view the component source code (Beta): FC_Comp_Source_Lib_DisplayManagerDummy.fcfx