ADD_GRAPHICS_ICON@

Platform

Win32, x64

Purpose

To place a movable icon or bitmap in a %gr graphics region.

Syntax

 INTEGER(7) FUNCTION ADD_GRAPHICS_ICON@(NAME, X, Y,
+   WIDTH, DEPTH)
 CHARACTER(*) NAME
 INTEGER X, Y, WIDTH, DEPTH

Description

A %gr (Graphics Region) graphics region may have an icon resource 'attached' to it. The icon can be moved freely around the graphics window with the mouse. Control of the icon is maintained by the call-back function attached to the %gr window with the caret modifier (^).

The NAME argument is that used for the resource that is included in your program. If the image is directly imported from a file then set NAME to the file name enclosed in curly backets. The X and Y values, initially hold the location the image is draw to. They also hold the new position when the image is moved. The CLEARWIN_INFO@ parameter 'DRAGGED_ICON' is set to the value of the handle of the moved icon. The handle is initially obtained as the returned from the function. The call-back function may modify the X and Y values if required. The purpose of this may be to 'lock' the image onto the horizontal or vertical plane by continuously setting either the X or Y variables to a constant value.

When the icon is dropped CLEARWIN_INFO@ parameter 'DROPPED_ICON' is set to the handle of the icon. A graphics icon can be removed with a call to REMOVE_GRAPHICS_ICON@.

The width and height parameters should be set at zero except when the icon image occupies less than the possible 32x32 icon area e.g. 16x16. A small icon can be constructed by starting at the top-left corner and filling the remaining unused area with the 'transparent' colour. If you do not specify the correct size of the icon then the unused area will be detected by the mouse.

Return value

Returns a non-zero value for success or zero for failure.

See also

REMOVE_GRAPHICS_ICON@, %gr Graphics icons

 

 

Basket
Empty
 
Copyright © 1999-2024 Silverfrost Limited