1、. STD-BSI ES ISO/IEC L5852-ENGL 1999 W Lb24669 0789977 7T1 H BRITISH STANDARD Momation technology - Programminglan$uag es - M Windowing API ICs 35.060 NO COPYING WITHOUT BSI PERMISSION EXCEPT AS PERMITTED BY COPYRIGHT LAW BS ISO/IEC 158521999 STD-BSI BS ISO/IEC 15852-ENGL 1999 O Lb24bb9 0789978 b38
2、direction of the DISC Board, was Amd. No. J) - present to the responsible internationalEuropean committee any enquiries on the interpretation, or proposais for change, and keep the UK interests informed; - monitor related international and European developments and promulgate them in the UK. A list
3、of organizations represented on this committee cm be obtained on request to its secretary. Cross-references The British Standards which implement international or European publications referred to in this document may be found in the BSI Standards Catalogue under the section entitled “International
4、Standards Correspondence Index”, or by using the “Find facility of the BSI Standards Electronic Catalogue. A British Standard does not purport to include all the necessary provisions of a contract. Users of British Standards are responsible for their correct application. Compliance with a British St
5、andard does not of itself confer immunity from legal obligations. Summary of pages This document comprises a front cover, an inside front cover, the ISO/IEC title page, pages ii to vii, a blank page, pages 1 to 85 and a back cover. The BSI copyright notice displayed in this document indicates when t
6、he document was last issued. O BSI 09-1999 ISBN O 580 32946 1 i NTE R N AT I ON AL STANDARD ISO/IEC 15852 First edition 1999-03-01 Information technology - Programming languages - M Windowing API Technologies de linformation - Langages de programmation - Interface de programme dapplication (API) du
7、langage M, utilisant des fentres Reference number ISOAEC 15852: 1999(E) - . STD-BSI BS ISO/IEC 15852-ENGL 1999 - 1b24bb9 0787980 296 = BS ISO/IEC 15852:1999 Contents 1 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 2 3 3.1 3.2 3.3 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9 General . scope Relation to En
8、vironment . Windows. Elements and Choices Displays Events . Attributes . Drawing . Parents and Children Normative Reference . Attributes . Manipulating Attributes . Attribute Definlions Attribute Value Domains . Length of Character Strings . Colors Characters and the Empty String . True/False Values
9、 Implementation and Application Attributes Extemal Resources Fonts . Identifiers Posfiion, Size and Units 3.3.10 Display Characteristics . 3.3.1 1 Drawing Characteristics . 3.3.1 2 Orientation 3.3.1 3 Key and Pointer Button Codes . 3.3.1 4 Insertion Point and Selection Range 3.3.15 Title Poslion . 3
10、.3.1 6 Choice Layout . 3.3.1 7 Modality . 3.3.18 Scrolling 3.3.1 9 Focus Location . 4 Displays 4.1 Display Attributes 4.1.1 BCOLOR 4-12 CLPBOARD . Page 1 1 1 1 2 2 2 2 2 3 4 4 5 6 6 6 6 7 7 7 8 9 10 11 12 13 13 13 13 14 14 14 15 15 15 16 16 ii STDmBSI BS ISO/IEC L5852-ENGL 1999 lib24bb9 0789983 322
11、9 BS ISO/IEC 15852:1999 4.1.3 COLOR . 4.1.4 COLORTYPE . 4.1 -5 FCOLOR . 4.1.6 FOCUS . 4.1.7 KEYBOARD 4.1.8 PEN . 4.1.9 PUTFORM 4.1.10 PTR . 4.1 . 11 SIZE 4.1.1 2 SPECTRUM . 4.1.13 TYPEFACE . 4.1.14 UNITS . 5 Windows . 5.1 Window Types 5.1.1 MTERM Windows 5.2 Window Components . 5.3 Window Repainting
12、 5.4 Window Attributes 5.4.1 Applicability of Window Attributes 5.4.2 ACTIVE . 5.4.3 BCOLOR . 5.4.4 COLOR . 5.4.5 DEFBUTTON . 5.4.6 DISPLAY . 5.4.7 EVENT 5.4.8 FCOLOR . 5.4.9 FFACE 5.4.1 0 FSIZE 5.4.1 1 =STYLE 5.4.12 ICON . 5.4.13 ICONIFY . 5.4.14 ID . 5.4.1 5 ITITLE . 5.4.16 MENUBAR 5.4.17 MIN . 5.
13、4.18 MODAL . 5.4.19 NEXTG . 5.4.20 PARENT . 5.4.21 POS 5.4.22 RESIZE . 5.4.23 SCROLL . 5.4.24 SIZE 5.4.25 SEMIN . 5.4.26 SIZEWIN . 5.4.27 TIED 5.4.28 TITLE 5.4.29 TYPE . 5.4.30 UNITS . 5.4.31 VISIBLE 6 Elements . 6.1 Gadgets 6.1.1 Check Box 6.1.2 Document . 6.1.3 Generic Box 6.1.4 Group Frame 6.1.5
14、Label . 16 16 16 17 17 17 17 18 18 18 18 19 19 19 20 20 20 20 21 23 23 23 23 24 24 24 24 24 25 25 25 25 25 26 26 26 26 27 27 28 28 28 29 29 29 30 30 30 30 31 31 31 32 32 32 32 iii STDeBSI BS ISO/IEC 15852-ENGL 1999 W lb24bb9 078998Z Ob9 BS ISODEC 15852:1999 6.1.6 List Box . 6.1.7 List Button . 6.1.8
15、 List Entry Box 6.1.9 Long List Box 6.1.1 O Push Button 6.1.1 1 Radio Button Set 6.1.12 Scroll . 6.1.13 Symbol 6.1.14 Text . 6.2 Menus . 6.3 Timers . 6.4 Element Attributes 6.4.1 ACTIVE . 6.4.2 BCOLOR 6.4.3 CANCEL . 6.4.4 CANCHANGE 6.4.5 CHANGED 6.4.6 CHARMAX 6.4.7 CHOICE 6.4.8 DRAW . 6.4.9 DRAWTYPE
16、 . 6.4.1 O EVENT 6.4.1 1 FCOLOR . 6.4.12 FFACE 6.4.13 FRAMED . 6.4.1 4 FSIZE 6.4.1 5 FSTYLE 6.4.16 ID 6.4.1 7 INSELECT 6.4.1 8 INTERVAL 6.4.19 NEXTG . 6.4.20 POS 6.4.21 RESOURCE . 6.4.22 ROWCOL . 6.4.23 SCROLL . 6.4.24 SCROLLBY 6.4.25 SCROLLDIR . 6.4.26 SCROLLPOS 6.4.27 SCROLLRANGE 6.4.28 SELECTMAX
17、6.4.29 SELECTVAL . 6.4-30 SIZE 6.4.31 TBCOLOR 6.4.32 TFCOLOR 6.4.33 TFFACE 6.4.34 TFSIZE . 6.4.35 TFSTYLE 6.4.36 TITLE 64-37 TOPSHOW . 6.4.38 TPOS 6.4.39 TYPE . 6.4.40 UNITS . 6.4.41 VALUE 6.4.42 VISIBLE 6.5 Choice Attributes 6.5.1 Applicability of Choice Attributes 6.5.2 ACCELERATOR 6.5.3 ACTIVE .
18、32 32 32 33 33 33 33 33 33 33 34 34 38 38 38 38 38 39 39 39 40 40 40 40 40 41 41 41 41 42 42 43 43 44 44 45 45 45 46 46 46 47 48 48 48 48 49 49 49 50 50 50 50 52 52 53 53 53 iV STD*BSI ES ISO/IEC 25852-ENGL 1979 9 Lb24bb9 0789983 TT5 BS ISO/IEC 15852:1999 6.5.4 AID 6.5.5 EVENT 6.5.6 MARKER 6.5.7 SEP
19、ARATOR . 6.5.8 SUBMENU 7 Drawing . 7.1 Draw Command Numbers . 7.2 Draw Commands 7.2.1 ARC 7.2.2 BCOLOR . 7.2.3 BITMAP 7.2.4 BOX 7.2.5 DMODE 7.2.6 DRAWTEXT . 7.2.7 FCOLOR . 7.2.8 FFACE 7.2.9 FILLPAT 7.2.10 FSIZE 7.2.1 1 FSTYLE 7.2.12 LINE 7.2.13 OVAL 7.2.14 PENSIZE 7.2.15 PICTURE 7.2.16 PIE 7.2.17 PO
20、INT . 8 Events . 8.1 Event Types 8.1 . 1 Window State Events . 8.1.2 Pointer Events 8.1.3 Keyboard Events 8.1.4 Focus Events 8.1.5 Select Events 8.1 -6 Long List Box Events 8.1.7 Help Events 8.1.8 Timer Events 8.1.9 Applicability of Event Types 8.2 Event Specification Attributes . 8.2.1 ENABLE 8.2.2
21、 FILTERIN 8.3 Processing Events 8.4 Event Commands . 8.4.1 ESTART 8.4.2 ESTOP 8.4.3 ETRIGGER . 8.5 Event Infomation . 8.5.1 CHOICE 8.5.2 CLASS 8.5.3 ELEMENT . 8.5.4 KEY . 8.5.5 NEXTFOCUS . 8.5.6 PRIORFOCUS . 8.5.7 OK . 8.5.8 PBUTTON 8.5.9 PPOS 8.5.10 PSTATE 8.5.1 1 SEQUENCE . 54 54 54 54 55 55 55 56
22、 56 57 57 57 57 58 58 58 58 59 59 59 59 59 60 60 60 60 60 61 61 62 62 63 64 64 64 64 68 68 68 69 69 69 70 70 71 71 72 72 72 72 73 73 73 73 74 74 V - - 1 I STD.BS1 BS ISO/IEC L5852-ENGL 1999 BS ISO/IEC 15852:1999 8.5.12 TYPE . 8.5.1 3 W INOOW . 8.5.14 9 9.1 9.1.1 9.1.2 9.1.3 9.2 10 10.1 10.2 11 11.1
23、11.1.1 11.1.2 11.1.3 11.1.4 11.1.5 Index Applicability of Event Information Attributes . Additional Functions and Special Variables . Functions $W FONT $WTFIT SWTWIDTH Special Variables Error Handling . Error Information . Errors Conformance Implementations . Conforming Implementation . MDC Conformi
24、ng Implementation . MDC Strictly Conforming Implementation MDC Partial Implementation Multiple Levels of Conformance . Window Attributes . Element Attributes . Choice Attributes . Events Event Infomation Implementation Definition Implernentation-specfiic Features Portability Limits . Unimplemented F
25、eatures 74 74 75 78 78 78 79 79 79 79 80 81 81 81 83 83 83 83 84 78 22 36 53 65 76 81 81 82 82 vi STDoBSI BS ISOIIEC 15852-ENGL 1999 162Ybb9 0787985 878 W BS ISO/IEC 15862:1999 Foreword IS0 (the Intemational Organization for Standardization) and IEC (the International Electrotechnical Commission) fo
26、rm the specialized system for worldwide standardization. National bodies that are members of IS0 or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technical activity. IS0 and IEC
27、technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with IS0 and IEC, also take part in the work. In the field of information technology, IS0 and IEC have established a joint technical committee, ISOAEC JTC 1
28、. Draft International Standards adopted by the joint technical committee are circulated to national bodies for voting. Publication as an International Standard requires approval by at least 75 YO of the national bodies casting a vote. International Standard ISOAEC 15852 was prepared by Joint Technic
29、al Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 22, Programming languages, their environments and system software interfaces. STD-BSI BS ISOIIEC lr5852-ENGL 1999 lib24669 078998b 704 E BS ISOOEC 15862:1999 Information technology - Programming languages - M Windowing API 1 General
30、 1.1 scope The M Windowing API (MWAPI) extends the M programming technology with the addition of capabilities for developing and operating graphical user interface (GUI) applications. For the purposes of this International Standard, an application is defined as a collection of one or more M routines
31、 using MWAPI capabilities and a user is a person utilizing such an application. 1.2 Relation to Environment The MWAPI may, but is not required to, operate in conjunction with an underlying windowing platform. The MWAPI does not provide a detailed specification of look and feel for applications. Rath
32、er, if an underlying windowing platform is present, it is intended that the MWAPI adhere to the platforms look and feel to the extent practicable. If no underlying windowing platform is present, the MWAPI implementation determines look and feel characteristics and carries out actions that would othe
33、rwise be carried out by the underlying windowing plaform. 1.3 Windows, Elements and Choices The primary mechanism for communicating with a user is a window. Windows provide a general mechanism for displaying text and graphics, typically enclosed by a border. Associated with windows, elements perform
34、 specialized tasks. Elements include gadgets, menus, and timers. Gadgets are used for specialized input and output. For instance, there are gadgets designed for text input and gadgets that enable users to select from a list of items. Menus are used to enable users to select actions to be performed.
35、Timers provide a means for notification of an application when a specified period of time has elapsed. Menus and certain gadgets contain a list of choices. For instance, a list box has a list of items that a user can select. An entity is a window, element, or choice. 1 BS ISWIEC 15862:1999 1.4 Displ
36、ays Windows are shown to the user via a display, a logical surface on which windows are placed. Each M process has its own display(s); displays are not shared, although physical devices may be shared. There is not necessarily a one-to-one correspondence between a display and the hardware device on w
37、hich it appears. Multiple displays may appear on the same device and may overlap. A single display may span multiple devices. Each display has associated input devices, typically a keyboard with alphanumeric, function and other keys, and a pointer such as a mouse. 1.5 Events Applications are made aw
38、are of actions taken by users, such as pressing a key or selecting a menu item, or of other occurrences via events. Applications specify the events about which they wish to be notified and the code to execute when an event occurs. 1.6 Attributes The characteristics of windows, elements, and choices
39、are specified through attributes in the structured system variable A$WINDOW. The characteristics of displays are specified through attributes in the structured system variable %DISPLAY. The characteristics of events that occur are specified through attributes in the structured system variable *$EVEN
40、T. 1.7 Drawing Within one type of gadget, the generic box, the MWAPt provides facilities for drawing geometric figures, text, and other graphical objects. 1.8 Parents and Children Each window and element has a single parent. A windows parent is either the display on which it appears or another windo
41、w. An elements parent is a window. If P is the parent of C, then C is a child of P. A is an ancestor of C and C is a descendant of A if (i) A is the parent of C, or (i) there exist one or more windows (Bi . Bn) such that A is the parent of Bi, 6, is the parent of C, and, for x equal to Bi through BW
42、1, B, is the parent of B,. A window or element inherits default values for certain attributes from its parent. A window or element .cannot be created before its parent is created. A window or element can be created by the same M command that creates its parent. P is a parent menu of S and S is a sub
43、menu of P if S is displayed when a choice in P is activated. 2 - STD-BSI BS ISOIIEC L5852-ENGL 3999 Lb24bb9 0789986 587 BS ISODEC 15852:1999 2 Normative Reference The following standard contains provisions which, through reference in this text, constitute provisions of this Intemational Standard. At
44、 the time of publication, the edition indicated was valid. All standards are subject to revision, and parties to agreements based on this International Standard are encouraged to investigate the possibility of applying the most recent edition of the standard indicated below. Members of IEC and IS0 m
45、aintain registers of currently valid Intemational Standards. ANSINDC X11.1-1995, American National Standard for Information Systems - Programming Languages - M. The following terms used in this text have the meaning defined in ANSIhDC X11 .l-1995: actuallist command doarau men t - eo1 mr expratom fu
46、nction m - ident intexor - intlit killaraument - L - Ivn mnemonicsDace name namevalue numexpr numlit orienaroument postcond process routine setdestination - SP - ssvn structured system variable subscript svn timeout tvexDr usearoument xara u me n t -9- - - v In addition, the syntax metalanguage used
47、 in this International Standard is the same as that used in ANSINDC X11.1. 3 _ STD-BSI BS ISO/IEC L5852-ENGL 1999 m Lb24fab9 0789784 413 m BS ISODEC 15852:1999 3 Attributes Attributes are specified as nodes within the structured system variables (ssvns) “$WINDOW, “$DISPLAY and “$EVENT. Attributes ar
48、e identified via keywords that appear as subscripts within these -s. These keywords are defined as dattribute, wattribute, elattribute, cattribute, esDecattribute, and einfoattribute values, and are referred to collectively as attribute names. All attribute names not specified by this International
49、Standard are reserved. From the perspective of any M process, “$DISPLAY, “$WINDOW and “$EVENT contain information about only those displays, windows and events that are accessible to the process. 3.1 Manipulating Attributes When an M process begins execution, “$WINDOW and “$EVENT are not defined. Values may be assigned to attributes by referencing “$WINDOW, “$DISPLAY or “$EVENT as a plvn on the left hand side of the equal sign in an M MERGE command or as a setdestination in an M SET command. W