Panel Embedded Web Page

Displays a web page or html/javascript content directly embedded into a panel of Usine.

Settings

url

Url of the web page to display (optional).

html

comma-text of the html/javascript source code to display (if the url is empty).

messages

Message received from the panel. Usine will create a bridge To send a message from the page to Usine use the sendUsine('myMessage'). The sendUsine function is define by:

var sendUsine = function(parameters) {
      var v = parameters;
    // MACOS
      if (!window.webkit || !window.webkit.messageHandlers || !window.webkit.messageHandlers.Usine) {
        return;
      }
      window.webkit.messageHandlers.Usine.postMessage(v);
    // WINDOWS
    if (!window.chrome || !window.chrome.webview || !window.chrome.webview.hostObjects || !window.chrome.webview.hostObjects.sync) {
      return;
    }
    var obj = window.chrome.webview.hostObjects.sync.Usine;
      if (obj) {
        obj.ObjectMessage = v;
      }
    //LINUX
      if (!window.webkit || !window.webkit.messageHandlers || !window.webkit.messageHandlers.Usine) {
        return;
      }
      window.webkit.messageHandlers.Usine.postMessage(v);
    };

Example for a button:

<button onclick=sendUsine('{name:"Bob",email:"bob32@gmail.com"}');>Bob</button>

the message mustn't contain any space char.

received

Sends 1 value when a message above is received.

javascript

Javascript to execute into the page. ie. document.getElementById("idexample").innerHTML = Math.random();

can be used to modify the content of the page from Usine.

execute

Executes the javascript above.

The execution is asynchronous.

location

where

Determines where the object is visible.

  • invisible: the object is invisible.
  • ctrl panel: in the control-panel.
  • parent ctrl panel: in the control-panel of the parent patch if it exists.
  • top ctrl panel : in the control-panel of the top parent patch (main patch) if it exists.
  • container : in the container of the current patch.
  • parent container : in the container of the parent patch of the current patch.
  • top parent container: in the container of the top parent patch of the current patch.
  • pop up window: visible in the popup.
  • top header: visible in the top top-header-panel.
  • toolbox: visible in the toolbox-panel.
  • workspace: visible in the workspace-panel.
  • additional container: visible in an additional container, identified by a number. See bellow.

When the location is set to a container which doesn't exist in the patch, Usine try to find in parent patches, the first container available. If no container is available an error message is displayed.

is additional container

Sets the control as an additional container so any other control can be placed into that container. The additional container is identified by a number.

a button inside a listbox

also visible in IB

When ON, will also be visible in the interface-builder-panel.

See also

version 6.0.240115

Edit All Pages