Porovnávané verzie

Kľúč

  • Tento riadok sa pridal
  • Riadok je odstránený.
  • Formátovanie sa zmenilo.

OnDrop event


Declaration
Blok kódu
languageesl
themeConfluence
 ENTRY OnDrop(IN INT _refId)
 ; actions
 END OnDrop 
Parameters
Description
Picture  Picture event is generated when a user moves data to the given target graphic object. Within event handling, there it is necessary to get a required data and following them to modify the content of graphic object. First, there must be detected what type of data format was transferred by %IsDragData function and following it to get data in the appropriate format through these functions:To define a position for placing the new data in a target object, use these functions:Based on these data, it is necessary to modify the target graphic object to reflect the executed Drop operation.
Example
Blok kódu
languageesl
themeRDark
 ENTRY OnDrop (IN INT _refID)
 IF %IsDragData(0, _CF_TEXT) THEN
 TEXT _dndText
 ; getting a text
 _dndText := %GetDragDataText(0)
 
 ; finding out a position in the tree
 _tmp := %HI_TVQueryDnDItem(_refId,_node1,_node2)
 
 ; setting a new item in the tree
 CALL AddTreeItem(_refId, _dndText, _node1, _node2)
 ENDIF
 END OnDrop