CommandFusion Wiki

Documentation Resources

User Tools

Site Tools


Sidebar

software:modules-and-examples:interlocking

This is an old revision of the document!


Interlocking

What is interlocking when we refer to a graphical user interface (GUI)?

Basically, it is when only one join can be active at a time in a group of joins.

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.

Demo GUI

These files are designed to help you implement interlocking in your projects.

It contains a demo gui and all the required JavaScript files.

Below is a screen shot of the .gui file

Instructions

The below instructions are included in the Interlock.js file.

// 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

Download

software/modules-and-examples/interlocking.1368059231.txt.gz · Last modified: 2013/05/09 00:27 by aaron