User Tools

Site Tools


region_declare_a_window_region_control_.htm
Navigation:  Language Reference > 8 - Controls > Control Declarations >====== REGION (declare a window region control) ====== Previous pageReturn to chapter overviewNext page

NewC7.jpg

REGION ,AT( ) [,CURSOR( )] [,USE( )] [,LAYOUT( )] [,DISABLE] [,FILL] [,COLOR( )] [,IMM] [,FULL]

[,SCROLL] [,HIDE] [,DRAGID( )] [,DROPID( )] [,BEVEL( )]

blk2blue.jpg

REGION Defines an area in the WINDOW or TOOLBAR.
AT Specifies the initial size and location of the control (PROP:AT). If omitted, default values are selected by the runtime library.
CURSOR Specifies a mouse cursor to display when the mouse is positioned over the control (PROP:CURSOR). If omitted, the WINDOW's CURSOR attribute is used, else the Windows default cursor is used.
USE A field equate label to reference the control in executable code (PROP:USE).
LAYOUT Specifies the control's left-to-right or right-to-left display orientation (PROP:LAYOUT)
DISABLE Specifies the control is disabled when the WINDOW or APPLICATION is first opened (PROP:DISABLE).
FILL Specifies the red, green, and blue component values that create the fill color for the control (PROP:FILL). If omitted, the region is not filled with color.
COLOR Specifies the border color of the control (PROP:COLOR). If omitted, there is no border.
IMM Specifies control generates an event whenever the mouse is moved in the region (PROP:IMM).
FULL Specifies the control expands to occupy the entire size of the WINDOW for any missing AT attribute width or height parameter (PROP:FULL).
SCROLL Specifies the control scrolls with the window (PROP:SCROLL).
HIDE Specifies the control does not appear when the WINDOW or APPLICATION is first opened (PROP:HIDE). UNHIDE must be used to display it.
DRAGID Specifies the control may serve as a drag host for drag-and-drop actions (PROP:DRAGID).
DROPID Specifies the control may serve as a drop target for drag-and-drop actions (PROP:DROPID).
BEVEL Specifies custom 3-D effect borders (PROP:BEVEL).

The REGION control defines an area on a WINDOW or TOOLBAR (not valid in a REPORT) at the position and size specified by its AT attribute. Generally, tracking the position of the mouse is the reason for defining a REGION. The MOUSEX and MOUSEY procedures can be used to determine the exact position of the mouse when the event occurs. Use of the IMM attribute causes some excess code and speed overhead at runtime, so it should be used only when necessary. This control cannot receive input focus.

A REGION with the DRAGID attribute can serve as a drag-and-drop host, providing information to be moved or copied to another control. A REGION with the DROPID attribute can serve as a drag-and-drop target, receiving information from another control. These attributes work together to specify drag-and-drop “signatures” that define a valid target for the operation. The DRAGID() and DROPID() procedures, along with the SETDROPID procedure, are used to perform the data exchange. Since a REGION can be defined over any other control, you can write drag-and-drop code between any two controls. Simply define REGION controls to handle the required drag-and drop functionality.

Events Generated:

EVENT:Accepted The mouse has been clicked by the user in the region.
EVENT:MouseIn The mouse has entered the region (only with the IMM attribute).
EVENT:MouseOut The mouse has left the region (only with the IMM attribute).
EVENT:MouseMove The mouse has moved within the region (only with the IMM attribute).
EVENT:Dragging The mouse cursor is over a potential drag target (only with the DRAGID attribute).
EVENT:Drag The mouse cursor has been released over a drag target (only with the DRAGID attribute).
EVENT:Drop The mouse cursor has been released over a drag target (only with the DROPID attribute).

Example:

MDIChild WINDOW('Child One'),AT(0,0,320,200),MDI,MAX,HVSCROLL

         REGION,AT(10,100,20,20),USE(?R1),BEVEL(-2,2)

         REGION,AT(100,100,20,20),USE(?R2),CURSOR(CURSOR:Wait)

         REGION,AT(10,200,20,20),USE(?R3),IMM

         REGION,AT(100,200,20,20),USE(?R4),COLOR(COLOR:ACTIVEBORDER)

         REGION,AT(10,300,20,20),USE(?R5),FILL(COLOR:ACTIVEBORDER)

        END

See Also:

PANEL

region_declare_a_window_region_control_.htm.txt · Last modified: 2021/04/15 15:57 (external edit)