On Focus library implemented

This commit is contained in:
Luis Fernando Molina committed 2019-10-14 15:56:40 +02:00
1 parent 3ec14cb02d
commit 16169abdff
3 files changed
+739 -60

No files matched your search

+26
View File
@@ -11,6 +11,7 @@ function newWorkspace () {
container: undefined,
enabled: false,
nodeChildren: undefined,
getNodeByShortcutKey: getNodeByShortcutKey,
getAllTradingEngines: getAllTradingEngines,
stopAllRunningTasks: stopAllRunningTasks,
onMenuItemClick: onMenuItemClick,
@@ -49,6 +50,9 @@ function newWorkspace () {
let functionLibraryWorkspaceNodes = newStringifyNode()
let functionLibraryTaskFunctions = newTaskFunctions()
let functionLibrarySessionFunctions = newSessionFunctions()
let functionLibraryShortcutKeys = newShortcutKeys()
let functionLibraryOnFocus = newOnFocus()
thisObject.nodeChildren = newNodeChildren()
return thisObject
@@ -188,6 +192,28 @@ function newWorkspace () {
return tradingEngines
}
function getNodeByShortcutKey (searchingKey) {
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
let rootNode = thisObject.workspaceNode.rootNodes[i]
if (rootNode.type === 'Definition') {
let definition = rootNode
let node = functionLibraryShortcutKeys.getNodeByShortcutKey(searchingKey)
if (node !== undefined) { return node }
}
}
}
function getNodeThatIsOnFocus () {
for (let i = 0; i < thisObject.workspaceNode.rootNodes.length; i++) {
let rootNode = thisObject.workspaceNode.rootNodes[i]
if (rootNode.type === 'Definition') {
let definition = rootNode
let node = functionLibraryOnFocus.getNodeThatIsOnFocus()
if (node !== undefined) { return node }
}
}
}
function spawn (nodeText, point) {
try {
point = canvas.floatingSpace.container.frame.unframeThisPoint(point)