Sign in Join

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

Mailing lists / fpc-pascal / 2017-07

Class type to package name?

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Anthony Walter

Assuming the class type has been registered either through RegisterComponent or RegisterNoIcon, what is the most straight forward way to get the package name it is defined in given a class type?

Reply by email

Michael Van Canneyt
to Anthony Walter
Anthony Walter wrote
Assuming the class type has been registered either through RegisterComponent or RegisterNoIcon, what is the most straight forward way to get the package name it is defined in given a class type?

Define package ?

Michael.

Reply by email

Anthony Walter
to Michael Van Canneyt

When I register a component with the IDE it is installed from a package. The package has a name. I want to know the name of the package, given a class type of a component registered in the IDE.

See this issue:

https://bugs.freepascal.org/view.php?id=32182

procedure RegisterForm(const Package: string; FormClass: TCustomFormClass;
const Category, Caption, Description, Units: string);

I would like to simplify this further by omitting the Package string if it could be computed from the FormClass parameter.

See also:

https://www.getlazarus.org/videos/dockedform/

Reply by email

Michael Van Canneyt
to Anthony Walter
Anthony Walter wrote 13 lines
When I register a component with the IDE it is installed from a package. The package has a name. I want to know the name of the package, given a class type of a component registered in the IDE. See this issue: https://bugs.freepascal.org/view.php?id=32182 procedure RegisterForm(const Package: string; FormClass: TCustomFormClass; const Category, Caption, Description, Units: string); I would like to simplify this further by omitting the Package string if it could be computed from the FormClass parameter.

So you mean a lazarus package.
In that case, you had better ask this on the lazarus mailing list ?

By sending the mail here, I was not sure whether you meant (future) dynamic package support or current Lazarus package support.

Michael.

Reply by email

Mattias Gaertner
to Anthony Walter: When I register a component with the IDE it is installed from a package. The package has…
When I register a component with the IDE it is installed from a package. The package has a name. I want to know the name of the package, given a class type of a component registered in the IDE.

You have to search the packages.
I added a utility function to make it more comfortable:

uses packageintf;

PackageEditingInterface.FindInstalledPackageWithUnit()

Mattias

Reply by email