Sign in Join

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

Mailing lists / lazarus / 2015-08

Editor toolbar changes ?

15 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Michael Van Canneyt

Hi,

I have 2 lazarus installations:
A new one (one that was compiler more recently: today). Another one is a little older (rev 49180).
I have in the older installation in the editor toolbar a dropdown button with the items 'Jump to' menu. It works as expected.

But:
If I click the 'configure' button, the 'jump to' is not displayed in the list of enabled buttons.

In the newer installation, when I add the 'Jump to' button, a button is added to the editor toolbar, but it is not functional: the dropdown menu is not shown, and clicking it does not do anything (not surprising).

What does this mean ? Did anything change in the toolbar editor ? Should I be afraid to update my SVN in the older installation ?

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
In the newer installation, when I add the 'Jump to' button, a button is added to the editor toolbar, but it is not functional: the dropdown menu is not shown, and clicking it does not do anything (not surprising).

This drove me insane too. Recently somebody changed the editor toolbar. There is no more "Jump To" dropdown. You now have to add individual buttons that jump to specific locations. So I had to add the "Jump to Implementation Section" (my most used option) onto my toolbar after the combobox disappeared after a Lazarus upgrade.

You can find the options under:
IDE Main Menu -> Search -> Jump To -> ...

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 13 lines
On 2015-08-04 10:26, Michael Van Canneyt wrote: > In the newer installation, when I add the 'Jump to' button, a button is added to the editor toolbar, > but it is not functional: the dropdown menu is not shown, and clicking it does not do anything > (not surprising). This drove me insane too. Recently somebody changed the editor toolbar. There is no more "Jump To" dropdown. You now have to add individual buttons that jump to specific locations. So I had to add the "Jump to Implementation Section" (my most used option) onto my toolbar after the combobox disappeared after a Lazarus upgrade. You can find the options under: IDE Main Menu -> Search -> Jump To -> ...

Seems to be a confirmed bug then :)

Michael.

Reply by email

Juha Manninen
to Michael Van Canneyt: I have 2 lazarus installations: A new one (one that was compiler more recently: today).…
Michael Van Canneyt wrote
But: If I click the 'configure' button, the 'jump to' is not displayed in the list of enabled buttons.

Earlier it was hard-coded and not configurable. IMO it did not deserve any special treatment, it should one configurable command amoung other commands ... and now it is.

In the newer installation, when I add the 'Jump to' button, a button is added to the editor toolbar, but it is not functional: the dropdown menu is not shown, and clicking it does not do anything (not surprising).

How did you do that?
You cannot add a 'Jump to' button. You can add 'Jump to Interface' and 'Jump to Implementation' buttons and they work perfectly well. These commands were added to Search menu precisely for this purpose.

What does this mean ? Did anything change in the toolbar editor ?

Yes, it was changed a lot. The code was moved from the package to IDE's code. The configuration dialog and related code is shared with the IDE Coolbar configuration.
The configuration data is stored in environment options instead of a separate config file.
The new desktops feature now includes Editor Toolbar, too. Earlier the Editor Toolbar had a profile feature for the same purpose but new desktops affect the whole IDE.

Should I be afraid to update my SVN in the older installation ?

No, the old settings are copied and preserved, except for the hard-coded (hackinsh) 'Jump to' button.

More improvements are needed but they must be done in a consistent way for the whole IDE.
As you noticed you cannot configure a dropdown button with a menu. The IDE Coolbar has some hard-coded dropdown buttons even though it is otherwise configurable. No good. There should be a clean API for commands with dropdown menus. Then both the IDE Coolbar and Editor Toolbar could use it.
If somebody wants to work on such a feature, I would be happy to help and finally commit it.

[...] Seems to be a confirmed bug then :)

No. It is a feature, not a bug.

Regards,
Juha

Reply by email

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 9 lines
On Tue, Aug 4, 2015 at 12:26 PM, Michael Van Canneyt wrote: > But: > If I click the 'configure' button, the 'jump to' is not displayed in the > list of enabled buttons. Earlier it was hard-coded and not configurable. IMO it did not deserve any special treatment, it should one configurable command amoung other commands ... and now it is.

I appreciate the API is now probably better. But the GUI is now worse.

Show quoted text 6 lines
> In the newer installation, when I add the 'Jump to' button, a button is > added to the editor toolbar, > but it is not functional: the dropdown menu is not shown, and clicking it > does not do anything (not surprising). How did you do that?

Double-click 'jump to' under 'Code explorer' ?
Maybe this is another "jump to" ?

You cannot add a 'Jump to' button. You can add 'Jump to Interface' and 'Jump to Implementation' buttons and they work perfectly well. These commands were added to Search menu precisely for this purpose.

