|
@@ -12,8 +12,6 @@ import { WorkbenchComponent } from "./diagram/workbench";
|
|
import { GUINode } from "./diagram/guiNode";
|
|
import { GUINode } from "./diagram/guiNode";
|
|
import { _TypeStore } from "babylonjs/Misc/typeStore";
|
|
import { _TypeStore } from "babylonjs/Misc/typeStore";
|
|
import { MessageDialogComponent } from "./sharedComponents/messageDialog";
|
|
import { MessageDialogComponent } from "./sharedComponents/messageDialog";
|
|
-import { Control } from "babylonjs-gui/2D/controls/control";
|
|
|
|
-import { Container } from "babylonjs-gui/2D/controls/container";
|
|
|
|
|
|
|
|
require("./main.scss");
|
|
require("./main.scss");
|
|
|
|
|
|
@@ -34,27 +32,9 @@ export class WorkbenchEditor extends React.Component<IGraphEditorProps, IGraphEd
|
|
private _leftWidth = DataStorage.ReadNumber("LeftWidth", 200);
|
|
private _leftWidth = DataStorage.ReadNumber("LeftWidth", 200);
|
|
private _rightWidth = DataStorage.ReadNumber("RightWidth", 300);
|
|
private _rightWidth = DataStorage.ReadNumber("RightWidth", 300);
|
|
|
|
|
|
- private _blocks = new Array<Container | Control>();
|
|
|
|
-
|
|
|
|
private _onWidgetKeyUpPointer: any;
|
|
private _onWidgetKeyUpPointer: any;
|
|
-
|
|
|
|
private _popUpWindow: Window;
|
|
private _popUpWindow: Window;
|
|
|
|
|
|
- /**
|
|
|
|
- * Creates a node and recursivly creates its parent nodes from it's input
|
|
|
|
- * @param block
|
|
|
|
- */
|
|
|
|
- public createNodeFromObject(block: Control, recursion = true) {
|
|
|
|
- if (this._blocks.indexOf(block) !== -1) {
|
|
|
|
- return this._workbenchCanvas.nodes.filter((n) => n.guiControl === block)[0];
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- this._blocks.push(block);
|
|
|
|
-
|
|
|
|
- //TODO: Implement
|
|
|
|
- const node = null;
|
|
|
|
- return node;
|
|
|
|
- }
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
componentDidMount() {
|
|
if (this.props.globalState.hostDocument) {
|
|
if (this.props.globalState.hostDocument) {
|
|
@@ -84,13 +64,13 @@ export class WorkbenchEditor extends React.Component<IGraphEditorProps, IGraphEd
|
|
(evt) => {
|
|
(evt) => {
|
|
if ((evt.keyCode === 46 || evt.keyCode === 8) && !this.props.globalState.blockKeyboardEvents) {
|
|
if ((evt.keyCode === 46 || evt.keyCode === 8) && !this.props.globalState.blockKeyboardEvents) {
|
|
// Delete
|
|
// Delete
|
|
- let selectedItems = this._workbenchCanvas.selectedGuiNodes;
|
|
|
|
|
|
+ /*let selectedItems = this._workbenchCanvas.selectedGuiNodes;
|
|
|
|
|
|
for (var selectedItem of selectedItems) {
|
|
for (var selectedItem of selectedItems) {
|
|
selectedItem.dispose();
|
|
selectedItem.dispose();
|
|
}
|
|
}
|
|
this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
|
|
this.props.globalState.onSelectionChangedObservable.notifyObservers(null);
|
|
- return;
|
|
|
|
|
|
+ return;*/
|
|
}
|
|
}
|
|
|
|
|
|
if (!evt.ctrlKey || this.props.globalState.blockKeyboardEvents) {
|
|
if (!evt.ctrlKey || this.props.globalState.blockKeyboardEvents) {
|
|
@@ -112,7 +92,6 @@ export class WorkbenchEditor extends React.Component<IGraphEditorProps, IGraphEd
|
|
}
|
|
}
|
|
} else if (evt.key === "v") {
|
|
} else if (evt.key === "v") {
|
|
// Paste
|
|
// Paste
|
|
- //TODO: Implement
|
|
|
|
}
|
|
}
|
|
},
|
|
},
|
|
false
|
|
false
|
|
@@ -227,8 +206,6 @@ export class WorkbenchEditor extends React.Component<IGraphEditorProps, IGraphEd
|
|
|
|
|
|
let newGuiNode = this._workbenchCanvas.appendBlock(guiElement);
|
|
let newGuiNode = this._workbenchCanvas.appendBlock(guiElement);
|
|
|
|
|
|
- //TODO: Get correct positioning
|
|
|
|
-
|
|
|
|
/*let x = event.clientX; // - event.currentTarget.offsetLeft - this._workbenchCanvas.x;
|
|
/*let x = event.clientX; // - event.currentTarget.offsetLeft - this._workbenchCanvas.x;
|
|
let y = event.clientY; // - event.currentTarget.offsetTop - this._workbenchCanvas.y - 20;
|
|
let y = event.clientY; // - event.currentTarget.offsetTop - this._workbenchCanvas.y - 20;
|
|
|
|
|