Loading...
 

Multi-Language Add-In for Visual Studio

Version 4.65

Version 4.65 of the Multi-Language Add-In for Visual Studio 2005/2008 includes a lot internal changes, some changes in functionality and some changes to the user interfaces.


Internal changes

Changes to the functionality

User interface changes

Installation changes

To do

New grid component

Previous versions of the Add-In, including the version for VB6, use a tree/grid component called SftTree/OCX from softel vdm. The tree functionality is used in the controls and source code grids. The control is also used as a simple grid in many dialogs.

For a long time, I have thought that it would be better to switch to a pure .NET grid component. If possible, I wanted to use a standard control, or one available in source code. The problem with licensed controls is that you can't easily share the source code with another developer. It would also be an irritation if I ever decided to sell the source code. Otherwise, I am quite happy to pay for a commercially available control (as I hope others are prepared to pay for this Add-In).

In all dialogs with a simple grid, I have replaced SftTree with the standard DataGridView.

In the two main grids (controls and source code) and in one or two other places, I have replaced SftTree with the TreeGridView. This is an extension of the DataGridView, created by Mike Rideout at Microsoft, although it is not a supported Microsoft Product.

I have in fact converted the TreeGridView source code from C# to VB.NET (mostly with an online tool) and integrated it directly into the Add-In source code. Since then, I have made some minor changes and extensions to the component. I would be happy to share my modified source code for the TreeGridView, if anybody is interested.

Although this is a minor change from a user's point of view, it has been a massive internal change to the Add-In.

Finally, in fairness to softel vdm, I must say that I always liked working with SftTree and found the quality of the software and the support first rate.

ADO.NET

Another hang over from the VB6 Add-In is, that some parts of the Add-In still used ADO and not ADO.NET.

Access to the project database was restructured and converted to ADO.NET in version 4.54 of the Add-In. Access to the global database still used ADO. In addition, some database update functions used the ADOX component.

I have now converted all database access to ADO.NET.

There is one remaining reference to the ADO library, required for the datalink dialog (MSDASC.DataLinks) which returns an ADO connection object. The datalink dialog is used for the global database connection. I don't know of any .NET way to show this dialog.

Again, although this is no real change at all from a user's point of view, it has been a major internal change.

Making changes to resource files immediately

From the very first version of the Multi-Language Add-In for VB6, the concept has been to:

  • enter translations
  • add runtime support (store resources)

The add runtime support step has to be repeated after modifying translations.

This is non intuitive for a lot of users and I have decided to change it.

In version 4.65, modified texts are stored immediately to the resource files. If this works, it means that you no longer heed to use the add runtime support command.

This will only be a minor improvement for existing users of the Add-In. The real target group for this change are people who download a trial version, find that it doesn't work properly and then give up. For new users, this could be the difference between a product that just works and that just doesn't work.

At present, I am still testing this feature.

Making changes to the function ml_UpdateControls immediately

This is very similar to the change described above.

If you select either of the options

  • Runtime language switching
  • Alternative runtime support

the Add-In generates a method ml_UpdateControls in all Forms and UserControls.

If you then select additional properties for translation, or deselect previously selected properties, then this function is out of date and has to be updated.

In version 4.65, the Add-In will make this change immediately.

Handling hidden items

In the original VB6 Add-In, I added a mechanism to hide items in the source code grid using the tree/grid functionality. Where one or more lines were hidden, an additional node was added, and the hidden lines were made into child nodes of this additional node. This node would usually be collapsed, thus hiding the lines.

The VB6 Add-In (still) has no support for hiding items in the controls grid.

In the Visual Studio .NET Add-In, I added support for hiding nodes to the controls grid, but I did not adopt the same mechanism. In this case, I figured that there would be too many of the additional nodes, mostly hiding only one or two properties.

(This was probably before I added an option to ignore empty strings. If you deselect this option, you will probably see many, many more properties which you would want to hide.)

As a result of this design decision, the mechanism for hiding items in the two grids was highly inconsistent. In addition, the mechanism for hiding and showing nodes was not really intuitive.

I have tidied this up in version 4.65. I have abandoned the idea of using additional nodes to hide items in the source code. Hidden items are handled in an identical manner in the two grids, simply by hiding the items.

The mask button on the toolbar is now a two-state button.
Image
When it is pressed, hidden items are hidden. When it is not pressed, all items are visible. When you initially hide an item, it remains visible until you toggle the state using the mask button.

The DataGridView actually supports hiding rows (i.e. setting Visible=False), so this seemed the obvious mechanism to use. There is a minor problem in the TreeGridView with the + icon to expand a node. It shows a + icon, even if all child items are actually hidden!

Column mode

Another new two-state button on the toolbar toggles between two different column modes.

In the default mode (with the button not pressed), the columns exactly fill the width of the grid. If you have only two or three languages, or a very wide monitor, this mode is ideal.
Image
However, if you have more languages, this mode quickly becomes useless.
Image
In the alternative mode (with the button pressed), the total width of all columns may be wider than the visible area of the grid. In this case there will be a horizontal scroll bar.
Image

Global database using SQL Server

In a standard installation, the global database is based on Microsoft Access 2000 database, which uses the Jet 4.0 database engine. The Jet database engine is now a deprecated component. You may even have to download and install Jet 4.0 to get this to work at all.

I receive an increasing number of error reports about errors connecting to the global database under Windows Vista. Clearly, it would make sense to stop relying on the Jet database engine.

In fact, it has always been possible to migrate the database to SQL server and specify a custom connection string in the Add-In's settings dialog. If several members of a team use the Add-In, this would always be a good idea. About a year ago I wrote an article on how to transfer the global database to SQL server.

A default installation of Visual Studio automatically includes the installation of SQL Server 2005 Express. Whilst some people will deselect this option, most potential users of the Add-In will nevertheless have an instance of SQL Server installed on their computer.

The setup file for version 4.65 now includes an additional database file for SQL Server 2005. I have added an extra step to the installation which checks for the presence of a local SQL Server 2005 (or newer) and attaches the datafile to this instance of SQL Server. If there is no local SQL Server (or if attaching the database fails) then the installation falls back to the Access database file.

I am not sure that this is a good approach, in fact I am worried that some users may object to having a database file attached to their SQL Server. Let me know if you have any comments about it.

Improving the word wrap mode

It is only recently (version 4.60.0009) that I added the word wrap feature. If you press the two-state word wrap button on the toolbar, then text in the grid is wrapped onto multiple lines.
Image
However, I wasn't happy with the behaviour using the old grid, and I am not happy with the behaviour using the new grid.

What I want is a grid which:

  1. always displays a line break where there is a line break in the original string
  2. wraps long lines when wrap mode is selected
  3. retains the same appearance in edit mode
  4. ideally, displays real line breaks with a special symbol.

The old grid fulfilled points 1 and 2, but did not wrap text in edit mode.
The new grid wraps text in edit mode, but it ignores real line breaks in non-wrap mode.
Point 4 is probably too much to hope for.

To get the behaviour that I want probably requires a completly owner-drawn cell, which might be considerably more effort than it is worth.

Testing

Version 4.65 is a beta version. I am still in the process of testing this version.

Help

At present, none of the changes described on this page are described in the help file.

Grid line redrawing

I often find that the grid lines are redrawn incorrectly. This may be a problem with my graphic board, but let me know if you experience this problem.

Image


Created by Phil. Last Modification: Sunday 05 of July, 2009 13:20:13 GMT by Phil.