| 18 | } |
| 19 | |
| 20 | class AnalogTimePicker extends TkinterBase{ |
| 21 | |
| 22 | static widgetType = "analog_timepicker" |
| 23 | static displayName = "Analog Timepicker" |
| 24 | |
| 25 | static requiredImports = [ |
| 26 | ...TkinterBase.requiredImports, |
| 27 | 'from tktimepicker import AnalogPicker, AnalogThemes, constants' |
| 28 | ] |
| 29 | |
| 30 | static requirements = ["tkTimePicker"] |
| 31 | |
| 32 | constructor(props) { |
| 33 | super(props) |
| 34 | |
| 35 | this.droppableTags = null |
| 36 | |
| 37 | const newAttrs = removeKeyFromObject("layout", this.state.attrs) |
| 38 | |
| 39 | this.timePicker = null |
| 40 | |
| 41 | this.timePickerRef = React.createRef() |
| 42 | |
| 43 | this.minSize = {width: 100, height: 100} |
| 44 | |
| 45 | this.state = { |
| 46 | ...this.state, |
| 47 | widgetName: "Timepicker", |
| 48 | size: { width: 250, height: 350 }, |
| 49 | attrs: { |
| 50 | ...newAttrs, |
| 51 | styling: { |
| 52 | theme:{ |
| 53 | label: "Theme", |
| 54 | tool: Tools.SELECT_DROPDOWN, |
| 55 | toolProps: {placeholder: "select theme"}, |
| 56 | value: "", |
| 57 | options: Object.values(Themes).map(val => ({value: val, label: val})), |
| 58 | onChange: (value) => this.handleThemeChange(value) |
| 59 | }, |
| 60 | ...newAttrs.styling, |
| 61 | clockColor: { |
| 62 | label: "Clock Color", |
| 63 | tool: Tools.COLOR_PICKER, // the tool to display, can be either HTML ELement or a constant string |
| 64 | value: "#EEEEEE", |
| 65 | onChange: (value) => { |
| 66 | this.setAttrValue("styling.clockColor", value) |
| 67 | } |
| 68 | }, |
| 69 | displayColor: { |
| 70 | label: "Display Color", |
| 71 | tool: Tools.COLOR_PICKER, // the tool to display, can be either HTML ELement or a constant string |
| 72 | value: "#000", |
| 73 | onChange: (value) => { |
| 74 | this.setAttrValue("styling.displayColor", value) |
| 75 | } |
| 76 | }, |
| 77 | numberColor: { |
nothing calls this directly
no outgoing calls
no test coverage detected