Prefix Wizard |
Prefix Wizard
This wizard can rename components to correct prefix by some rules. Both Delphi/C++Builder are supported.
There are three rename mode in this wizard, including Auto, Prompt and Manual.
Rename Prompt
In default options, if you put a new component or modify name of a component, this wizard will check whether the new name accords with its rule. If not, a rename dialog will popup to let you rename the component.
If the rule of this component type was not defined, a prefix type dialog will popup as below:
You can enter the prefix of this type of component.
Ignore This Type of Component: If this was selected, all this type of component will be ignored and never prompt again after clicking "OK" or "Cancel" Button.
Never Ask Again: If this was selected, all components without a prefix rule will be ignored.
OK: Confirm this prefix for this type of component.
Cancel: Cancel the modification.
Help: Show this help.
If a prefix rule for a type of component was defined, and a new or name-modified component's prefix does NOT accord with this rule, a rename dialog will popup to rename this component as below:
You can enter new component name here.
Ignore This Type of Component: If this was selected, all this type of component will be ignored and never prompt again after clicking "OK" or "Cancel" Button.
Auto Rename and Never Ask Again: If this was selected, all rename operations will be executed automatically without showing this dialog.
Disable Prefix Wizard: If this was selected, the Prefix feature will be disabled without any renaming or dialog. You can re-enable it in CnPack IDE Wizards setting dialog.
Modify Prefix: Click this button to modify prefix in the rule for this type of component.
Classname Button: Set classname without T to component name.
OK: Confirm modification.
Cancel: Cancel this modification.
Help: Show this help.
Rename Manually
If you click the 'Prefix Wizard...' menu item in 'CnPack' menu in IDE, a dialog will show as below:
Please Select Which to be Processed
Selected Components: The range is selected components in current form. It's enabled when selected count > 0.
All Components in Current Form: The range is all components in current form. It's enabled when current form is form designer.
All Components in All Opened Forms: The range is all components in all opened forms in IDE.
All Components in All Forms of Project: The range is all components in all forms of current project in IDE.
All Components in All Forms of ProjectGroup: The range is all components in all forms of current projectgroup in IDE.
Process Those in the List
Components with Unproper Prefix: Only process those components without a correct prefix in range.
Components with Unproper Prefix or Name + Digital: Only process those components without a correct prefix or auto generated name with digital subfix in range.
All Components including Those Ignored Process all component in range, including those ignored components. It's used to browse and rename batch components.
Process: Process components. If components requiring renaming exist, a prompt dialog will show.
Settings: Display settings dialog.
Close: Close this dialog.
Help: Show this help.
If components requiring renaming exist after clicking 'OK', a prompt dialog will show as below.
This dialog shows the components that need renaming. You can choose one item and enter new name in top edit and press enter to confirm this modification.
Hint: You can use Up, Down, Home, PgUp, PgDown, End to move cursor.
Modify: Modify selected component and confirm the new name. It's equal to press enter in edit.
OK: Confirm all rename operations.
Cancel: Cancel this operation and close dialog.
Help: Show this help.
If you do NOT want to modify a name of a component, you can uncheck its checkbox or modify new name to empty.
Sorting is supported by clicking column header.
Settings Dialog
Settings dialog of this wizard is as below:
Display Settings
Enable Modify Prefix Automatically: Whether allow renaming component automatically, if NOT, all options below will be disabled.
Show Dialog when Add New Component or Rename: Whether show renaming dialog to let user enter new component name. If not, renaming will be performed automatically.
Prompt for Undefined Prefix: Whether show prefix definition dialog to let user enter the prefix when meeting components without a corresponding prefix rule.
Ignore Component Naming after Class Name: Whether ignore those components naming after classname without T, such as MainMenu.
Replace the Prefix when Auto-rename: Whether replace the old prefix when computing new names.
Add Underscore after Prefix when Renaming: Whether add an underscore after prefix, i.e. btn_1.
Use Action Name as New Name if Connected to an Action: If checked and if the component has an Action property, use the prefix + action name (without the action prefix) as the new name of this component.
Auto Rename when Action Changed: If checked and when the Action property of an unnamed component, or named but does not have a correct prefix, or has a prefix + digital, changed (except to nil), component name will be renamed to prefix + action name (without the action prefix).
Use DataField as New Name if this Property Exists: If checked and if the component has an DataField property, use the prefix + DataField value as the new name of this component.
Auto Rename when DataField Changed: If checked and when the DataField property of an unnamed component, or named but does not have a correct prefix, or has a prefix + digital, changed (except to ''), component name will be renamed to prefix + DataField value.
Component Prefix Settings
Modify: Modify selected component type's prefix.
Import: Import prefix rules from a file.
Export: Export prefix rules to a file.
OK: Save settings and close this dialog.
Cancel: Cancel settings modification and close this dialog.
Help: Show this help.
Note: If the checkbox before a type was not selected, this type will be ignored when processing.
Links