I imagined this, and I tried this, but then I need 5 buttons, which have not very clear and distinguishable icons and take a lot of place.

1 button with a clear dropdown takes less place and is very understandable because the caption is very clear.

Show quoted text 16 lines
> What does this mean ? Did anything change in the toolbar editor ? Yes, it was changed a lot. The code was moved from the package to IDE's code. The configuration dialog and related code is shared with the IDE Coolbar configuration. The configuration data is stored in environment options instead of a separate config file. The new desktops feature now includes Editor Toolbar, too. Earlier the Editor Toolbar had a profile feature for the same purpose but new desktops affect the whole IDE. > Should I be afraid to update my SVN in the older installation ? No, the old settings are copied and preserved, except for the hard-coded (hackinsh) 'Jump to' button.

It's in fact almost the only button I care about, because I use it most of all, besides the backward/forward in history.

Show quoted text 15 lines
More improvements are needed but they must be done in a consistent way for the whole IDE. As you noticed you cannot configure a dropdown button with a menu. The IDE Coolbar has some hard-coded dropdown buttons even though it is otherwise configurable. No good. There should be a clean API for commands with dropdown menus. Then both the IDE Coolbar and Editor Toolbar could use it. If somebody wants to work on such a feature, I would be happy to help and finally commit it. > [...] > Seems to be a confirmed bug then :) No. It is a feature, not a bug.

That depends on your point of view, of course.
As a user of the IDE I don't care so much about the API, it's invisible. The fact that my much-used button is gone, is very visible.

As a programmer, I of course completely understand you want a clean and clear programming interface. No argument there.

But then please make it possible - from the start - to create a dropdown button and add commands to that (as you suggest), so users can at least recreate the old situation from day 1.

well, it means I must wait with upgrading the other machine till the job is properly finished :(

Thanks for the explanation and please notify on the list when someone has completed the work.

Michael.

Reply by email

Juha Manninen
to Michael Van Canneyt
Michael Van Canneyt wrote
Double-click 'jump to' under 'Code explorer' ? Maybe this is another "jump to" ?

Right, yes. That one is quite useless in a toolbar. I don't know how to filter out the useless commands.
Another related issue are the IDE commands without a menu entry. You can configure key combinations for them but you cannot add them to a toolbar. The Lazarus command system is a little messy.

It's in fact almost the only button I care about, because I use it most of all, besides the backward/forward in history.

Personal preferences differ. I did not realize it was so crucial for somebody. I thought only Graeme uses it. :)
However it may be easier to fix than I first though. The Search menu already has a menu section for the Jump ... commands. The configuration window can be made to accept a menu section, too. Then the sub-items would show in a dropdown list.
Now I have summer activities but I will look at this a little later. Patches are welcome, too.

Juha

Reply by email

Graeme Geldenhuys
to Juha Manninen
Juha Manninen wrote
Personal preferences differ. I did not realize it was so crucial for somebody. I thought only Graeme uses it. :)

So I don't count. :)

However it may be easier to fix than I first though. The Search menu already has a menu section for the Jump ... commands.

If the combobox could be added again, I too would be very grateful. I mostly used the default button behaviour (jump to implementation - without having to open the combobox), but on occasion I used the other options too. Adding 5 buttons with no captions are too much, and finding them on occasion in the Search sub-menu wastes too much time.

I hard-coded that "Jump To" combobox for a reason. ;-)

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Van Canneyt
to Juha Manninen: On Tue, Aug 4, 2015 at 2:50 PM, Michael Van Canneyt Right, yes. That one is quite useless…
Juha Manninen wrote 16 lines
On Tue, Aug 4, 2015 at 2:50 PM, Michael Van Canneyt wrote: > Double-click 'jump to' under 'Code explorer' ? > Maybe this is another "jump to" ? Right, yes. That one is quite useless in a toolbar. I don't know how to filter out the useless commands. Another related issue are the IDE commands without a menu entry. You can configure key combinations for them but you cannot add them to a toolbar. The Lazarus command system is a little messy. > It's in fact almost the only button I care about, because I use it most of > all, besides the backward/forward in history. Personal preferences differ. I did not realize it was so crucial for somebody.

Well, that's why we have a mailing list :-)

I thought only Graeme uses it. :)

Clearly not, obviously he was right about the importance of this button to treat it specially ;)

