FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Listbox DragDrop Sample : how multiselect ?
Posts: 1772
Joined: Thu Sep 05, 2019 05:32 AM
Listbox DragDrop Sample : how multiselect ?
Posted: Mon May 01, 2023 06:55 PM
hi,

i can use this CODE to Dragdropg "single" Item from Listbox to "other" Listbox()
Code (fw): Select all Collapse
         @ 20, 10 LISTBOX oList_Left VAR ccLeft ;
                 ITEMS {} ;
                 SIZE 200, 280 PIXEL ;
                 FONT oFontDefault COLOR BFcolor, BGcolor ;
                 ON DBLCLICK Nil ;
                 MULTISEL

         // Set a DropOver action for the ListBox
         oList_Left:bDropOver = { | uDropInfo, nRow, nCol, nKeyFlags | ;
               oList_Left:Add( uDropInfo ), oList_Right:del() }

         oList_Left:oDragCursor = oCursor                             // Select a Drag cursor
         oList_Left:bDragBegin = { | nRow, nCol, nKeyFlags | ;
                         SetDropInfo( oList_Left:getSelText() ), ;       // Save drop info !!!
                         oPickList:SetMsg( "Dragging..." ) }

         @ 20, 320 LISTBOX oList_Right VAR ccRight ;
                 ITEMS {} ;
                 SIZE 200, 280 PIXEL ;
                 FONT oFontDefault COLOR BFcolor, BGcolor ;
                 ON DBLCLICK Nil ;
                 MULTISEL

         // Set a DropOver action for the ListBox
         oList_Right:bDropOver = { | uDropInfo, nRow, nCol, nKeyFlags | ;
               oList_Right:Add( uDropInfo ), oList_Left:del() }

         oList_Right:oDragCursor = oCursor                            // Select a Drag cursor
         oList_Right:bDragBegin = { | nRow, nCol, nKeyFlags | ;
                           SetDropInfo( oList_Right:getSelText() ), ;     // Save drop info !!!
                           oPickList:SetMsg( "Dragging..." ) }
now i like to modify these Lines for "multi" Item
Code (fw): Select all Collapse
    oList_Left:Add( uDropInfo ), oList_Right:del() }

   oList_Right:Add( uDropInfo ), oList_Left:del() }
it try to use
Code (fw): Select all Collapse
   SelectLeftThis()

STATIC PROCEDURE SelectLeftThis()
LOCAL aSelect := oList_Left:GetSelItems()
but it does not as expect. how can help :?:
greeting,

Jimmy

Continue the discussion