{"id":15784,"date":"2024-12-12T07:19:21","date_gmt":"2024-12-12T07:19:21","guid":{"rendered":"https:\/\/www.qec.tw\/?p=15784"},"modified":"2024-12-12T07:19:24","modified_gmt":"2024-12-12T07:19:24","slug":"textlist","status":"publish","type":"post","link":"https:\/\/www.qec.tw\/zh\/86duino\/86hmi\/textlist\/","title":{"rendered":"86HMI::TextList"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">[Visualization widgets]<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Object Functions<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">TextList Object<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"546\" height=\"325\" src=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-43.png\" alt=\"TextList-1\" class=\"wp-image-15785\" srcset=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-43.png 546w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-43-300x179.png 300w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-43-18x12.png 18w\" sizes=\"(max-width: 546px) 100vw, 546px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">TextList Properties.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"354\" height=\"548\" src=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-44.png\" alt=\"TextList-2\" class=\"wp-image-15786\" srcset=\"https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-44.png 354w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-44-194x300.png 194w, https:\/\/www.qec.tw\/wp-content\/uploads\/2024\/12\/image-44-8x12.png 8w\" sizes=\"(max-width: 354px) 100vw, 354px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Identifier:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ID: Unique number that identifies the object.<\/li>\n\n\n\n<li>Name: User-definable name for the object. It can be used with 86HMI API.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Geometry:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>X: Object X coordinate.<\/li>\n\n\n\n<li>Y: Object Y coordinate.<\/li>\n\n\n\n<li>Width: Object width.<\/li>\n\n\n\n<li>Height: Object height.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Options:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>LineNumbers: Determines whether to display line numbers.<\/li>\n\n\n\n<li>LineBorder: Display styles of the Lines border, with the options as None\/Horizontal\/Vertical\/Both.<\/li>\n\n\n\n<li>LineSpacing: Set the spacing between each line of text, with the options as None\/Smaller\/Normal\/Larger.<\/li>\n\n\n\n<li>TextIndent: Set the indent width between line numbers and text content, with the options as None\/Normal\/Larger\/Largest.<\/li>\n\n\n\n<li>LineCount: The maximum number of lines of text that can be displayed, with the options as 99\/999\/9999.<\/li>\n\n\n\n<li>LineNum Color: Set the color style of line numbers.<\/li>\n\n\n\n<li>TextColor: Set the color style of text content.<\/li>\n\n\n\n<li>LineNum Font: Set the font style of line numbers.<\/li>\n\n\n\n<li>TextFont: Set the font style of text content.<\/li>\n\n\n\n<li>Odd-Line Color: The background color of odd-numbered rows in TextList can be set to any color.<\/li>\n\n\n\n<li>Even-Line Color: The background color of even-numbered rows in TextList can be set to any color.<\/li>\n\n\n\n<li>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.<\/li>\n\n\n\n<li>Enable: Select the default state of the object, enable or disable.<\/li>\n\n\n\n<li>Order: Object order. It can adjust the object order by up\/down, which can be viewed on the Object List.<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">API Functions<\/h2>\n\n\n\n<div style=\"height:30px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">setTextListLine()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Set the TextList line.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>void setTextListLine(lv_obj_t* id, int lineNumber, char* text);<br>void setTextListLine(char* name, int lineNumber, char* text);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n\n\n\n<li><code>[in] int lineNumber<\/code><br>The TextList Line number.<\/li>\n\n\n\n<li><code>[in] char* text<\/code><br>The content.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Hmi.begin();\n  \/\/ ...\n  Hmi.setTextListLine(p1tl1, 1, &quot;This is the first line.&quot;);\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">getTextListLine()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Get the TextList line.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>char* getTextListLine(lv_obj_t* id, int lineNumber);<br>char* getTextListLine(char* name, int lineNumber);<br>char* getTextListLine(lv_obj_t* id, int lineNumber, char* buf);<br>char* getTextListLine(char* name, int lineNumber, char* buf);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[in] id<br>Object ID.<\/li>\n\n\n\n<li>[in] name<br>Object Name.<\/li>\n\n\n\n<li>[in] int lineNumber<br>The TextList Line number.<\/li>\n\n\n\n<li>[out] char* buf<br>The content buffer.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None or the TextList line content.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Serial.begin(115200);\n  while (!Serial);\n  \n  Hmi.begin();\n  \/\/ ...\n  Serial.println(Hmi.getTextListLine(p1tl1, 1));\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">importToTextList()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Import the specific path file content into the TextList object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>void importToTextList(lv_obj_t* id, char* path);<br>void importToTextList(char* name, char* path);<br>void importToTextList(lv_obj_t* id, char* path, int disk);<br>void importToTextList(char* name, char* path, int disk);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n\n\n\n<li><code>[in] char* path<\/code><br>The import file path.<\/li>\n\n\n\n<li><code>[in] int disk<\/code><br>The disk that the file comes from.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Hmi.begin();\n  \/\/ ...\n  Hmi.setFileBrowserDisk(p1fb1, USBDISK);\n}\n\nvoid loop() {\n  \/\/ HMI event\n  BEGIN_HMI_EVENT_PROC\n  {\n    \/\/ USB\n    if (Hmi.buttonClicked(p1b1))\n    {\n      Hmi.importToTextList(p1tl1, Hmi.getFileBrowserFilePath(p1fb1), USBDISK);\n    }\n    if (Hmi.buttonClicked(p1b2))\n    {\n      Hmi.clearTextList(p1tl1);\n    }\n  }\n  END_HMI_EVENT_PROC\n  delay(100);\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">clearTextList()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Clear all content of the TextList object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>void clearTextList(lv_obj_t* id);<br>void clearTextList(char* name);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[in] id<br>Object ID.<\/li>\n\n\n\n<li>[in] name<br>Object Name.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Hmi.begin();\n  \/\/ ...\n  Hmi.setFileBrowserDisk(p1fb1, USBDISK);\n}\n\nvoid loop() {\n  \/\/ HMI event\n  BEGIN_HMI_EVENT_PROC\n  {\n    \/\/ USB\n    if (Hmi.buttonClicked(p1b1))\n    {\n      Hmi.importToTextList(p1tl1, Hmi.getFileBrowserFilePath(p1fb1), USBDISK);\n    }\n    if (Hmi.buttonClicked(p1b2))\n    {\n      Hmi.clearTextList(p1tl1);\n    }\n  }\n  END_HMI_EVENT_PROC\n  delay(100);\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">focusTextListLine()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Focus the TextList object line.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>void focusTextListLine(lv_obj_t* id, int lineNumber);<br>void focusTextListLine(char* name, int lineNumber);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n\n\n\n<li><code>[in] int lineNumber<\/code><br>The TextList line number.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Hmi.begin();\n  \/\/ ...\n  Hmi.focusTextListLine(p1fb1, 1);\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">setTextListViewRange()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Set the view range of the TextList object line.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>void setTextListViewRange(lv_obj_t* id, int startLine, int endLine);<br>void setTextListViewRange(char* name, int startLine, int endLine);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n\n\n\n<li><code>[in] int startLine<\/code><br>The TextList start line.<\/li>\n\n\n\n<li><code>[in] int endLine<\/code><br>The TextList end line.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">None.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Hmi.begin();\n  \/\/ ...\n  Hmi.setTextListViewRange(p1tl1, 1, 20);\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">getTextListViewRangeStart()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Get the view start range of the TextList object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>int getTextListViewRangeStart(lv_obj_t* id);<br>int getTextListViewRangeStart(char* name);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>[in] id<\/code><br>Object ID.<\/li>\n\n\n\n<li><code>[in] name<\/code><br>Object Name.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The view start range of the TextList object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Serial.begin(115200);\n  while (!Serial);\n  \n  Hmi.begin();\n  \/\/ ...\n  Serial.println(Hmi.getTextListViewRangeStart(p1tl1));\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">getTextListViewRangeEnd()<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">Description<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Get the view end range of the TextList object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Syntax<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>int getTextListViewRangeStart(lv_obj_t* id);<br>int getTextListViewRangeStart(char* name);<\/code><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Parameters<\/h4>\n\n\n\n<ul class=\"wp-block-list\">\n<li>[in] id<br>Object ID.<\/li>\n\n\n\n<li>[in] name<br>Object Name.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">Return<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">The view end range of the TextList object.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example<\/h4>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>#include &quot;myhmi.h&quot;\n\nvoid setup() {\n  Serial.begin(115200);\n  while (!Serial);\n  \n  Hmi.begin();\n  \/\/ ...\n  Serial.println(Hmi.getTextListViewRangeEnd(p1tl1));\n}\n\nvoid loop() {\n  \/\/ ...\n}<\/pre><\/div>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Please see the\u00a0<a href=\"https:\/\/www.qec.tw\/86duino\/86hmi\/\">86HMI Editor User Manual<\/a>\u00a0for more instructions on 86HMI widgets and API usage.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[Visualization widgets] Object Functions TextList Object TextList Properties. Identifier: Geometry: Options: API Functions setTextListLine() Description Set the TextList line. Syntax void setTextListLine(lv_obj_t* id, int lineNumber, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":15787,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[285],"tags":[162],"class_list":["post-15784","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-86hmi","tag-86duino"],"_links":{"self":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/posts\/15784","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/comments?post=15784"}],"version-history":[{"count":0,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/posts\/15784\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/media\/15787"}],"wp:attachment":[{"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/media?parent=15784"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/categories?post=15784"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qec.tw\/zh\/wp-json\/wp\/v2\/tags?post=15784"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}