(BTW: It's one of the first buttons of "GExperts" which I add to the toolbar in Delphi... Just to give you an idea...)

However it may be easier to fix than I first though. The Search menu already has a menu section for the Jump ... commands. The configuration window can be made to accept a menu section, too. Then the sub-items would show in a dropdown list.

That seems like the most easy approach, yes.

Now I have summer activities but I will look at this a little later. Patches are welcome, too.

Take your time, I am glad you see a solution and are willing to work on it.

Please don't forget to notify when you implement it :)

Michael.

Reply by email

Juha Manninen
to Graeme Geldenhuys: So I don't count. :) If the combobox could be added again, I too would be very grateful. I
Graeme Geldenhuys wrote
If the combobox could be added again, I too would be very grateful. I mostly used the default button behaviour (jump to implementation - without having to open the combobox), but on occasion I used the other options too.

Ok, the button's default behavior needs some extra logic and maybe a flag in TIDEMenuCommand.

Adding 5 buttons with no captions are too much, and finding them on occasion in the Search sub-menu wastes too much time.

Yes, the dropdown thing is needed.
The changes so far have been part of bigger improvements in the IDE, made by at least 4 people (including myself).
A public API for IDE Coolbar and Editor Toolbar must be added, too.

Juha

Reply by email

Juha Manninen
to Juha Manninen

Good news!
Trunk revision 49732 implements configurable ToolButtons with dropdown lists. The design is from Ondrej Pokorny. It uses a new class TIDEToolButton + polymorphism and integrates with TIDEMenuCommand. The code that implements a specific button can be in a package. We have a clean API now I dare to say.

Now it is used for 2 buttons, a Desktop selection and a JumpTo selection. The JumpTo feature is interesting. It does not use the menu section as I first envisioned, it adds the dropdown list to all JumpTo* commands. It means you always get the dropdown list together with any of those commands. It also means the used command works as a default action for the button but the list is always the same.
I added JumpToImplementation button to the default configuration. It is identical with the orignal Editor Toolbar now.

Graeme and Michael, please test.

Juha

Reply by email

Graeme Geldenhuys
to Juha Manninen
Juha Manninen wrote
I added JumpToImplementation button to the default configuration. It is identical with the orignal Editor Toolbar now. Graeme and Michael, please test.

Many thanks Juha (and anybody else that contributed). I'll get an update tonight and test.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 8 lines
On 2015-09-01 12:16, Juha Manninen wrote: > I added JumpToImplementation button to the default configuration. It > is identical with the orignal Editor Toolbar now. > > Graeme and Michael, please test. Many thanks Juha (and anybody else that contributed). I'll get an update tonight and test.

I updated, but see no changes. What are we supposed to see ?

Michael.

Reply by email

Ondrej Pokorny
to Michael Van Canneyt
Michael Van Canneyt wrote 13 lines
On Tue, 1 Sep 2015, Graeme Geldenhuys wrote: > On 2015-09-01 12:16, Juha Manninen wrote: >> I added JumpToImplementation button to the default configuration. It >> is identical with the orignal Editor Toolbar now. >> >> Graeme and Michael, please test. > > Many thanks Juha (and anybody else that contributed). I'll get an update > tonight and test. I updated, but see no changes. What are we supposed to see ? Michael.

If you add one of the JumpTo* buttons (e.g. "Jump to Implementation") to IDECoolBar or EditorToolBar you will see that they have a drop-down menu now. The same is for the "Desktops ..." button. See attached image.

Ondrej
-------------- next part --------------
A non-text attachment was scrubbed...
Name: toolbuttons3.png
Type: image/png
Size: 25773 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150901/3b0dd148/attachment-0001.png>

Reply by email

Juha Manninen
to Ondrej Pokorny
Ondrej Pokorny wrote 7 lines
> I updated, but see no changes. What are we supposed to see ? > > Michael. If you add one of the JumpTo* buttons (e.g. "Jump to Implementation") to IDECoolBar or EditorToolBar you will see that they have a drop-down menu now.

Yes, the default configuration is not used when you already have a local configuration for the ToolBar. You must add the button now yourself. For new users it comes automatically.

The same is for the "Desktops ..." button. See attached image.

In r49734 I added the "Desktops ..." button to the default IDE CoolBar configuration.
The button was also extended with "Save current desktop as" menu, thanks to Ondrej!

Regards,
Juha

Reply by email

Michael Van Canneyt
to Juha Manninen
Juha Manninen wrote 20 lines
On Tue, Sep 1, 2015 at 7:39 PM, Ondrej Pokorny wrote: >> I updated, but see no changes. What are we supposed to see ? >> >> Michael. > > If you add one of the JumpTo* buttons (e.g. "Jump to Implementation") to > IDECoolBar or EditorToolBar you will see that they have a drop-down menu > now. Yes, the default configuration is not used when you already have a local configuration for the ToolBar. You must add the button now yourself. For new users it comes automatically. > The same is for the "Desktops ..." button. See attached image. In r49734 I added the "Desktops ..." button to the default IDE CoolBar configuration. The button was also extended with "Save current desktop as" menu, thanks to Ondrej!

OK, I added it, I now see indeed the whole jump-to.

Thanks very much.

Reply by email