Silverfrost Logo About Us | Contact Us
 

Parameter box - %N.Mpb[options]

A parameter block is a control that has been designed for use in complex simulation programs where you may wish to browse a large set of parameter names and values, with the option to select a value and modify it. A parameter block is defined using %N.Mpb where N is the width of the block in average characters, and M is the number of lines in the control. The control will scroll if necessary to display all the parameters. %pb takes the option sorted to cause the parameters to be alphabetically sorted by name. After a parameter block has been defined, parameters can be attached by subsequent format codes as follows:

%dp - Integer parameter

%fp - Floating point parameter

%tp - Text parameter

%ep - Enumerated parameter (a set of named alternatives)

%up - User parameter (just activates a call-back)

Each of these format codes is followed by a standard character string that gives the text to appear in the box. The question mark (?) modifier can be used with any of the additional format codes as illustrated below but %pb itself takes no modifiers. If a question mark is used with a parameter, the associated help string is displayed when the cursor is positioned above that parameter. One use for the user parameter (%up) is to activate another parameter block to achieve a hierarchical effect.

The various parameter types are illustrated by the following example:

  WINAPP
  INCLUDE <windows.ins>
  EXTERNAL action
  INTEGER i,texture_type
  DOUBLE PRECISION v,p,a
  CHARACTER*8 textures(6)
  CHARACTER*20 name
  DATA textures/'Sticky','Messy','Dirty','Greasy','Slimy',
 + 'Very slippery'/
  DATA /k1,k2,k4,k5,v,texture_type,a/1,2,4,5,4.5,4,35.4/
  p=120.6
  name='Black n Sticky 123'
  i=winio@('%ww[casts_shaddow]%ca[Parameter setting]&')
  i=winio@('Double click on the parameter you wish to'
 +            //'change:%2nl&')
  i=winio@('%30.8pb[sorted]&')
  i=winio@('%dp[test1]&',k1)
  i=winio@('%dp[test2]&',k2)
  i=winio@('%ep[Oil texture]&',textures,6,texture_type)
  i=winio@('%dp[Temperature (Deg C)]&',k4)
  i=winio@('%dp[Carbon monoxide (%)]&',k5)
  i=winio@('%fp[Curent (Amps)test6]&',a)
  i=winio@('%10.3fp[Voltage]&',v)
  i=winio@('%fp[Oil pressure (PSI)]&',p)
  i=winio@(
 1 '%?tp[Oil name][What is the official name of this oil?]&',
 2  name)
  i=winio@('%up[Special action]',action)
  END

  INTEGER FUNCTION action()
  INCLUDE <windows.ins>
  i=winio@('No special action available'
 +         //'yet%2nl%cn%bt[Continue]')
  action=2
  END

 

 

Copyright © 1999-2017 Silverfrost Limited