added pandatable and map viewer attributes

This commit is contained in:
paul
2024-09-28 19:14:24 +05:30
parent 75dc3d7ae2
commit e12d76a7bc
7 changed files with 161 additions and 23 deletions

View File

@@ -7,12 +7,20 @@ import { removeKeyFromObject } from "../../../utils/common"
import MapImage from "./assets/map.png"
import { MinusOutlined, PlayCircleFilled, PlusOutlined } from "@ant-design/icons"
import { TkinterBase } from "../widgets/base"
class MapView extends Widget{
class MapView extends TkinterBase{
static widgetType = "map_view"
static requiredImports = [
...TkinterBase.requiredImports,
"import tkintermapview"
]
static requirements = ["tkintermapview"]
constructor(props) {
super(props)
@@ -21,17 +29,26 @@ class MapView extends Widget{
const newAttrs = removeKeyFromObject("layout", this.state.attrs)
this.state = {
...this.state,
...this.state,
widgetName: "Map viewer",
size: { width: 400, height: 250 },
}
}
componentDidMount(){
super.componentDidMount()
this.setWidgetName("Map viewer")
this.setAttrValue("styling.backgroundColor", "#E4E2E2")
// componentDidMount(){
// super.componentDidMount()
// }
generateCode(variableName, parent){
return [
`${variableName} = tkintermapview.TkinterMapView(master=${parent})`,
`${variableName}.${this.getLayoutCode()}`
]
}
getToolbarAttrs(){
const toolBarAttrs = super.getToolbarAttrs()