Resource Type Editors

 

Overview

A resource type editor is an editor that handles the editing of a certain type of translation unit. A resource type editor allows for specialized editing according to the requirements of a certain resource type.  In other words: a resource type editor is an editor that "knows" how to handle the translation of a certain resource type in the most appropriate manner.

 

A number of resource type editors can be made available for one and the same resource type where each may handle a different aspect of a translation unit.

 

Available Editors

The following resource type editors are initially available (August 2005) in RC-WinTrans:

 

 

Editor
Name

 

Resource Type
(XLIFF type)

 

 

  File
Type

 

Description

"String Width"

string

Win32

Assigns the "width" value of a virtual dialog box item.

 

See: String Size (Width) Validation.

 

"LinkLabel resx"

x-linkarea

.NET

Determines the link area of a link label caption text.

 

"Hotkey"

caption

.NET
and
Win32

Determines, assigns, and solves the conflicts of hotkey characters used in menu and dialog box resources.

 

"Font winres"

font

Win32

Font selection dialog box for Win32 resource files.

 

"Font resx"

font

.NET

Font selection dialog box for .NET Forms files.

 

"Version Header"

x-stringfileinfoblock
and x-varfileinfovalue

 

Win32

Selects the language and character set for VersionInfo resources.

"Extended Style"

x-exstyle

Win32

Sets or resets the extended style flags of dialog boxes and dialog box items.

 

"Style"

x-style

Win32

Sets or resets the style flags of dialog box items.

 

"Shortcut winres"

shortcut

Win32

Edits a single accelerator key of an accelerator table resource.

 

"Shortcut resx"

shortcut

.NET

Edits a shortcut as it is used in .NET files.

 

Access

There are several ways to open a resource type editor for the currently selected translation unit:

·

Via the Edit menu.

·

Using the local menu (right mouse-click) in the Text Table view.

·

Using the toolbar button in the Project Window toolbar ( ).

·

Via the toolbar button in the Translation Edit bar ( ).

 

Technical Basis

A resource type editor is realized as a VBA macro (file: "SystemMacros.macro"; module: "CustomEditors").  Such an editor will usually open a dialog box in which the translation unit can be edited.

 

SAMPLE VBA MACRO: A VBA macro implementing a resource type editor is primarily a simple VBA subroutine without parameters.  The current translation unit object is available by using the "ActiveTransUnit" method of the "Application" object.

 

Example of a VBA macro to handle the editing of a translation unit:

 

Sub StringWidthDefinition()

Dim tu As TransUnit

Set tu = Application.ActiveTransUnit

< VBA code implementing the editor >

End Sub

 

A resource type editor is accessible via the user interface as soon as the VBA macro (implementing a resource type editor) is made known to the RC-WinTrans system.

 

Custom Editors

As mentioned in the previous section ("Technical Basis"), a resource type editor can be realized by creating a VBA macro that handles the editing of a translation unit.  A VBA macro will be acknowledged as a resource type editor on the Resource Type Editors property page.

 

NOTE: A resource type editor can be made for all data as they are supplied through a translation unit.  This can be normal text as well as flags, attributes, size data, images, and binary data.

 

Related topics

 

NOTE ON BINARY DATA: Because binary data is also accessible through translation units it is as simple to get and set as text.  The "Tools" object "XMLTool" can be used to convert Base64 data (as binary data is supplied through a translation unit) to binary data.