show_resource()

Purpose

Displays objects dynamically from a resource file

Syntax

void pascal show_resource(int mapnr, int fieldnr,
const * res_name, int flags)

Parameters

int mapnr

Number of map to display image in

 

int fieldnr

Number of field to display image in

 

const char * res_name

Resource or file name

 

int flags

Specifies the position and source of the object to be displayed. You may specify either DEFAULT or a combination of the other flags. Please note that, at least from 4.619 on, format flags set in the control or map field used to display the image over-ride the flags passed by the program.

 

DEFAULT

Display a bitmap from a resource file

 

or a combination of the following and, optionally, SKIP_MISSING_FIELD:

 

SHOW_ICON

Use this option if you wish to display an icon. If this is not specified a bitmap is assumed.

 

SHOW_FOCUS

In 4.5xx Use the focus rectangle position of the field to display the graphic, leaving the field available to display text. In 4.6xx look for a "static" control instead of an edit control with a matching field number,

 

SHOW_APPN

Use this option to specify resources that are part of your program rather than DP4RES.DLL. This option is available in Windows only.

 

SHOW_FILE

Use this option to specify that the name is the name of a file containing a bitmap or icon, and not a resource. If no path is specified the current directory (normally the executables own directory, is asssumed). This option is available from 4.619.

The file must be really be a bitmap (.bmp) or icon file. JPEG,PNGs,GIFs etc cannot be displayed this way (currently).

 

SHOW_STRETCH

Stretches or shrinks a bitmap to fit the control it is shown in. This option is available from 4.619.

Description

This function allows DP4 Windows and DP4 DOS "Windows-like" applications to display icons and bitmaps in a DP4 maps.

The bitmaps or icons to be shown must be declared in a respurce file (unless SHOW_FILE is used). By default DP4 for Windows uses DP4RES.DLL, but in a C application you may use an alternative filename.

If, for example, you wish to use a bitmap named DOG.BMP, you could declare it as follows in your resource file:

DOG BITMAP DOG.BMP

In a QA Build application, set the field type of the field to display the resource to "graphic" and specify the resource name as the field's formula.

Example

show_resource(mapnr, fieldnr, "DOG", DEFAULT);