Moving from MZ-Tools 3.0 to 8.0 Part 25: Private Clipboards enhancements

Another very used feature of MZ-Tools 3.0 that has been enhanced in MZ-Tools 8.0 are the Private Clipboards. Now you have “Copy To” and “Paste From” dropdowns on the Main toolbar, to provide better accessibility if you want to use the mouse instead of keyboard shortcuts:

PrivateClipboardsDropdowns

The private clipboards are now editable so you can type anything; you don’t need to have code in a window to copy it to some private clipboard:

PrivateClipboards

And since the private clipboards are editable, you can also clear their contents with the provided buttons at the bottom of the window, either individually or all of them at the same time.

With these minor enhancements this feature provides even more productivity and flexibility than the previous version 3.0, and along with the personal Code Library it can save you a lot of time when you need to repeat code.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

MZ-Tools 8.0 Build 8.0.0.51 released with bug fixes

A few hours ago the build 8.0.0.51 was released, that fixes a few minor bugs, but an important one: in some VBA IDEs (such as Word 2016 and CorelDRAW X7), MZ-Tools hanged when loaded or when the VBA editor main window was activated.

The new build also introduces a minor enhancement useful if you use multiple IDEs at the same time, or use multiple monitors with floating toolwindows. Now, the Options window and the toolwindows show in the caption the IDE description (such as “Word 2010”, “Excel 2010”, etc.):

CodeLibraryCaption

OptionsCaption

The complete changelog is the following:

