Kbase 16175: Try V6FRAME if error 3131 or 4492 occurs using V6DISPLAY
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/05/1998 |
|
Try V6FRAME if error 3131 or 4492 occurs using V6DISPLAY
Programmers make use of the V6DISPLAY attribute in PROGRESS
Version 7 or later to make their V6-style screens look as they
did on Version 6. Very often, they wish to use code
developed on Version 6 without making changes in Version 7
or higher. Sometimes they wish to incorporate this V6-style
code into applications which also use GUI-style code.
Errors 4492 and 3131 generally occur when the programmer is
attempting to use V6DISPLAY to make this integration easier.
The SESSION attribute for V6DISPLAY can be set in the
Progress.ini file (by saying V6Display=yes) or it can be set at
runtime using the following statement:
SESSION:V6DISPLAY = yes.
When V6DISPLAY is toggled at runtime, it is possible that
errors 4492 and/or 3131 will occur:
** All windows must be hidden before switching
V6DISPLAY mode. (4492)
Unable to set attribute V6DISPLAY in widget of
type PSEUDO-WIDGET. (3131)
Error 3131 is a direct consequence of error 4492; in other words, if
the cause of error 4492 is eliminated then error 3131 will disappear
as well.
Because the V6DISPLAY attribute is a SESSION attribute, it
applies to every window or frame displayed in your PROGRESS
session. If, at the time you attempt to change the setting of
V6DISPLAY, you already have one or more windows or frames
realized on the screen, PROGRESS will not be able to change
the value of the attribute. This is because PROGRESS cannot send
a message out to Windows to request that the existing widgets
and frames get redisplayed in the new mode. Error 4492
is the result.
To properly set V6DISPLAY at runtime, it is first necessary
to *programmatically* hide every window and frame already
displayed. Only then will PROGRESS be able to toggle the value for
V6DISPLAY. This "universal hide" can be carried out by walking
the widget tree and hiding any widget of TYPE "Window", or
a programmer may come up with another method. Once all
the windows are hidden, V6DISPLAY can be toggled. Afterward
it will be necessary to walk the widget tree again and
redisplay the windows.
Errors when setting V6DISPLAY in the ADE
----------------------------------------
It is worth noting a special case of these errors. If you
attempt to change the value of V6DISPLAY at any time while
working in the Procedure Editor, UIB, or other ADE tool,
errors 4492 and 3131 will result. (To see this, simply
type "SESSION:V6DISPLAY = yes." in the Procedure Editor
and run it.)
This is because the ADE tools themselves, due to the
the fact that they are being displayed on your screen
while you do development, are preventing the toggle
of the attribute.
Furthermore, since the ADE tools do not support V6DISPLAY,
the "hide-and-toggle" method described above will not
work. To properly manipulate V6DISPLAY as a runtime
attribute, you must set the value in the source
code then run the .p using the "-p" startup parameter.
You will *not* be able to run the source code from the
Procedure Editor or the UIB.
V6FRAME as an alternative
-------------------------
One common reason for wanting to change V6DISPLAY at
runtime is the programmer's wish to implement existing
Version 6 procedures with newly created Version 7 (or
Version 8) GUI procedures. At the point where the
V6-style procedure is launched, the programmer needs
to shift over to V6DISPLAY mode to assure proper
frame layout.
The "hide-and-toggle" requirement can become cumbersome
in such a situation. One alternative recommended by
Progress is to use V6FRAME instead. Because V6FRAME
is a FRAME attribute rather than a SESSION attribute,
it can be incorporated into a frame's definition at
compile time, on a frame-by-frame basis. Some of the
frames in your application can use V6FRAME while
others use standard GUI display rules. The procedures
which require a V6-style layout can be compiled with
the V6FRAME switch turned on, while the GUI-style frames
can leave out the V6FRAME specification.
V6FRAME can be written into a frame's definition, or can
be used as part of the COMPILE statement:
COMPILE main.p V6FRAME=yes SAVE.
By setting V6FRAME in the COMPILE statement, it removes
any requirement to change legacy code by editing
"V6FRAME" into frame phrases in the actual .p's.
For more information
--------------------
For information on "walking the widget tree", see the
Programming Handbook chapter on "Frames", particularly
the section on "Accessing Field Groups".
Other references
----------------
Version 7 and higher Language Reference entries on
COMPILE and DEFINE FRAME
Kbase 13432 "How to convert version 6 TTY application
to version 7 GUI"
Kbase 13306 "V6FRAME in 7.2E and 7.3A for a more GUI
look and feel"
Kbase 12971 "Image does not fit in parent frame when
accessing dict 4041"
Progress Software Technical Support Note # 16175