Jump to content
Stefan Glienke

Main menu

Recommended Posts

Might it be worth considering restructuring the Main menu which is getting longer and longer and organize the items in sub items to clean it up?

  • Like 1

Share this post


Link to post

I think you are talking about different "main menus" here. 😉

 

@Stefan Glienke Yes, it's getting larger (which annoys me too sometimes), but do you really use all the experts? You could simply disable those you don't use which removes them from the menu.

 

Organizing it into submenus would be a major change since currently the menu is built by enumerating all the experts and adding an entry for all that are active.

 

Feel free to submit a feature request though. One day I might get bored enough to do it or maybe somebody else does it and submits a patch.

 

  • Like 1

Share this post


Link to post

Oh... This is the GExperts sub forum...

I didn't notice that so I actually thought you meant the IDE main menu (which is what I was talking about). Well then, pls ignore what I said.

Share this post


Link to post
15 hours ago, Anders Melander said:

They can start by getting rid of the Refactor menu - and that might also improve the stability of the IDE.

You can rename/remove refactoride###.bpl file

Share this post


Link to post
1 hour ago, Fr0sT.Brutal said:

You can rename/remove refactoride###.bpl file

Yes but that also removes the stuff I use and which actually works (mostly): "Find References" and "Rename".

  • Like 1

Share this post


Link to post
Guest

@Anders Melander, we should maybe start another thread, in andother sub-forum, but i have also made that mistake when reading and commenting. The sub-forum name is IMHO visually too suppressed.

Share this post


Link to post
1 hour ago, Dany Marmur said:

@Anders Melander, we should maybe start another thread, in andother sub-forum

Actually: It should be easy for yet another expert (yet another GExperts menu entry 😉) to hide some of the menu entries of the IDE. Or, since there is already an expert for changing the menu shortcuts of the IDE, it could be extended to also allow hiding those entries.

23 hours ago, Anders Melander said:

and that might also improve the stability of the IDE

In that case obviously not.

Share this post


Link to post
13 minutes ago, dummzeuch said:

In that case obviously not.

Actually it might. One of my grieves with the Refactor menu item is that if you accidentally move the mouse over the menu item (e.g. on the way to the View or Project menu item) then there's a noticeable delay (very noticeable on low end systems) as the IDE loads the refactor stuff (among it the J# run time I suspect) in order to populate the sub menu.

 

2 hours ago, Dany Marmur said:

we should maybe start another thread

Agree, but I don't think I'll have more to contribute on the subject.

Share this post


Link to post
On 11/15/2019 at 12:49 PM, dummzeuch said:

Actually: It should be easy for yet another expert (yet another GExperts menu entry 😉) to hide some of the menu entries of the IDE. Or, since there is already an expert for changing the menu shortcuts of the IDE, it could be extended to also allow hiding those entries.

In that case obviously not.

This post is old. Is there anything in gexpert to remove items or move them from the Delphi mainmenu ?

Share this post


Link to post
7 hours ago, luciano_f said:

This post is old. Is there anything in gexpert to remove items or move them from the Delphi mainmenu ?

There are only two options for now:

  • Hide Window Menu
  • Move the Component menu to Tools

Both can be found on the IDE tab of the GExperts configuration dialog.

I have no plans exending this functionality, but I am - as always - accepting patches.

Share this post


Link to post
3 hours ago, dummzeuch said:

There are only two options for now:

  • Hide Window Menu
  • Move the Component menu to Tools

Both can be found on the IDE tab of the GExperts configuration dialog.

I have no plans exending this functionality, but I am - as always - accepting patches.

 

I wanted to hide Delphi's "UniDac" menu, it has no use

 

 

 

Unidac.png

Share this post


Link to post
2 hours ago, luciano_f said:

 

I wanted to hide Delphi's "UniDac" menu, it has no use

 

 

 

Unidac.png

That is not a menu of the IDE but one added by some plugin or possibly a property editor.

(Or it is part of a higher SKU than I know, e.g. Delphi Enterprise or Delphi Architect)

Share this post


Link to post
1 hour ago, dummzeuch said:

That is not a menu of the IDE but one added by some plugin or possibly a property editor.

(Or it is part of a higher SKU than I know, e.g. Delphi Enterprise or Delphi Architect)

I would have to install some BPL just to remove this Menu

How could I do it ?

Share this post


Link to post
2 hours ago, dummzeuch said:

(Or it is part of a higher SKU than I know, e.g. Delphi Enterprise or Delphi Architect)

It probably is part of the UniDAC components from DevArt.

Share this post


Link to post

Sorry couldn't resist.

 

Here try this

1) New package.

2) Add to required image.png.4229dedbe52585eeb07b3eca93961800.png

 

3) add this huge unit to search and hide menu

