>>
APLDN Home

>>
Events

>>
Trainings

>>
APL Books

>>
APLDN Links

>>
Discussion Groups

>>
Downloads

>>
Articles

>>
Library

>>
Learning Tools

>>
APLDN User IO

>>
APL2000.com




Bug Reports

Author Thread: Bug with savecontent and style properties
Mike.Montgomery
Bug with savecontent and style properties
Posted: Friday, May 13, 2005 9:09 AM (EST)
I have what I think is a bug in the APL Grid. A sample program is included in component 1 of the attached file. The problem arose in the following sequence: 1) I created a form that contained a grid. 2) I defined some default settings for the grid. (My preferences for the application.) 3) I then populated the grid with values. After this was working, I decided that I needed to set the "style" property of the parent form to 2 (Make form independent of any other form that is Waiting). The problem exists for any value of style, not specifically 2. I did this between steps 2 and 3 above. The effect was that the default settings for the grid were lost. Even worse, if I do it after step 3 every thing in the grid is lost. The problem relates to the "savecontent" property of the grid. When the "savecontent" property is set to 1, there is no problem. According to the documentation, if the "savecontent" property of the grid is set to 0, its definition is lost when the grid is closed. It seems that when the "style" property of the form is changed, the grid gets closed, or something else happens that causes its settings to be lost. I included an "onClose" event handler for the grid to check if it gets closed, but it does not.

Attached file: gridbug.sf


Comments:

Author Thread:
Support
Bug with savecontent and style properties
Posted: Friday, May 13, 2005 10:35 AM (EST)
What is the version number of your APL Grid?  You obtain this from the gridversion property of APL Grid.

APL2000 Support

     

davin.church
Bug with savecontent and style properties
Posted: Friday, May 13, 2005 5:52 PM (EST)
My guess would be that changing the style property of a form causes it to be recreated, thus causing all the sub-objects to be recreated at the same time.

     

Support
Bug with savecontent and style properties
Posted: Friday, May 13, 2005 6:31 PM (EST)
Yes.  Something else is happening that causes the APL Grid to lose its definition.  But it's not due to a bug in APL+Win or APL Grid.  What's happening is that when the style property of the Form is modified, the Form (and all of its children) is first destroyed then recreated with the new style property value.  You can verify this yourself with setting the onDestroy event handler for the APL Grid.  It's because the APL Grid is destroyed is the reason it loses it's definition; i.e. when savecontent isn't 1.

APL2000 Support

     

Mike.Montgomery
Bug with savecontent and style properties
Posted: Monday, May 16, 2005 6:48 AM (EST)
The gridversion property is 5 0 20 0. I've revised the sample program to add more event handlers and another copy of the grid. For one of the grids savecontent is set to 0, for the other it is set to 1. [I can send the revised program if necessary. There is no option for attaching files on this page.] When the style of the form is changed (or reset to the same style), the following events happen (in the sequence shown): the form is hidden; the form is destroyed; the 2 grid controls are destroyed; the button is destroyed; the form is reopened; the 2 grid controls are reopened; the button is reopened. In this sequence the destroy events are triggered but the close and delete events are not. At the end of this sequence, the settings for the grid for which savecontent is 1 survive. All the settings for the otherwise identical (except for savecontent) grid are lost.

     

davin.church
Bug with savecontent and style properties
Posted: Monday, May 16, 2005 10:15 AM (EST)
Right - that's to be expected. When the grids are destroyed, they lose their internal information unless savecontent is 1. And Windows requires that all a form's objects are destroyed and recreated when the form's style is changed.

     



APL2000 Official Web Site

Most good judgment comes from experience. Most experience comes from bad judgment.
--- Anonymous

APLDN Home   |    |  Events   |  Trainings   |  APL Books   |  APLDN Links   |    |  Discussion Groups   |    |  Downloads   |  Articles   |  Library   |  Learning Tools   |  APLDN User IO   |  APL2000.com   |