Presentations Function Reference


Long := CreateWindowObject( UpperLeftCornerPoint,
LowerLeftCornerPoint,
WindowTitle,
TitlePosition,
ExplodeSpeed,
SoundEffects,
DisplayNow,
EraseAfterDisplay,
FileToShow)


Explanation-

Creates a window object. A window is an object that 'lives' from the time it is created with this call until it is destroyed with a KillWindow call. While it exists, a window object may shown, hidden, resized, written on, cleared, etc. The long integer value returned is a 'Handle' to the window, which must be preserved and passed to other window manipulation functions that may operate on this window.

Parameters for this function:

UpperLeftCornerPoint : Screen coordinates of the Upper-Left corner of the window as a packed Row, Column value. Use MakePoint to provide this value.

LowerRightCornerPoint : Screen coordinates of the Lower-Right corner of the window. Use MakePoint to provide this value.

WindowTitle : Text value that you want to appear along the frame.

TitlePosition : A number indicating the positioning of the title on the frame:

                              0-1  Reserved ;
                              2    Along Top @ Left
                              3    Along Top, centered
                              4    Along top, Flush Right
                              5    Along bottom @ left
                              6    Along bottom, centered
                              7    Along bottom, Flush right

FrameConfig : A number indicating the frame type

                              0    no frame
                              1    Double Top and Bottom, single sides
                              2    Single line all the way around
                              3    Double line all the way around

ExplosionSpeed : If this number is non-zero, the window will explode on the screen as opposed to just 'popping up', the value determines the relative speed of the effect, with speed decreasing as the value increases. A value of 5-20 is typical.

SoundEffects : This number only applies if ExplosionSpeed is non-zero. A non-zero value in this field causes a sound effect to accompany the expansion and contraction of the window.

DisplayNow : A non-zero value causes the window to be shown immediately after being created. A zero value causes the window object to be created, but not shown.

EraseAfterDisplay : If DisplayNow is true (non-zero) and this value is non-zero, then the window will be shown for approximately EraseAfterDisplay milliseconds and then erased. If EraseAfterDisplay is less than zero, then the window is shown until a key is pressed. Note: the window object is NOT destroyed after it is erased.

FileToShow : May contain a valid filename, the contents of which will be displayed in the window when it is shown. The file is shown 'as-is' and may not be scrolled, etc. (See BrowseFile for more sophisticated text manipulation).

Examples

To display a file called BO_HELP.TXT on the screen for 2 seconds, then erase. Explode window on the screen with sound effects. Surround text with a double-line frame and place a title on the window 'Qty Backordered' in the top center of the window frame.

