import * as React from "react"; import { Observable } from "babylonjs/Misc/observable"; import { PropertyChangedEvent } from "../../../../propertyChangedEvent"; import { LineContainerComponent } from "../../../../../sharedUiComponents/lines/lineContainerComponent"; import { TextLineComponent } from "../../../../../sharedUiComponents/lines/textLineComponent"; import { Control } from "babylonjs-gui/2D/controls/control"; import { Grid } from "babylonjs-gui/2D/controls/grid"; import { SliderLineComponent } from "../../../../../sharedUiComponents/lines/sliderLineComponent"; import { FloatLineComponent } from "../../../../../sharedUiComponents/lines/floatLineComponent"; import { TextInputLineComponent } from "../../../../../sharedUiComponents/lines/textInputLineComponent"; import { LockObject } from "../../../../../sharedUiComponents/tabs/propertyGrids/lockObject"; import { OptionsLineComponent } from "../../../../../sharedUiComponents/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) { return null; } const gridParent = control.parent; if ((gridParent as any).rowCount === undefined) { return null; } const grid = gridParent as Grid; const childCellInfo = grid.getChildCellInfo(control); if (childCellInfo === undefined) { return null; } const cellInfos = childCellInfo.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() }
); } }