![]() |
|
wdb |
Longname: | w indow d ialogue b ox | ![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
Released: | not available | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Created: | not available | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Last modified: | 6.52a | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
See also: | getvar wdbm twdbm |
Summary |
Invokes a dialogue box, either to screen or to a set of named variables which can be used and manipulated in a script or further macro. Both forms of wdb are used extensively within scripts. |
Example extract |
The macros shown below as they would appear in a script make an 'invisible' call to Arbortext APP's typeface name dialogue box:
Usually, when you enter the macro on its own the typeface name dialogue box would appear. This shows the 'short' and 'long' names of the currently-selected typeface, in two edit boxes one above the other. When you enter the tf macro immediately after a valid wdb macro, the dialogue box will not appear and the contents of each edit box are 'pushed' into the variables named by wdb in the order they appear in the dialogue box. In this example ^variable1 would receive the font short name, and ^variable2 would receive the font long name. The wdb macro asks for three variables to be filled: but because the typeface name dialogue box only contains two edit boxes, ^variable3 remains unaffected, i.e. retains any value it previously had. |
Syntax
|
Ø:n ?string:n ?flags:s ?script variable:s ?exit code:n ?
|
Ø:n |
When used without parameters wdb can be used to switch off 'invisible' dialogue box trapping. This is useful for trapping error condition, for example, the macro shown below can be used to delete a tag without generating an error message if the tag does not exist.
|
string:n |
The number of a string defining a dialogue box. The text for the dialogue box is taken from the given string number defined in the stuk.3ad system file, in a user strings file, or by a script. ExampleThe example below shows a simple use of the ^wdb variable, along with ? macros, in a stripped down version of the script used in stuk.3ad to define the search/replace dialogue box.
|
flags:s |
Instructs the dialogue box to conform to the following options.
|
script variable:s |
One or more variable names separated by a comma or space character. These variables will be filled by the subsequent call to a dialogue box using macro, and are filled in in the order that the dialogue box fields are defined. If you do not want to collect information from a specific field this can be skipped over by using a dummy script variable, e.g. "". Scripts using the wdb macro in this way are sensitive to the order in which edit boxes appear in a 3B2 dialogue box. Advent reserves the right to alter this order during the development of 3B2. |
exit code:n |
Returns an exit code to an 'invisible' dialogue box. This is useful when a script invokes an 'are you sure' type of dialogue box, which requires an OK response. It can also be used to access some otherwise elusive dialogue boxes. ExampleWith a frame selected, the macro shown below will invoke the Unequal Columns dialogue box. Without the final wdb, and with more script variable entries, this would give a script access to the column settings for a frame.
|
When used with a script variable wdb affects the next dialogue box that appears. The macro used to invoke the dialogue box whose values are to be passed to one or more script variable items. The dialogue box will not be drawn on screen, but its contents will be passed in order to the script variables. |
Macros and scripts can communicate with 3B2 in many ways, allowing you to extract information about the user's setup or the state of the current document. The simplest way of communicating with 3B2 is to make an 'invisible' call to one of 3B2's existing dialogue boxes using the wdb macro. Any of the information that you would usually see in a dialogue box can be 'pushed' into a variable of your choice. |
Example |
One of the most useful features of the tgm macro is that it can be combined with wdb to extract information about a selected graphic shape. The macro shown below gets the size of the selected shape:
|
Document created on 08-Feb-2003 (revision 1)