PRB: SAY Field Refresh Option Causes Hidden Window to ReappearLast reviewed: December 18, 1997Article ID: Q112484 |
2.50b | 2.00 2.50 2.50a 2.50b | 2.50 2.50a 2.50b MACINTOSH | MS-DOS | WINDOWSkbprg kbprb kbui kbdisplay The information in this article applies to:
SYMPTOMSWhen you are running a screen set with multiple windows in which one has been hidden, the hidden window reappears even when a SHOW WINDOW command has not been executed.
CAUSEIn addition to other screen objects, the hidden window contains at least one SAY/output object, and the Refresh Output Field check box is selected. A SHOW GETS command that does not include a WINDOW clause is placed in a user-defined code snippet to update objects on the screen. To understand why this behavior occurs requires looking at the generated screen code. When the FoxPro screen code generator (GENSCRN.PRG) creates the screen program (.SPR) from a screen with a SAY/output field, the Refresh property of which has been checked, it generates code in the SHOW snippet which looks like the following:
IF SYS(2016) = "SCR1" OR SYS(2016) = "*" ACTIVATE WINDOW scr1 SAME @ 1.000,2.800 SAY company ; SIZE 1.000,80.800, 0.000 ; FONT "MS Sans Serif", 8 ENDIFAs documented in the "Language Reference" and the online Help system, SYS(2016) returns the name of the window to be refreshed by the last SHOW GETS command executed. If SHOW GETS is called without the optional WINDOW clause, SYS(2016) will return an asterisk (*). It is the ACTIVATE WINDOW command in the IF ... ENDIF block above that causes the hidden window to be redisplayed. The following command will update the objects on the current window only:
SHOW GETS WINDOW (WOUTPUT()) RESOLUTIONSee "Workarounds" in the "Steps to Reproduce Behavior" section below.
STATUSThis behavior is by design.
MORE INFORMATIONWARNING: ANY USE OF THE CODE PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this code "as is" without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Steps to Reproduce BehaviorThe following procedure illustrates the behavior described. The steps describe dialog boxes and objects found in FoxPro for Windows and FoxPro for Macintosh. Minor differences exist in the FoxPro for MS-DOS environment.
WorkaroundsTo correct the screen set created above, eliminate the comments (&&) in step 9, save SCR2.SCX, and regenerate the screen set, making sure that SCR1 is listed first in the screen set list box of the Generate Screen dialog box. There are a variety of ways to combine a screen set. If the limit on the number of READs is a concern, see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q106697 TITLE : How to Prevent "Too Many READs in Effect" Error MessageIt describes a method of switching between screens without incrementing the READ level much like the sample application EX1 included with Microsoft FoxPro. If speed of execution between screens is a concern, SAY fields cannot be used. Instead, use GET objects. In the WHEN clause of each GET, return the value .F., so that the user cannot enter the field. A fundamental problem exists with the method described for tying two independent screens together in a single READ, commonly referred to as a "screen set." Without modifying the .SPR directly, there is no way to avoid the momentary display of the hidden window before it is hidden again by the HIDE WINDOW command the user places in the ON SCREEN ENTRY code snippet. The screen generator doesn't provide an option to prevent the display of one or more windows combined in a screen set. While the flicker may be momentarily distracting on slower computers, the speed gained in having more than one screen in memory simultaneously may provide justification. Another benefit is that only a single READ level is consumed by all screens involved.
|
Additional reference words: FoxDos FoxWin FoxMac 2.00 2.50 2.50a 2.50b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |