4.20E

From BR Wiki
Jump to navigation Jump to search

Business Rules! Release 4.20E


BORER= changes - important

The BORDER= parameter in the OPEN statement has been upgraded for use with GUI. The new syntax is: BORDER=S|D|B[:attributes] This means that BORDER= MUST be followed by S, D or B, which in turn may optionally be followed by a colon and attribute specifications. S denotes single line, D denotes double line and B denotes blank.

Border=H and the eight linedraw characters are no longer supported except that a new OPTION 62 permits S, D, B, H or an eight character string followed by a colon and then attributes: BORDER=S|D|B|H|8-char-string[:attributes] While the colon is actually optional, it is recommended for readability when attributes are included.

NoSort introduced.

Hot Windows

FKEY= may now be specified in an Open Window statement. This makes the window hot, so a user can click anywhere in the window to tell the program that they want to switch focus. This is inheritable, but not to independent windows. In other words, assigning an FKEY value to a window automatically assigns the same FKEY value to it's child windows, unless another FKEY ( or -1 ) is assigned to a child.



Days() Processing Made More Flexible

If a date format mask omits month, day, year and/or century BR now assumes the first day of the current month for the respective omitted mask components. Values must conform to masks with the following exceptions:

   * Any valid format for month or day is accepted on input where the mask requests the respective month or day.
   * Any valid separator will be accepted where any separator is specified by the mask.

examples-

  days("Tuesday 23 January, 2007",'day dd month, ccyy') -> 39104
  days("January, 2007",'day dd month, ccyy') -> 39082  (day 1 assumed)
  days("Tuesday 23 Jan; 07",'day dd m3, yy') -> 39104  (note mm yy separator)
  days("Tuesday 23 Jan/ 07",'day dd m3, yy') -> 39104
  days("Tuesday 23 Jan; 07",'day dd m3, yy') -> 39104
  days("Tuesday 23 Jan- 07",'day dd m3, yy') -> 39104
  days("23 Jan;",'dd m3,')                   -> 40200  (current year and century)

We do require that the entered value conform to the specified mask to avoid the entry of incorrect dates using unforseen valid expressions.

We will allow a null mask, but the omission of a mask does not denote a null mask. It denotes whatever the system default mask is currently set to, which could be the system default.



TYPE NOW TRANSLATES PRINTER ESCAPE SEQUENCES.

e.g. TYPE filename >destination [ PRINTER_TYPE= HP3 ]

Printer translation is done in accordance with the destination printer name matching that is done at OPEN time for printer files ( same as NAME=PRN:/printer etc. ). The optional PRINTER_TYPE= specification is valid only if the destination is a display file. It is matched against the second parameter of configuration file PRINTER statements.

e.g. TYPE PRT\report-file >PREVIEW:/HP4 This will translate HP4 printer escape sequences embedded in report-file.

e.g. TYPE PRT\report-file1 >report-file2 PRINTER_TYPE=HP4 This will copy file1 to file 2 interpreting HP4 printer escape sequences.

COPY now supports copying a print file *unaltered* to a printer. e.g. COPY PRT\EDITLIST.255 DIRECT:/HP4

File Selection Box Improvement

The file browser dialog box syntax has been expanded to include "NAME=REPLACE: starting-directory[mask]" which denotes the same as NAME=SAVE:... except no confirmation dialog will be given if the user selects an existing file. When SAVE is specified and the user selects an existing file a confirmation dialog will always be presented.

Any of NAME=OPEN | SAVE | REPLACE:... specifications may be given in conjunction with any of the OPEN file parameters NEW | USE | REPLACE. The REPLACE keyword in the NAME= parameter qualifies the open dialog only and the REPLACE keyword in the OPEN string continues to overwrite if necessary. In other words if you use NAME=REPLACE: then you should also specify REPLACE elsewhere in the OPEN string.



Incidentals-

Helplevel 4 supports tooltips, but suppresses field help windows.


CURWINDOW [ (window-number) ] Identifies the number of the window currently in focus. If a window number is given, then that window is raised.


The PREVIEW window continues to be non-modal (permitting multiple concurrent previews), but we suppress the raising of the initiating window in response to waiting for keyboard entry until the PREVIEW window is closed. This avoids the eclipsing of the preview window by the initiating window.


As of 4.20 NWP supports DUPLEX printing ( &l#S )where: 0 -> simplex 1 -> duplex long edge 2 -> duplex short edge


For OPTION 9 (max users) if a negative value is given 1000 is added to it. e.g. CON OPTION 9 -998 -> maximum concurrent users are 2


BREAK varname also displays the variable assignment like DISPLAY does, except only the first element that changed in an array will be displayed.


Note that whole arrays can be referenced by DISPLAY statements. e.g. DISPLAY MAT CUSTOMER$ Displays all changed values in an array when values are changed.


PDF support was added to the MAC version.




Monitor Configuration Interrogation

ENV$("MONITOR1 | MONITOR2", MAT num-arrayname)

This redimensions num-arrayname to 4 elements and returns X (horizontal) and Y (vertical), of the upper left corner, and Width and Height in pixels of the current setting for either monitor 1 or monitor 2. Monitor 2 can be regarded as an extension of monitor 1 concerning the total video space.

Example Program-

00010    let MONITORS$ = ENV$("monitor_count")
00020    let MONITORS = VAL(MONITORS$)
00030    print MONITORS
00040    for I = 1 to MONITORS
00050       let ENV$("monitor"&STR$(I), MAT TEST)
00060       for J = 1 to 4
00070          print TEST(J);
00080       next J
00090       print 
00100    next I

Results for 2 monitors of differing sizes: 2 0 0 1280 1024 1280 0 1024 768




Window Interrogation

file(nn,"WINDOW_RECT | USABLE_RECT", MAT num-arrayname)

BR distinguishes between window dimensions and the useable area of windows.

The above file() reference redimensions num-arrayname to 4 elements and returns X (horizontal), Y (vertical), Width, and Height in pixels of either the window or usable area rectangle.


file(nn,"FONTSIZE", MAT num-arrayname)

This FONTSIZE reference returns a two element array with the height and width of each fixed character position in pixels (used for positioning and sizing controls).




Notes Concerning the Positioning of Independent Windows:

  • When an independent window is maximized the actual window edges slightly exceed the screen border. This is normal Windows behavior.
  • Child windows are positioned in relation to the useable rectangles of their parents.
  • SROW and SCOL specify the Usable Rectangle position. Therefore extra border rows and columns must be specified to allow for framing when a border is required or the window is a tabbed window. In other words a framed window should be positioned one column to the right and one row below where the frame will appear.

Example Program-

00010    def FNRECTSTRING$*100(MAT RECT)="x="&STR$(RECT(1))&", y="&STR$(RECT(2))&", width="&STR$(RECT(3))&", height="&STR$(RECT(4))
00020    def FNPRINTSCREENINFO(WINDOWNUMBER)
00030       let FILE(WINDOWNUMBER, "WINDOW_RECT", MAT RECT)
00040       print #WINDOWNUMBER, fields "1,1,c": "window rect is "&FNRECTSTRING$(MAT RECT)
00050       let FILE(WINDOWNUMBER, "USABLE_RECT", MAT RECT)
00060       print #WINDOWNUMBER, fields "2,1,c": "usable rect is "&FNRECTSTRING$(MAT RECT)
00070       let FILE(WINDOWNUMBER, "FONTSIZE", MAT RECT)
00080       print #WINDOWNUMBER, fields "3,1,c": "font size height="&STR$(RECT(1))&", width="&STR$(RECT(2))
00090    fnend 
00100    open #1: "srow=4,scol=4,rows=3,cols=70,n=/rgb:b",display,output 
00110    open #2: "srow=8,scol=4,rows=3,cols=70,n=/hrgb:r,font=roman,border=s,caption=window info",display,output 
00120    open #3: "srow=12,scol=4,rows=12,cols=70,n=/g:b",display,output 
00130    open #4: "parent=3,srow=4,scol=1,rows=3,cols=65,n=/r:g",display,output 
00131    open #5: "parent=3,srow=8,scol=2,rows=3,cols=65,n=/r:rgb,font=roman,tab=one",display,output 
00140    let FNPRINTSCREENINFO(0)
00150    let FNPRINTSCREENINFO(1)
00160    let FNPRINTSCREENINFO(2)
00170    let FNPRINTSCREENINFO(3)
00180    let FNPRINTSCREENINFO(4)
00181    let FNPRINTSCREENINFO(5)
00190    let KSTAT$(1)


Window Positioning Enhancements

OPEN ... "SROW=, SCOL= ,… RELATIVE | ABSOLUTE, ... "

RELATIVE and ABSOLUTE qualify SROW and SCOL which specify the position of a new independent window. RELATIVE (the default) indicates relative to window zero ( the main console ), and ABSOLUTE indicates relative to the screen. SROW and SCOL are based on FONTSIZE. Use negative values to position an independent window to the left of or above the main console. BR will attempt to honor the request keeping the new window viewable up to the maximum size of the screen.

The keywords are case and position insensitive within the OPEN string

As an alternative to the default relative window positioning, ABSOLUTE may be specified to position relative to the screen. Window zero positioning is always ABSOLUTE. When positioning on the second monitor specify a starting position to the right of the last position of the first monitor.


'NAME=window-name' indicates that BR is to save the position of the window at the time it is closed and restore it to that position when it is reopened, even across sessions. Replacement or overlaying windows can use the same window names to position themselves wherever and at whatever character size the user has changed it to. So once a window has been opened with a particular name, subsequent opens ignore ROW= and COL= and instead use the user positioned values.

As a result window positioning and size priority is as follows:

       1. NAME= window-name
       2. (for window zero only) un-named save font size and position.
       3. SROW, SCOL, MAXIMIZE, NOMAXIMIZE, ABSOLUTE, RELATIVE, FONTSIZE

Another attribute ( that doesn't get saved ) is OVERRIDE, which indicates that the SROW and SCOL ( etc. ) settings in the OPEN statement are to be used even if Name= is also specified. When OVERRIDE is specified in OPENDFLT, it only applies to the first OPEN of window #0.

In all other cases Name= tumphs SROW +++ settings.

All of the above specifications apply to Window zero except it cannot be opened RELATIVE.


OPEN ... "… NO_TASK_BAR ... " suppresses the task bar icon. This feature is available on any window.

OPEN ... "… MODAL ... " uses the same task bar icon as it's parent. This ignores any clicks on its parent window.

Example Program-

00100 ! Run This Program With The Br Main Screen Unmaximized
00120 ! Run It More Than Once With The Br Main Screen In Different Positions
00140 ! Repositioning The Named Windows Are Be Remembered From Run To Run.
00160    open #1: "parent=none,RELATIVE,srow=0,scol=0, rows=10,cols=50,fontsize=20x10",display,output 
00180    print #1, fields "1,1,c,s": "This PARENT=NONE window was positioned relative to window #0.  Press any key to continue"
00200    let KSTAT$(1)
00220    close #1: 
00240    open #1: "parent=none,RELATIVE,srow=-4,scol=-4, rows=10,cols=50,fontsize=20x10",display,output 
00260    print #1, fields "1,1,c,s": "This PARENT=NONE window was also positioned relative to window #0.  It uses a negative SROW and SCOL.  Press any key to continue"
00280    let KSTAT$(1)
00300    close #1: 
00320    open #1: "parent=none,ABSOLUTE,srow=0,scol=0, rows=10,cols=50,fontsize=20x10",display,output 
00340    print #1, fields "1,1,c,s": "This PARENT=NONE window was positioned on the absolute screen coordinates.  Press any key to continue"
00360    let KSTAT$(1)
00380    close #1: 
00400    open #1: "parent=none,ABSOLUTE,srow=10,scol=10, rows=10,cols=50,fontsize=20x10",display,output 
00420    print #1, fields "1,1,c,s": "This PARENT=NONE window was positioned on the absolute screen coordinates at 10,10.  Note that SROW and SCOL are now measured in character sizes based on the specified  FONTSIZE.  Press any key to continue"
00440    let KSTAT$(1)
00460    close #1: 
00480    open #1: "parent=none,ABSOLUTE,srow=0,scol=0, rows=10,cols=50,fontsize=20x10,name=AbsolutePositionExample_1",display,output 
00500    print #1, fields "1,1,c,s": "This PARENT=NONE window was positioned on the absolute screen coordinates.  This window saves its screen size and position based on name=AbsolutePositionExample_1.  You can   move this window around and it will open in the new place the next time you run this example.  Press any key to continue"
00520    let KSTAT$(1)
00540    close #1: 
00560    open #1: "parent=none,RELATIVE,srow=0,scol=0, rows=10,cols=50,fontsize=20x10,name=RelativePositionExample_1",display,output 
00580    print #1, fields "1,1,c,s": "This PARENT=NONE window was positioned relative to window #0.  This window saves its screen size and position based on name=RelativePositionExample_1.  It saves this information relative to window #0.  You can move this window around and it will open in the new place relative to window #0 the next time you run this example.  Note: This saved position is relative to window #0.  This means that if window #0 is moved, the saved position will move right along with it.  Press any key to continue"
00600    let KSTAT$(1)
00620    close #1: 
00640    print fields "1,1,c,,B1001": "This button cannot be clicked while there is a modal window open"
00660    open #1: "parent=none,RELATIVE,srow=10,scol=10, rows=10,cols=50,fontsize=20x10,MODAL",display,output 
00680    print #1, fields "1,1,c,s": "This window was opened MODAL.  Note that you cannot interact with window #0 while it is opened.  Also note that it does not have a task bar icon.  Press Ok to continue"
00700    print #1, fields "6, 22, C,,B1001": "Ok"
00720    do WHILE (FKEY <> 1001)
00740       let KSTAT$(1)
00760    loop 
00780    close #1: 
00800    print NEWPAGE
00820    open #1: "parent=none,RELATIVE,srow=0,scol=0, rows=10,cols=50,fontsize=20x10, NO_TASK_BAR",display,output 
00840    print #1, fields "1,1,c,s": "This PARENT=NONE window does not have a task bar item.  Press any key to continue"
00860    let KSTAT$(1)
00880    close #1:

Errors Corrected

BRListener.exe was skipping authentication altogether if MultiSession was specified.

Positioning of independent windows is restricted to the visible portion of screens.