MDI Child & Chart width / height

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

MDI Child & Chart width / height

Post by moelski » Mon Nov 17, 2008 2:47 pm

Hi !

I have a MDI application and the MDI Child is only a form with a chart (Align = clClient).

I create a new MDI Child and change the size of the window (because of the alignment the chart will be resized, too).

Now I call this:

Code: Select all

  SaveChartToFile(TfrChild(frMain.ActiveMDIChild).Chart1,
                  'Test.lov',
                  True,
                  True);
I got a file which looks like this:
object TChart
Left = 0
Top = 0
Width = 426
Height = 286
Title.Text.Strings = (
'TChart')
Align = alClient
TabOrder = 0
end
Now I close the MDI Child and open a new MDI child window. The size is set back to the default size.

Now I load back the TEE File:

Code: Select all

  LoadChartFromFile(TCustomChart(TfrChild(frMain.ActiveMDIChild).Chart1),
                    'Test.lov');
This works, but the size wont be changed to that size which is saved in the Test.lov file.
So what must I do in order to get the correct saved chart size automatically?

I tried to set the AutoSize property to true, but this won´t help.

Any suggestions?

moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

Post by moelski » Wed Nov 19, 2008 7:55 am

Hi Support,

no hint :roll: ?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Nov 19, 2008 8:09 am

Hi moelski,

We need some time to investigate the issue here. We will get back to you ASAP.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Mariano
Newbie
Newbie
Posts: 46
Joined: Fri Nov 15, 2002 12:00 am
Location: España

Post by Mariano » Wed Nov 19, 2008 8:18 am

Hi,

I did have a similar issue.

try the following method:

- create/move the MID child outside of the visible area (left=-5000).
- set a form size > screen size (width=3000)
- disable the chart alClient
- load the chart file.
- read the chart size, and resize the form client area.
- re set the chart alClient
- move back the form to the visible area.

also, you can save the form size in a custrom (perso) file data. and include the chart file inside this one. (then load the form size, then extract the chart data file and load it)
This is the ways I recommend you. So you can add other info in the future.


hope this help,

moelski
Newbie
Newbie
Posts: 92
Joined: Tue Jun 19, 2007 12:00 am
Contact:

Post by moelski » Wed Nov 19, 2008 8:21 am

Hi Mariano,

it would also be possible to read the TEE file and get the width / height. And then you set the MDI Width / height.

But I think this is an issue that should be fixed by steema.

Mariano
Newbie
Newbie
Posts: 46
Joined: Fri Nov 15, 2002 12:00 am
Location: España

Post by Mariano » Fri Nov 21, 2008 8:42 am

hi,

yes, you can read by yourself the TEE file, but you may want to not depend too much of the Steema file format.

This is just a workaround. I use this kind of solution to have a feeling of "instant" loading in my app. (to prevent flashing when you reload a lot of chart/mdi at one). Also, I do load other data related to the MDI.

note that an other solution is to create the chart by hand (without a parent, and so not visible), load the file, get the size, then "add it" to the MDI. If you look in that way, search the forum about this. I remember some issue with the .width of charts with no parent.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Mon Nov 24, 2008 7:58 am

Hi moelski,

This is most likely a Delphi issue. We think sames happens with an image set to Align=alClient. As suggested, a solution could be loading the tee file.

An alternative would be changing Align to alNone before saving the chart. Maybe then when loading it makes the chart bigger than child's form. Then you can make the form to be the size of the chart and then set the chart back to Align=alClient.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply