Sign in Join

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

Mailing lists / lazarus / 2013-08

Position of Tab with "My Components" in IDE

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Bart

Hi,

On the Dutch Delphi/Lazarus forum somebody asked this question:

I have a set of custom components.
When I install them in the IDE they get their own Tab "My Components", as expected.
The problem this person has is that when he re-builds the IDE (for instance when adding a new component), then the position of the "My Components" Tab changes.

Is there a way to tell the IDE where the "My Components" Tab should go in the IDE?

Bart

Reply by email

Mattias Gaertner
to Bart: On the Dutch Delphi/Lazarus forum somebody asked this question: I have a set of custom…
Show quoted text 10 lines
Hi, On the Dutch Delphi/Lazarus forum somebody asked this question: I have a set of custom components. When I install them in the IDE they get their own Tab "My Components", as expected. The problem this person has is that when he re-builds the IDE (for instance when adding a new component), then the position of the "My Components" Tab changes.

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.

Is there a way to tell the IDE where the "My Components" Tab should go in the IDE?

It is started, but it is not complete. Every page and every component has a priority.

The idea is that eventually someone writes a GUI to allow users define the order.

Mattias

Reply by email

Juha Manninen
to Mattias Gaertner: On Thu, 15 Aug 2013 10:41:25 +0200 The 1.0.x IDE only sorts packages topologically, not…
Mattias Gaertner 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?

Juha

Reply by email

Mattias Gaertner
to Juha Manninen
Show quoted text 15 lines
Juha Manninen hat am 2. September 2013 um 15:45 geschrieben: On Thu, Aug 15, 2013 at 12:08 PM, Mattias Gaertner 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

Reply by email