unit uRemoveUniDacMenu;

interface

uses
  Classes, SysUtils, ToolsAPI, VCL.Menus;

implementation

procedure FindMenuByCaptionAndHide(aMenu: TMenu; aCaption: string);
var
  i: Integer;
begin
  i := aMenu.Items.Count;
  while i > 0 do
  begin
    Dec(i);
    if aMenu.Items.Items[i].Caption = aCaption then
    begin
      aMenu.Items.Items[i].Visible := false;
      Break;
    end;
  end;
end;

procedure RemoveUniDacMenu;
var
  NTAServices: INTAServices;
  IDEMainMenu: TMenu;
begin
  if Supports(BorlandIDEServices, INTAServices, NTAServices) then
    IDEMainMenu := NTAServices.MainMenu;
  if Assigned(IDEMainMenu) then
  begin
    FindMenuByCaptionAndHide(IDEMainMenu, '&UniDAC');
    FindMenuByCaptionAndHide(IDEMainMenu, 'V&irtualDAC');
  end;
end;

initialization
  RemoveUniDacMenu;

end.

 

Enjoy !

 

Share this post


Link to post
1 hour ago, Kas Ob. said:

Sorry couldn't resist.

 

Here try this

1) New package.

2) Add to required image.png.4229dedbe52585eeb07b3eca93961800.png

 

3) add this huge unit to search and hide menu


unit uRemoveUniDacMenu;

interface

uses
  Classes, SysUtils, ToolsAPI, VCL.Menus;

implementation

procedure FindMenuByCaptionAndHide(aMenu: TMenu; aCaption: string);
var
  i: Integer;
begin
  i := aMenu.Items.Count;
  while i > 0 do
  begin
    Dec(i);
    if aMenu.Items.Items[i].Caption = aCaption then
    begin
      aMenu.Items.Items[i].Visible := false;
      Break;
    end;
  end;
end;

procedure RemoveUniDacMenu;
var
  NTAServices: INTAServices;
  IDEMainMenu: TMenu;
begin
  if Supports(BorlandIDEServices, INTAServices, NTAServices) then
    IDEMainMenu := NTAServices.MainMenu;
  if Assigned(IDEMainMenu) then
  begin
    FindMenuByCaptionAndHide(IDEMainMenu, '&UniDAC');
    FindMenuByCaptionAndHide(IDEMainMenu, 'V&irtualDAC');
  end;
end;

initialization
  RemoveUniDacMenu;

end.

 

Enjoy !

 


Wonder,  It worked


Much obliged.

 

Share this post


Link to post
On 11/14/2019 at 2:24 PM, dummzeuch said:

I think you are talking about different "main menus" here. 😉

 

@Stefan Glienke Yes, it's getting larger (which annoys me too sometimes), but do you really use all the experts? You could simply disable those you don't use which removes them from the menu.

 

Organizing it into submenus would be a major change since currently the menu is built by enumerating all the experts and adding an entry for all that are active.

 

Feel free to submit a feature request though. One day I might get bored enough to do it or maybe somebody else does it and submits a patch.

 

I don't know if it would be too much to ask, Gexpert could have a feature to remove items from the menu or even move items to other places

Share this post


Link to post

@luciano_f I tried my own code today and the IDE generated a warning, it didn't show me yesterday so the code without warning is

unit uRemoveUniDacMenu;

interface

uses
  Classes, SysUtils, ToolsAPI, Windows, VCL.Menus;

implementation

procedure FindMenuByCaptionAndHide(aMenu: TMenu; aCaption: string);
var
  i: Integer;
begin
  i := aMenu.Items.Count;
  while i > 0 do
  begin
    Dec(i);
    if aMenu.Items.Items[i].Caption = aCaption then
    begin
      aMenu.Items.Items[i].Visible := false;
      Break;
    end;
  end;
end;

procedure RemoveUniDacMenu;
var
  NTAServices: INTAServices;
  IDEMainMenu: TMenu;
begin
  if Supports(BorlandIDEServices, INTAServices, NTAServices) then
  begin
    IDEMainMenu := NTAServices.MainMenu;
    FindMenuByCaptionAndHide(IDEMainMenu, '&UniDAC');
    FindMenuByCaptionAndHide(IDEMainMenu, 'V&irtualDAC');
  end;
end;

initialization
  RemoveUniDacMenu;

end.

Another problem is after first IDE restart the menu was deleted but after two restart the menu was there and the code failed to delete the menu, the reason was something changed the order of package loading also this IDE is a cloned one meaning is really missed up, so can't be sure of the reason.

Any way to make sure it will work always you need to add to required any of the UniDac packages like "dcldac220" and this ensure this package will follow the needed package, in this case all the UniDac RTL packages are loaded together so it will work with any of them.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×