|
PRAGMA PROGRAM REFERENCE MANUAL
|
Index
|
All Operation
|
|
Expand All ADDENDUM
|
CREATE WINDOW
|
CWN
|
Standard Verb
|
Screen Operation
|
Target =
|
Creates a plain window or a window with a border on the screen. After the creation of the window all display oriented commands will stay inside the boundaries of the window. You may create as many windows as you like and select them by using SELECT WINDOW and the desired window number. Or you can bring a window to the top of a stack of windows with RAISE WINDOW. DESTROY WINDOW removes a window from the screen.
|
CREATE WINDOW starting row START ROW starting column START COLUMN ending row END ROW ending column END COLUMN using border style BORDER NAME number to the noun NOUN. BORDER NAME are the standard nouns that define the border style (BORDER NONE, BORDER DOUBLE COMPOUND, etc). NOUN will contain the number of the new window. After CREATE WINDOW you must do an ERASE SCREEN to activate the window.
|
SEE ALSO: SELECT WINDOW / RAISE WINDOW /
|
The basic concept of the PRAGMA windowing package is very simple; the current window of the screen (which is a rectangle, with a starting and ending row and column), can be considered to be the whole screen when it is being used. In other words, if you have a window on the screen, and you are DISPLAYing into it, it looks to the program like the window is the whole screen. Everything you DISPLAY stays inside the boundaries of the window. The window will scroll up when you reach the bottom of it. Lines wrap inside the window boundaries. This concept applies totally and uniformly to all display oriented commands.
When inside of a window, the window, for all intents and purposes, is the whole screen.
A good example of this is the standard verb CLEAR SCREEN. If you are inside of a window, when you execute a CLEAR SCREEN, only the window gets cleared. The rest of the screen (if any) stays as it was. Also, the standard verb SAVE SCREEN IMAGE will save only the contents of the window in which it is currently operating. In short, EVERY single display oriented command thinks the current window is the whole screen.
A default window the size of the full screen is automatically created when PRAGMA comes up, and this will be used if you do not create any windows. The full screen (as you see it) is a window, and is thus just like any other window.
CREATING A WINDOW
To create a window, you use the standard verb CREATE WINDOW.
It takes six parameters; the beginning row and column, the ending row and column, the border style and a noun into which the window number is stored.
The row and column addresses given to CREATE WINDOW are absolute in relation to the physical screen itself. For instance, CREATE WINDOW starting row 10 starting column 15 ending row 20 ending column 65 will create a window starting at row 10 and column 15 of the screen, through row 20 and column 65.
The border style lets you choose whether your window will have no border, a single line border, a double line border, a single line compound or a double line compound border. Compound borders add a column to both sides of the vertical line in order to give a uniform look to the window and not to squash the text against the lines.
The border styles are chosen by entering the standard nouns that describe the border style. These are the standard nouns that you may use:
BORDER DOUBLE (BD) BORDER DOUBLE COMPOUND (BDC) BORDER NONE (BN) BORDER SINGLE (BS) BORDER SINGLE COMPOUND (BSC)
Each window has a number. When you CREATE WINDOW, the system gives back to you the number of the new window into the noun you specify. You then use this noun to refer to this particular window. The windows number 0 (zero) and 1 are used by PRAGMA.
After you create a window, you can specify the new colors and attribute for it. You must then always do an ERASE SCREEN to fill the window with the chosen colors, and to display the border, if any was chosen.
The cursor will be positioned at the top left corner of the new window. Text written into the window will be in the selected attributes and colors (until they are changed).
WORKING WITH WINDOWS
You may create as many windows on the screen as you like.
When you create a new window, the cursor is moved into that window (to the top left corner). To get back to a window that was previously created, you use SELECT WINDOW. You give it one parameter; the window number. This is how you move the "focus" of PRAGMA from one window to another. The selected window becomes the focus; it becomes the "screen", and all interaction is done, and can only be done, on one window at a time; on the selected window. The selected window remains selected until a new window is selected.
When you create your first window, PRAGMA automatically stores the full background screen into window 1. You can always revert to the full screen and leave a window by issuing the command SELECT WINDOW number 1 in your verb.
When you create many windows, some of them may overlap. When you select a window, if part of it is overlaid by another window, when you display into that covered area of the bottommost (selected) window, this data is written into the window, but it will not be visible on the screen. This data is hidden from view because it is currently underneath another window. If you want to bring the full window up to the top of the stack, to show all of its contents, you use RAISE WINDOW. It also takes a single parameter; the window number. The raised window comes to the top of the pile, all of the window becomes visible, and it may thus now cover part or all of other windows. These covered windows are not deleted or modified in any way; they are just momentarily hidden from view. Selecting a window does not raise it to the top of the stack.
LOWER WINDOW is the opposite of RAISE WINDOW. When you lower a window, it is placed on the bottom of the window stack. If the window being lowered was not at the top of the stack, the currently selected window remains selected. If the window being lowered was at the top of the stack, the mew window at the top of the stack becomes selected. This is different than RAISE WINDOW, which always selects the window being raised.
Normally, in the verb stack, window 1 , the background window, is at the bottom. It's basic purpose is to provide a window to restore the contents of the screen when other windows are destroyed. Window 1 is the same size as the full screen. When you create windows of your own, they are placed in the stack above window 1. And you rarely if ever will need to select or raise window 1. So, it will be there as a copy of the background, as it should be.
When you lower a window, it goes all of the way to the bottom, below even window 1. Since window 1 is full screen sized, this causes a lowered window to disappear. The lowered window is behind window 1, and thus you can't see it. This is a good way to temporarily get rid of a window you don't need for a moment. If you destroy it, you would have to recreate it later, and display into it again. If you lower it, you can make it invisible for the time being, and then simply raise it later when you need it.
The other possibility may be that you want to move a window to the bottom of a stack of your windows, but you want it to still be visible, perhaps partially visible if it is covered somewhat by other windows. To accomplish this, you would lower the window, and then lower window 1 afterwards. Window 1 will then be on the bottom again, and your window will be just above it, at the bottom of the stack of your other windows.
MORE ON WINDOWS
Each window has a state. The state includes the display attribute, foreground and background color, and cursor position. Each window remembers its own state. When you select any window, the character attributes and colors of that window go into affect again, and the cursor moves to the place in the window where it was when you left it (by selecting another window).
Each window also maintains a complete picture of its own contents. When a window is destroyed, the underlying data of the previous window that was overlaid is then restored. This is the main purpose for the full screen default window; it is used to restore the screen when your windows are destroyed.
If you SAVE SCREEN IMAGE on a window that is partially hidden, it makes no difference. You get the complete and total contents of the window every time.
The default full screen window is always window number 1. This window may also be selected and used as any other. You cannot destroy this window. You may only destroy window created by you. To remove a window from the screen, and thus restore what was on the screen behind it, you use DESTROY WINDOW, and give it the window number.
There is also another window created by the system at start up time. This is window 0 (zero), and it contains the complete image of the physical screen itself. It is also the full size of the screen. This window though contains a composite picture of all windows together. It contains the exact picture of the physical screen. This makes it different than any other window. All other windows contain ONLY the picture of their own contents, and in fact some of these contents may not even be on the screen if part of the window is covered by another.
Thus, window 0 may be considered the physical screen window, and window 1 may be considered the full screen window. Either one may be selected and used as any other window. And neither may be destroyed by you. You may never need these windows, but they are there. An example of a usage of the physical window number 0 is to give you a composite picture of the screen. Perhaps you may create a bunch of windows on the screen. You may then, after you finish creating them, wish to combine them all into ONE big screen. You may do this by selecting window 0, and then performing a SAVE SCREEN IMAGE. The image saved will be the actual total contents of the physical screen. This will be the combined images of all of the windows put together into one (of course, any overlapping areas not on screen will be lost from this composite image). This eliminates the need to join windows together.
The full screen window number 1 can be thought of as a full screen sized window that underlies all of your windows.
There is another verb, DESTROY ALL WINDOWS. This will remove all windows you have created, and the contents of the full screen window number 1 will be restored to the screen. PRAGMA also issues this command when returning to the START MESSAGE.
The basic way to use windows is to create them, select them, use them, and then destroy them when you are done (or let PRAGMA destroy them all when it returns to the START message). Only one window is selected at any given time, and all operations are performed on the selected window. When you create a window, it is also selected automatically. And when you raise a window, it will be selected. Otherwise, you need to explicitly select the window you desire. When you destroy a window, if the window being destroyed is the currently selected window, the topmost window of the stack becomes selected. The window stack is maintained by PRAGMA. When a window is raised, it is put on the top of the stack, and the others get pushed down one. At the bottom of the stack are the two system windows, 0 and 1.
The PRAGMA windowing package works on any terminal supported by PRAGMA, but it will operate slowly on serial terminals (or a terminal like DOSANSI, which may be considered serial for purposes of this discussion), because all windowing functionality must be performed by PRAGMA the hard way. Serial terminals do not have the capability to scroll a window of the screen, for instance, so doing it the hard way is necessary. Under DOS, you should use the memory mapped screens because they are faster.
|
|
|
CustomWare® is a registered trademark of CustomWare Designs, Inc. All rights reserved.
CustomWare® is a registered servicemark of CustomWare Designs, Inc. All rights reserved.
All images and designs on this web site are copyrighted© 2021.
v
t
|
|