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 ff6646e1.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
v0.2.0
v0.1.2
v0.1.1
v0.1.0
release_en
Downloads
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.