All too often the dialog generated by the Geospatial Administrator isn't visually appealing. This article will explore a few simple settings you can adjust to change that. The dialog we'll be using is shown as follows and is unmodified. At the bottom of this article is a link to download the schema for your learning purposes.
As you may be aware, inserting feature metadata creates Operations and Methods. The definitions and parameters for the dialogs can be found in the Dialogs node where:
Form View – A window or screen that contains the property labels and associated fields for data entry.
You can think of a form view as a container for other dialog items.
Expanding the Place Parcel dialog and reviewing the stdDlgItem settings, you’ll notice values for the Width, Height, Max Width and Max height. As well, there are values for the X and Y which are set to 0.
These values are expressed in Dialog Units which are based on the default system font, DPI and screen resolution. Additional information regarding dialog units can be found here: https://docs.microsoft.com/en-us/windows/win32/uxguide/vis-fonts.
For the non-programmer, you can simply adjust the values up or down by a factor of 1 to see the impact on position and size. This method allows you to quickly guess what values to use to refine dialog and item sizes.
On the authors workstation, the following represents 1 unit in height and 1 unit in width.
The following environment variables can be used to override the defaults used for the layout of dialog items:
MS_GEOXFM_DIALOG_LINEHEIGHT - By default the LINEHEIGHT is calculated as 1.5 x Current Font Height. Typically, around 15.
MS_GEOXFM_DIALOG_INNERLINESPACING - By default the INNERLINESPACING is calculated as Current Font Height/4. Typically, around 2.
MS_GEOXFM_DIALOG_UNITWIDTH - By default the UNITWIDTH is calculated as the Current Font's Maximum Character Width. Typically, around 11.
MS_GEOXFM_DIALOG_FONTNAME - By default the FONTNAME is MicroStation’s default font. For example, this can be set to "MS Arial Unicode."
MS_GEOXFM_DIALOG_FONT_POINT_SIZE - By default the FONT_POINT_SIZE is used with the FONTNAME to generate the font to be used in dialogs.
A couple of definitions you should be aware of are:
itemSpec - Defines data used to create a dialog item for properties.
stdDlgItem – Built-in dialog items such as label, separator line, OK button, cancel button, feature item, operation item, form view, group box, enable toggle, clear all button and clear button.
Increase the height size of the form view to accommodate all dialog items
Expanding the Place Parcel dialog will reveal the size of the FormView which is a stdDlgItem. Its Width is set to 42 and Height is set to 9. While the width is fine, it’s not tall enough to show all properties without scrolling vertically.
Max Height - When the attribute height is zero the height of the form view will be calculated to a maximum of this attribute.
Max Width - When the attribute width is zero the width of the form view will be calculated to a maximum of this attribute.
Adjusting the Height to 11 appears to accommodate all properties nicely:
Another easy way to improve the appearance of your dialogs, is to adjust the width of the dialog items. In this example, the author prefers that all fields are of a similar length. Let’s start by simply adjusting the width of all properties to 12. This is done in the Dialog Items panel of the Form View dialog.
Saving, exporting and testing the results shows some improvement:
While most of the property fields were adjusted, the ComboProps were not. To correct this, simply turn off Calculate List Width in the ComboBox Property page:
With these small changes, the dialog is looking quite nice, although now it’s too wide.
By adjusting the Form View width from 42 to 22, the dialog width is corrected.
Re-order dialog items
In some cases, you may want to re-order the dialog items. For example, move the RichTextProp so that it’s the second item in the dialog. To do this, you may be inclined to edit the feature definition and the property order. While that would certainly achieve what you want, it's far easier to simply move the dialogItems in the dialog itself. For example, delete the existing row by selecting Delete Row(s) from the right click menu.
Then select the second dialogItem row and choose Insert > Feature Item. In the Item Detail pane, set the Feature Alias to the feature and press Apply. You’ll also need to re-define the width if that was changed.
The modified dialog is now nice and compact, with the properties in a customized order, and each field is of a uniform width:
Additional settings and definitions
Resizeable - If true the dialog will be resizable.
Max Height - Restricts the maximum height of a resizable dialog to this number of pixels.
Min Height - Restricts the minimum height of a resizable dialog to this number of pixels.
Max Width - Restricts the maximum width of a resizable dialog to this number of pixels.
Min Width - Restricts the minimum width of a resizable dialog to this number of pixels.
Ignore Enter Key - When this attribute is true the ENTER key works like the TAB key.
Search Key - By default the dialog can be found by the dialog Title attribute.
Use Criteria - Specifies if this itemlist should be used.
Operation - Operation name used to search the operations cache for the property.
Alias - If operation name is empty, then alias name is used to search the global feature list to find the feature object containing the property.
Property - The property name of property that will be set.
Anchor - The anchor attribute defines what distance to keep constant when a dialog is resized.
Layout - The layout attribute defines the origin of the x and y attributes. By default, the x and y are offsets from the topLeft of the dialog. By using this attribute, the origin for the x and y offsets can be changed. When the layout attribute is bottom the y value is positive and so the dialog will increase in size.
Layout Type - This gives the ability to place items on a dialog relative to the placement of the previous dialog item. By default, the layout attribute's origin is on the dialog. When this attribute is last Item then the layout attribute's origin is on the previous dialog item. For example, when this attribute is lastItem and layout is TopRight then an x=1 and a y=0 would place this item at the same height as the last item and over by 1 from the last item.
Don’t Shift - Normally if any dialog items are located off the dialog all dialog items are shifted over, when this attribute is true then this dialog item would not be shifted over.
x - Optional x location of the item excluding the label. If the value is zero or the attribute does not exist, then all dialog items will shift over by the same amount so that all items and their labels are visible.
y - Optional y location of the item. If the value is zero or does not exist, then each item will start below the last placed item.
Attached are the sample schemas used for this article.