## Printer Device Driver

[prev][next][parent][TOC]

### UI Blocks

Each entry is part of a larger structure, the UI_BLOCK structure. Each UI block in the PPD has a matching structure. The end of the UI_BLOCK structure contains a variable-length UI_ENTRY array. This allows the support of a variable number of UI entries.

Each UI_BLOCK contains the following fields:

ofsUIName The offset of the UI block name. In the example above, the UI block name is: PageSize.

ofsUITransString The translation string of the UI block. If no translation string exists, this value is the same as ofsUIName. In the above example, the translation string for the block is: Paper Size.

usOrderDep This contains the numeric value of where the specific UI block is to be located with respect to other UI blocks in the PPD. The UI blocks in the PPD are not necessarily listed in the order that they appear. In the PPD compiler, this value contains the numeric value taken from * OrderDependency. In the example above, usOrderDepen contains the value 20. The lower the number, the higher in priority the UI block appears in the UI list. After all the UI blocks have been parsed, this value contains the zero-based offset of where the specific UI block is listed in respect to the UI list. For example, the first UI block in the list, usOrderDep, is 0, the next UI block contains 1, etc.

uiEntry This is the variable-length array containing UI_ENTRY structures.

usDefaultEntry This contains the uiEntry array number to the default entry.

usNumOfEntries This contains the number of UI_ENTRY structures for a given block.

ucGroupType This contains the value of the type of group where the UI block belongs. The group type is defined by the *OpenGroup/*CloseGroup keywords. This field contains one of the following values:

UIGT_INSTALLABLEOPTION This is used for UI blocks that fall between the * OpenGroup InstallableOption / *CloseGroup InstallableOption keywords. UI blocks that belong to this group are displayed in Printer Properties.

UIGT_DEFAULTOPTION This is the default group type for UI blocks. Blocks that belong to this group are displayed in Job Properties.

usSelectType This identifies whether the current UI block is a single- selection UI, multiple-selection UI, or Boolean UI. This field contains one of the following values:

UI_SELECT_PICKONE The current UI only allows one selection. This is set if PickOne is specified.

UI_SELECTTYPE_PICKMANY The UI allows one or more selections. This value is set if PickMany is set.

UI_SELECT_BOOLEAN The UI allows only one selection from a TRUE/FALSE type of selection. This value is set if Boolean is provided. The selection type of the UI is determined by the string PickOne, string PickMany, or Boolean strings that appear on the same line as *OpenUI. In the example above, the string PickOne sets the value of this field to UI_SELECT_PICKONE.

ucPanelID This identifies where the block string is to be displayed. It contains one of the following values:

UIP_PREDEF_FEATURE This identifies the block as a predefined feature. A predefined feature is a UI block that is displayed in a page other than the Features page. Some examples of predefined features are PageSize and MediaType-these blocks are not displayed in the Features page, but rather in the Forms page. These UI controls are called "predefined UIs," meaning that they have a specific control that handles them and are not to be listed in the Features page. To define your own predefined UI, do the following:

1.The header file PPD2BIN.H contains a global structure called " szPredefined". This lists all the UI strings as predefined UIs. Insert the string for the UI that you wish to list in a page other than the Features page. Order is not important, but case sensitivity is necessary.

2.Change the value of MAX_PREDEFINED to the number of strings in the array .

When the PPD compiler finds a match for the string you defined, the UI block field ucPanelID is modified with the flag UIP_PREDEF_FEATURE. When the Features page lists all the default UI blocks, it queries the UI block to see whether or not UIP_PREDEF_FEATURE exists. If it exists, the block is not inserted.

UIP_OEM_FEATURE This setting means that this UI block is to be displayed in a special page defined for a specific device. In other words, this UI block is not listed in any of the standard dialog pages, but rather in a page for a specific device only.

UIP_OS2_FEATURE This is the default value for UI blocks. At this setting, the UI block is displayed in the Features page.

usUILocation As mentioned before, OrderDependency arranges the UI blocks in the order that they appear in the raw job. However, where the UI block string appears in the raw job is also important. The location where the string is sent is determined by this field. This field may contain one of the following values:

UI_ORDER_ANYSETUP This is the default value. This indicates that the data may be inserted anywhere in the job. For this driver, data with this value is inserted in the document-setup section.

UI_ORDER_JCLSETUP This value accompanies a JCL UI block. This means that the data is inserted at the beginning of the job where the JCL code is inserted.

UI_ORDER_PAGESETUP For this value, the data is inserted at the beginning of a page.

UI_ORDER_DOCSETUP For this value, the data is inserted after the prologue section at the beginning of the job.

UI_ORDER_EXITSERVER