import * as React from "react"; import { Observable } from "babylonjs/Misc/observable"; import { PropertyChangedEvent } from "../../../../propertyChangedEvent"; import { CommonControlPropertyGridComponent } from "./commonControlPropertyGridComponent"; import { LockObject } from "../../../../../sharedUiComponents/tabs/propertyGrids/lockObject"; import { Grid } from "babylonjs-gui/2D/controls/grid"; import { LineContainerComponent } from "../../../../../sharedUiComponents/lines/lineContainerComponent"; import { TextLineComponent } from "../../../../../sharedUiComponents/lines/textLineComponent"; import { GlobalState } from '../../../../globalState'; interface IGridPropertyGridComponentProps { globalState: GlobalState; grid: Grid, lockObject: LockObject, onPropertyChangedObservable?: Observable } export class GridPropertyGridComponent extends React.Component { constructor(props: IGridPropertyGridComponentProps) { super(props); } renderRows() { const grid = this.props.grid; const rows = []; for (var index = 0; index < grid.rowCount; index++) { rows.push(grid.getRowDefinition(index)!); } return ( rows.map((rd, i) => { return ( ) }) ); } renderColumns() { const grid = this.props.grid; const cols = []; for (var index = 0; index < grid.columnCount; index++) { cols.push(grid.getColumnDefinition(index)!); } return ( cols.map((cd, i) => { return ( ) }) ); } render() { const grid = this.props.grid; const cols = []; for (var index = 0; index < grid.rowCount; index++) { cols.push(grid.getColumnDefinition(index)); } return (
{ this.renderRows() } { this.renderColumns() }
); } }