Annotations

If setting of certain options is required, then this must of course be done before calling the Designer.

Normally the user is asked (by a file selection dialog) which file he would like to process. Let's assume in our example that a label is to be processed:

It is important that the buffer receiving the filename is pre-initialized - either to an empty string (""), or to a file name suggestion (which also sets the path!):

TCHAR aczProjectFile [_MAX_PATH];
_tcscpy(aczProjectFile,"c:\\mylabel.lbl");
LlSelectFileDlgTitle(hJob, hWindow, "Choose label", LL_PROJECT_LABEL,
       aczProjectFile, _MAX_PATH, NULL);

Of course this can also be done with an individual dialog box, or a file name can be passed to the Designer directly if the user should not be given the option of choosing.

List & Label must be informed of the possible variables in order to make them available to the user during design time or print time. Otherwise, the user could only use fixed text in the object definitions.

First of all, the variable buffer is cleared (in case variables have been previously defined. The call is also recommended to make sure that the variable buffer is empty, and no variables remain from the previous print job that might be meaningless in this next task):

LlDefineVariableStart(hJob);

Now the variables can be declared in various ways. If the Designer knows sample data for a variable, then these are used instead of the variable name in the preview window in order to guarantee a more realistic preview display.

LlDefineVariable(hJob, "forename", "George")
LlDefineVariable(hJob, "lastname", "Smith");

And so the expression
          'forename +" "+lastname'
is transformed to
          'George Smith'

If list objects are also required - in a 'report' or list project (LL_PROJECT_LIST) - then the programmer must also make the necessary fields available. This is done analogously to the above (barcode fields and drawings are also possible table columns), except that the function names contain "Field" instead of "Variable":

LlDefineFieldStart(hJob);
LlDefineField(hJob, "book");
LlDefineField(hJob, "ISBN");
LlDefineFieldExt(hJob, "ISBN", "40|15589|97531", LL_BARCODE_EAN13, NULL);
LlDefineFieldExt(hJob, "photo", "c:\\dwg\\test.bmp", LL_DRAWING, NULL);

Before calling LlDefineLayout(), menu items can be deleted by LlDesignerProhibitAction() or blocked so that the Designer cannot be minimized. The latter can be done by calling:

LlDesignerProhibitAction(hJob, LL_SYSCOMMAND_MINIMIZE);

Now everything has been defined sufficiently for the user to edit his project and the Designer can be started:

LlDefineLayout(hJob, hWindow, "test title", LL_PROJECT_LABEL, "test.lbl");

For a list, change the constant to LL_PROJECT_LIST, or for a file card project to LL_­PRO­JECT_­CARD.

Please note that in the Designer you will generally see the data of only one record (multiple times) in the Designer. It is possible to provide a real data preview in the designer. See chapter Direct Print and Export From the Designer for further information.

Checking for error codes is generally recommended.