Sign in Join

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

Mailing lists / lazarus / 2014-07

editortoolbar enhancements

7 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Giuliano Colla

Hi, Lazarus developers,

following the discussion of a few days ago about editortoolbar package, I'm preparing an enhancement patch.
What I've done:

1) Added an option in Editortoolbar configuration, to select its position (Top,Bottom,Right,Left)

2) Added a "Show toolbar" checkbox in Editor -> General -> Misc, and an eoEditorToolBar to TSynEditorOption2.

What is missing:

1) A better implementation of the Show Toolbar option. Currently Editortoolbar uses SourceEditorManagerIntf, which doesn't expose (or if it does I didn't find how) the current editor options. My quick and dirty solution has been just to read the editor configuration file. As a consequence, a change is only taken in charge when restarting the IDE, or when starting a new project.
Any suggestions?

2) Including Editortoolbar among the default IDE packages. I've never done such a thing, and I don't know how to do it in a clean way. Moreover it has to be seen if:

a) It is desirable to do it. Given that it can be switched off I would be in favor.

b) It is desirable to keep it as a separate package from the SynEdit suite, or it should become the umptieth SynSomething.

Again: suggestions?

Giuliano

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140715/9e956c8e/attachment.html>

Reply by email

Juha Manninen
to Giuliano Colla
Giuliano Colla wrote
1) Added an option in Editortoolbar configuration, to select its position (Top,Bottom,Right,Left)

Good.

2) Added a "Show toolbar" checkbox in Editor -> General -> Misc, and an eoEditorToolBar to TSynEditorOption2.

How do you do that from the package code? Or, did you modify the IDE's code?

Show quoted text 9 lines
What is missing: 1) A better implementation of the Show Toolbar option. Currently Editortoolbar uses SourceEditorManagerIntf, which doesn't expose (or if it does I didn't find how) the current editor options. My quick and dirty solution has been just to read the editor configuration file. As a consequence, a change is only taken in charge when restarting the IDE, or when starting a new project. Any suggestions?

IdeOptionsIntf has the interface for options.
Maybe you should keep the option checkbox somewhere else. It makes sense in the Editor -> General -> Misc only if the package is installed all the time.

Show quoted text 6 lines
2) Including Editortoolbar among the default IDE packages. I've never done such a thing, and I don't know how to do it in a clean way. Moreover it has to be seen if: a) It is desirable to do it. Given that it can be switched off I would be in favor.

It is possible. Especially new users keep requesting such a feature. For them it should be installed by default.
One addition please: add the "jump backward" and "jump forward" (Ctrl-H, Ctrl-Shift-H) buttons there by default. They are the single most requested operations. Once people learn to use shortcuts, they are not as important any more.

b) It is desirable to keep it as a separate package from the SynEdit suite, or it should become the umptieth SynSomething.

Now you are on wrong tracks. EditorToolbar is a misleading name. It is more like IdeToolbarLocatedInEditor. It supports all commands, including for Designer and Package editor.

Juha

Reply by email

Giuliano Colla
to Juha Manninen

Il 15/07/2014 20:16, Juha Manninen ha scritto:

Show quoted text 10 lines
On Tue, Jul 15, 2014 at 8:05 PM, Giuliano Colla wrote: > 1) Added an option in Editortoolbar configuration, to select its position > (Top,Bottom,Right,Left) Good. > 2) Added a "Show toolbar" checkbox in Editor -> General -> Misc, and an > eoEditorToolBar to TSynEditorOption2. How do you do that from the package code? Or, did you modify the IDE's code?

I modified IDE code (editoroptions.pp and
editor_general-miscoptions.pas, assuming that the toolbar would be provided as a default.

Show quoted text 14 lines
> What is missing: > > 1) A better implementation of the Show Toolbar option. > Currently Editortoolbar uses SourceEditorManagerIntf, which doesn't expose > (or if it does I didn't find how) the current editor options. My quick and > dirty solution has been just to read the editor configuration file. As a > consequence, a change is only taken in charge when restarting the IDE, or > when starting a new project. > Any suggestions? IdeOptionsIntf has the interface for options. Maybe you should keep the option checkbox somewhere else. It makes sense in the Editor -> General -> Misc only if the package is installed all the time.

I'll look into it. Thanks for the hint.

