Saturday, February 16, 2008

Fixing FrameMaker

It is generally accepted that FrameMaker is one of the best tools for reliably authoring long documents. In this category of software, Microsoft Word isn't even a contender. Yet for all FrameMaker's many strengths, it still suffers from some rather annoying problems that can really throw a spanner into the works that is your writing. One of these FrameMaker problems is the size of some of its dialog windows, especially those used for selecting conditional text settings.

The main problem with these windows is that they are too small to show the full name of defined conditions. To add insult to injury, these dialog windows are not even resizable. What this means, in all practicality, is that if you have multiple conditions that share the first few characters, you will not be able to differentiate the conditions using Frame's dialog windows.

For example, the documents I work on have gone through several technical writers, share content for a variety of outputs (PDF and online Help) and between application families. In an effort to reign in the conditional text chaos, we've standardized our conditional text names. Now, all conditional text names use the following convention "mc_f__". Some typical conditions would be:
  • mc_f_app1_ug
  • mc_f_app1_ug_mac
  • mc_f_app1_ug_win
  • mc_f_app1_uag
  • mc_f_app1_uag_mac
  • mc_f_app1_uag_win
  • mc_f_app2
Granted, this convention is less than ideal for a number of reasons, but it was a big step forward from the hodgepodge of different conditions used previously.

Below is a screen capture of the Show/Hide Conditional Text dialog used to select which conditions to show in a document:

As you can see, this dialog is worse than useless...it is downright frustrating to use. The cells for Show and Hide just don't provide enough horizontal space to show the full names of the conditions. Fortunately, with a little resourcefulness and careful planning, you can resize these windows to just about any size that works for you. All you need is a little application called Resource Hacker and some patience.

Fixing FrameMaker with Resource Hacker
The first thing you'll need to do is to download Resource Hacker. This free tool is available from many sites offering freeware for download. The link at the bottom is just one such site.

Resource Hacker allows you to edit various program resource files (like .dll files) that contain the properties for many of the dialog (and other) windows used in an application. Fortunately for us, the FrameMaker's conditional dialog windows are housed in one such DLL.

Before editing the DLL in question, you first need to find it and make a safe backup copy of it that you can revert to in case of unforeseen problems. Mind you, I've been using a modified version of this DLL for quite some time and have yet to encounter any problem. . .but as with any such modification, your mileage may vary and there is no guarantee that such "hacks" won't result in a core meltdown of your computer, an increase in global warming, the downfall of western civilization, a rise in communism, inflation, etc... Be warned.

So now that you've been warned, here's the info you need to get started. The file you want is called fmdlg.dll and it is usually found in the following location:

C:\Program Files\Adobe\FrameMaker+SGML6.0\fminit\fmdlg.dll

Once you've made a backup copy of it, fire up Resource Hacker. Once it opens, navigate to and open the abovementioned fmdlg.dll file. You'll see that Resource Hacker utilizes the familiar tree/properties presentation scheme where the navigation tree on the left side of the screen allows you to choose between the various resources included in the DLL file while the right side details pane presents information on the selected resource.

Expand the "Dialog" root and look for the COND_TEXT and COND_VISIBILITY branches. These are the two branches that contain the resources for the FrameMaker dialogs for applying conditional text and for showing and hiding conditional text.

Expanding the COND_TEXT and COND_VISIBILITY branches reveals a resource numbered "1033" in each. I don't know what this number signifies. Perhaps it is the answer to life, the universe, and everything. Perhaps it is the number of angels that can dance on the head of a pin. Or perhaps it has some other more mundane significance. In any case, the number isn't important. The fact is that when you click the number, the details for the corresponding dialog window appear in the details pane of Resource Hacker and an editable preview of the selected dialog window also appears below.

Lets edit the Show/Hide Conditional Text window first, since it obscures more of the conditional tags and (AFAIK) there is no hotkey combination for revealing and hiding conditions equivalent to those used to apply and remove conditions. Without full visibility of your conditions, this window is indeed useless.

The first thing you'll need to do, if you haven't already, is click the "1033" resource in the "COND_VISIBILITY" branch of the Dialogs root in Resource Hacker. The result should be nearly identical to the screen capture above: the properties of the dialog will be displayed in the details pane of resource hacker and an editable preview of the dialog will appear at the bottom. (If you don't immediately notice the preview, check the lower right corner of your screen. For some reason on my machine, this is the default preview location for resources opened in Resource Hacker.)

You can resize the window either by dragging and moving the objects in the preview, or by editing the text in the details view of resource hacker. I'm going to leave it up to you which way you do it. Editing the text is faster for an expert, but if you are new to Resource Hacker, you'll probably want to expirament by resizing in the preview. Just one word of note, when you select an object or control in the preview, a red asterisk will appear next to the object's information line in the details pane. This will allow you to correlate which controls correspond to what information in the preview pane. Change a control (or window's) dimensions in the preview pane will change the information in the control or window's infromation in the preview pane correspondingly. Conversely, changing values directly in the details pane does not immediately update the preview. To see your changed values, you'll need to click the Compile Script button atop the details pane.

