[Visualization widgets]
Object Functions
TextList Object

TextList Properties.

Identifier:
- ID: Unique number that identifies the object.
- Name: User-definable name for the object. It can be used with 86HMI API.
Geometry:
- X: Object X coordinate.
- Y: Object Y coordinate.
- Width: Object width.
- Height: Object height.
Options:
- LineNumbers: Determines whether to display line numbers.
- LineBorder: Display styles of the Lines border, with the options as None/Horizontal/Vertical/Both.
- LineSpacing: Set the spacing between each line of text, with the options as None/Smaller/Normal/Larger.
- TextIndent: Set the indent width between line numbers and text content, with the options as None/Normal/Larger/Largest.
- LineCount: The maximum number of lines of text that can be displayed, with the options as 99/999/9999.
- LineNum Color: Set the color style of line numbers.
- TextColor: Set the color style of text content.
- LineNum Font: Set the font style of line numbers.
- TextFont: Set the font style of text content.
- Odd-Line Color: The background color of odd-numbered rows in TextList can be set to any color.
- Even-Line Color: The background color of even-numbered rows in TextList can be set to any color.
- Focus-Line Color: Make the TextList scroll directly to the specified line and highlight the line. Set the color displayed by the Focus Line to match any theme color. It requires ArduBlock or myHMI API.
- Enable: Select the default state of the object, enable or disable.
- Order: Object order. It can adjust the object order by up/down, which can be viewed on the Object List.
API Functions
setTextListLine()
Description
Set the TextList line.
Syntax
void setTextListLine(lv_obj_t* id, int lineNumber, char* text);
void setTextListLine(char* name, int lineNumber, char* text);
Parameters
[in] id
Object ID.[in] name
Object Name.[in] int lineNumber
The TextList Line number.[in] char* text
The content.
Return
None.
Example
#include "myhmi.h" void setup() { Hmi.begin(); // ... Hmi.setTextListLine(p1tl1, 1, "This is the first line."); } void loop() { // ... }
getTextListLine()
Description
Get the TextList line.
Syntax
char* getTextListLine(lv_obj_t* id, int lineNumber);
char* getTextListLine(char* name, int lineNumber);
char* getTextListLine(lv_obj_t* id, int lineNumber, char* buf);
char* getTextListLine(char* name, int lineNumber, char* buf);
Parameters
- [in] id
Object ID. - [in] name
Object Name. - [in] int lineNumber
The TextList Line number. - [out] char* buf
The content buffer.
Return
None or the TextList line content.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); // ... Serial.println(Hmi.getTextListLine(p1tl1, 1)); } void loop() { // ... }
importToTextList()
Description
Import the specific path file content into the TextList object.
Syntax
void importToTextList(lv_obj_t* id, char* path);
void importToTextList(char* name, char* path);
void importToTextList(lv_obj_t* id, char* path, int disk);
void importToTextList(char* name, char* path, int disk);
Parameters
[in] id
Object ID.[in] name
Object Name.[in] char* path
The import file path.[in] int disk
The disk that the file comes from.
Return
None.
Example
#include "myhmi.h" void setup() { Hmi.begin(); // ... Hmi.setFileBrowserDisk(p1fb1, USBDISK); } void loop() { // HMI event BEGIN_HMI_EVENT_PROC { // USB if (Hmi.buttonClicked(p1b1)) { Hmi.importToTextList(p1tl1, Hmi.getFileBrowserFilePath(p1fb1), USBDISK); } if (Hmi.buttonClicked(p1b2)) { Hmi.clearTextList(p1tl1); } } END_HMI_EVENT_PROC delay(100); }
clearTextList()
Description
Clear all content of the TextList object.
Syntax
void clearTextList(lv_obj_t* id);
void clearTextList(char* name);
Parameters
- [in] id
Object ID. - [in] name
Object Name.
Return
None.
Example
#include "myhmi.h" void setup() { Hmi.begin(); // ... Hmi.setFileBrowserDisk(p1fb1, USBDISK); } void loop() { // HMI event BEGIN_HMI_EVENT_PROC { // USB if (Hmi.buttonClicked(p1b1)) { Hmi.importToTextList(p1tl1, Hmi.getFileBrowserFilePath(p1fb1), USBDISK); } if (Hmi.buttonClicked(p1b2)) { Hmi.clearTextList(p1tl1); } } END_HMI_EVENT_PROC delay(100); }
focusTextListLine()
Description
Focus the TextList object line.
Syntax
void focusTextListLine(lv_obj_t* id, int lineNumber);
void focusTextListLine(char* name, int lineNumber);
Parameters
[in] id
Object ID.[in] name
Object Name.[in] int lineNumber
The TextList line number.
Return
None.
Example
#include "myhmi.h" void setup() { Hmi.begin(); // ... Hmi.focusTextListLine(p1fb1, 1); } void loop() { // ... }
setTextListViewRange()
Description
Set the view range of the TextList object line.
Syntax
void setTextListViewRange(lv_obj_t* id, int startLine, int endLine);
void setTextListViewRange(char* name, int startLine, int endLine);
Parameters
[in] id
Object ID.[in] name
Object Name.[in] int startLine
The TextList start line.[in] int endLine
The TextList end line.
Return
None.
Example
#include "myhmi.h" void setup() { Hmi.begin(); // ... Hmi.setTextListViewRange(p1tl1, 1, 20); } void loop() { // ... }
getTextListViewRangeStart()
Description
Get the view start range of the TextList object.
Syntax
int getTextListViewRangeStart(lv_obj_t* id);
int getTextListViewRangeStart(char* name);
Parameters
[in] id
Object ID.[in] name
Object Name.
Return
The view start range of the TextList object.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); // ... Serial.println(Hmi.getTextListViewRangeStart(p1tl1)); } void loop() { // ... }
getTextListViewRangeEnd()
Description
Get the view end range of the TextList object.
Syntax
int getTextListViewRangeStart(lv_obj_t* id);
int getTextListViewRangeStart(char* name);
Parameters
- [in] id
Object ID. - [in] name
Object Name.
Return
The view end range of the TextList object.
Example
#include "myhmi.h" void setup() { Serial.begin(115200); while (!Serial); Hmi.begin(); // ... Serial.println(Hmi.getTextListViewRangeEnd(p1tl1)); } void loop() { // ... }
Please see the 86HMI Editor User Manual for more instructions on 86HMI widgets and API usage.