Show quoted text 13 lines
> 2) Including Editortoolbar among the default IDE packages. I've never done > such a thing, and I don't know how to do it in a clean way. > Moreover it has to be seen if: > > a) It is desirable to do it. Given that it can be switched off I would be in > favor. It is possible. Especially new users keep requesting such a feature. For them it should be installed by default. One addition please: add the "jump backward" and "jump forward" (Ctrl-H, Ctrl-Shift-H) buttons there by default. They are the single most requested operations. Once people learn to use shortcuts, they are not as important any more.

As we already steel some pixels from the editor window, I was thinking to provide as a starting default a number of usual edit functions (Undo/redo - Cut/Copy/Paste - Search/Search in Files - Jump Back/Jump Forward). Then users may add/remove what they need.

Show quoted text 5 lines
> b) It is desirable to keep it as a separate package from the SynEdit suite, > or it should become the umptieth SynSomething. Now you are on wrong tracks. EditorToolbar is a misleading name. It is more like IdeToolbarLocatedInEditor. It supports all commands, including for Designer and Package editor.

You're right. This should help to find a better position for the show/hide option, and a better location for the package. I'll give a look into it.

Reply by email

Graeme Geldenhuys
to Juha Manninen: On Tue, Jul 15, 2014 at 8:05 PM, Giuliano Colla Good. How do you do that from the package…
Juha Manninen wrote
One addition please: add the "jump backward" and "jump forward" (Ctrl-H, Ctrl-Shift-H) buttons there by default. They are the single most requested operations. Once people learn to use shortcuts, they are not as important any more.

Very good idea. If Giuliano doesn't know how to do that, I'll submit a patch with (or after) his, adding that change.

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Giuliano Colla: Il 15/07/2014 20:16, Juha Manninen ha scritto: I modified IDE code (editoroptions.pp and…
Giuliano Colla wrote
I was thinking to provide as a starting default a number of usual edit functions (Undo/redo - Cut/Copy/Paste - Search/Search in Files - Jump Back/Jump

I wouldn't. I think everybody knows those shortcuts as they are common in all editors.

The "Jump To" is a editor toolbar feature hence it was on there by default. The "Jump Back/Forward" has a Lazarus IDE specific shortcut most don't know (in the beginning). So these two can be justified as default items.

The Cut/Copy/Paste etc just takes up toolbar space, and means others will have to go through the trouble to delete them if not needed. I know I will. ;-)

Regards,
- Graeme -

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

Reply by email

Václav Valíček
to Graeme Geldenhuys

Yes, It's only space consumer... Copy/Cut/Paste are known even by my father. (LOL). I don't think that buttons are needed...

V?clav Val??ek

Dne 15.7.2014 20:48, Graeme Geldenhuys napsal(a):

Show quoted text 20 lines
On 2014-07-15 19:40, Giuliano Colla wrote: > I was thinking > to provide as a starting default a number of usual edit functions > (Undo/redo - Cut/Copy/Paste - Search/Search in Files - Jump Back/Jump I wouldn't. I think everybody knows those shortcuts as they are common in all editors. The "Jump To" is a editor toolbar feature hence it was on there by default. The "Jump Back/Forward" has a Lazarus IDE specific shortcut most don't know (in the beginning). So these two can be justified as default items. The Cut/Copy/Paste etc just takes up toolbar space, and means others will have to go through the trouble to delete them if not needed. I know I will. ;-) Regards, - Graeme -

Reply by email

Giuliano Colla
to Graeme Geldenhuys: Very good idea. If Giuliano doesn't know how to do that, I'll submit a patch with (or…

Il 15/07/2014 20:43, Graeme Geldenhuys ha scritto:

Show quoted text 9 lines
On 2014-07-15 19:16, Juha Manninen wrote: > One addition please: add the "jump backward" and "jump forward" > (Ctrl-H, Ctrl-Shift-H) buttons there by default. They are the single > most requested operations. Once people learn to use shortcuts, they > are not as important any more. Very good idea. If Giuliano doesn't know how to do that, I'll submit a patch with (or after) his, adding that change.

Please go ahead with your patch. You're more familiar with your code than I am, and your implementation will certainly be better than mine. If you let me have it as soon as it's ready I can incorporate it in my work in progress without waiting for the svn update process.

Giuliano

Reply by email