Shortform-Documentation For Window-Library WINDOW.OPO V1.0 Contents: ========= 1 General 2 Subroutines 2.1 Basic Subroutines 2.2 Deducted Subroutines 1 General ========= The WINDOW.OPO-module is an utility for OPL-programmers, which provides window support similar to GEM. WINDOW.OPO is fully copyrighted by ELEKTROHMETER GbR, Slezakweg 2, 84478 Waldkraiburg, Germany, and is distributed as shareware. No warranty or liability is given with this program. WINDOW is not a trademark of ELEKTROHMETER or another company. WINDOW is not copy restricted but free use is allowed for private use only. ******************************************************** * In all cases it is forbidden to change or delete the * * copyright text or other contents in the WINDOW.OPO * * module. * ******************************************************** If you want a complete manual, update support or use the module together with a commercial distributed program, send a minimum of DM 40 or equivalent directly to ELEKTROHMETER or order the money to Postscheckamt Mnchen D-80318 Muenchen BLZ 700 100 80 KtoNr. 037 578 680 2 along with your name, adress and version number of your WINDOW program to legalize your usage of WINDOW. How to use ---------- After unzipping the WINDOW.ZIP - package copy the WINDOW.OPO module to your \OPO directory. You can then use the module in your OPL-program after loading with LOADM "WINDOW" (see demo program WIN_DEMO.OPO). Features -------- The WINDOW-module contains subroutines for handling windows similar to GEM-windows. A WINDOW window is supplied with a title bar which contains a centered title string at the top. This title is inverted during the window is selected / enabled. The title string is limited to a length of 20 characters. Optionally a info bar is avaliable under the title field. The info string is limited to a length of 40 characters. Windows can be topped, moved, aligned, sized, cleared and so on. GLOBAL Variables ---------------- The variables listed below m u s t be declared GLOBAL in the main:-procedure of the users program - otherwise the window-module cannot run properly. - scrW%, scrH%= width, height of the standard window - wId%= window-id of the actual window - redraw%= flag, set if the content of the window is modified, so that the calling program must update the window content. After updating the window the calling program m u s t reset this flag (redraw%= 0)! - chrW%= width of the '0'-character of the actual character set - chrWm%= width of the widest character of the actual character set - chrH%= character height of the actual character set - chrO%= upper character height of the actual character set - chrU%= lower character height of the actual character set - chrHm%= maximum character height of the actual character set - winT$(20)= title of the actual window (set internally) - winI$(40)= info-line of the actual window (set internally) - winTy0%= minimum y-location in the actual window - winI$(8,40), winT$(8,20), winTy0%(8), winX%(8), fId%(8), sId%(8), winY%(8), winW%(8), winH%(8) integer arrays for titles, infos, minimum-y's for window contents, text fonts and style, location and dimensions of the 8 possible windows. Upper or lower case writing of characters of the variable names (or procedure names) as previous written is not important, because OPL translates all names to upper case. Important Notices ----------------- All names of the main WINDOW subroutines except scrPar: are terminated by a "w"-character to differ this module subroutines from those of the main program. WINDOW don't use the text window and the standard window. Text and standard window cannot be opend, altered or closed by using WINDOW subroutines. WINDOW assumes always, that gGMODE 0 and gTMODE 0 is selected. If other modes are used in the main program, the programmer must provide that gGMODE 0 and gTMODE 0 is selected before calling a WINDOW subroutine. (Some subroutines of WINDOW are altering the graphmode.) Text font and style must be selected by opening a window. It is advisable to use only one font for all windows together - it makes programming easier. The window identity number wId% is set after executing the openw:-subroutine. If the user want to deal with more than one window, he m u s t store the id-number e.g. in an array for further operations. 2. Subroutines ============== 2.1 Basic Subroutines ===================== scrPar: This subroutine m u s t be executed before executing any other WINDOW subroutine and before width or height of the standard window is altered. It stores screen width and height in the scrW% and scrH% variables for further operations. openw:(x%,y%,w%,h%,t$,i$,f%,s%) ... opens a new window at the location x%, y% with width w% and height h%. Text font and style must be selected setting the f% and s% variable. The title bar is feeded with t$, optionally an info bar can be filled with i$. The window-id wId% is set new. closew:(id%) ...closes a previous opened window with window-id id%. If the actual window is closed the very top background window is topped. topw:(id%) ...tops the window with window-id id%. The actual window is deselected and the window parameters are stored. The topped window is selected and shifted in the foreground. titelw:(t$) ... shows the title string t$ at the top of the active window. T$ is stored in the winT$ variable. infow:(i$) ...shows the info string i$ under the title bar. I$ is stored in the global winI$ variable. If i$ is string then the info line is erased. The minimum y-value for the window contents winTy0% is set to a valid value. movew:(dx%,dy%) ...move the actual window by the value of dx%,dy% pixel. A negative value for dx% will move the window left, a negative value for dy% will move the window up. sizew:(dw%,dh%) ...modify the width the value of dw% pixel and the height value of dh% pixel. A negative value for dw% or dh% will diminuish the corresponding window dimension. textw:(x%,y%,s$) ...s$ is output at the location x%,y% pixel. The number of characters of s$ fitting in the window is returned. arroww: ...is modifying the vertical and horizontal dimension of the window using a sort of an arrow. The lower right edge location can be altered using the arrow keys, optionally together with the psion-key (fast action). The procedure ends if the enter key was hit. Then the window is updated. clearw: ...wipes the contents of the window - except title and info - out. resetw: ...resets completely the window. The window is first "wiped out" and then border, title bar and info bar (if used) are drawn. storew: ...copys the window parameters winT$, winI$, winTy0%, screen location of the window and window dimensions to the corresponding parameter arrays at the index of the actual window. 2.2 Deducted Subroutines ======================== centerw: ...centers the window horizontally and vertically relative to the screen. leftw: ...alignes the window at the left screen border. The vertical location is not altered. rightw: ...alignes the window at the right screen border. The vertical location is not altered. upw: ...alignes the window at the upper screen border. The horizontal location is not altered. downw: ...alignes the bottom of the window at the lower screen border. The horizontal location is not altered. fullw: ...the dimensions and the position of the window are set equal to the screen dimensions and position. vhalfw: Width and height of the actual window are set to the vertical half of the screen with the result that two windows can be shown side by side. hhalfw: Width and height of the actual window are set to the horizontal half of the screen and two windows can be shown one upon another. sorry for my english... Heinrich Hiemesch @M2.maus.de FRG