Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2010-09

Non visual programs that use components

6 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Frank Church

Which of the demo programs show how to create programs that are not visual, but allow components to be created at runtime, rather than adding them to the form.

What type of projects should be chosen when picking the project type from the New menu?

How do you tell the units dependencies as the IDE is not there to automatically add them to the form's unit?

Frank Church ======================= http://devblog.brahmancreations.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100916/b925ad21/attachment.html>

Reply by email

Felipe Monteiro de Carvalho
to Frank Church

2010/9/16 Frank Church :

What type of projects should be chosen when picking the project type from the New menu?

Any of them. You just create the component in code:

uses unit_with_component;
...
var
  MyComponent: TMyComponent;
begin
  MyComponent := TMyComponent.Create(Application);
  // now do something with MyComponent, usually setting properties
How do you tell the units dependencies as the IDE is not there to automatically add them to the form's unit?

In the uses clause: http://wiki.lazarus.freepascal.org/Uses

Felipe Monteiro de Carvalho

Reply by email

Mattias Gaertner
to Frank Church: Which of the demo programs show how to create programs that are not visual, but allow…
Which of the demo programs show how to create programs that are not visual, but allow components to be created at runtime, rather than adding them to the form.

Many examples create components in code.
For example examples/taborder.lpi.
You can mix, that means use a lfm and add some components later in code.

What type of projects should be chosen when picking the project type from the New menu?

There is no difference. 'Application'.
You can convert any project type in any other, because it is just a bunch of flags.

How do you tell the units dependencies as the IDE is not there to automatically add them to the form's unit?

You can find the unit name by right clicking on the icon on the component palette. This will open a popup menu and show the package and file name.
If you have not yet used the package, click on the menu item to open it. Then More / Add to project.

Or you can use the View / Code Browser.

Or you can use 'Find in Files'.

Or with 0.9.29 you can compile and wait for the error message 'identifier not found', right click on the message and use 'Search identifier'.

Mattias

Reply by email

Maik Wojcieszak
to Felipe Monteiro de Carvalho: 2010/9/16 Frank Church : Any of them. You just create the component in code: uses…

Hi,

I've implemented a custom variant in delphi an tried to port it to lazarus.

A lot of TCustomVariantType seems not to be supported. Example:

procedure TCustomVariantType.VarDataInit(var Dest: TVarData);
begin
  NotSupported('TCustomVariantType.VarDataInit');
end;

Also the functions to implement methods and properties seem not to be implemeted.
I get a DispInvoke not supported message when running my program.

Searching the internet for examples how to implement custom variants did not bring up
a lot. It seems that even in delphi it is a rarely used feature.

Is there a way to implement the custom variant with methods and properties in lazarus ?

Maik

Reply by email

Sven Barth
to Maik Wojcieszak
Maik Wojcieszak wrote 22 lines
Hi, I've implemented a custom variant in delphi an tried to port it to lazarus. A lot of TCustomVariantType seems not to be supported. Example: procedure TCustomVariantType.VarDataInit(var Dest: TVarData); begin NotSupported('TCustomVariantType.VarDataInit'); end; Also the functions to implement methods and properties seem not to be implemeted. I get a DispInvoke not supported message when running my program. Searching the internet for examples how to implement custom variants did not bring up a lot. It seems that even in delphi it is a rarely used feature. Is there a way to implement the custom variant with methods and properties in lazarus ?

You might either ask this on the FPC mailing list or create an issue report in the FPC bugtracker, because that's a problem of FPC not Lazarus. :)

Regards,
Sven

Reply by email