MZ-Tools 8.0.0.51 released (February 9, 2016)

  • Enhanced [#10644] (All): The Check for Updates feature now verifies that the downloaded file is not corrupted.
  • Enhanced [#10696] (All): The Options window and the toolwindows now show the IDE name.
  • Fixed [#10642] (All): The Download button of the Check for Updates dialog was not disabled during the download.
  • Fixed [#10645] (VB): The Smart Design Mode caused an error when trying to modify the Height property of a Combobox.
  • Fixed [#10645] (VB): The Smart Design Mode caused an error when trying to apply negative widths.
  • Fixed [#10396] (All): The Import button didn’t import a list of items from a regular Options .xml file in some cases.
  • Fixed [#10687] (VBA): The Name of a VBA project included always the file name. Now it doesn’t include it if the project name is not the default ‘VBAProject’ name.
  • Fixed [#10675] (VBA): The hyperlinks of the “Files” section of the HTML documentation (Filename and Type table) did not work correctly in VBA.
  • Fixed [#10697] (VBA): The VBA Editor for CorelDRAW X7 hangs when opened.
  • Fixed [#10485] (VBA): The VBA Editor for Word 2106 hangs when opened.
  • Fixed [Internal] (VB/VBA): The caption of the error handler editor has been changed from ‘Exception Handler’ to ‘Error Handler’.
  • Fixed [Internal] (VB): The Prompt Name and Caption dialog used the “Text” literal instead of the “Caption” literal.
  • Fixed [Internal] (VB): The Add Multiple Files menu entry on the Project menu was not added in the correct position.
  • Fixed [Internal] (All): The icon in the list of collection item conditions of the Programming Rules Review feature was not correct.
  • Fixed [Internal] (All): The Code Library didn’t import root or intermediate folders of code templates.
  • Fixed [Internal] (All): Localization typo in French.
Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 24: The enhanced New Method / Property Assistant

A popular feature of MZ-Tools 3.0 was the Add Procedure assistant, especially to generate properties. MZ-Tools 8.0 renames the feature to New Method / Property Assistant and provides quite a few enhancements.

To customize how a method is generated, use the Options window, Team Options tab, New Method / Property Assistant section, New Method tab, where you can define how you want to name the result variable for functions. The nomenclature can be a fixed value (such as “result”) or use type tags (such as “iResult” for integers, etc.). An example is shown in the preview zone:

NewMethodOptionsFor properties you use the New Property tab, where you can define the nomenclature for the field of the property and for the value parameter. Again, you can use predefined variables for type tags and for the name of the property, and an example is shown in the preview zone:

NewPropertyOptionsOnce configured, you can use the New Method / Property Assistant, which provides more options to customize the generated method and a live preview of the code:

NewMethodAnd for properties, you can specify the style (Standard vs Compact), whether to limit the access of the Let/Set member of the property, etc.:

NewProperty

With these enhancements, MZ-Tools 8.0 can accommodate better your coding style and nomenclature, and can make you more productive, showing a syntax-colored live preview of the resulting code to ensure that it meets your needs.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 23: Generating XML/HTML documentation

Another useful feature of MZ-Tools 3.0 that has been improved in MZ-Tools 8.0 has been the Generate XML / HTML Documentation. In MZ-Tools 3.0 the generated documentation was always XML, but if an XSLT file was specified inside the XML file, when opening it with a browser it was rendered as HTML.

The first improvement is that there are now two different buttons to generate XML and HTML documentation, so that trick is no longer required and you can have pure HTML documentation:

GenerateDocumentationButtonsThe XML documentation generation is configurable in the Options window, Team Options tab, XML Documentation section, where you can specify the output file encoding, whether to document only public declarations or not, and if you want to specify some executable for post-processing of the generated XML file. Furthermore, you can generate the XML documentation automatically, on any folder, when making a VB executable:

XmlDocumentationOptionsThe HTML documentation generation is also configurable in the Options window, Team Options tab, HTML Documentation section, where you can specify the XSL file to transform the XML documentation into HTML documentation. And, as it was the case with XML documentation, you can also generate the HTML documentation automatically when making a VB executable:

HtmlDocumentationOptionsAnother improvement that has been made in the HTML documentation is that now images are shown for different elements such as projects, properties, files, etc.:

HtmlDocumentation

With these enhancements, MZ-Tools 8.0 provides greater flexibility and productivity on how you want to generate the XML / HTML documentation of your projects so that the documentation is always in sync with the binaries.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 22: Reviewing the development environment settings

MZ-Tools 8.0 provides a new feature that allows a team lead to define the environment settings that should be standardized across all the computers of the team. For example:

  • The Windows OS must be 10.0
  • The VB6 IDE must have applied Service Pack 6.
  • The tab width must be 3 characters.
  • The Require Declaration setting is mandatory.
  • The Office version must be 2016.
  • The Office language must be US-English.
  • The source code control repository must have some URL.
  • Etc.

Then, each time that MZ-Tools 8.0 is loaded, it checks those settings and shows a warning to the developer if some setting is not the correct one. The settings are Registry-based, since Windows and Microsoft IDEs store the settings in the Windows registry. For example, VB6 stores its settings in this registry key:

RegistryVB6

While the VBA editor of Office uses this other one:

RegistryVBA

The development environment settings are defined in the Options window, Team Options tab, Development Environment Settings Review section:

DevelopmentEnvironmentSettingReviewsThat page allows you to create, edit, delete, activate or deactivate development environment setting reviews, and provides a handy “Run Active Reviews” button to check that they are correctly defined.

When you create a development environment setting review, you need to enter a description, the registry hive and key, a condition and a “How to fix” explanation for the developer:

DevelopmentEnvironmentSettingReview

When a development environment setting review fails, a dialog is shown to the developer, along with the procedure to fix it:

DevelopmentEnvironmentSettingReviewsFailed

This feature is not only useful for teams, but also if you have more than one computer for development, or even if you need to format your only computer and want to have the same settings as before, provided that you have defined them previously and made a backup or you are using cloud based options.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 21: Checking for updates

MZ-Tools 3.0 didn’t offer an easy way to check for updates, which was a pity because for many years there was a monthly new build until all reported bugs were fixed and a rock-solid quality was achieved. The only way was to subscribe to the RSS feed to get notifications for new versions.

MZ-Tools 8.0 provides multiple ways to know which version you are using, which version you are downloading and installing, and to be notified when a new build is available.

To know which version you are using you can use the MZ-Tools > About window:

FileVersionAbout

Or, if you know the location of the .dll file, you can check its Properties window, Details tab:

FileVersionPropertiesWindow

The downloads page contains the build number for each setup:

FileVersionDownloads

And when you are installing MZ-Tools, the setup indicates the build number:

FileVersionSetup

Now, to get notified about news related to MZ-Tools, including new builds, you can use this blog, or the social channels: Twitter, Facebook and LinkedIn.

If you are interested only in notifications about new builds, you can use the RSS feed of the changelog:

FileVersionRSS

Or you can use the new Check for Updates feature, either manually or automatically (on startup), as configured in the Options window, Personal Options tab, Check for Updates section:

CheckForUpdatesOptions

If you want to execute it manually you can use either the “Check now” button on that window, or the MZ-Tools > Check for Updates menu entry:

CheckForUpdatesMenu

In both cases, if a new build is available you get a dialog with the change log and a button to download the new version:

CheckForUpdatesNewVersionAvailable

So, now you have multiple choices to stay current with your installed MZ-Tools 8.0 version.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 20: Sorting code elements. Any criteria. One click. And reviewable.

MZ-Tools 3.0 offered a Sort Procedures feature that showed a window with all the procedures of the active code file with Up/Down buttons to sort them manually:

SortProceduresVersion3

While that feature was very popular, the approach was very time-consuming, because you had to sort manually each file, and when you added new procedures, you had to sort them again manually. Furthermore, there was no way to detect if the procedures of a file were correctly sorted or not.

MZ-Tools 8.0 introduces a new approach, that requires some initial configuration but that pays off many times later. First of all, the term “Procedure” has been changed by “Code Element”. While at the time of this writing you can only sort “procedures” (subroutines, functions and properties), in some future build you will be able to sort also the code elements of the (General)-(Declarations) section (enums, user-defined types, class fields, class constants, events, etc.).

The feature is then renamed to “Sort Code Elements” and shows no window, it sorts instantly the code elements of the active code file using a predefined sorting criteria that you define in the “Options” window, “Team Options” tab, “Code Elements Order” section:

CodeElementsOrder

In that window, first you select the parent code element kind, which can be a class, a module or an interface, allowing you to define a different sorting criteria for each one. Once selected a parent, such a class, you then add children code elements, that can be moved up/down to define its priority. In the example above, the order is:

  1. Class_Initialize method
  2. Class_Terminate method
  3. Methods that are event handlers
  4. Methods that are subroutines
  5. Methods that are functions
  6. Everything else (ex: Properties)

The Child Code Element editor provides several options to define a child code element.

  • Name matching regular expression.
  • Access (any, Public, Private, etc.).
  • Context: a “context” is a characteristic of the code element, which can vary depending on the kind of code element.

For example, for methods the available contexts are “Function”, “Sub”, “Event handler” and “Not event handler”:

ChildCodeElementMethod

While for properties, the available contexts are “Property Get”, “Property Set” and “Property Let”:

ChildCodeElementProperty

Once configured the desired sorting criteria, not only you can now sort the code elements of any file with one click, but also you have a Code Elements Order Review as part of the Quality Review feature:

CodeElementsOrderReview

That review can detect which code elements are not in the correct place according to the sorting criteria:

CodeElementsOrderReviewResults

To summarize, the Sort Code Elements feature can provide more productivity using its one-click approach, and also more quality detecting if your code files have their code elements correctly sorted.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 19: Closing all windows, or some of them

The VB / VBA IDEs lack a menu entry or button to close all windows, so MZ-Tools 3.0 provided the Close All Windows as button on its toolbar and as menu entry on the Window menu.

MZ-Tools 8.0 enhances this feature providing four possibilities, that are self-explanatory:

  • Close All Windows (same as before)
  • Close All Windows but the Active One
  • Close All Designer Windows
  • Close All Code Windows

In early versions of MZ-Tools 8.0 you had a dropdown on the Main toolbar to select the desired option, but since that approach required two clicks to close the windows, recent builds provide dedicate buttons on the toolbar:

CloseWindowsToolbar

You can also define a keyboard shortcut for each one of those buttons. And of course, you have also the corresponding menu entries on the Window menu:

CloseWindowsMainMenu

Since that Window menu contains also a menu entry for each open window, if there are many of them the menu can be very populated, so you can remove the “Close All …” menu entries that you don’t want to appear using the “Options” window, “Personal Options” tab, “Toolbars and Menus” section, “Menu: Window” node:

CustomizingCloseWindows

As you can see, this is another feature where MZ-Tools 8.0 provides more flexibility to increase your productivity.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 18: Prefixes, suffixes and tags for controls and types

In MZ-Tools 3.0 the customization options for prefixes and suffixes were quite limited. You could define prefixes only for the intrinsic types (String, Integer, etc.) and for some generic types such as Collection, Control, Object and Enum:

NomenclatureVersion3

In MZ-Tools 8.0 the “tag” term is introduced, which can be used as prefix or as suffix, and there are tags both for types and for controls. In both cases, they are defined in the Options window, Team Options tab.

In the Type Tags section you can define some tags for general types (Class, User-Defined Type, Enum and Interface) and tags for any specific type:

TypeTags

The specific types can be intrinsic types such as Boolean, String, Integer, etc.:

TypeTagIntrinsic

Or types inside any type library:

TypeTagLibrary

In the Control Tags section you can define tags for controls:

ControlTags

The Control Tag editor allows you to select any control library and control type:

ControlTag

Once control tags and type tags are defined, you can use them in several features, through predefined variables. For example, when creating a nomenclature rule, you can use tags in the fields Prefix 1, Prefix 2, Suffix 1 or Suffix 2:

InsertPredefinedVariable

Another example is the New Method Assistant, that allows you to customize the nomenclature of the field and value parameter for properties using type tags:

NewMethodAssistantTypeTags

To summarize, MZ-Tools 8.0 provides you the greatest flexibility to define prefixes or suffixes for types and controls, that can be used in several of its features.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit

Moving from MZ-Tools 3.0 to 8.0 Part 17: The Favorite Code Elements toolwindow

MZ-Tools 8.0 enhances also the Favorite Procedures feature of MZ-Tools 3.0, which is renamed to “Favorite Code Elements” because now you can add as favorite items not only procedures (subroutines, functions and properties) but also any code element in the (General)-(Declarations) section, such as enums, user-defined types, etc.:

FavoriteCodeElementsThe second enhancement is that the window is now a toolwindow, rather than a modal window. So, you can keep it always open, docked, floating, on a second monitor, etc.

Another enhancement is that the feature stores the exact line inside the code element that you want to keep as favorite, so you can even have two favorite lines inside the same subroutine:

FavoriteCodeElementsDifferentLinesSameMethodFor greater productivity, you have a toggle button on the toolbar to filter only the favorite code elements that belong to the active code file:

FavoriteCodeElementsFilteredByFileAnd you have also a new text filter at the right of the toolwindow, to type some text to filter the code elements:

FavoriteCodeElementsFilteredByTextFinally, the toolbar offers also some handy buttons to refresh the list (just in case it is not refreshed automatically), to locate a favorite code element (closing or not the toolwindow), to show the options, etc.

With all these enhancements, provided as feedback by users of MZ-Tools 3.0 during many years, MZ-Tools 8.0 provides better productivity for one of its most used features.

Tweet about this on TwitterShare on FacebookEmail this to someoneShare on Google+Share on LinkedInShare on Reddit