2

I hope I can explain this clearly..

Is there a way to configure the delphi XE IDE to stop it creating new events in alphabetical order?

In Delphi 7 new event declarations were added to the end of the unit, and here are my problems with XE.

1) When I create my Menus or Actions, lets say a standard File Menu (New, Open, Save etc..) - I normally double click these and let Delphi create the event declarations for it. This worked perfect in Delphi 7 as the declarations were easily found and grouped together at the end of the unit.

Delphi XE seems to instead move the declarations in alphabetical order, making it harder to find the declarations, they are no longer grouped together and its making life harder and more time consuming because of it.

2) The same rule applies with new class declarations, suppose I have a simple class such as:

TMyClass = class
  private
    constructor Create;
    destructor Destroy;

    procedure Initialize;
  public
    procedure Test;
    procedure Blah;
  end;

I use the keyboard shortcut Ctrl+Shift+C which lets Delphi create the declarations for me, like so:

{ TMyClass }

procedure TMyClass.Blah;
begin

end;

constructor TMyClass.Create;
begin

end;

destructor TMyClass.Destroy;
begin

end;

procedure TMyClass.Initialize;
begin

end;

procedure TMyClass.Test;
begin

end;

Like my first example, the declarations have been put in alphabetical order. To some people this may seem like no problem at all, but to me this is an annoyance I would rather not have to put up with.

Delphi 7 would put them in order by the way they were defined or created from the form designer, not alphabetical.

Is there an option maybe I cannot find to change this behavior?

I hope I explained clearly :)

Thanks.

1
  • Yep. I hate that behavior too. Commented Aug 17, 2012 at 15:15

1 Answer 1

1

There is not an option to change the creation order of the Class Completion feature. The only option to reorder an already created class is use a thirparty plugin for the delphi IDE like Code Explorer of ModelMaker, but this works only for classes with the code already created.

Sign up to request clarification or add additional context in comments.

3 Comments

That is a bit disappointing, I would of hoped there was a setting to make the IDE insert the declarations one after another, as opposed to alphabetically. When you have a lot of event declarations, inserting multiple ones at a time is a nightmare as you have to locate them.
@Craig, it's not that difficult. :) From the implementation (say in Destroy), press Ctrl+UpArrow. This will take you back to the interface declaration of Destroy. Move the cursor to the next proc you want to edit, and press Ctrl+DownArrow; it will move you to that procedure in the implementation section. BTW, the order was changed as a result of people voting to change them from unsorted to sorted in QualityCentral; once it was made, other people started saying they wanted the old behavior. I agree that CodeGear/Embarcadero should have made it an option instead of just one way.
Use CnWizards's Ctrl+D from cnpack.org (or GExperts's Ctrl+G from gexperts.org) to call Procedure List window and from there to navigate to the desired method. This is the quickest way to "jump around" your code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.