How to Assign an Image to Display at Runtime in Clarion


Insert the following line of source code in the embed point where the assignment will take place.


?Image{PROP:Text} = FileName


Optionally, you can use the DosFileLookup control template to allow a user to select the graphic image from a standard File Dialog.



DOS File Lookup control template


You can specify the file masks, the default directory and filename, and the variable to receive the filename selected by the end user.

In addition, you may optionally allow the selection of multiple files and specify the code to process each selected file. The template generates a LOOP to process all the selected files.

 

The DOSFileLookup template provides the following prompts:


General

File Dialog Header 

Type the text for the caption of the Windows file dialog.

DOS Filename Variable 

Press the ellipsis (...) button to choose a variable to receive the end user's choice from the File Schematic dialog. You can also type the variable name directly into the entry box.

Default Directory 



Specify the starting directory for the Windows file dialog. If blank, the file dialog opens to the working directory.

Default Filename 



Specify the initial filename for the Windows file dialog. If blank, the file dialog opens with no intial filename.

Return to original directory when done 

Check this box to reset the working directory to its value prior to the file lookup.

Multi-Select? 

Check this box to allow selection of one or more files.

Action For Each Selection





Type a valid Clarion language statement to execute for each selected file--typically a procedure call. You may want to pass the FileName Variable

The template generates a LOOP to execute the code you specify for each selected file. The generated code reloads the FileName Variable with the appropriate filename for each loop cycle.



File Masks


Use a variable file mask

Check this box to supply the file mask with a variable. This enables the Variable Mask Value field to name the variable, and disables the Mask Description, File Mask, and More File Masks prompts.

Mask Variable

Names the variable that contains the file mask. See FILEDIALOG in the Language Reference for information on the contents of this variable.

File Mask Description

Type a file type description. The string appears in the drop-down list in the Windows file dialog. You can add additional masks by pressing the More File Masks button.

File Mask

Type a file mask specification, such as "*.TXT" or use multiple patterns for this mask separating each with a semicolon, such as "*.BMP;*.GIF". You can add additional masks by pressing the More File Masks button.

More File Masks

Press this button to add additional file masks. These masks are available to end the user through the List files of type drop-down list in the Windows file dialog.



Window Update Options


Update entire window?

Check this box to refresh the contents of all window controls after the file selection and processing is complete. Clear the box to select specific fields to refresh.

Update Selected Fields

Press this button to select specific fields to refresh after the file selection and processing is complete.  The template generates a DISPLAY statement for each field you specify.   See DISPLAY in the Language Reference.


Classes Tab

Use the Classes tab to override the global settings for the Class.    See Classes Tab.