86HMI::TextList(テキストリスト)

[視覚化ウィジェット]

オブジェクト関数

TextListオブジェクト

TextList-1

TextListのプロパティ

TextList-2

Identifier (Identifier (識別子)):

  • ID: オブジェクトを識別する一意の番号
  • Name: オブジェクトのユーザー定義可能な名前。86HMI APIで使用できます。

Geometry (Geometry (形状)):

  • X: オブジェクトのX座標
  • Y: オブジェクトのY座標
  • Width: オブジェクトの幅
  • Height: オブジェクトの高さ

オプション:

  • LineNumbers: 行番号を表示するかどうかを決定します。
  • LineBorder: 境界線のスタイルを、なし/水平/垂直/両方のいずれかに設定します。
  • LineSpacing: テキストの各行間の間隔を、なし/小/標準/大のいずれかで設定します。
  • TextIndent: 行番号とテキストコンテンツ間のインデントの幅を、なし/標準/大/最大のいずれかに設定します。
  • LineCount: 表示できるテキストの最大行数で、 99/999/9999行のいずれかです。
  • LineNum Color: 行番号の色のスタイルを設定します。
  • TextColor: テキストコンテンツの色のスタイルを設定します。
  • LineNum Font: 行番号のフォントスタイルを設定します。
  • TextFont: テキストコンテンツのフォントスタイルを設定します。
  • Odd-Line Color: TextListの奇数行の背景色を任意の色に設定できます。
  • Even-Line Color: TextListの偶数行の背景色を任意の色に設定できます。
  • Focus-Line Color: TextListを指定された行まで直接スクロールし、その行を強調表示します。フォーカス・ラインに表示される色を任意のテーマカラーと一致するように設定します。ArduBlockまたは myHMI APIが必要です。
  • Enable: オブジェクトのデフォルト状態を有効化または無効化を選択します。
  • Order: オブジェクトの順序。オブジェクトリストに表示されるオブジェクトの順序を上下に調整できます。

API Functions

setTextListLine()

説明

Set the TextList line.

構文

void setTextListLine(lv_obj_t* id, int lineNumber, char* text);
void setTextListLine(char* name, int lineNumber, char* text);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名
  • [in] int lineNumber
    The TextList Line number.
  • [in] char* text
    The content.

戻り値

なし

#include "myhmi.h"

void setup() {
  Hmi.begin();
  // ...
  Hmi.setTextListLine(p1tl1, 1, "This is the first line.");
}

void loop() {
  // ...
}

getTextListLine()

説明

Get the TextList line.

構文

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);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名
  • [in] int lineNumber
    The TextList Line number.
  • [out] char* buf
    The content buffer.

戻り値

None or the TextList line content.

#include "myhmi.h"

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  Hmi.begin();
  // ...
  Serial.println(Hmi.getTextListLine(p1tl1, 1));
}

void loop() {
  // ...
}

importToTextList()

説明

Import the specific path file content into the TextList object.

構文

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);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名
  • [in] char* path
    The import file path.
  • [in] int disk
    The disk that the file comes from.

戻り値

なし

#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()

説明

Clear all content of the TextList object.

構文

void clearTextList(lv_obj_t* id);
void clearTextList(char* name);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名

戻り値

なし

#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()

説明

Focus the TextList object line.

構文

void focusTextListLine(lv_obj_t* id, int lineNumber);
void focusTextListLine(char* name, int lineNumber);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名
  • [in] int lineNumber
    The TextList line number.

戻り値

なし

#include "myhmi.h"

void setup() {
  Hmi.begin();
  // ...
  Hmi.focusTextListLine(p1fb1, 1);
}

void loop() {
  // ...
}

setTextListViewRange()

説明

Set the view range of the TextList object line.

構文

void setTextListViewRange(lv_obj_t* id, int startLine, int endLine);
void setTextListViewRange(char* name, int startLine, int endLine);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名
  • [in] int startLine
    The TextList start line.
  • [in] int endLine
    The TextList end line.

戻り値

なし

#include "myhmi.h"

void setup() {
  Hmi.begin();
  // ...
  Hmi.setTextListViewRange(p1tl1, 1, 20);
}

void loop() {
  // ...
}

getTextListViewRangeStart()

説明

Get the view start range of the TextList object.

構文

int getTextListViewRangeStart(lv_obj_t* id);
int getTextListViewRangeStart(char* name);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名

戻り値

The view start range of the TextList object.

#include "myhmi.h"

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  Hmi.begin();
  // ...
  Serial.println(Hmi.getTextListViewRangeStart(p1tl1));
}

void loop() {
  // ...
}

getTextListViewRangeEnd()

説明

Get the view end range of the TextList object.

構文

int getTextListViewRangeStart(lv_obj_t* id);
int getTextListViewRangeStart(char* name);

媒介変数

  • [in] id
    オブジェクトID
  • [in] name
    オブジェクト名

戻り値

The view end range of the TextList object.

#include "myhmi.h"

void setup() {
  Serial.begin(115200);
  while (!Serial);
  
  Hmi.begin();
  // ...
  Serial.println(Hmi.getTextListViewRangeEnd(p1tl1));
}

void loop() {
  // ...
}

詳細は 86HMIエディタ ユーザーマニュアル には、86HMI ウィジェットとAPIのさらなる説明がございます。

上部へスクロール