控件操作 Control operation
| 2 | import json |
| 3 | |
| 4 | class Control: |
| 5 | """ |
| 6 | 控件操作 |
| 7 | Control operation |
| 8 | """ |
| 9 | def create_text_view(self, _id: int, text: str, coordinate: tuple = (400,500), width: int = 400, height: int = 60) -> bool: |
| 10 | """ |
| 11 | 创建文本框控件 |
| 12 | Create a text box control |
| 13 | |
| 14 | _id: 控件ID,不可与其他控件重复 |
| 15 | text: 控件文本 |
| 16 | coordinate 默认 (400,500) |
| 17 | width: 控件宽度,默认 400 |
| 18 | height: 控件高度,默认 60 |
| 19 | return: True或者False |
| 20 | |
| 21 | _id: control id, which cannot be duplicated with other controls |
| 22 | text: control text |
| 23 | coordinate default (400,500) |
| 24 | width: the width of the control, which is 400 by default |
| 25 | height: control height, 60 by default |
| 26 | return: True or False |
| 27 | """ |
| 28 | return "true" in self.SendData("createTextView", _id, text, coordinate[0], coordinate[1], width, height) |
| 29 | |
| 30 | def create_edit_view(self, _id: int, text: str, coordinate: tuple = (400,500), width: int = 400, height: int = 150) -> bool: |
| 31 | """ |
| 32 | 创建编辑框控件 |
| 33 | Create an edit box control |
| 34 | |
| 35 | _id: 控件ID,不可与其他控件重复 |
| 36 | text: 控件文本 |
| 37 | coordinate: x,y坐标 默认 (400,500) |
| 38 | width: 控件宽度,默认 400 |
| 39 | height: 控件高度,默认 150 |
| 40 | return: True或者False |
| 41 | |
| 42 | _id: control id, which cannot be duplicated with other controls |
| 43 | text: control text |
| 44 | coordinate: x,y coordinates default (400,500) |
| 45 | width: the width of the control, which is 400 by default |
| 46 | height: control height, default is 150 |
| 47 | return: True or False |
| 48 | """ |
| 49 | return "true" in self.SendData("createEditText", _id, text, coordinate[0], coordinate[1], width, height) |
| 50 | |
| 51 | def create_check_box(self, _id: int, text: str, coordinate: tuple = (400,500), width: int = 400, height: int = 60,is_select: bool = False) -> bool: |
| 52 | """ |
| 53 | 创建复选框控件 |
| 54 | Create a check box control |
| 55 | |
| 56 | _id: 控件ID,不可与其他控件重复 |
| 57 | text: 控件文本 |
| 58 | coordinate: x,y坐标 默认 (400,500) |
| 59 | width: 控件宽度,默认 400 |
| 60 | height: 控件高度,默认 60 |
| 61 | is_select: 是否勾选,默认 False |
nothing calls this directly
no outgoing calls
no test coverage detected