Runtime Access of TOptionsForm

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Runtime Access of TOptionsForm

Post by miked » Mon Oct 03, 2011 9:37 pm

Currently the TOptionsForm is only accessible from the design environment even though the options have a major impact on the run time editor (TChartEditor). This means that we must put custom coding in to get the changes we need from the user and then go in and update the registry.

Please consider giving us run time access to this processing.

Thanks

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Runtime Access of TOptionsForm

Post by Yeray » Wed Oct 05, 2011 8:39 am

Hello miked,

You can show the same Form at runtime as follows:

Code: Select all

uses TeeDesignOptions;

procedure TForm1.Button1Click(Sender: TObject);
begin
  with TOptionsForm.Create(Self) do
  begin
    ShowModal;
  end;
end;
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Re: Runtime Access of TOptionsForm

Post by miked » Thu Oct 06, 2011 3:17 pm

I already tried that and could not get it to work.

I do the processing using C++ and the code is contained in a DLL. I added the include for the class and the pragma link for the link. When I go to link the DLL, I get the following error:

[ILINK32 Error] Fatal: Unable to open file 'TEEDESIGNOPTIONS.OBJ'

I tried a couple of other names for the pragma link and got the same result.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Runtime Access of TOptionsForm

Post by Yeray » Fri Oct 07, 2011 2:19 pm

Hello miked,

Adding the TeeDesignOptions.pas from your TeeChart installation folder, in "\Examples\Features C++\" to your project, the .obj is generated.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Re: Runtime Access of TOptionsForm

Post by miked » Sat Oct 08, 2011 4:07 pm

I tried your suggestion and I get the following error during the compile processing:

[DCC Fatal Error] TeeDesignOptions.pas(24): F1026 File not found: 'TeCanvas.dcu'

I made sure all the search paths were correct in my project options. They point to where the dcu is located. You should note that I have only the C++ personality so I am not sure how this is suppose to work.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Runtime Access of TOptionsForm

Post by Yeray » Tue Oct 11, 2011 1:56 pm

Hello Mike,

Could you please specify what exact TeeChart version, IDE and OS are you using?
Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Re: Runtime Access of TOptionsForm

Post by miked » Wed Oct 19, 2011 4:05 pm

I am using the latest TChart (Build 2011.03.30407), Embarcadero C++ 2010, on Windows XP.

I have Embarcadero C++ XE2, but waiting for the TChart binaries.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Runtime Access of TOptionsForm

Post by Yeray » Fri Oct 21, 2011 11:13 am

Hello,

I'm afraid we have some problems with the C++ demos and the latest IDEs that demand a quite deep revision.
However, the examples use the same code in the versions for the old IDEs so you could run the executable here compiled in C++Builder 6.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Re: Runtime Access of TOptionsForm

Post by miked » Mon Oct 24, 2011 4:32 pm

I am sorry, but there appears to be a bit of confusion. My original request was to get access to the TOptionsForm so I could use it at run time. I was not not intending to use it as a demo or to view it as part of the demo. One suggestion was to include the form from the demo into my project, and that did not work.

I feel this processing is needed because TChart is now putting registry entries at the end user locations that alter the behavior of the default processing, and there is no other way to change these values without specifically writing code to update the registry or to change the registry manually. Since these default settings affect the run time editor processing for the end user, it only seems natural that they should be allowed to control the default behavior of the design environment as well.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Runtime Access of TOptionsForm

Post by Yeray » Tue Oct 25, 2011 9:01 am

Hello miked,
miked wrote:I am sorry, but there appears to be a bit of confusion. My original request was to get access to the TOptionsForm so I could use it at run time. I was not not intending to use it as a demo or to view it as part of the demo.
Oups. I obviously got confused somehow. Excuse me for that.
miked wrote:One suggestion was to include the form from the demo into my project, and that did not work.
I've checked it again and it seems to work for me here. Could you please try the project attached?
TOptionsForm.zip
(7.28 KiB) Downloaded 652 times
miked wrote:I feel this processing is needed because TChart is now putting registry entries at the end user locations that alter the behavior of the default processing, and there is no other way to change these values without specifically writing code to update the registry or to change the registry manually. Since these default settings affect the run time editor processing for the end user, it only seems natural that they should be allowed to control the default behavior of the design environment as well.
You should be able to run the Options form at runtime as in the example above but also to force an individual property. In the example above I also forced the editor to show the tabs instead of the Tree with:

Code: Select all

TeeSaveBoolOption(TeeMsg_TreeMode,false);
If you are interested on any particular property, you could take a look at the TeeDesignOptions.pas file and see how the properties are saved.
Alternatively, if you want to access register yourself to change any property, here is where the configuration is saved:
HKEY_CURRENT_USER\Software\Steema Software\TeeChart Pro\Editor
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

miked
Newbie
Newbie
Posts: 8
Joined: Mon Feb 14, 2011 12:00 am

Re: Runtime Access of TOptionsForm

Post by miked » Thu Oct 27, 2011 4:45 pm

Your project works correctly because it is in a standalone module. I indicated earlier in the post that I was attempting to use it in a DLL. Because of the duplicated use of TChart in my DLLs, I use the runtime modules. (If I don't use runtime modules, I have other problems to deal with) The DLL processing does not work for the Options Form.

Previously I attempted to "convert" the Options Form to C++. The dialog uses some of the "inbuilt" stuff for its processing and greatly assists in the use of the dialog. (I am referring to the processing on the New Chart tab). These items are really important to the overall interface. When I did this, I had all kinds of problems when I ran the program. The DLL was faulting when the program started, so it is not possible to include this processing separately.

I have tried everything I can think of, and have not had any success, thus my request. As I said, the Options Form allows for the setting of the design defaults, but can not be accessed in a "run-time" environment. I realize that I can access the registry myself (I had to do this to detour another problem), but it is not possible to completely replace the processing provided by the Options Form.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Runtime Access of TOptionsForm

Post by Yeray » Thu Nov 03, 2011 11:48 am

Hello miked,

Could you please send us a simple example project we can run as-is to reproduce the problem here? Or maybe better two, one showing how do you create the dll and another one showing how do you use it.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply