Providing the Missing Pieces by The Master's Touch.

23
Providing the Missing Pieces by The Master's Touch

description

The “Needs” identified I needed to be able to enter “text” (notes) in an environment that supported word-wrap, formatted text (fonts, colors, paragraphs, and prehaps spell checking). I needed more flexibility than “msgbox” provided – something that supports customized responses (more than OK, Yes, No, Abort and that could serve as a replacement for the fnDialog$ function found in fnSnap). I wanted to utilize windows controls for standard windows tasks (File Open, File Close, File Location). I needed information stored in the windows registry.

Transcript of Providing the Missing Pieces by The Master's Touch.

Page 1: Providing the Missing Pieces by The Master's Touch.

Providing the Missing Piecesby The Master's Touch

Page 2: Providing the Missing Pieces by The Master's Touch.

Providing the missing pieces

• Creating an application no longer implies the use of one language or one application environment

• Identify the need• Develop, or locate a software solution(s)• Implement the complete solution that best serves

the end-user.

Page 3: Providing the Missing Pieces by The Master's Touch.

The “Needs” identified• I needed to be able to enter “text” (notes) in

an environment that supported word-wrap, formatted text (fonts, colors, paragraphs, and prehaps spell checking).

• I needed more flexibility than “msgbox” provided – something that supports customized responses (more than OK, Yes, No, Abort and that could serve as a replacement for the fnDialog$ function found in fnSnap).

• I wanted to utilize windows controls for standard windows tasks (File Open, File Close, File Location).

• I needed information stored in the windows registry.

Page 4: Providing the Missing Pieces by The Master's Touch.

Implementation Goals

• Create tools that are usable in all versions of Business Rules.

• Utilize a consistent interface for communicating between applications.

• Design the tools to provide the maximum flexibility for implementation– Screen location– Content– Features– Ease of use

Page 5: Providing the Missing Pieces by The Master's Touch.

Tools currently released• BRGrid – supports input from a formatted text file

OR read directly from an internal BR file. Display is a grid with sort, filter, and find features. It allows selection of one or more rows for subsequent processing.

• BRRegister – allows you to read (and write if desired) entries directly from/to the Windows Registry

• Calendar – a graphic calendar for date selection (allows keyboard and mouse controls)

• File Open/Save – presents the standard windows dialog allowing the user to select the location and name of the file.

• Location Selection – useful in allowing the user to designate a location to be used for installations. This tool indicates a path but not file names.

Page 6: Providing the Missing Pieces by The Master's Touch.

Tools currently released

• Help Tips – designed to present the familiar “did you know” programming tips. (George uses this for field help.) Without parameters, this program functions as a viewer for the published BR errors.txt file.

• RadioChk – presents selections using radio dots, checkbox, or buttons with instructional message.

• SpellCheck – text entry with options for spell checking, find/search, supports text and RTF document formats (some limitations), word wrap and more.

Page 7: Providing the Missing Pieces by The Master's Touch.

Tools currently released

• Viewer – a read-only display developed to present formatted text, removing the ability to alter content (PFE allows user to change the text), with a small sized executable.

• Player – allows you to integrate sound clips in your BR application.

– More ideas present more solutions and greater flexibility in existing tools

• MenuHelp• Password

Page 8: Providing the Missing Pieces by The Master's Touch.

Features worth noting

• Command line interface• User defined location and appearance, by

positioning relative to BR screen, or absolute positioning on the display. Variable rows and columns supported in BR 4.1x

• User defined content• Small executable size (quick loading)• Switches on the command line may appear

in any order.

Page 9: Providing the Missing Pieces by The Master's Touch.

RadioChk.exe

• This tool was originally designed as a direct replacement for the fnSnap “fndialog”

• Selections were expanded to include radio dots, check boxes, and the traditional buttons, limited only by screen size.

• Features include:– Customized colorization– User defined number of columns– Pre-selection of options (one or more)– User defined caption, message, options– Message Box (no options)

Page 10: Providing the Missing Pieces by The Master's Touch.

RadioChk.exe

This is the original output of fnDialog$.

Page 11: Providing the Missing Pieces by The Master's Touch.

RadioChk.exe

This is the modified output of fnDialog$ using RadioChk.Note that the message is centered on the BR screen!

Page 12: Providing the Missing Pieces by The Master's Touch.

What does it take to use RadioChk?

C:\BRAG\...\RadioCHk.exe -B999 -Fcommandfile2.txt -XB -Y4 -D350

