Listbox DragDrop Sample : how multiselect ?

Listbox DragDrop Sample : how multiselect ?

Postby Jimmy » Mon May 01, 2023 6:55 pm

hi,

i can use this CODE to Dragdropg "single" Item from Listbox to "other" Listbox()
Code: Select all  Expand view
         @ 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: Select all  Expand view
   oList_Left:Add( uDropInfo ), oList_Right:del() }

   oList_Right:Add( uDropInfo ), oList_Left:del() }

it try to use
Code: Select all  Expand view
  SelectLeftThis()

STATIC PROCEDURE SelectLeftThis()
LOCAL aSelect := oList_Left:GetSelItems()

but it does not as expect. how can help :?:
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1732
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 87 guests