RoboMaster Developer Guide
latest

Quick Start

  • 1. Introduction
  • 2. Programming Environment Installation
  • 3. Third-party Platform Communication

RoboMaster SDK Description

  • 1. Install RoboMaster SDK
  • 2. Download RoboMaster SDK Source Code
  • 3. Connect the RoboMaster SDK with Robots
  • 4. Getting Started with RoboMaster SDK - Basics
  • 5. Getting Started with the RoboMaster SDK - EP
  • 6. Getting Started with the RoboMaster SDK - Education-series Drones
  • 7. Getting Started with the RoboMaster SDK - Multi-device Control
  • 8. Logging for the RoboMaster SDK
  • 9. RoboMaster SDK APIs
  • 10. Detailed Description of RoboMaster SDK APIs
  • 11. Summary of RoboMaster SDK Multi-device APIs
  • 12. Implement Multi-device Formation for TT by Using the RoboMaster SDK
  • 13. Implement Multi-device Formation for EP by Using the RoboMaster SDK

Extended Module/Interface Description

  • 1. Mechanical Arm and Mechanical Gripper
  • 2. Servo
  • 3. Infrared Distance Sensor
  • 4. Sensor Adapter
  • 5. UART Interface

Plaintext SDK Description

  • 1. Introduction to the Plaintext SDK
  • 2. Access Methods
  • 3. Plaintext Protocol
  • 4. Formation Control

Python Programming Description

  • 1. Introduction to Python Programming
  • 2. Introduction to Python Functions
  • 3. Python API
    • 3.1. Robot
    • 3.2. Multi-device Communication
    • 3.3. Custom UI System
      • 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. Blaster
    • 3.5. Mechanical Gripper
    • 3.6. Mechanical Arm
    • 3.7. Servo
    • 3.8. Vision
    • 3.9. Armor Plate
    • 3.10. Infrared Distance Sensor
    • 3.11. Sensor Adapter
    • 3.12. UART

Version Description

  • Version Description
RoboMaster Developer Guide
  • Docs »
  • 3. Python API »
  • 3.3. Custom UI System »
  • 3.3.7. Dropdown
  • Edit on GitHub

3.3.7. Dropdown¶

The Dropdown control is often used to select a specific value among the multiple attribute options of an object.

dropdown_object.set_options(*options)¶
Description:Sets the content of the dropdown box, which is a list of strings. The number of items in the list is the number of dropdown box options.
Parameters:*args (string) – Options in the dropdown box
Returns:None
Example:my_Dropdown.set_options('RoboMaser EP', 'People')
Example description:
 There are two options in the dropdown box, RoboMaster EP and People
dropdown_object.set_background_color(r, g, b, a)¶
Description:

Sets the background color of the selected item in the dropdown box

Parameters:
  • r (int) – The r value of background color, whose range is [0, 255]
  • g (int) – The g value of the background color, whose range is [0, 255]
  • b (int) – The b value of the background color, whose range is [0, 255]
  • a (int) – The transparency of the background color, whose range is [0, 255]
Returns:

None

Example:

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

Example description:
 

Set the rgb value of the background color of selected items in the dropdown box to (200, 200, 200) and the transparency to 230

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

Sets the color of the selection arrow in the dropdown box

Parameters:
  • r (int) – The r value of arrow color, whose range is [0, 255]
  • g (int) – The g value of arrow color, whose range is [0, 255]
  • b (int) – The b value of arrow color, whose range is [0, 255]
  • a (int) – The transparency of arrow color, whose range is [0, 255]
Returns:

None

Example:

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

Example description:
 

Set the rgb value of the color of the selection arrow in the dropdown box to (120, 120, 120) and the transparency to 200

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

Sets the background color of unselected items in the dropdown box

Parameters:
  • r (int) – The r value of background color, whose range is [0, 255]
  • g (int) – The g value of the background color, whose range is [0, 255]
  • b (int) – The b value of the background color, whose range is [0, 255]
  • a (int) – The transparency of the background color, whose range is [0, 255]
Returns:

None

Example:

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

Example description:
 

Set the rgb value of the background color of unselected items in the dropdown box to (200, 200, 200) and the transparency to 230

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

Sets the color of the selection icon in the dropdown box

Parameters:
  • r (int) – The r value of checkmark color, whose range is [0, 255]
  • g (int) – The g value of checkmark color, whose range is [0, 255]
  • b (int) – The b value of checkmark color, whose range is [0, 255]
  • a (int) – The transparency of checkmark color, whose range is [0, 255]
Returns:

None

Example:

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

Example description:
 

Set the rgb value of the checkmark color in the dropdown box to (200, 200, 200) and the transparency to 230

Next Previous

© Copyright 2020, DJI RoboMaster Product Development Team Revision ec257bfa.

Built with Sphinx using a theme provided by Read the Docs.
Read the Docs v: latest
Versions
latest
Downloads
html
epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.