After some hacking, here is what I achieved: A window roughly twice as large in both the horizontal and vertical directions As you can see, I've resized the Show and Hide list boxes proportionally.

Once you've finished mucking around with your window, it's time to save your changes back to the fmdlg.dll file and test them out in FrameMaker. This is done by clicking Save in the file menu of Resource Hacker.

Now, the result in FrameMaker:

Ahhh... much better. Finally, I can see the full text of each condition. This makes selecting the which conditional text to show and hide much easier.

By following the same principals, I can resize the Conditional Text window as well:

If you like how I've resized these windows, you can achieve the same results by replacing the details text in Resource Hacker with the appropriate text below, clicking Compile Script, and saving the results.

Conditional Text Dialog Settings


COND_TEXT DIALOG 33, 49, 400, 194
STYLE DS_MODALFRAME | WS_CLIPSIBLINGS | WS_CAPTION
CAPTION "Conditional Text"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Sans Serif"
{
CONTROL "Current Selection Is:", 104, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 3, 2, 188, 9
CONTROL "&Unconditional", 105, BUTTON, BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 3, 15, 56, 10
CONTROL "&Conditional", 106, BUTTON, BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 3, 26, 48, 10
CONTROL "", 107, STATIC, SS_ETCHEDFRAME | WS_CHILD | WS_VISIBLE | WS_GROUP, 3, 39, 393, 135
CONTROL "In:", 108, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 9, 42, 56, 9
CONTROL "", 109, LISTBOX, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 9, 52, 120, 100
CONTROL "Not In:", 110, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 141, 42, 56, 9
CONTROL "", 111, LISTBOX, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 141, 52, 120, 100
CONTROL "As Is:", 112, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 271, 42, 56, 9
CONTROL "", 113, LISTBOX, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 271, 52, 120, 100
CONTROL "<---", 114, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 181, 157, 18, 13 CONTROL "--->", 115, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 211, 157, 18, 13
CONTROL "&Apply", 100, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 3, 179, 50, 13
CONTROL "&Edit Condition Tag...", 101, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 61, 179, 72, 13
CONTROL "&Show/Hide...", 102, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 141, 179, 50, 13
CONTROL " ", 103, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 1333, 1231, 0, 0
CONTROL "Conditional Text", 116, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_GROUP, 0, 0, 0, 0
}


Show/Hide Conditional Text Dialog Settings


COND_VISBILITY DIALOG 33, 49, 372, 230
STYLE DS_MODALFRAME | WS_CLIPSIBLINGS | WS_CAPTION
CAPTION "Show/Hide Conditional Text"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 8, "MS Sans Serif"
{
CONTROL "Show &All", 103, BUTTON, BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 3, 2, 180, 10
CONTROL "Sho&w:", 104, BUTTON, BS_AUTORADIOBUTTON | WS_CHILD | WS_VISIBLE, 3, 16, 33, 10
CONTROL "", 105, LISTBOX, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 3, 27, 152, 146
CONTROL "<---", 106, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 178, 33, 18, 13 CONTROL "--->", 107, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 178, 50, 18, 13
CONTROL "Hide:", 108, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 216, 17, 18, 9
CONTROL "", 109, LISTBOX, LBS_STANDARD | LBS_OWNERDRAWFIXED | LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 216, 27, 152, 146
CONTROL "Show &Condition Indicators", 110, BUTTON, BS_AUTOCHECKBOX | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 3, 182, 180, 10
CONTROL "", 111, STATIC, SS_ETCHEDHORZ | WS_CHILD | WS_VISIBLE | WS_GROUP, 3, 196, 179, 1
CONTROL "&Set", 100, BUTTON, BS_DEFPUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 3, 203, 30, 13
CONTROL "Cancel", 101, BUTTON, BS_PUSHBUTTON | WS_CHILD | WS_VISIBLE | WS_GROUP | WS_TABSTOP, 339, 203, 30, 13
CONTROL "(No Undo)", 113, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 3, 219, 34, 9
CONTROL "&Help", 112, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_GROUP, 1333, 1231, 0, 0
CONTROL "Show/Hide Conditional Text", 102, STATIC, SS_LEFTNOWORDWRAP | WS_CHILD | WS_VISIBLE | WS_DISABLED | WS_GROUP, 0, 0, 0, 0
}


Resources Mentioned in this Article

1 comment:

Anonymous said...

I usually don’t post in Blogs but your blog forced me to, amazing work.. beautiful …