The Adobe Express View Engine (EVE) is the recommended method of laying out UI widgets in InDesign dialogs. The main benefit of using EVE is that widget geometry is calculated for you, so that when you add or remove widgets to a dialog all of the other widgets are shifted automatically without you having to recalculate sizes etc.
Benefits of using EVE
- Updating dialogs by adding and removing widgets is made easier because the layout of all widgets is adjusted for you.
- Where text is different sizes on different operating systems you don’t have to worry about calculating extra whitespace.
- English dialogs can be smaller because you don’t need to leave room for anticipated localised text, so your dialogs look good in all languages.
- EVE automatically resizes text, buttons, checkboxes, radio buttons and drop-down lists so you needn’t worry about text being clipped.
A quick introduction to EVE
In order to use EVE widgets in your dialog definitions you’ll need to add an include to your FR file.
#include "EveInfo.fh"
This file is a very useful resource since it lists all of the EVE widgets which are available out of the box, so do have a look inside.
In order to have your dialog use EVE you’ll need to add WidgetEveInfo to its type definition.
type BscDlgDialogBoss(kViewRsrcType) : DialogBoss(ClassID = kBscDlgDialogBoss)
{
WidgetEveInfo;
};
Finally you can change your dialog definition to use EVE by changing it to use EVE widgets and by adding the necessary EVE layout constants to the dialog itself (since you’ve now made the dialog an EVE dialog by adding WidgetEveInfo to its type definition).
Since all dialogs have an OK and Cancel button and some other content, here’s a complete dialog definition that uses EVE to layout an OK and Cancel button.
resource BscDlgDialogBoss (kSDKDefDialogResourceID + index_enUS)
{
__FILE__, __LINE__,
kBscDlgDialogWidgetID, // WidgetID
kPMRsrcID_None, // RsrcID
kBindNone, // Binding
Frame(0,0,388,112) // Frame (l,t,r,b)
kTrue, kTrue, // Visible, Enabled
kBscDlgDialogTitleKey, // Dialog name
{
// Add dialog content here (like EVEStaticTextWidget..)
EVEGenericPanelWidget
(
kInvalidWidgetID, // WidgetId
0 // RsrcId
0,
kBindNone, // Frame binding
Frame(0,0,0,0) // Frame is 0 for auto-sizing
kTrue, // Visible
kTrue, // Enabled
kEVEAlignLeft | kEVELargeSpaceAfter | kEVEArrangeChildrenInColumn,
{
EVEDefaultButtonWidget
(
kOKButtonWidgetID, // WidgetID
kSysButtonPMRsrcId, // RsrcID
kBindNone, // Binding
Frame(0,0,0,0) // Frame (l,t,r,b)
kTrue, kTrue, // Visible, Enabled
kSDKDefOKButtonApplicationKey, // Button text
kEVELargeSpaceAfter,
),
EVECancelButtonWidget
(
kCancelButton_WidgetID, // WidgetID
kSysButtonPMRsrcId, // RsrcID
kBindNone, // Binding
Frame(0,0,0,0) // Frame (l,t,r,b)
kTrue, kTrue, // Visible, Enabled
kSDKDefCancelButtonApplicationKey, // Button name
kTrue, // Change to Reset on option-click.
kEVELargeSpaceAfter,
),
} // End of EVE Generic panel child widgets
), // End of EVE Generic panel widget definition
},
kEVEArrangeChildrenInRow | kEVESmallMargin,
};
If you are familiar with InDesign plug-in development you’ll notice that the general format of the dialog definition is the same as usual except for some EVE layout additions and the use of widget names prefixed with EVE.
How do I convert my existing dialogs to use EVE?
The InDesign plug-in SDK includes an EVEConverter tool which enables you to very quickly EVE-ize your dialog definitions however it’s output is less than optimal. Be aware that the tool will also convert any panel definitions to use EVE so you should keep a backup copy of your original FR file so that you can replace the EVE-ized panel definition with your original non-EVE panel definition. The EVEConverter tool is a great first step to get a feel for EVE and how to use it.
Once you are better acquainted with EVE it becomes easier to hand craft your conversions or do some of them by hand. It all depends on how complex your dialogs are and if you are using any custom widgets. As a rule of thumb you might use the EVE converter first, then go over the output by hand to remove any excess spacer widgets or superfluous generic panel definitions.
The plug-in SDK also includes a porting guide which includes a chapter on using EVE. You can obtain the plug-in SDK from here http://www.adobe.com/devnet/indesign/sdk.html.
