MWAPI Standard~

From VistApedia
Revision as of 00:33, 2 July 2019 by DavidWhitten (talk | contribs)
Jump to: navigation, search
From the FAQ: ( as documented by Daniel P.B. Smith 1995)
------------------------------------------------------------------------
11. Does M/MUMPS support Microsoft Windows and other GUIUs?

A 1994 addition to the M standard, the M Windowing API (MWAPI), defines an interface between the M language and windowing systems.

InterSystems and Micronetics offer versions of M that implement the MWAPI in a Microsoft Windows environment. Digital has an implementation [is it commercially released? Details?] for Windows NT.

The M Windowing API and its commercial implementations are relatively new and have rough edges. The MWAPI has the advantage of portability and platform-independence, but has some limitations associated with the "least-common-denominator" approach.

A unique feature of the MWAPI is that this "API" does not consist of subroutine calls (except for a few incidental functions). MWAPI programming consists mainly of performing sets and kills into a "structured system variable," which looks like a standard M global. For example, to set the title of a window to "M Technology Demonstration," you write

    s ^$WINDOW("main","TITLE")="M Technology Demonstration"

To make its dimensions 300 by 200, you write

    s ^$WINDOW("main","SIZE")="300,200"

The MWAPI is currently offered for Microsoft Windows by InterSystems and Micronetics, and for Windows NT by Digital Equipment Corporation.  It is often presented as the windowing future for M technology.
VISUAL-BASIC-LIKE APPROACHES
InterSystems' "Visual M" is a set of tools which link M with Microsoft Visual Basic, creating an integrated dual-language environment. M code can be accessed and edited from within the VB design environment, can access VB 

control properties, and can be triggered by VB events.

Micronetics [product name????] provides a Visual-Basic-like environment entirely based on M and the MWAPI.  
"WRITE-SLASH" APPROACHES
InterSystems' "DT-Windows," MGlobal's MGM-PC (for MS-Windows) and MGM-Mac (for the Macintosh) use a feature of the M standard that allows the language to be extended for device-specific purposes by means of the "write-slash" 

syntax. In DT-Windows and MGM, the windowing system is treated as a "device" with an unusually rich repertoire of device-specific commands.

Although DT-Windows and MGM are conceptually similar, they are incompatible with each other.  They are ad-hoc language extensions.  Neither seems to have set a defacto standard.  Why do these products (DT-Windows and MGM) 

provide a nonstandard approach? The answer, in part, is that they were introduced prior to the finalization of the MWAPI standard. Why do they still exist? Because they are closer to their underlying windowing platform than the MWAPI, they arguably provide better performance and broader access to the GUI system's functionality.

Examples from the DT-Windows manual and MGM product literature, respectively, show how an "OK" button is added to a dialog box:
DT-Windows
w /waddbutton(2,65,40,10,20,1,1,1,0,0,0,"OK",1)
MGM
W /DBUTTON("OK",2,9)