Top Space objects clickeable
This commit is contained in:
1 parent
d36acdb76b
commit
a6f385d78f
8 files changed
+94
-62
No files matched your search
@@ -235,7 +235,18 @@ function newCanvas() {
|
||||
|
||||
let container;
|
||||
|
||||
/* We check first if the mouse is over a panel/ */
|
||||
/* We check if the mouse is over an element of the Top Space / */
|
||||
|
||||
container = thisObject.topSpace.getContainer(point);
|
||||
|
||||
if (container !== undefined && container.isDraggeable === true) {
|
||||
|
||||
containerBeingDragged = container;
|
||||
containerDragStarted = true;
|
||||
return;
|
||||
}
|
||||
|
||||
/* We check if the mouse is over a panel/ */
|
||||
|
||||
container = thisObject.panelsSpace.getContainer(point);
|
||||
|
||||
@@ -246,7 +257,7 @@ function newCanvas() {
|
||||
return;
|
||||
}
|
||||
|
||||
/* We check first if the mouse is over a floatingObject/ */
|
||||
/* We check if the mouse is over a floatingObject/ */
|
||||
|
||||
floatingObjectBeingDragged = thisObject.floatingSpace.floatingLayer.isInside(event.pageX, event.pageY);
|
||||
|
||||
@@ -280,7 +291,17 @@ function newCanvas() {
|
||||
|
||||
let container;
|
||||
|
||||
/* We check first if the mouse is over a panel/ */
|
||||
/* We check if the mouse is over an element of the Top Space / */
|
||||
|
||||
container = thisObject.topSpace.getContainer(point);
|
||||
|
||||
if (container !== undefined && container.isClickeable === true) {
|
||||
|
||||
container.eventHandler.raiseEvent('onMouseClick', event);
|
||||
return;
|
||||
}
|
||||
|
||||
/* We check if the mouse is over a panel/ */
|
||||
|
||||
container = thisObject.panelsSpace.getContainer(point);
|
||||
|
||||
@@ -290,7 +311,7 @@ function newCanvas() {
|
||||
return;
|
||||
}
|
||||
|
||||
/* We check first if the mouse is over a floatingObject/ */
|
||||
/* We check if the mouse is over a floatingObject/ */
|
||||
|
||||
let floatingObjectBeingClicked = thisObject.floatingSpace.floatingLayer.isInside(event.pageX, event.pageY);
|
||||
|
||||
|
||||
@@ -219,6 +219,7 @@ function newTimeControlPanel() {
|
||||
beginDatetime: thisObject.datetimeDisplay.currentDatetime,
|
||||
endDatetime: undefined,
|
||||
timePeriod: PLAY_STEP,
|
||||
startMode: window.CURRENT_START_MODE,
|
||||
eventHandler: thisObject.container.eventHandler
|
||||
};
|
||||
|
||||
|
||||
+10
-7
@@ -54,17 +54,20 @@ function newTopSpace() {
|
||||
|
||||
let container;
|
||||
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
container = endUser.getContainer(point);
|
||||
if (container !== undefined) { return container; }
|
||||
|
||||
container = thisObject.panels[i].getContainer(point);
|
||||
container = devTeam.getContainer(point);
|
||||
if (container !== undefined) { return container; }
|
||||
|
||||
if (container !== undefined) {
|
||||
container = currentBot.getContainer(point);
|
||||
if (container !== undefined) { return container; }
|
||||
|
||||
/* We found an inner container which has the point. We return it. */
|
||||
container = currentProcess.getContainer(point);
|
||||
if (container !== undefined) { return container; }
|
||||
|
||||
return container;
|
||||
}
|
||||
}
|
||||
container = currentStartMode.getContainer(point);
|
||||
if (container !== undefined) { return container; }
|
||||
|
||||
/* The point does not belong to any inner container, so we return the current container. */
|
||||
|
||||
|
||||
+7
-10
@@ -35,22 +35,19 @@ function newCurrentBot() {
|
||||
|
||||
let container;
|
||||
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
/* First we check if this point is inside this object UI. */
|
||||
|
||||
container = thisObject.panels[i].getContainer(point);
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
if (container !== undefined) {
|
||||
return this.container;
|
||||
|
||||
/* We found an inner container which has the point. We return it. */
|
||||
} else {
|
||||
|
||||
return container;
|
||||
}
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* The point does not belong to any inner container, so we return the current container. */
|
||||
|
||||
return thisObject.container;
|
||||
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
@@ -35,22 +35,19 @@ function newCurrentProcess() {
|
||||
|
||||
let container;
|
||||
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
/* First we check if this point is inside this object UI. */
|
||||
|
||||
container = thisObject.panels[i].getContainer(point);
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
if (container !== undefined) {
|
||||
return this.container;
|
||||
|
||||
/* We found an inner container which has the point. We return it. */
|
||||
} else {
|
||||
|
||||
return container;
|
||||
}
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* The point does not belong to any inner container, so we return the current container. */
|
||||
|
||||
return thisObject.container;
|
||||
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
@@ -19,6 +19,7 @@ function newCurrentStartMode() {
|
||||
container.frame.position.y = 0;
|
||||
|
||||
container.isDraggeable = false;
|
||||
container.isClickeable = true;
|
||||
|
||||
return thisObject;
|
||||
|
||||
@@ -27,7 +28,28 @@ function newCurrentStartMode() {
|
||||
window.CURRENT_START_MODE = window.localStorage.getItem("currentStartMode");
|
||||
|
||||
if (window.CURRENT_START_MODE === null) {
|
||||
window.CURRENT_START_MODE = "";
|
||||
window.CURRENT_START_MODE = "Backtest";
|
||||
}
|
||||
|
||||
thisObject.container.eventHandler.listenToEvent("onMouseClick", onClick);
|
||||
}
|
||||
|
||||
function onClick() {
|
||||
|
||||
switch (window.CURRENT_START_MODE) {
|
||||
|
||||
case "Backtest": {
|
||||
window.CURRENT_START_MODE = "Live";
|
||||
break;
|
||||
}
|
||||
case "Live": {
|
||||
window.CURRENT_START_MODE = "Competition";
|
||||
break;
|
||||
}
|
||||
case "Competition": {
|
||||
window.CURRENT_START_MODE = "Backtest";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,22 +57,19 @@ function newCurrentStartMode() {
|
||||
|
||||
let container;
|
||||
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
/* First we check if this point is inside this object UI. */
|
||||
|
||||
container = thisObject.panels[i].getContainer(point);
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
if (container !== undefined) {
|
||||
return this.container;
|
||||
|
||||
/* We found an inner container which has the point. We return it. */
|
||||
} else {
|
||||
|
||||
return container;
|
||||
}
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* The point does not belong to any inner container, so we return the current container. */
|
||||
|
||||
return thisObject.container;
|
||||
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
+7
-10
@@ -35,22 +35,19 @@ function newDevTeam() {
|
||||
|
||||
let container;
|
||||
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
/* First we check if this point is inside this object UI. */
|
||||
|
||||
container = thisObject.panels[i].getContainer(point);
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
if (container !== undefined) {
|
||||
return this.container;
|
||||
|
||||
/* We found an inner container which has the point. We return it. */
|
||||
} else {
|
||||
|
||||
return container;
|
||||
}
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* The point does not belong to any inner container, so we return the current container. */
|
||||
|
||||
return thisObject.container;
|
||||
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
+7
-10
@@ -35,22 +35,19 @@ function newEndUser() {
|
||||
|
||||
let container;
|
||||
|
||||
for (let i = 0; i < thisObject.panels.length; i++) {
|
||||
/* First we check if this point is inside this object UI. */
|
||||
|
||||
container = thisObject.panels[i].getContainer(point);
|
||||
if (thisObject.container.frame.isThisPointHere(point, true) === true) {
|
||||
|
||||
if (container !== undefined) {
|
||||
return this.container;
|
||||
|
||||
/* We found an inner container which has the point. We return it. */
|
||||
} else {
|
||||
|
||||
return container;
|
||||
}
|
||||
/* This point does not belong to this space. */
|
||||
|
||||
return undefined;
|
||||
}
|
||||
|
||||
/* The point does not belong to any inner container, so we return the current container. */
|
||||
|
||||
return thisObject.container;
|
||||
|
||||
}
|
||||
|
||||
function draw() {
|
||||
|
||||
Reference in new issue
Block a user