RoboMaster Developer Guide
latest

快速開始

  • 1. 開篇介紹
  • 2. 編程環境安裝
  • 3. 第三方平台通信

RoboMaster SDK 說明

  • 1. RoboMaster SDK 安裝
  • 2. RoboMaster SDK 下載源碼
  • 3. RoboMaster SDK 和機器人建立連接
  • 4. RoboMaster SDK 新手入門 - 基礎篇
  • 5. RoboMaster SDK 新手入門 - EP 篇
  • 6. RoboMaster SDK 新手入門 - 教育系列無人機篇
  • 7. RoboMaster SDK 新手入門 - 多機控制篇
  • 8. RoboMaster SDK 如何記錄日誌
  • 9. RoboMaster SDK APIs
  • 10. RoboMaster SDK API 詳細介紹
  • 11. RoboMaster SDK 多機api匯總
  • 12. RoboMaster SDK 多機編隊TT
  • 13. RoboMaster SDK 多機編隊EP

拓展模塊/拓展接口說明

  • 1. 機械臂與機械爪
  • 2. 舵機
  • 3. 紅外深度傳感器
  • 4. 傳感器轉接模塊
  • 5. UART 接口

明文 SDK 說明

  • 1. 明文 SDK 介紹
  • 2. 接入方式
  • 3. 明文協議
  • 4. 編隊控制

Python 編程說明

  • 1. Python 編程介紹
  • 2. Python 功能介紹
  • 3. Python API
    • 3.1. 機器人
    • 3.2. 多機通信
    • 3.3. 自定義 UI 系統
      • 3.3.1. Common
      • 3.3.2. Stage
      • 3.3.3. Button
      • 3.3.4. Toggle
      • 3.3.5. Text
      • 3.3.6. InputField
      • 3.3.7. Dropdown
    • 3.4. 發射器
    • 3.5. 機械爪
    • 3.6. 機械臂
    • 3.7. 舵機
    • 3.8. 智能
    • 3.9. 裝甲板
    • 3.10. 紅外深度傳感器
    • 3.11. 傳感器轉接模塊
    • 3.12. UART

版本說明

  • 版本說明
RoboMaster Developer Guide
  • Docs »
  • 3. Python API »
  • 3.3. 自定義 UI 系統 »
  • 3.3.7. Dropdown
  • Edit on GitHub

3.3.7. Dropdown¶

Dropdown 控件通常用於在某個對象的多個屬性選項中,選中某個特定值

dropdown_object.set_options(*options)¶
描述:設置下拉框中的內容,輸入為字符串列表,列表中元素個數為下拉框選項個數
參數:*args (string) – 下拉框中的選項內容
傳回:無
示例:my_Dropdown.set_options('RoboMaser EP', 'People')
示例說明:下拉框中有兩個選項,分別為 RoboMaster EP 與 People
dropdown_object.set_background_color(r, g, b, a)¶
描述:

設置下拉框中選中的條目的背景色

參數:
  • r (int) – 背景顏色的 r 值,範圍為[0, 255]
  • g (int) – 背景顏色的 g 值,範圍為[0, 255]
  • b (int) – 背景顏色的 b 值,範圍為[0, 255]
  • a (int) – 背景顏色的透明度,範圍為[0, 255]
傳回:

無

示例:

my_DropDown.set_background_color(200, 200, 200, 230)

示例說明:

設置下拉框中選中的條目的背景色的 rgb 值為(200, 200, 200) ,透明度為 230

dropdown_object.set_arrow_color(r, g, b, a)¶
描述:

設置下拉框選箭頭的顏色

參數:
  • r (int) – 箭頭顏色的 r 值,範圍為[0, 255]
  • g (int) – 箭頭顏色的 g 值,範圍為[0, 255]
  • b (int) – 箭頭顏色的 b 值,範圍為[0, 255]
  • a (int) – 箭頭顏色的透明度,範圍為[0, 255]
傳回:

無

示例:

my_Dropdown.set_arrow_color(120, 120, 120, 200)

示例說明:

設置下拉框選中箭頭顏色的 rgb 值為(120, 120, 120),透明度為 200

dropdown_object.set_item_background_color(r, g, b, a)¶
描述:

設置下拉框中未被選擇的條目的背景色

參數:
  • r (int) – 背景顏色的 r 值,範圍為[0, 255]
  • g (int) – 背景顏色的 g 值,範圍為[0, 255]
  • b (int) – 背景顏色的 b 值,範圍為[0, 255]
  • a (int) – 背景顏色的透明度,範圍為[0, 255]
傳回:

無

示例:

my_DropDown.set_item_background_color(200, 200, 200, 230)

示例說明:

設置下拉框中未被選擇的條目的背景色的 rgb 值為(200, 200, 200) ,透明度為 230

dropdown_object.set_item_checkmark_color(r, g, b, a)¶
描述:

設置下拉框中選中圖標的顏色

參數:
  • r (int) – checkmark顏色的 r 值,範圍為[0, 255]
  • g (int) – checkmark顏色的 g 值,範圍為[0, 255]
  • b (int) – checkmark顏色的 b 值,範圍為[0, 255]
  • a (int) – checkmark 顏色的透明度,範圍為[0, 255]
傳回:

無

示例:

my_DropDown.set_item_checkmark_color(200, 200, 200, 230)

示例說明:

設置下拉框中 checkmark 顏色的 rgb 值為(200, 200, 200) ,透明度為 230

Next Previous

© Copyright 2020, DJI RoboMaster Product Development Team Revision 9b72bfdc.

Built with Sphinx using a theme provided by Read the Docs.