import * as React from "react"; import { Observable } from "babylonjs/Misc/observable"; import { PropertyChangedEvent } from "../../../../propertyChangedEvent"; import { LineContainerComponent } from "../../../lineContainerComponent"; import { TextLineComponent } from "../../../lines/textLineComponent"; import { Control } from "babylonjs-gui/2D/controls/control"; import { Grid } from "babylonjs-gui/2D/controls/grid"; import { SliderLineComponent } from "../../../lines/sliderLineComponent"; import { FloatLineComponent } from "../../../lines/floatLineComponent"; import { TextInputLineComponent } from "../../../lines/textInputLineComponent"; import { LockObject } from "../lockObject"; import { OptionsLineComponent } from "../../../lines/optionsLineComponent"; import { GlobalState } from '../../../../globalState'; interface ICommonControlPropertyGridComponentProps { globalState: GlobalState; control: Control; lockObject: LockObject; onPropertyChangedObservable?: Observable; } export class CommonControlPropertyGridComponent extends React.Component { constructor(props: ICommonControlPropertyGridComponentProps) { super(props); } renderGridInformation() { const control = this.props.control; if (!control.parent || !control.parent.parent) { return null; } const gridParent = control.parent.parent; if ((gridParent as any).rowCount === undefined) { return null; } const grid = gridParent as Grid; const cellInfos = grid.getChildCellInfo(control).split(":"); return ( ); } render() { const control = this.props.control; var horizontalOptions = [ { label: "Left", value: Control.HORIZONTAL_ALIGNMENT_LEFT }, { label: "Right", value: Control.HORIZONTAL_ALIGNMENT_RIGHT }, { label: "Center", value: Control.HORIZONTAL_ALIGNMENT_CENTER }, ]; var verticalOptions = [ { label: "Top", value: Control.VERTICAL_ALIGNMENT_TOP }, { label: "Bottom", value: Control.VERTICAL_ALIGNMENT_BOTTOM }, { label: "Center", value: Control.VERTICAL_ALIGNMENT_CENTER }, ]; return (
{ (control as any).color !== undefined && } { (control as any).background !== undefined && } { this.renderGridInformation() }
); } }