View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005413 | JEDI VCL | 00 JVCL Components | public | 2010-11-22 12:36 | 2011-06-21 14:50 |
Reporter | CDametto | Assigned To | jfudickar | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 3.40 | ||||
Target Version | Fixed in Version | ||||
Summary | 0005413: problem with the JvFormStorage | ||||
Description | I have a problem with the JvFormStorage when I try to store a property of an object made by me. To reproduce what I think to be the case, try putting a panel on a form of type MDIChild and anchor it on all sides. Add the JvFormStorage (with a storage) and add two property to store the height and the width of the panel. Run the program and maximizes the form child, then close it and reopen it: the panel is larger, why? | ||||
Additional Information | Sorry for my english | ||||
Tags | No tags attached. | ||||
|
Please create a sample app and add it to this case. |
2010-11-24 10:19
|
JvFormStorageQuestion.zip (6,020 bytes) |
|
Added sample application |
|
As you are storing the size of the form, you should not be storing the size of the panel because it is anchored. If you don't store the width nor the height, it works just fine. |
|
That's right, but I stored the width and the height because my panel is resizable and I should need to preserve the last user customization. Perhaps I could try to realize a more complex sample with a TSplitter... |
|
This problem is realy not so easy to solve. The problem is the restore order in combination with your anchors. The situation looks like: 1. The panel size is restored and changed 2. The form mdi status is restored and based on this the form is maximized. 3. Based on the form resize in combination with the anchors the panel is resized. One solution could be to restore the form state before restoring the FormStorage.StoredProps. Any comments welcome Regards Jens |
|
It was the solution I originally thought about, but the source code was difficult for me to fix and I realized another issue. If the panel is located on a MDIChild form maximized to the main, and you close the form, change the main size and reopen the form, then you'll not have the same dimension of the form when you closed it, and the restoration of the panel will be wrong, I think... The point is to have the same form size when you save and restore the panel dimentions data. Perhaps you could always normalize the form on closing, before saving the form and panel sizes, and leave restoration as now, first the form and the panel sizes, then the form state. Could it work? Sorry for my English, I hope I was clear enough. Thanks for the availability. |
|
This will also not work. The point is to store the distance of panel width to form width, and then restore this. This could be handled by additional events and maybe the stored values. This will be the only way to solve the other problem also. Regards Jens |
|
Hi, I changed your sample a little bit, and it seems to work now. Hopefully for all situations. Have a look on it. Regards Jens |
2011-06-11 12:28
|
JvFormStorageQuestion-Answer.zip (6,067 bytes) |
|
Ok, I'll try to adopt this solution. Thanks |
|
Actually I would like to preserve the relationship between the width of the panel and the width of the form, instead of their distance, but I can not. I still have the same problem that the form expands after setting the size of the panel... |
|
You can do this in the same way like the distance. But this is a different behaviour then your anchor behaviour. As far as I can see the anchor is based on the distance. Regards Jens |
|
Yes, the anchor is based on the distance, and the expansion is linear and not proportional. I can't restore the proportion on the AfterRestorePlacement event because the width of the form is not yet maximized. I'm thinking that maybe this problem is not due to the component, but I can not find a solution. Thanks for any suggestions. |
|
But you can calculate also the ration. This should work. Or maybe you create a more complex sample. Because based on your original sample I can't see a problem with my solution. Regards Jens |
2011-06-16 17:05
|
JvFormStorageNewQuestion.zip (6,890 bytes) |
|
Added a new sample |
|
Sorry for having no "perfect" news for you. This is nothing I see to fix on our (jvcl) level. The problem is that the changing of the window state is happening AFTER the FormShow Event. You can test this by adding a messagedlg to formshow and formresize (both showing formwidth). When you set the window state to maximize at design time you see that the formwidth is changed after the formshow (and there is no event to react on). The only solution is to store the ratio in a form variable and change this ratio every time when the splitter is moved, and restore it every time when the form is resized. Have a look at my new sample. It seems to solve your problem. Regards Jens |
2011-06-19 13:12
|
JvFormStorageNewQuestionAnswered.zip (9,867 bytes) |
2011-06-21 10:22
|
JvFormStorageResult.zip (6,597 bytes) |
|
Your example is very good, I just changed it a little, because I don't want an always proportional resizing, but just at the opening of the form. Now it works properly for my needs. I added a final sample of the result. Thank you very much for your time and your help. Sincerely Cristiano |
|
Good to know. And thanks that you informed us that the problem is solved. Regards Jens |
Date Modified | Username | Field | Change |
---|---|---|---|
2010-11-22 12:36 | CDametto | New Issue | |
2010-11-22 22:31 | jfudickar | Note Added: 0018148 | |
2010-11-22 22:31 | jfudickar | Status | new => feedback |
2010-11-24 10:19 | CDametto | File Added: JvFormStorageQuestion.zip | |
2010-11-24 10:21 | CDametto | Note Added: 0018160 | |
2011-06-07 17:30 | obones | Status | feedback => acknowledged |
2011-06-08 13:52 | obones | Note Added: 0018663 | |
2011-06-08 13:52 | obones | Status | acknowledged => feedback |
2011-06-08 18:53 | CDametto | Note Added: 0018702 | |
2011-06-09 21:24 | jfudickar | Note Added: 0018712 | |
2011-06-10 16:27 | CDametto | Note Added: 0018727 | |
2011-06-10 16:43 | jfudickar | Note Added: 0018728 | |
2011-06-11 12:27 | jfudickar | Note Added: 0018740 | |
2011-06-11 12:28 | jfudickar | File Added: JvFormStorageQuestion-Answer.zip | |
2011-06-13 11:03 | CDametto | Note Added: 0018758 | |
2011-06-13 17:14 | CDametto | Note Added: 0018761 | |
2011-06-13 17:34 | jfudickar | Note Added: 0018762 | |
2011-06-14 10:59 | CDametto | Note Added: 0018764 | |
2011-06-14 22:42 | jfudickar | Note Added: 0018765 | |
2011-06-16 17:05 | CDametto | File Added: JvFormStorageNewQuestion.zip | |
2011-06-16 17:07 | CDametto | Note Added: 0018770 | |
2011-06-19 13:11 | jfudickar | Note Added: 0018778 | |
2011-06-19 13:12 | jfudickar | File Added: JvFormStorageNewQuestionAnswered.zip | |
2011-06-21 10:22 | CDametto | File Added: JvFormStorageResult.zip | |
2011-06-21 10:25 | CDametto | Note Added: 0018796 | |
2011-06-21 14:50 | jfudickar | Note Added: 0018799 | |
2011-06-21 14:50 | jfudickar | Status | feedback => resolved |
2011-06-21 14:50 | jfudickar | Resolution | open => fixed |
2011-06-21 14:50 | jfudickar | Assigned To | => jfudickar |