CreateWindowObject(MakePoint(5,4), MakePoint(65,18),"Qty
Backordered",3,10,1,1,2000,"BO_HELP.TXT")

Do the same thing, but destroy the window after use.

KillWindowObject(CreateWindowObject(MakePoint(5,4), MakePoint(65,18), "Qty
Backordered", 3, 10, 1, 1, 2000, "BO_HELP.TXT"),"")

Create a window object for later use. No special effects, no file.

Handle := CreateWindowObject(MakePoint(5,5),MakePoint(75,17), "Procedure
Status", 3, 0, 0, 0, 0, 0,"")

Display the window created above.

X := ShowWindow(Handle,"")


Integer := KillWindowObject(WindowHandle, Trigger)


Explanation-

Destroys the Window object associated with Window. WindowHandle is the numeric value returned by a previous call to CreateWindowObject. After calling KillWindowObject WindowHandle becomes invalid and should not be used again. Returns -1 if the handle is invalid.


Integer := HideWindow(WindowHandle, Trigger)


Explanation-

Erases the Window object associated with WindowHandle. WindowHandle is the numeric value returned by a previous call to CreateWindowObject. Window Handle may be re-displayed with ShowWindow. Returns -1 if the handle is invalid.


Integer := ShowWindow(WindowHandle, Trigger)


Explanation-

Displays the Window object associated with WindowHandle, was is the value obtained from CreateWindowObject. The window associeate with WindowHandle may be hidden with HideWindow. Returns -1 if the handle is invalid.


Integer := ClrWinAttr(WindowHandle, FillCharacter, InteriorColor, Trigger)


Explanation-

Erases a window's interior. WindowHandle is the unique handle for the window supplied by CreateWindowObject. The interior of the window will be filled with FillCharacter characters displayed in InteriorColor. Use the Color function to provide Interior color.

Example

Handle is the handle of a window previously created with CreateWindowObject. Clear the interior to bright red text on a gray background:

ClrWinAttr(Handle, " ", Color(12,7),"")


Integer := ClrWin(WindowHandle, Trigger)


Explanation-

Erases the interior of a window. See also ClrWinAttr. Returns nothing meaningful.


Integer := WinWrite(WindowHandle, Row, Column, TextToWrite, Trigger)


Explanation-

Writes TextToWrite to a window referenced by WindowHandle at Row and Column, which are relative to the window's upper left corner. TextToWrite appears in the window's current color attributes.


Integer := WinWriteAttr(WindowHandle, Row, Column, Color, TextToWrite, Trigger)


Explanation-

Same as WinWrite except you are given control over the color of the text written. Use the Color function to supply Color.


Integer := WinWriteVerticalAttr(WindowHandle, Row, Column, Color, TextToWrite, Trigger)


Explanation-

Writes TextToWrite vertically(top to bottom) in window identified by WindowHandle starting at Row and Column in colors specified with Color. Use the Color function to derive Color.


Integer := WinWriteRJAttr(WindowHandle, Row, Color, TextToWrite, Trigger)


Explanation-

Writes TextToWrite right-justified on the window-relative Row in window identified by WindowHandle in color attributes specified by Color. Use the Color function to derive color. See also CRTWriteRJAttr.


Integer := WinWriteCenterAttr(WindowHandle, Row, Color, TextToWrite, Trigger)


Explanation-

Writes TextToWrite to window identified by WindowHandle centered on the window-relative Row in color attributes specified in Color. Use Color function to derive Color.


Integer := WinWriteTextandScroll(WindowHandle, TextToWrite, Trigger)


Explanation-

Writes TextToWrite plus a carriage return in window identified by WindowHandle at current cursor location.


String := ReadWin(WindowHandle, Row, Column, NumberOfCharacters, Trigger)


Explanation-

This function reads text appearing in a window and returns it to your formula. WindowHandle is the handle to the window object previously created with CreateWindowObject. Row and Column are window-relative coordinates where the function will begin reading characters. NumberOfCharacters is the number of characters to be read. Characters are read from left to right starting at Row and Column. A text string NumberOfCharacters long is returned.


Integer := ReadWinAttr(WindowHandle, Row, Column)


Explanation-

Returns the current color attribute code of the window at the specified position.


TextString := PromptUser( PromptText,
Row,
Column,
MaximumCharactersToInput,
ScreenWidthofField,
PictureMask,
DefaultValue,
HelpFile,
Trigger)


Explanation-

PromptUser provides a method for selectively prompting the user for input with a fair amount of input editing, validation, and help. PromptUser pops a window up on the screen at Row and Column with PromptText displayed inside the window along with an input field to accept the user's input. The width of the window's interior is Length(PromptText)+1+ScreenWidthofField. MaximumCharactersToInput specifies the maximum number of characters to input. If the width of the field on the screen is less than the allowed number of input characters, the edit field will automatically scroll its contents horizontally. The input field is automatically populated with DefaultValue. You may specify the name of a text file in HelpFile that will be displayed in another window if the user presses F1 during input.

PictureMask provides a powerful capability to specify a format for acceptable input. PictureMask may be one of the following characters, which are used to indicate the acceptable format for the inputted data:

          X    =    Any Character
          x    =    Any Character, forces mixed case (first letter in each word is capitalized).
          !    =    Any Character, force upper case.
          L    =    Any character, force lower case.
          a    =    Alpha text only
          A    =    Alpha text only, force upper case
          l    =    Alpha text only, force lower case
          9    =    Digits and spaces only
          #    =    Digits, spaces, minus, period
          E    =    Digits, spaces, minus, period, 'e' (Scientific)
          K    =    Hex Only (0-9, A-F, force upper)
          B    =    Boolean only (T,t,F,f);
          Y    =    Yes or No (Y,y,N,n);

During entry, the user may relocate the input window using Ctrl-left, Ctrl-right, Ctrl-PgUp, Ctrl-PgDn. While in the input field, cursor navigation keys all function intuitively. The Enter key terminates input, kills the window, and returns the string input by the user to your formula.

If the user presses Escape, then PromptUsers returns a blank value. Use GetPromptExitCode to verify the user's response.

Additional information about PromptUser may be obtained in the section concerning the ASK utility located in the appendix.

Example

Prompt the user to enter an authorization code. Provide on-line help from the file 'C:\HELP\AUTH.HLP'. Prompt appears at row 12, column 30. Input field is 5 characters wide on screen and accepts 5 characters of input that must be numeric.

PromptUser( "Please enter an authorization code (F1 for Help) :", 12, 30, 5, 5, "9", "00000", "C:\HELP\AUTH.HLP","")


Integer := GetPromptExitCode(Trigger)


Explanation-

Returns a code which indicates the keystroke used to terminate the last use of the PromptUser function. If the user escaped out of the prompt, GetPromptExitCode will return 4. If the user entered data normally and terminated input with a carriage return, the code returned will be 3 .


Integer := BrowseFile( FileToBrowse, MessageText, BrowseWindowTitle, NumberOfFrozenColumnHeadingRows, NumberOfFrozenRowHeadingColumns, NumberOfReportTitleRows, MaximumHorizontalPan, BytesToSkipAtStartofFile, StripNonPrintableCharacters, NameOfHelpFile)


Explanation-

BrowseFile provides a powerful text file browser. BrowseFile is commonly used to provide a sophisticated context sensitive help system or as a report previewer. It supports a mouse and provides scroll bars and status lines. You may freeze row and/or column headings that appear at the top and left edge of a report file similarly to setting horizontal and vertical titles is most popular spreadsheet programs. You have a great deal of control over most of the appearance aspects of the browser's operation.

Any size file may be browsed. The file browser saves your DataEase display before execution and restores the DataEase screen after it completes.

FileToBrowse The name of the text file to be browsed with BrowseFile.
MessageText A message that will be displayed on BrowseFile's 25th line, along with status information,such as current cursor row and column.
BrowseWindowTitle A message that is displayed along the top of the main text window used by the browser.
NumberOfFrozenColumnHeadingRows Specifying a non-zero value for this parameter indicates that this number of lines at the beginning of the file should be treated as column headings. Column headings are kept at the top of the browser's display regardless of the scrolling activity that takes place. That is, this text remains as a heading inside the browser window. Column headings DO pan left and right in sync with the data in the body of a report being viewed.
NumberOfFrozenRowHeadingColumns Specifying a non-zero value for this parameter indicates that this number of columns at the beginning of each line in the file should be treated as row headings. Row headings are kept at the left of the browser's display regardless of the scrolling activity that takes place. That is, this text remains as a heading inside the browser window. Row headings DO pan up and down in sync with the data in the body of the report being viewed.
NumberOfReportTitleRows This specifies the number of rows at the beginning of the report that contain title information. These rows will have all white space condensed and will not pan left and right during horizontal scrolling activity.
MaximumHorizontalPan This figures indicates the maximum line width of the file to be browsed. If this is known, then set accordingly, otherwise use 255.
BytesToSkipAtStartOfFile A non-zero figure here indicates that this number of bytes should be skipped when the file is opened for browsing. This is useful for skipping past any printer initialization instructions, etc.
StripNonPrintableCharacters Setting this value to 1 causes all ASCII characters less than 32(space) and greater than 126 (z) to be stripped from the file text before displaying. This can be useful in eliminating some of the printer control codes that could disrupt the screen display.
NameofHelpFile If you specify a filename here, its contents will be displayed when the user presses F1 while operating the browser. BROWSE.HLP, supplied in the BONUS.EXE file, provides some generic help text for operating the file browser.

When the BrowseFile function is executed, control is passed to a full-featured file browsing sub-program, which has its own keyboard interface. The user hasavailable a wide variety of functions including text search, go to, block saving and printing.

Browsing CDF Keyboard Operation

General -

To Exit Program: X, Alt-X or Esc from main screen For Help: Ctrl-F1, H or Alt-H

Panning and Scrolling the Display -

Arrows: Down, Left, Right, Up - One line or character in that direction. PgDn, PgUp: Scroll display down in file one screen page.

Ctrl-PgUp: Scroll display to the beginning of file. Ctrl-PgDn: Scroll display to the end of file.

Ctrl-Right: Pan the display to the right 10 character columns. Ctrl-Left: Pan the display to the left 10 character columns.

Home: Pan to left-most column. End: Pan to right-most column.

Searching -

The report browser supports searching for the occurrence of words in the report:

S or Alt-S: Begins a new search

You will be prompted to enter a search string on the status line (25th). You may enter any text as the search string.

After entering the search text, you will be asked to enter 'Options:' any combination of the following options may be entered:

u - Ignore Case. Text is matched regardless of case. The default is to perform case-sensitive searching.

b - Backwards. The search proceeds from the current line backwards to the top of the file. The default is to search forward.

g - Global Search. The file is rewound to the beginning before a forward search for the text begins. Searching Example:

To search for the first occurrence in the entire report of the word 'Desk' in any combination of upper and lowercase characters, the options would be 'ub'. Option letters themselves are not case sensitive.

Press N or Alt-N to locate the next occurrence of the same text.

Press G or Alt-G to go to a specific line number in the text.

Titles -

The program may be configured to 'freeze' a specified number of lines and/or columns at the top and left portions of the report text. The effect of this is that these so-called title portions of the text will always be visible in the display window, while the remaining text is scrolled or panned. The number of rows and columns to freeze is determined by a startup parameter.

Title text is so indicated by being displayed in a different color than the scrollable report text.

Pressing T or Alt-T toggles title freezing on and off. Note that title freezing should be disabled if you are performing any of the block operations described below.

Block Operations -

NOTE: All block operations should be performed with title freezing toggled off.

Block operations allow you to mark specific sections of the report for printing or saving to another file.

Ctrl-K, B: Mark Block Beginning. The top line in the display window is marked as the beginning of the block. Any previously placed block markers are erased.

Ctrl-K, K: Mark Block End. The top line in the display window is marked as the end of the block (inclusive). The marked text occurring within the block is highlighted on the display. Ctrl-K, W: Write Block to File. You will be prompted to enter the name of a file and, provided there are no errors in your input, the marked block is written to that file. If the file exists, you are asked to confirm overwriting of the file.

Ctrl-K, P: Print Block. The marked block is output to the LPT1 port.