This is a simple selection using three choices with thisdescriptive text. Paragraph format is supported forpresenting the text to the end user.\n\nIndicate what youyou think by selecting one of the following choices.|&Thoughtful|&Interesting|&Worthless

The text above (red) should appear on a single line in a text file. This file will be referenced by the -F parameter. A sample command line is shown in blue below.

-B999 identifies the result file name (DBDE999.txt)-XB indicates the use of buttons-Y4 indicates that the 4th line of the file (-F) should be used-D350 defines a fixed width for RadioChk

Page 13: Providing the Missing Pieces by The Master's Touch.

What does it look like?

The next slide will demonstrate the various styles of outputthat RadioChk can produce. Only one character is differenton the command line to indicate which style to be used.

The output will be based on the text and command linepresented on the previous slide.

Page 14: Providing the Missing Pieces by The Master's Touch.

RadioChk screen shots

Page 15: Providing the Missing Pieces by The Master's Touch.

RadioChk screen shots

Each of these screens was produced from an identical command line with one exception! The -X parameter was changed from -XB to -XC to -XR.

Page 16: Providing the Missing Pieces by The Master's Touch.

What does the BR code look like?

To call RadioChk from within the BR program, you execute a system call

10000 execute "sys -w C:\BRAG\...\RadioChk.exe -B999 -Fcommandfile2.txt -XB -Y4 -D350"

To obtain the result, read the file created by the -B parameter above. A full discussion of the various options is contained in the documentation. Using the example, the result file will be written to the same location as the executable file. (The dots in the example represent whatever path may be used)

10010 dim longstring$*30010020 sleep(.25) ! allows the file to be written and closed by RadioChk10030 open #100:"name=c:\brag\...\dbde999.txt",display,input10040 linput #100:longstring$10050 close #100,free:10060 ! check for unexpected exit from exe10070 if pos("TIMEOUT,CANCEL,ESCAPE",uprc$(longstring$))>0 then select=0: goto abort10080 ! buttons and radio controls have only one response10090 x=pos(longstring$,"1")10100 select=x ! the xth button was selected10110 abort: !

Page 17: Providing the Missing Pieces by The Master's Touch.

What results do I get?

Should you use the Checkbox format, the result would have tobe analyzed differently since multiple items may be selected.

The routine to determine which choices were selected in the BRprogram might look something like the lines below:

10200 for i=1 to len(longstring$)10210 if longstring$(i:i)="0" then nextitem10220 ! do whatever you need done here10230 ! with the choice that was selected10240 nextitem: next i

"0" indicates the choice was not selected, "1" was selected

Page 18: Providing the Missing Pieces by The Master's Touch.

How flexible is RadioChk?

RadioChk offers even greater flexibility than the original fnDialog$, as the choices are not limited to three options.

You are limited only by the physical screen size.

Using the additional switch on the command line: -Z4, the choices are spread over 4 columns.

Page 19: Providing the Missing Pieces by The Master's Touch.

Changing the appearance

The example below utilizes the additional switch: -Z3 -W120 to force the column widths to a fixed 120 pixels.

Page 20: Providing the Missing Pieces by The Master's Touch.

Just a Message, No Selections

RadioChk can also be used to provide information that requires no response from the end-user. In this case the message is displayed with an OK button.

The “paragraph appearance” is accomplished by inserting “\n\n” in the single line text in the file specified by -F.

Page 21: Providing the Missing Pieces by The Master's Touch.

Advanced Capabilites

The “Advanced Capabilities” include the ability to colorize the text or choices. This is done by using ^ at the beginning of each section followed immediately by the RGB color code expressed in hexadecimal representation.

Color should be used with care or it loses the impact.

^FF0000This report will print all claims for the selected policy by year.\n\nThe demonstrates the use of RED text.|Print Select Policies from a list|^990099All Active Policies|Recently Terminated Policies

Page 22: Providing the Missing Pieces by The Master's Touch.

“Take Aways”

• Ability to use external tools to provide a complete solution to the end user.

• Confidence in your ability to think of new ways to present your application to provide a more complete Windows appearance. Using the GUI of BR version 4.1x is only part of a complete solution.

Page 23: Providing the Missing Pieces by The Master's Touch.

Workshop Exercise

Provided:A census file in CSV format, BR (any version you choose),a copy of brctrl.dll and RadioChk.exe.

This practical exercise is the basis for tomorrow's exercise using BRGrid.

Today, using the census.csv file, create a BR program that calls RadioChk to allow you to select one or more column headings.

1) You should NOT need to create any files (except for use with -F).2) You should NOT hard-code any values in the BR program.3) You must be able to explain the logic to the group.4) All column headings must be available for selection.