[Lazarus] Position of Tab with "My Components" in IDE

Mattias Gaertner nc-gaertnma at netcologne.de
Mon Sep 2 16:38:18 CEST 2013


> Juha Manninen <juha.manninen62 at gmail.com> hat am 2. September 2013 um 15:45
> geschrieben:
>
>
> On Thu, Aug 15, 2013 at 12:08 PM, Mattias Gaertner
> <nc-gaertnma at netcologne.de> wrote:
> > The 1.0.x IDE only sorts packages topologically, not alphabetically,
> > so the order between same level packages is not fixed.
> > The 1.1 IDE sorts packages alphabetically too, so the order is fixed.
>
> I try to learn and understand the code related to component palette
> and package registration, to finally implement the configuration by
> user.
> Mattias, where is the code to sort packages topologically and
> alphabetically? Should I care about it?

If you only want to implement user sorting of the component palette, then you
don't need to bother about how packages are sorted.

I guess you have already seen, that each TRegisteredComponent has a function
GetPriority.
TRegisteredComponent is implemented by TPkgComponent, which takes the priority
from the associated package file (TPkgFile).
The pages are sorted by their highest component priority.
At the moment only the base packages define priorities. All other use the
default, so they get the order of registration.

My original idea was to load the priorities from the lpk. So a package
maintainer can define a default order for his components.

The user settings should be stored in the IDE configs. If I would do it I would
implement a storage for the user priorities and add a hook in
TPkgComponent.GetPriority to query that storage.

Mattias




More information about the Lazarus mailing list