[WD23] DnD from Table to TreeViewTable August 27, 2020 12:03PM |
Registered: 5 years ago Posts: 121 |
Argus
Re: [WD23] DnD from Table to TreeViewTable August 27, 2020 09:59PM |
Re: [WD23] DnD from Table to TreeViewTable August 28, 2020 01:12PM |
Registered: 5 years ago Posts: 121 |
PROCEDURE TVTDrop() //See also: TVT, TableDrag, TVTRollover() DnDAccept(dndMove) sSourceLine is string //Contents of the row selected in the source table nLandingRow is int //Landing/target row for the dropping nPosXTVT is int nPosYTVT is int nCorrection is int nCurPos is int //Cursor position // Coordinates of the table nPosXTVT = {_DND.TargetControl,indControl}..X nPosYTVT = {_DND.TargetControl,indControl}..Y // To find out the number of the landing row, // we need to know the position of the cursor: nCurPos = CursorPos(cpClient) IF nCurPos = -1 THEN ReturnToCapture() //Target was outside the limits //Retrieve the source row that is being moved. //In the WD sample the first element corresponds to the number of the row to move. //Here the 1st item of sSourceLine contains the email's Id (SPOSTI.SPID): sSourceLine = DnDGetData(CF_TEXT) //Find the landing row's number. //The correction value (28 here, 24 in sample) was found by trial //and error; do not change it or the height of the TVT header row: nCorrection = 28 //Adjustment for the height of the header row. nLandingRow = TableInfoXY({_DND.TargetControl,indControl},... tiLineNumber,... LoWord(nCurPos)-nPosXTVT,... HiWord(nCurPos)-nPosYTVT-nCorrection) TVT.SelectPlus(nLandingRow) //Then do what you want with the data in the source and landing rows...
Argus
Re: [WD23] DnD from Table to TreeViewTable September 01, 2020 11:20PM |
Re: [WD23] DnD from Table to TreeViewTable September 02, 2020 12:33PM |
Registered: 5 years ago Posts: 121 |
//Alternative 2 (new) - No luck: first gives a random row //(= two rows below the previously selected, original row), //then the last selected row, but never the row over which the left mouse button was released: nLandingRow = TableInfoXY({_DND.TargetControl,indControl},tiLineNumber,nPosX,nPosY) //nLandingRow = TableInfoXY(TVT,tiLineNumber,nPosX,nPosY) //Also a direct reference doesn't work.