I_SNAPSHOT
Save/restore an input window’s controls
WSupported on Windows
|
USupported on Unix
|
VSupported on OpenVMS
|
NSupported in Synergy .NET
|
xcall I_SNAPSHOT(D_COPY|D_LOAD, window_id, snapshot, [length], [record] & [, a_methoddata1, ..., a_methoddata20])
Arguments
D_COPY
Copy the current controls. (n)
D_LOAD
Load previously copied controls. (n)
window_id
The ID of the input window. (n)
snapshot
The snapshot information field. (a)
length
(optional) The returned length of the snapshot information. (n)
record
(optional) The structure data for redisplaying the fields on a D_LOAD operation. (a)
a_methoddata1 through a_methoddata20
(optional) Up to 20 additional data arguments. (any)
Discussion
I_SNAPSHOT enables you to “take a picture” of the input window’s controls, then restore them at a later time. The information that is saved/restored includes the following:
- Cleared state of all input fields
- Context of all input sets
- What fields are in what sets
- Enabled/disabled state of all input fields
Additionally, on a D_LOAD (restore) operation, the fields can be redisplayed according to their cleared states. This is done by passing record, which will be used as the structure data for all input sets. If record is not passed, the display will not be affected.
This subroutine is useful in conjunction with I_SETDEL, as it can restore fields that had been previously deleted from a set.
I_SNAPSHOT has the following limitations:
- If record is passed, it must be usable as the structure data for all input sets in the window.
- The snapshot argument must be large enough to contain the snapshot information. This length is presently computed as the total number of fields in the window, plus 8 times the number of input sets, plus the number of fields used in each set, for a maximum length of 6,778. (The equation would be represented as maxfields + [maxsets * 8] + [maxsets * maxfields].) The length argument can optionally be returned with this length.
- You must not modify the data in snapshot between D_COPY or D_LOAD operations. This data has a private format that will be changed in future versions of UI Toolkit.
- The D_LOAD operation always removes frames from fields. To restore field frames, call I_FRAMES.
A_methoddata1 through a_methoddata20 are up to 20 additional optional arguments that can be passed to I_SNAPSHOT. I_ SNAPSHOT, in turn, passes them directly to %IDISPLAY_METHOD. This allows you to communicate additional information to your display method.
Examples
The following example copies the current input window control information for the window identified by inpid into the field inpinfo, and returns the length of that information in infolen.
xcall i_snapshot(D_COPY, inpid, inpinfo, infolen)
The next example resets the same input window to its state at the time that the D_COPY operation in the first example occurred.
xcall i_snapshot(D_LOAD, inpid, inpinfo(1:infolen))
The example for I_SETDEL also shows the I_SNAPSHOT subroutine being used. (See the I_SETDEL Examples for more information.).