Browse Source

removing container code

msDestiny14 4 năm trước cách đây
mục cha
commit
4532449326

+ 1 - 17
guiEditor/src/diagram/guiNode.ts

@@ -5,8 +5,6 @@ import { WorkbenchComponent, FramePortData } from './workbench';
 import { Control } from 'babylonjs-gui/2D/controls/control';
 import { Vector2 } from 'babylonjs/Maths/math.vector';
 import { Container } from 'babylonjs-gui/2D/controls/container';
-import { ContainerPropertyTabComponent } from './properties/containerPropertyComponent';
-import * as React from 'react';
 
 export class GUINode {
 
@@ -22,7 +20,6 @@ export class GUINode {
     private _isSelected: boolean;
     private _isVisible = true;
     private _enclosingFrameId = -1;
-    private _isContainer = false;
     
     public children: GUINode[] = [];
 
@@ -123,7 +120,6 @@ export class GUINode {
             this._ownerCanvas.isUp = false;
         }
         );
-
         
         guiControl.onPointerEnterObservable.add( evt => {
             this._ownerCanvas.isOverGUINode = true;
@@ -137,8 +133,6 @@ export class GUINode {
         }
         );
 
-        this._isContainer = this.isContainer();
-
         //TODO: Implement
         this._onSelectionBoxMovedObserver = this._globalState.onSelectionBoxMoved.add(rect1 => {
         });
@@ -171,22 +165,13 @@ export class GUINode {
         //evt.stopPropagation();
     }
 
-    renderContainer(): React.ReactNode {
-        if(!this._isContainer) return null;
-
-        return React.createElement(ContainerPropertyTabComponent, {
-        globalState: this._globalState,
-        guiNode: this
-        });
-    }
-
     public updateVisual()
     {
         this.guiControl.leftInPixels = this.x;
         this.guiControl.topInPixels = this.y;
     }
 
-    private isContainer() {
+    private _isContainer() {
         switch (this.guiControl.typeName) {
             case "Button":
             case "StackPanel":
@@ -198,7 +183,6 @@ export class GUINode {
         }
     }
 
-
     public addGui(childNode: GUINode)
     {
         if(!this._isContainer) return;

+ 0 - 47
guiEditor/src/diagram/properties/containerPropertyComponent.tsx

@@ -1,47 +0,0 @@
-
-import { Container } from "babylonjs-gui";
-import * as React from "react";
-import { ButtonLineComponent } from "../../sharedUiComponents/lines/buttonLineComponent";
-import { LineContainerComponent } from "../../sharedUiComponents/lines/lineContainerComponent";
-import { TextLineComponent } from "../../sharedUiComponents/lines/textLineComponent";
-import { IContainerComponentProps } from "./propertyComponentProps";
-
-export class ContainerPropertyTabComponent extends React.Component<IContainerComponentProps> {
-    constructor(props: IContainerComponentProps) {
-        super(props);
-    }
-
-    AddElement()
-    {
-        let newElementName = window.prompt("Please enter name of the element");
-
-        if (!newElementName) {
-            return;
-        }
-
-        //var childGuiNode = this.props.globalState.workbench.findNodeFromGuiElement(newElementName);
-        //this.props.guiNode.addGui(childGuiNode);
-    }
-
-    
-    render() {
-
-        var guiElementMenu: JSX.Element[] = [];
-        var guiNode = this.props.guiNode.guiControl as Container;
-        guiNode.children.forEach(child => {
-            guiElementMenu.push(<TextLineComponent label={child.name}></TextLineComponent>);           
-        });
-
-
-        return (
-            <>                
-                <LineContainerComponent title="CONTAINER PROPERTIES"> 
-                {guiElementMenu}               
-                <ButtonLineComponent label="Add element" onClick={() => {
-                    this.AddElement();
-                }} />
-                </LineContainerComponent>            
-            </>
-        );
-    }
-}

+ 0 - 13
guiEditor/src/diagram/properties/propertyComponentProps.ts

@@ -1,13 +0,0 @@
-import { Control } from "babylonjs-gui/2D/controls/control";
-import { GlobalState } from "../../globalState";
-import { GUINode } from "../guiNode";
-
-export interface IPropertyComponentProps {
-    globalState: GlobalState;
-    guiBlock: Control;
-}
-
-export interface IContainerComponentProps {
-    globalState: GlobalState;
-    guiNode: GUINode;
-}