-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
1,178 additions
and
434 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<details class="doc_details" id="hca_ui_doc_id"><summary>HCA User Interface</summary> | ||
This interface to a graph editor for creating FPGA code is | ||
quite preliminary and far from ready for productive work, | ||
but shows one possible approach. | ||
<p></p> | ||
It reuses DDE user interface | ||
elements for those opperations that are in common with | ||
normal DDE editing. | ||
When the HCA UI is brought up, it replaces the editor section of | ||
DDE's editor pane with a graph editor. | ||
<p></p> | ||
The editor is only available via a secret incantation, | ||
not accessible in released DDE. | ||
|
||
|
||
<details class="doc_details"><summary>HCA editor keystrokes</summary> | ||
<ul> | ||
<li> <b>ctrl-a</b> select all nodes.</li> | ||
<li> <b>ctrl-x</b> cut the selected nodes.</li> | ||
<li> <b>ctrl-c</b> copy the selected nodes to the clipboard.</li> | ||
<li> <b>ctrl-v</b> paste the selected nodes from the clipboard.</li> | ||
</ul> | ||
</details> | ||
|
||
<details class="doc_details"><summary>DDE Menu items for HCA</summary> | ||
<ul> | ||
<li><b>File menu/New</b> Clears the canvas of all nodes and starts a "new buffer".</li> | ||
<li><b>File menu/Open ...</b> Allows the user to select a file from the computer's file system | ||
to edit.</li> | ||
<li><b>File menu/Load ...</b> Allows the user to select a file to load, which creates | ||
buttons of definitions of nodes. Clicking a button creates an instance | ||
of that definition, populating the canvas with nodes.</li> | ||
<li><b>File menu/Save</b> Saves the current file being edited (as a big JSON string).</li> | ||
<li><b>File menu/Save as ...</b> Lets the user choose a file to save the currently | ||
being edited nodes.</li> | ||
<li><b>Edit menu/pretty print</b> arranges the nodes to be well spaced.</li> | ||
</ul> | ||
</details> | ||
|
||
<details class="doc_details"><summary>Other DDE UI for HCA</summary> | ||
<b>Files menu</b> (select of recently used files) | ||
If you select a file without | ||
valid HCA code, it errors but leaves the current canvas and fikes menu unchanged. | ||
<p></p> | ||
<b>Eval button</b> | ||
<ul> | ||
<li>If no selection, inspect the HCA class itself.</li> | ||
<li>If one selected node, inspect it.</li> | ||
<li>If more than one selected node, inspect an array of those selected nodes.</li> | ||
</ul> | ||
|
||
</details> | ||
</details> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,7 +120,7 @@ <h4>Groups</h4> | |
function LGraphGroup(title) | ||
new LiteGraph.LGraphGroup("mytitle") //make a group. | ||
HCA.lgraph.add(new LiteGraph.LGraphGroup("mytit")) //add new group to grpah, it shows with title | ||
you can drag the lower right cornder of the group rect to exand or contract it. | ||
you can drag the lower right corner of the group rect to exand or contract it. | ||
You can drop a node in a group, then drag teh group and it keeps the node in the group. | ||
You can drag a node and drop it inside the group | ||
</pre> | ||
|
@@ -163,6 +163,7 @@ <h4>LGraphCanvas</h4> | |
LGraphCanvas.prototype.getCanvasMenuOptions = function() | ||
LGraphCanvas.prototype.getNodeMenuOptions = function(node)//called by processContextMenu to extract the menu list | ||
LGraphCanvas.prototype.getGroupMenuOptions = function(node) | ||
subgraph_node.buildFromNodes( nodes_list ) | ||
|
||
right click menu: | ||
function ContextMenu(values, //(allows object { title: "Nice text", callback: function ... }) | ||
|
@@ -176,6 +177,28 @@ <h4>LGraphCanvas</h4> | |
LGraphCanvas.prototype.canvas | ||
Trying to get pop up menu on a node. | ||
|
||
Node: onDblClick | ||
|
||
Attribute for Node getExtraMenuOptions: //to add option to context menu | ||
LGraphCanvas.prototype.processMouseDown calls this.processContextMenu(node, e); | ||
for a e.which of 3. | ||
var menu = new LiteGraph.ContextMenu(text_values, { | ||
scale: Math.max(1, this.ds.scale), | ||
event: event, | ||
className: "dark", | ||
callback: inner_clicked.bind(w) | ||
}, | ||
ref_window); | ||
var menu = new LiteGraph.ContextMenu( | ||
entries, | ||
{ | ||
event: e, | ||
callback: inner_clicked, | ||
parentMenu: prev_menu, | ||
node: node | ||
}, | ||
ref_window | ||
); | ||
|
||
//drawing a node. | ||
LGraphCanvas.prototype.drawNode(node, ctx); c | ||
|
@@ -198,6 +221,12 @@ <h4>LGraphCanvas</h4> | |
an array of 2 floats ie [234.4 125.6] | ||
</pre> | ||
|
||
Different link types: | ||
STRAIGHT_LINK: 0, | ||
LINEAR_LINK: 1, | ||
SPLINE_LINK: 2, | ||
LiteGraphCanavas this.links_render_mode = LiteGraph.SPLINE_LINK; | ||
|
||
<h4>Questions</h4> | ||
<pre> | ||
You can write any feedback to [email protected] | ||
|
Oops, something went wrong.