Class type to package name?

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Class type to package name?

Anthony Walter-3
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?


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Class type to package name?

Michael Van Canneyt


On Thu, 20 Jul 2017, 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Class type to package name?

Anthony Walter-3
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:


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:



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Class type to package name?

Michael Van Canneyt


On Fri, 21 Jul 2017, Anthony Walter wrote:

> 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.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Class type to package name?

Mattias Gaertner
In reply to this post by Anthony Walter-3
On Fri, 21 Jul 2017 04:54:04 -0400
Anthony Walter <[hidden email]> wrote:

> 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

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Loading...