Sign in Join

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

Mailing lists / lazarus / 2014-07

Editortoolbar Patch + Pending issue

6 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Giuliano Colla

Hi,

I've posted to the bugtracker (
http://bugs.freepascal.org/view.php?id=26524 ) a patch meant to cover all pending issues, except the "Untranslatable Strings" issue, which is still pending.

For this issue I summarize the problem and the possible solutions:

1) The problem:
The Editortoolbar creates a Treeview which reproduces exactly the structure of IDEMenuRoots.
This has the advantage of giving access to all the available menu items, whether they are in the main Ide menu, or in various pop-up menus, well organized, making it easy to locate what you need.

The problem is that while Menu Items have a translatable caption, Menu Sections do not, because they were intended only for internal usage. But using the same structure for a human readable Treeview gives rise to the problem.

2) Possible solutions:

a) To leave things as they are. In the Treeview, Menu Sections are shown with the internal name.
Pros: No need to modify anything.
Cons: Users unfamiliar with English, or worse unfamiliar with Latin alphabet will have a lot of troubles to understand what the heck mean some of them.

    b) To modify lazarus code, adding a human readable Caption to Menu
    Sections. Sort of: TIDEMenuSection.Create (const TheName: string;
    const TheCaption: string = '');
    Pros: It becomes possible to take advantage of IDEMenuRoots to
    generate human readable infos also for Menu Sections. Editortoolbar
    can exploit this, but other IDE future extensions may take advantage
    too.
    Cons: Requires the update of quite a number of units/packages.
    c) To modify EditorToolbar code, which upon detecting the
    untranslated string (Name=Caption), may access his own translations
    in his resources.
    Pros: no need to modify lazarus code elsewhere.
    Cons: requires housekeeping of EditorToolbar whenever there's a
    change in lazarus Menu Sections.
    d) To implement differently the EditorToolbar TreeView. But I fail
    to see how.

I'd be in favor of option b), but that's just my vote. What shall we do?

Giuliano

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20140724/4c50c7d3/attachment.html>

Reply by email

Mattias Gaertner
to Giuliano Colla
Show quoted text 6 lines
[...]But using the same structure for a human readable Treeview gives rise to the problem. 2) Possible solutions: [...]

e) A section without caption is like the TMenuItem separator. The designer simply shows a '-'.
Same can be done for sections without caption:
Write a '-' or 'Section' or use a special icon or draw a line.

Mattias

Reply by email

Graeme Geldenhuys
to Mattias Gaertner
Mattias Gaertner wrote
e) A section without caption is like the TMenuItem separator. The designer simply shows a '-'. Same can be done for sections without caption: Write a '-' or 'Section' or use a special icon or draw a line.

+1

And that should be easy to implement.

Regards,
- Graeme -

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

Reply by email

Giuliano Colla
to Graeme Geldenhuys

Il 25/07/2014 00:22, Graeme Geldenhuys ha scritto:

Show quoted text 9 lines
On 2014-07-24 21:02, Mattias Gaertner wrote: > e) A section without caption is like the TMenuItem separator. The > designer simply shows a '-'. > Same can be done for sections without caption: > Write a '-' or 'Section' or use a special icon or draw a line. +1 And that should be easy to implement.

Yes, it's very easy to implement, and it was my first choice.

I merrily added just two lines:

  if Item.Caption  Item.Name then ACaption:= Item.Caption
   else ACaption:= '---';

and modified a third line to use ACaption instead of Item.Caption. A child's play.

But to my dismay this was the result:

http://www.copeca.it/colla/Toolbar/Treeview1.png

(as opposed to: http://www.copeca.it/colla/Toolbar/Treeview.png )

Opening some nodes brings to this result:

http://www.copeca.it/colla/Toolbar/Treeview2.png

In order to keep the hierarchical structure which makes it easy to locate what you need, we must have human readable names for Menu Sections. They're not only separators, they're ancestor nodes for our Treeview.

Any better idea?

Giuliano

Reply by email

Giuliano Colla
to Mattias Gaertner

Il 25/07/2014 19:16, Mattias Gaertner ha scritto:

Show quoted text 17 lines
On Fri, 25 Jul 2014 17:30:03 +0200 Giuliano Colla wrote: > [...] > But to my dismay this was the result: > > http://www.copeca.it/colla/Toolbar/Treeview1.png > > (as opposed to: http://www.copeca.it/colla/Toolbar/Treeview.png ) > > Opening some nodes brings to this result: > > http://www.copeca.it/colla/Toolbar/Treeview2.png 1. Do not show empty sections. 2. Expand all by default. Maybe we can give the root nodes captions.

I can give it a try, by providing root node captions, and following your advices for the rest. I'm afraid that expanding all by default will make it harder to locate what you want, but one should check in practice. I might temporarily add some buttons to change setup, to help deciding what's better. After all 1.3 is currently a development version, not a production one.

Giuliano

Reply by email