Futurebasic/Language/Reference/picture field

Revised
February, 2002 (Release 6)

Description
Use this statement to create a new picture field in the current output window, or to modify the characteristics of an existing picture field. A picture field displays a picture which is automatically refreshed when necessary, and which can optionally respond to mouse clicks.

There are important differences in how picture fields are handled in the older Standard BASIC versus the newer Appearance Runtime. In Standard BASIC, picture fields were actually edit fields that had a destination rectangle with no height. (The top of the destination rectangle was equal to the bottom.) The contents of those edit fields consisted of data that told FB what to display. For instance, if the contents were. " " then FB knew to display a resource picture with an ID of 1001.

Appearance picture fields are buttons and as such inherit the full power of the Appearance Manager's ability to display and manage them properly. There is, however, a difference between a picture field and a picture button. A picture field is fully managed as a user pane (a special type of button) by the Appearance Runtime.In other words, FB tells the toolbox that it should call back into the runtime for the details of managing the picture. A picture button is a standard CDEF (control definition) that is managed by the Appearance Manager. Both are buttons. But PICTURE FIELDs are generally display items where APPEARANCE BUTTONs that employ pictures are generally action items.

Appearance Manager picture fields abandon the more obscure framing conventions that were available in the Standard BASIC runtime. For instance, frame types such as,  , and   are no longer available.

The parameters are interpreted as follows.

This is the ID number of the picture field. To create a new picture field, specify a value which is different from the ID of any existing picture field, and any existing edit field, in the current window. When you're creating a new picture field, the  and   parameters are also required. To modify an existing picture field, specify the ID number of the existing field, and any other parameters that you want to modify; any parameter that you omit won't have its corresponding characteristic changed.

This parameter specifies the picture to display in the picture field. You can specify it in any of the following forms:

 —The name of a PICT resource in a currently open resource file.

—A "%" symbol followed by the resource ID number of a PICT resource in a currently open resource file.

—An "&amp;" symbol followed by a picture handle.



If you use a  resource, it's best to use one that's purgeable so that the memory it occupies will be properly released (this memory is not automatically released when the picture field is closed). Don't close the resource file containing the picture until after you close the picture field or you put a different picture into the field. If you use a picture handle, make sure you do not release its memory (don't call ) until after you close the picture field or you put a different picture into the field.

This parameter specifies the rectangle in which the picture will appear; no part of the picture will be drawn outside of this rectangle. You can specify it in either of the following forms:

 —These coordinates specify two diagonally opposite corners of the rectangle.

—A pointer or long integer expression. This is interpreted as the address of a standard 8-byte RECT structure.



This is an integer which specifies several characteristics about the field.

"Clickable" types. Picture fields of these types will generate an  Dialog event (Standard BASIC) when the user clicks in them.



"Non-clickable" types. Picture fields of these types will not generate any Dialog event when the user clicks in them.



You can also add any combination of the following constants to the  parameter to achieve different effects in appearance:

"Images Were Here.

Note
To remove a picture field from the window, use the  statement.

When you create, modify or click on a "clickable" picture field, all edit fields in the current window become inactive, and the picture field becomes "active." When a picture field is "active," you can retrieve various kinds of information about it using the function.