CnPack Forum » CnWizards IDE Wizards » Suggestion: Code Editor: Auto Align parameters


2013-4-23 22:31 dbbanjo
Suggestion: Code Editor: Auto Align parameters

Howdy,

  Could an option be added which would provide the ability
to auto-align a parameter list according to the parameter type?

  Here is a before and after example:

      Before:
              procedure tFormCustomDrawCell(Sender: TObject; ACanvas: TCanvas; ARect: TRect;  ANode: TdxTreeListNode;
                                                            AColumn: TdxTreeListColumn; ASelected, AFocused, ANewItemRow: Boolean;
                                                            Var AText: String; Var AColor: TColor; AFont: TFont; Var AAlignment: TAlignment;
                                                            Var ADone: Boolean);

      After:
              procedure tFormCustomDrawCell(Sender: TObject;
                                                            ACanvas: TCanvas;
                                                            ARect: TRect;  ANode: TdxTreeListNode;
                                                            AColumn: TdxTreeListColumn;
                                                            ASelected, AFocused, ANewItemRow: Boolean;
                                                            Var AText: String;
                                                            Var AColor: TColor;
                                                            AFont: TFont;
                                                            Var AAlignment: TAlignment;
                                                            Var ADone: Boolean);

  Note: If the above ability is already present?   Please let me know where this
option is located ...

                     Thanks,

                           DbBanjo (Marc Bolen)

2013-5-4 11:47 Passion
It's a part of code formatting, but our code formatting feature is only for testing, not published.

It also can be done by a Pascal Script.

2013-5-18 21:03 WWebber
I would even prefer following output (which is even not possible with the RAD code formatter):

After:

procedure tFormCustomDrawCell(Sender:              TObject;
                                              ACanvas:             TCanvas;
                                              ARect:                TRect;  
                                              ANode:               TdxTreeListNode;
                                              AColumn:            TdxTreeListColumn;
                                              ASelected, AFocused, ANewItemRow: Boolean;
                                              Var AText:           String;
                                              Var AColor:           TColor;
                                              AFont:                 TFont;
                                              Var AAlignment:    TAlignment;
                                              Var ADone:           Boolean);

In C++ this would look like:

int          MyForm::TFormCustomDrawCell(TObject *       Sender,
                                                         TCanvas *        ACanvas,
                                                         TRect  &          ARect,
                                                          ...
                                                         bool &             Done)
{
}

页: [1]


Powered by Discuz! Archiver 5.0.0  © 2001-2006 Comsenz Inc.