New Features in ModelMaker Code Explorer 3.10

New Pascal Features

  • Event properties are recognized and displayed, filtered and sorted independently from normal properties. Whether a property is an event or not is based on the type name. Events are properties with a delegate (method pointer) type. A delegate type definition is for example
    TNotifyEvent = procedure (Sender: TObject) of object;
    ModelMaker Code Explorer uses these rules to check whether a property type name refers to a delegate type and therefore makes the property an event:
    • A delegate type defined in the same module and preceding the property is recognized.
    • A file "global_delegates.txt" in the ModelMaker Tools shared directory allows defining globally known delegate types. By default this file contains the VCL TNotifyEvent definition, you may add your own commonly used types. This file is auto created after running once. The Properties|Pascal|Parsing tab has a button to edit this file. A restart is required for changes to take effect.
    • Optionally, properties named 'OnXyz' are assumed to be events, this can be disabled in the Properties|Pascal|Parsing tab.
  • Whenever access is changed in the Property Editor dialog, the read / write code options are preset according to the preferences (Project Options| Coding Style).
  • Method directive final supported for Delphi.NET syntax
  • Delphi support on the Properties|Pascal|Parsing tab now be set to
    • Delphi 7 Win32
    • Delphi 9 Win32 (new)
    • Delphi .NET
    The parser, editor constraints and code generator handle syntax according to the selected language
  • Add Local Var improved: new vars are appended after the last existing var in the last var section. If no var section exists, the var section is added after all local procedures, type declarations, consts, labels etc. Also, you'll get a warning when adding a variable that already exists. Similar logic applies to Add Explaining Var.

Pascal String and Number conversion wizards

  • The Convert String to Resourcestring refactoring allows selecting the scope for the extracted resourcestring:
    • Module: defines the extracted string globally in the current module - identical to the previous behavior.
    • Local: defines the extracted string as a local resourcestring in the current method.
    • External File: defines the extracted string globally in the interface section of a different file. The unit is added to the implementation's uses list. Placing resource strings in a external file is commonly used to centralize resourcestrings.
  • Similar, the Module String Conversion Wizard allows defining the extracted string in either the current Module (like previously) or an external file. The Module String Conversion Wizard uses the settings (scope and external file name) as defined on the Properties | String Conversion tab.
  • The Convert to Const refactoring allows the same scopes as for converting strings to resourcestrings: Module, Local or External File.

Generic new features

  • Documentation Pane shows documentation for entity at cursor position. Controlled by Properties | Documentation tab.
  • Collapsible Type Selector in all dialogs that use a type selector. Expansion/Collapsing to a to simple combo box is controlled with button to the right of the type name edit. The user definable type presets can be assigned to the type drop down list.
  • Parameter Wizard: a structured editor to add, edit, delete and rearrange (move) parameters. Invoked in several places. Keyboard shortcut Ctrl+P and button next to the parameters edit on the delegate dialog invokes this wizard.
  • Add Parameter refactoring invokes the Parameter wizard and allows adding / rearranging multiple parameters. The token at editor cursor is used as default parameter name.
  • Rename Parameter refactoring invokes the Parameter wizard and allows renaming multiple parameters at once. Renamed Parameters are optionally propagated in method code.
  • Method (and Pascal Procedure) dialogs have an Integrated Parameter wizard:
    • A button to the left of the Parameters edit shows / hides the integrated wizard.
    • While the wizard is enabled, the parameters edit is disabled.
    • Parameters renamed with the integrated wizard are propagated in method code for "Edit Method" - obviously not for "Add Method".
    • Renaming Parameters uses a "Don't ask me again" style dialog for confirmation. Renaming and Confirmation style is controlled on the Properties|{Pascal|C#}|IntelliReplace tab.
  • In several Dialogs seldom used options are now collapsible. Check for example the C# Delegate or Pascal Method and Property dialogs.
  • The default rename scope for Rename Local (method, class, module) is adjustable on the [Language]|Editing tab.
  • The Language|Parsing options have an option "Compress Parameter Lists" which if enabled removes duplicate spaces from parameter lists. Default is enabled.
  • Insert Component Name replaces the current selected text (if any).
  • When switching between modules, the explorer no longer (re-)positions the editor cursor position.
  • Surround With Template predefines macro <!token!>. This expands to the selected text or the identifier at cursor position.
  • Surround With Template allows using user macros in templates. When applying the template you'll be prompted for values. For example:
    <!class!>.Create(<!params!>);
    When applied, you'll be prompted for values for class and params
  • Local Var, Field and Parameter Wizard use Hungarian type look up when clicking the "other.." type in the type selector.

Solved bugs Pascal

  • Rename Local with a scope other than method would not include the method implementation declaration lines. As a result Rename Local could not be used to rename a method in class / module scope. Solved.
  • Making a property override in the Property Editor Dialog would not reset access to none. Solved
  • Rebuilding a parameter list with identical optional parameters as "I: Integer = 0; J: Integer = 0;" would result in bad syntax: "I, J: Integer = 0". Solved, default parameters are no longer combined

Solved bugs C#

  • A class without ancestor specification would interpret the first supported interface as ancestor. This is due to the fact that Code Explorer uses a single pass parser rather than compile all code. As a work around for this problem, interfaces defined before the class in the same unit, are now recognized. Also, if the ancestor starts with 'I' or the Interface name prefix as defined on the C#|New Entities tab, and the next character is an upper case letter, the ancestor is assumed to be an interface. Interpreting ancestors as interfaces can be disabled by setting string value "HKEY_CURRENT_USER\Software\ModelMaker\MideX\3.0\C#\Preferences\Delphi 7\FixAncestors" to "False".