CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


software:modules-and-examples:interlocking

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

software:modules-and-examples:interlocking [2013/05/09 00:46]
aaron
software:modules-and-examples:interlocking [2013/12/08 02:35] (current)
jarrod [Instructions]
Line 1: Line 1:
-====== Interlocking ======+====== Interlocking ​Module====== 
 +This is a JavaScript module that allows you to implement interlocking easily in guiDesigner & iViewer. 
 What is interlocking when we refer to a graphical user interface (GUI)? What is interlocking when we refer to a graphical user interface (GUI)?
  
Line 6: Line 8:
 E.g. you have 4 buttons in a GUI, each that select a source. Only one source can be selected at a time, so you would use interlocking to make sure that only one join can be active at a time. When a different join is activated, it first deactivates all other joins in that group. E.g. you have 4 buttons in a GUI, each that select a source. Only one source can be selected at a time, so you would use interlocking to make sure that only one join can be active at a time. When a different join is activated, it first deactivates all other joins in that group.
  
- +===== Example ​GUI =====
-===== Demo GUI =====+
 These files are designed to help you implement interlocking in your projects. ​ These files are designed to help you implement interlocking in your projects. ​
  
Line 16: Line 17:
  
 ==== Instructions ==== ==== Instructions ====
-The below instructions are included in the Interlock.js file. +The instructions are included in the [[https://github.com/CommandFusion/DemoUserInterfaces/tree/master/Interlock|GitHub readme]] and the Interlock.js file.
- +
-<sxh js; lighttrue> +
-// A simple module to manage interlock groups in iViewer +
-// +
-// The module provides a suite of simple calls to manage interlocks:​ +
-// +
-// * to create an interlock group: +
-Interlock.create("​group name", join1, join2 ..joinN); +
- +
-// * to set the currently selected item in an interlock group: +
-Interlock.select("​group name", join); +
- +
-// * to be notified when the current selection of an interlock group changes: +
-Interlock.watch("​group name", function(group name, newSelectedJoin,​ previousSelectedJoin) { +
-  // ... do something here ... +
-}); +
- +
-/* to stop being notified for an interlock group +
-Interlock.unwatch("​group name"​);​ +
- +
-// * to get the current selected join for an interlock group +
-var join = Interlock.get("​group name"​);​ +
- +
-// * to remove an interlock group (remove interlock functionality):​ +
-Interlock.remove("​group name"​);​ +
- +
-// Author: Florent Pillet, CommandFusion +
- +
-</​sxh>​+
 ==== Download ==== ==== Download ====
-{{:software:​examples-software:​gui-examples:​commandfusion_interlock_demo.zip| Click here to download the required files}}+[[https://​github.com/​CommandFusion/​DemoUserInterfaces/​raw/​master/​Interlock/​Interlock.zip|Click here to download the required files]]
 \\ \\
- 
software/modules-and-examples/interlocking.txt · Last modified: 2013/12/08 02:35 by jarrod