DRAGITEM


7.8.5, PLBCMP GUI Only

square.png Objects

 

The DRAGITEM instruction turns on or off the capability of repositioning a graphical object or moving an item from one object to another object. When the capability of repositioning a graphical object is on, the user may drag the graphical object to a new spot on the screen. The instruction uses one of the following formats:

 

(1)

[label]

DRAGITEM

{object},{state}

(2)

[label]

DRAGITEM

{object2},DROP[,[{drag-cursor}][,{drop-cursor}]]

 

Where:

label

Optional. A Program Execution Label.

object

Required. A previously defined and created object variable or pointer to an object.

state

Required. The keyword ON or OFF indicating the state of the DRAGITEM feature.

object2

Required. A previously defined and created DIALOG, MENU, or SUBMENU object variable or object pointer.

drag-cursor

Optional. A Numeric Variable, decimal constant, or Expression indicating the resource id value of a drag cursor.

drop-cursor

Optional. A Numeric Variable, decimal constant or Expression indicating the resource id value of a drop cursor.

Flags Affected: NONE

Note the following:

  1. If the ON keyword is specified, the object's {routine} as defined in the ACTIVATE instruction for that object is called every time the object is moved. The object's {routine} is also called with a single click on the right mouse button or a double click with the left or right buttons of the mouse.

  2. The result passed to the {routine} is the new top-left screen coordinates of the object. The bottom four digits describe the new top position and the next four digits describe the new left position. The ninth digit describes which button was used and if a double click occurred. The left button is zero, the right button is one, double click left button is two and double click right button is three.

  3. When an object's DRAGITEM mode is set to ON, the object is disabled and any text on the object will appear gray. This is done to prevent spurious events during a drag operation. Once the mode is restored to OFF, the object is enabled and the text will appear normal.

  4. Normal object processing is restored when the OFF keyword is used.

  5. If the DROP keyword is used, when the user clicks the {object} and while holding the mouse button down drags the object over to another object that has a DROPID defined, the {routine} associated with {object} receives the DROPID value of the receiving object. If {object} is a DATALIST, the result field has a five (5) in the ninth digit position. This allows the {routine} to get a selected DATALIST item for the drag/drop operation.

  6. {drag-cursor} and {drop-cursor} are optional parameters that specify resource id values for a drag cursor and drop cursor respectively. This allows the definition of cursors from a resource Dynamic Link Library (DLL), one of the Window's cursor resource ids, or one of the reserved values below that are defined in the runtime:

  7.  

    Value

    Cursor

    1

    Bold Cross

    2

    Hand

    3

    Arrow over Page

    4

    Arrow not over Page

 

  1. An object must be CREATEd before being using DRAGITEM. If this is not done, a runtime error of O105 is generated.

  2. If insufficient memory is available to perform the operation, a runtime error of O106 is generated.

  3. The LISTVIEW object allows end user actions when the MULTISELECT property is ON. This allows use of the control key when selecting multiple rows while the DRAGITEM mode is on.

  4. A mouse down or mouse up event is now generated for the left and right mouse events for a LISTVIEW object when the DRAGITEM DROP mode is active.

  5. A right mouse action now selects a LISTVIEW line item when the DRAGITEM DROP mode is active.

  6. A right mouse click event is generated by an immediate mouse down and mouse up action without moving the mouse between the mouse down and the mouse up actions.

  7. This instruction is not supported by the PLB Web Server,

 

 

re Also: Example Code, Object Instructions

 



PL/B Language Reference DISABLEITEM ENABLEITEM