The EWC repository contains a folder named demo, which contains a
+collection of forms that have been used to test EWC during development,
+After linking the EWC folder to your active workspace, you can launch
+this application by calling demo.Run with a right argument that selects
+the mode (one of 'Desktop', 'Browser' or 'Multi'):
+
]link.create # /path/to/ewc
+demo.Run 'Desktop'
+
Every window that is created by the Demo app contains a drop-down at the
+top right, which allows you to pick one of the sample apps. There is also
+a button with the caption "Stop", which can be used to end the demo.
+Finally, for use by developers (or curious users), and when running in
+Desktop modde, there is a button with the caption "Inspect", which will
+open a DevTools window for the active HTMLRenderer window.
+
The demo application also works in 'Multi' mode, which means you can
+connect several browser sessions to it and see how cloning works. The demo
+namespace contains both an Initialise function that starts a new session
+in Multi mode, and an onClose function that is called when a session ends.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/0.1/Usage/Initialisation/index.html b/0.1/Usage/Initialisation/index.html
index ab09c8e..3ac6b5b 100755
--- a/0.1/Usage/Initialisation/index.html
+++ b/0.1/Usage/Initialisation/index.html
@@ -1348,13 +1348,16 @@
EWC.Init
provide a left argument to change the names. For example,
'x' EWC.Init 'Browser'
Will create functions xWC, xWS etc, and start EWC in Browser mode.
-
Multi Modes
+
'Multi' Mode
In Desktop and Browser mode, your application can call EWC.Init and then immediately
continue to create GUI components using eWC. In browser mode, EWC.Init will not
return until a browser is connected.
However, in Multi mode, your application namespace must contain a
-function called Init which will be called when each new browser session starts,
+function called Initialise which will be called when each new browser session starts,
to create the GUI for the new session.
+
If your application namespace contains a function called onClose, then it will be
+called when the browser session is terminated.
+
Note that in Multi mode, the only permitted prefix is 'e'.
The simplest way to verify installtion is to run the demo application:
]link.create # /path/to/ewc
-demo.Run ''
+demo.Run 'Desktop'
This will pop up a form with a Dyalog logo and a dropdown on the right which allows
you to select a variety of simple test applications that have been used to test
EWC during development.
-
Alternatively, after linking ewc, you can create a form as follows:
+
The Demo Application
+
The demo application provides several examples that illustrate the use of
+EWC. It supports Desktop, Browser and Multi modes - and will run in the mode that you
+select using the right argument.
+
Building your Own Application
+
After linking ewc, you can create a form as follows:
This should create an HTMLRenderer window with the caption "Hello World". For more
diff --git a/0.1/index.html b/0.1/index.html
index b19d718..f366901 100755
--- a/0.1/index.html
+++ b/0.1/index.html
@@ -1341,7 +1341,8 @@
Introduction
Alternatively, EWC can be initialised in "Browser" mode, in which case it starts a listener on the configured port (22322 by default), and a Browser must be connected to that port. In this mode, it really only makes sense to have a single form, although modeal MsgBox's can be
popped up if required.
Finally, there is an experimental "Multi" mode, intended to support
-multi-user applications. In this mode, EWC must also be used via browsers. For each connection, the application namespace is cloned.
+multi-user applications. In this mode, EWC must also be used via browsers.
+For each connection, the application namespace is cloned.
If the application namespace is called demo, then clones will be named
demo_1, demo_2 etc. This allows each session to have separate state.
The browser-based modes can be used on any Dyalog-supported platform,
diff --git a/0.1/search/search_index.json b/0.1/search/search_index.json
index 5b60d9a..c74dc1e 100755
--- a/0.1/search/search_index.json
+++ b/0.1/search/search_index.json
@@ -1 +1 @@
-{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction","text":"
EWC stands for \"Everywhere Window Create\". EWC is a cross-platform implementation of the \u2395WC family of system functions (\u2395WC, \u2395WS, \u2395WG, \u2395WN, \u2395NQ and \u2395DQ) that are available in Dyalog APL for Microsoft Windows.
EWC only supports a subset of the functionality provided by \u2395WC. This subset is growing, driven by the requirements of early adopters. The supported subset is documented in the object reference.
Note
At this time, EWC is work in progress, and not supported via normal channels. A supported release of EWC is expected in mid-2025.
EWC can run in \"Desktop\" mode using an HTMLRenderer. In this mode, EWC supports multiple forms in the same way as \u2395WC, creating one HTMLRenderer for each form.
Alternatively, EWC can be initialised in \"Browser\" mode, in which case it starts a listener on the configured port (22322 by default), and a Browser must be connected to that port. In this mode, it really only makes sense to have a single form, although modeal MsgBox's can be popped up if required.
Finally, there is an experimental \"Multi\" mode, intended to support multi-user applications. In this mode, EWC must also be used via browsers. For each connection, the application namespace is cloned. If the application namespace is called demo, then clones will be named demo_1, demo_2 etc. This allows each session to have separate state.
The browser-based modes can be used on any Dyalog-supported platform, desktop mode is restricted to the platforms where the HTMLRenderer is available - currently Linux, MacOS and Windows.
Check out the installation instructions, the section on initialisation, or the implementation details.
If you are not familiar with \u2395WC, you may want to start with the standard Dyalog documentation for this feature. The documentation for EWC only discusses differences between the original Win32 based implementation (\u2395WC) and the emulation (EWC).
Note
During prototyping, the project has been known as JSWC, or \"JavaScript WC\". Both the code and the documentation for EWC still contain references to JSWC. Until the transition is complete, JSWC should be read as EWC anywhere that it occurs.
"},{"location":"Discussion/Differences/","title":"EWC versus \u2395WC","text":"
Most importantly, EWC only supports a subset of the objects supported by \u2395WC - and for each of the supported classes, only a subset of the features of the class.
If you use an unsupported property, EWC will output a warning message to the log and continue, in the hope that your application will work in a degraded mode. The warning message identifies the line of application code that used the unsupported feature. For example:
59:15.169 W: *** Warning: at Make[16] wMakeSubForm[8] - Unsupported on button: FCol BCol Accelerator
You can decide to ignore the warning, work around it, or request support for the missing feature from Dyalog. For more information, see the documentation of supported classes.
"},{"location":"Discussion/Differences/#validation-and-error-messages","title":"Validation and Error Messages","text":"
Property validation and error messages are not as reliable as \u2395WC and \u2395WS. If you provide incorrect property values, the results can be unpredictable: the property may simply be ignored, in the worst case the form will be blanked out due to the creation of invalid HTML.
The following restrictions are temporary and will be relaxed before the first supported release:
Coord must be (and defaults to) \"Pixel\"
Setting properties must be done using \u2395WC and \u2395WS, assignment is not supported.
Up-to-date property values must be retrieved using \u2395WG. Although a namespace is created for each EWC object, and there are variables in these spaces that correspond to the properties of GUI objects, these values are not kept up-to-date when the user manipulates the GUI.
In EWC all images are defined using images files, which can be in any format supported by web browsers. You can not refer directly to image files on your local machine, the images must be served up by the web server whic his embedded in EWC.
The location of your images must be declared by setting the variable EWC.RESOURCES before calling EWC.Init, for example:
This creates a virtual folder /images/ that can be referred to when using images.
The ImageList object has a new property Files, which contains a list of the file names that define the ImageList. It is not possible to populate an ImageList by creating child icons and bitmap objects, as in \u2395WC.
The File property of an Icon, and the Picture property of a Button, Form and several other properties, are also affected by this.
EWC has some degree of support for the following \u2395WC classes:
\u2395WC Classes BitMap Grid Menu SubForm Button Group MenuBar TabButton Circle Icon MenuItem TabControl Combo Image MsgBox Text Edit ImageList Poly Timer Ellipse Label Rect TreeView Font List Scroll Form ListView Splitter
EWC adds the following classes not supported by \u2395WC:
Coord defaults to Pixel, Size to 400 600 and Posn to 100 100. The Picture property must refer to a file which resides in one of the folders defined in the EWC.RESOURCES array. See Images for more information.
In EWC, ImageLists are defined using the Files property must refer to files which reside in one of the folders defined in the EWC.RESOURCES array. See Images for more information.
Sets up virtual folders that contain images and other resources that your application might refer to. This is a 2-column matric containing pairs of virtual folder names and real folders containing resource files. For example:
This variable allows you to control the log messages that are output to the session while running EWC. At this stage in the development of EWC, all messages are output for diagnostic purposes. By default, all message types are output (EWC.LOGMODES\u2190\u2395A). At the time that this text was written, the following modes existed:
D: Debug
E: Error
F: Format Request
W: Warning
T: Transmit on WebSocket
R: Receive on WebSocket
C: Connect or Disconnect
U: Unsupported feature
N: Explicit NQ
P: ProcessEvent
G: WG processing
An up-to-date list can be found in the function EWC.Log.
If you want to override EWC's efforts to locate a folder where the JavaScript client code resides, you can set this variable to point to a specific folder. This is only useful if you are either a developer or on the bleeding edge of client development, and need to switch between versions of the client.
If this variable is not set, EWC will first look for a sibling folder called EWC-client in case you have a checkout of the JavaScript code in that location, and if that does not exist use the client in the /client/dist folder within the EWC folder.
"},{"location":"Usage/Initialisation/","title":"Initialising an EWC session","text":"
Once you have a folder on your machine containing EWC, you can load it into a Dyalog APL session (18.2 or later is required):
]link.import # /path/to/ewc
Where /path/to/ewc is the name of the folder that you created during installation.
The function EWC.Init takes a right argument of the mode that you want to enable:
'Desktop' to run each form in an HTMLRenderer
'Browser' to allow a single session from a browser
'Multi' to allow multiple sessions from browsers (more about that later)
For example:
EWC.Init 'Desktop'
EWC.Init will also create cover-functions eWC, eWS and so on, in the namespace from which Init was called. These are intended to be used as replacements for the system functions \u2395WC, \u2395WS, etc.
If you would like to use a different prefix letter for these functions, you can provide a left argument to change the names. For example,
'x' EWC.Init 'Browser'
Will create functions xWC, xWS etc, and start EWC in Browser mode.
In Desktop and Browser mode, your application can call EWC.Init and then immediately continue to create GUI components using eWC. In browser mode, EWC.Init will not return until a browser is connected.
However, in Multi mode, your application namespace must contain a function called Init which will be called when each new browser session starts, to create the GUI for the new session.
EWC is developed as an open-sourcen GitHub repository. To download the code, you can either install Git and clone the repository using the following command:
git clone https://github.com/dyalog/ewc.git
Alternatively, you can just download a zip file containing all the code.
The simplest way to verify installtion is to run the demo application:
]link.create # /path/to/ewcdemo.Run ''
This will pop up a form with a Dyalog logo and a dropdown on the right which allows you to select a variety of simple test applications that have been used to test EWC during development.
Alternatively, after linking ewc, you can create a form as follows:
If you are developing EWC, or you are working with EWC developers and need to quickly pick up changes to the JavaScript client, it may be a good idea to clone the client code separately. In order for EWC to automatically find this code, it must be located in a folder called ewc-client, in the same folder as EWC itself.
"}]}
\ No newline at end of file
+{"config":{"lang":["en"],"separator":"[\\s\\-]+","pipeline":["stopWordFilter"]},"docs":[{"location":"","title":"Introduction","text":"
EWC stands for \"Everywhere Window Create\". EWC is a cross-platform implementation of the \u2395WC family of system functions (\u2395WC, \u2395WS, \u2395WG, \u2395WN, \u2395NQ and \u2395DQ) that are available in Dyalog APL for Microsoft Windows.
EWC only supports a subset of the functionality provided by \u2395WC. This subset is growing, driven by the requirements of early adopters. The supported subset is documented in the object reference.
Note
At this time, EWC is work in progress, and not supported via normal channels. A supported release of EWC is expected in mid-2025.
EWC can run in \"Desktop\" mode using an HTMLRenderer. In this mode, EWC supports multiple forms in the same way as \u2395WC, creating one HTMLRenderer for each form.
Alternatively, EWC can be initialised in \"Browser\" mode, in which case it starts a listener on the configured port (22322 by default), and a Browser must be connected to that port. In this mode, it really only makes sense to have a single form, although modeal MsgBox's can be popped up if required.
Finally, there is an experimental \"Multi\" mode, intended to support multi-user applications. In this mode, EWC must also be used via browsers. For each connection, the application namespace is cloned. If the application namespace is called demo, then clones will be named demo_1, demo_2 etc. This allows each session to have separate state.
The browser-based modes can be used on any Dyalog-supported platform, desktop mode is restricted to the platforms where the HTMLRenderer is available - currently Linux, MacOS and Windows.
Check out the installation instructions, the section on initialisation, or the implementation details.
If you are not familiar with \u2395WC, you may want to start with the standard Dyalog documentation for this feature. The documentation for EWC only discusses differences between the original Win32 based implementation (\u2395WC) and the emulation (EWC).
Note
During prototyping, the project has been known as JSWC, or \"JavaScript WC\". Both the code and the documentation for EWC still contain references to JSWC. Until the transition is complete, JSWC should be read as EWC anywhere that it occurs.
"},{"location":"Discussion/Differences/","title":"EWC versus \u2395WC","text":"
Most importantly, EWC only supports a subset of the objects supported by \u2395WC - and for each of the supported classes, only a subset of the features of the class.
If you use an unsupported property, EWC will output a warning message to the log and continue, in the hope that your application will work in a degraded mode. The warning message identifies the line of application code that used the unsupported feature. For example:
59:15.169 W: *** Warning: at Make[16] wMakeSubForm[8] - Unsupported on button: FCol BCol Accelerator
You can decide to ignore the warning, work around it, or request support for the missing feature from Dyalog. For more information, see the documentation of supported classes.
"},{"location":"Discussion/Differences/#validation-and-error-messages","title":"Validation and Error Messages","text":"
Property validation and error messages are not as reliable as \u2395WC and \u2395WS. If you provide incorrect property values, the results can be unpredictable: the property may simply be ignored, in the worst case the form will be blanked out due to the creation of invalid HTML.
The following restrictions are temporary and will be relaxed before the first supported release:
Coord must be (and defaults to) \"Pixel\"
Setting properties must be done using \u2395WC and \u2395WS, assignment is not supported.
Up-to-date property values must be retrieved using \u2395WG. Although a namespace is created for each EWC object, and there are variables in these spaces that correspond to the properties of GUI objects, these values are not kept up-to-date when the user manipulates the GUI.
In EWC all images are defined using images files, which can be in any format supported by web browsers. You can not refer directly to image files on your local machine, the images must be served up by the web server whic his embedded in EWC.
The location of your images must be declared by setting the variable EWC.RESOURCES before calling EWC.Init, for example:
This creates a virtual folder /images/ that can be referred to when using images.
The ImageList object has a new property Files, which contains a list of the file names that define the ImageList. It is not possible to populate an ImageList by creating child icons and bitmap objects, as in \u2395WC.
The File property of an Icon, and the Picture property of a Button, Form and several other properties, are also affected by this.
EWC has some degree of support for the following \u2395WC classes:
\u2395WC Classes BitMap Grid Menu SubForm Button Group MenuBar TabButton Circle Icon MenuItem TabControl Combo Image MsgBox Text Edit ImageList Poly Timer Ellipse Label Rect TreeView Font List Scroll Form ListView Splitter
EWC adds the following classes not supported by \u2395WC:
Coord defaults to Pixel, Size to 400 600 and Posn to 100 100. The Picture property must refer to a file which resides in one of the folders defined in the EWC.RESOURCES array. See Images for more information.
In EWC, ImageLists are defined using the Files property must refer to files which reside in one of the folders defined in the EWC.RESOURCES array. See Images for more information.
Sets up virtual folders that contain images and other resources that your application might refer to. This is a 2-column matric containing pairs of virtual folder names and real folders containing resource files. For example:
This variable allows you to control the log messages that are output to the session while running EWC. At this stage in the development of EWC, all messages are output for diagnostic purposes. By default, all message types are output (EWC.LOGMODES\u2190\u2395A). At the time that this text was written, the following modes existed:
D: Debug
E: Error
F: Format Request
W: Warning
T: Transmit on WebSocket
R: Receive on WebSocket
C: Connect or Disconnect
U: Unsupported feature
N: Explicit NQ
P: ProcessEvent
G: WG processing
An up-to-date list can be found in the function EWC.Log.
If you want to override EWC's efforts to locate a folder where the JavaScript client code resides, you can set this variable to point to a specific folder. This is only useful if you are either a developer or on the bleeding edge of client development, and need to switch between versions of the client.
If this variable is not set, EWC will first look for a sibling folder called EWC-client in case you have a checkout of the JavaScript code in that location, and if that does not exist use the client in the /client/dist folder within the EWC folder.
The EWC repository contains a folder named demo, which contains a collection of forms that have been used to test EWC during development, After linking the EWC folder to your active workspace, you can launch this application by calling demo.Run with a right argument that selects the mode (one of 'Desktop', 'Browser' or 'Multi'):
]link.create # /path/to/ewcdemo.Run 'Desktop'
Every window that is created by the Demo app contains a drop-down at the top right, which allows you to pick one of the sample apps. There is also a button with the caption \"Stop\", which can be used to end the demo. Finally, for use by developers (or curious users), and when running in Desktop modde, there is a button with the caption \"Inspect\", which will open a DevTools window for the active HTMLRenderer window.
The demo application also works in 'Multi' mode, which means you can connect several browser sessions to it and see how cloning works. The demo namespace contains both an Initialise function that starts a new session in Multi mode, and an onClose function that is called when a session ends.
"},{"location":"Usage/Initialisation/","title":"Initialising an EWC session","text":"
Once you have a folder on your machine containing EWC, you can load it into a Dyalog APL session (18.2 or later is required):
]link.import # /path/to/ewc
Where /path/to/ewc is the name of the folder that you created during installation.
The function EWC.Init takes a right argument of the mode that you want to enable:
'Desktop' to run each form in an HTMLRenderer
'Browser' to allow a single session from a browser
'Multi' to allow multiple sessions from browsers (more about that later)
For example:
EWC.Init 'Desktop'
EWC.Init will also create cover-functions eWC, eWS and so on, in the namespace from which Init was called. These are intended to be used as replacements for the system functions \u2395WC, \u2395WS, etc.
If you would like to use a different prefix letter for these functions, you can provide a left argument to change the names. For example,
'x' EWC.Init 'Browser'
Will create functions xWC, xWS etc, and start EWC in Browser mode.
In Desktop and Browser mode, your application can call EWC.Init and then immediately continue to create GUI components using eWC. In browser mode, EWC.Init will not return until a browser is connected.
However, in Multi mode, your application namespace must contain a function called Initialise which will be called when each new browser session starts, to create the GUI for the new session.
If your application namespace contains a function called onClose, then it will be called when the browser session is terminated.
Note that in Multi mode, the only permitted prefix is 'e'.
EWC is developed as an open-sourcen GitHub repository. To download the code, you can either install Git and clone the repository using the following command:
git clone https://github.com/dyalog/ewc.git
Alternatively, you can just download a zip file containing all the code.
The simplest way to verify installtion is to run the demo application:
]link.create # /path/to/ewcdemo.Run 'Desktop'
This will pop up a form with a Dyalog logo and a dropdown on the right which allows you to select a variety of simple test applications that have been used to test EWC during development.
The demo application provides several examples that illustrate the use of EWC. It supports Desktop, Browser and Multi modes - and will run in the mode that you select using the right argument.
"},{"location":"Usage/Installation/#building-your-own-application","title":"Building your Own Application","text":"
After linking ewc, you can create a form as follows:
If you are developing EWC, or you are working with EWC developers and need to quickly pick up changes to the JavaScript client, it may be a good idea to clone the client code separately. In order for EWC to automatically find this code, it must be located in a folder called ewc-client, in the same folder as EWC itself.