#TEMPLATE (jmDDEdit, 'Drag & Drop editing - Flat Chat Solutions'),FAMILY('ABC') #! #! From Flat Chat Solutions, Australia #! Version 1.0 October, 1999 #! #! This Template creates "Drag & Drop sensitive" regions around the #! Change & Delete buttons of a Browse - upon which Browse records can be #! dropped - invoking the logic behind the target button. #! #! Thanks to Sterling Data Services for making the idea for this template #! available on their web-site at http://www.sterlingdata.com #! #! To use in your own apps: #! 1) Register jmDDEdit.TPL #! 2) From Procedure Properties, click the Extensions button #! 3) Press the Insert button and select the jmDDEdit extension for insertion #! - confirm the controls to be included in Drag & Drop editing #! - that's all there is to it! #! #! #EXTENSION(jmDDedit,'Drag & Drop Change/Delete'), DESCRIPTION('Drag and Drop Change/Delete'), WINDOW #DISPLAY ('') #DISPLAY ('jmDDEdit - From Flat Chat Solutions, Australia') #DISPLAY ('') #DISPLAY (' Thanks to Sterling Data Services for the idea') #DISPLAY (' - see www.sterlingdata.com') #DISPLAY (' and to Topspeed Turnpike for pointing me there') #DISPLAY (' - see www.netins.net/showcase/tomruby/clarion/') #DISPLAY ('') #BOXED('Edit Drag Source:') #DISPLAY ('') #PROMPT('Browse:',FROM(%Control,%ControlType = 'LIST')),%jmDDEditBrowse,DEFAULT('?Browse:2'),REQ #DISPLAY ('') #DISPLAY ('Note: The Browse Drag ID will be set to ''jmDDEditDID''') #ENDBOXED #DISPLAY ('') #BOXED('Edit Drop Targets:') #DISPLAY ('') #PROMPT('Browse Change Button:',FROM(%Control,%ControlType = 'BUTTON')),%jmDDEditChgButton,DEFAULT('?Change:2'),REQ #PROMPT('Browse Delete Button:',FROM(%Control,%ControlType = 'BUTTON')),%jmDDEditDelButton,DEFAULT('?Delete:2'),REQ #ENDBOXED #AT (%WindowManagerMethodCodeSection, 'Init','(),BYTE'),PRIORITY(8010) %jmDDEditBrowse{PROP:DRAGID} = 'jmDDEditDID' ! Set Source DragID %jmDDEditChgButton{PROP:DROPID} = 'jmDDEditDID' ! Set Change Button DropID %jmDDEditDelButton{PROP:DROPID} = 'jmDDEditDID' ! Set Delete Button DropID #ENDAT #AT (%WindowManagerMethodCodeSection, 'TakeFieldEvent','(),BYTE'), PRIORITY(3060) OF %jmDDEditChgButton IF EVENT()=EVENT:Drop POST(EVENT:Accepted,%jmDDEditChgButton) ! Drag/Drop Change . OF %jmDDeditDelButton IF EVENT()=EVENT:Drop POST(EVENT:Accepted,%jmDDEditDelButton) ! Drag/Drop Delete . #ENDAT