Hello,
I have a mover container class. It has 4 buttons (Move one, Move All, Remove One, Remove All) and also allows drag-drop.
Move/Remove one calls this code
Remove does the same, but the parameters are switched.
Move All calls
and Remove All does the same in opposite direction.
Here is code in MoveOne method
This is code form MoveAll method
And I have a similar code in drag-drop.
Now, I need to be able to run some custom code when I add items to the right (destination) and then I remove items from it.
I'm not sure how and there to put a call to this method (or different methods) and what parameters (or properties) would I need.
I'd like to hear some ideas.
Thanks in advance.
I have a mover container class. It has 4 buttons (Move one, Move All, Remove One, Remove All) and also allows drag-drop.
Move/Remove one calls this code
Code:
* Move the highlighted entry in the source listbox to the destination listbox.
This.parent.MoveOne(this.Parent.lstSource, this.Parent.lstDestination)
Move All calls
Code:
* Move all entries in the source listbox to the destination listbox.
this.Parent.MoveAll(this.Parent.lstSource, this.Parent.lstDestination)
Here is code in MoveOne method
Code:
LPARAMETERS toFrom AS LISTBOX, toTo AS LISTBOX
LOCAL lcSelect, lnIndex, lnTotItem, llLockScreen
llLockScreen=THISFORM.LOCKSCREEN
THISFORM.LOCKSCREEN=.T.
lnIndex = m.toFrom.LISTINDEX
FOR lnIndex = toFrom.LISTCOUNT TO 1 STEP -1
IF toFrom.SELECTED[lnIndex]
lcSelect = toFrom.LIST[lnIndex,1]
toTo.ADDITEM(lcSelect)
toFrom.REMOVEITEM(lnIndex)
ENDIF
ENDFOR
DO CASE
CASE toTo.LISTCOUNT = 1 AND toTo.SELECTEDID[1] = .F.
toTo.SELECTEDID[1] = .T.
IF UPPER(toTo.NAME) = UPPER("lstDestination")
THIS.RefreshDependents_Destination(toTo.LISTITEM[1])
ELSE
THIS.RefreshDependents_Source(toTo.LISTITEM[1])
ENDIF
CASE toTo.LISTCOUNT = 0
IF UPPER(toTo.NAME) = UPPER("lstDestination")
THIS.ClearDependents_Destination()
ELSE
THIS.ClearDependents_Source()
ENDIF
ENDCASE
THIS.REFRESH()
THISFORM.LOCKSCREEN=llLockScreen
This is code form MoveAll method
Code:
LPARAMETERS toFrom, toTo
LOCAL lcSelect, lnIndex, lnTotItem
lnTotItem = toFrom.LISTCOUNT
FOR lnIndex = 1 TO m.lnTotItem
lcSelect = toFrom.LIST(m.lnIndex,1)
toTo.ADDITEM(m.lcSelect)
NEXT
toFrom.CLEAR()
THIS.REFRESH()
And I have a similar code in drag-drop.
Now, I need to be able to run some custom code when I add items to the right (destination) and then I remove items from it.
I'm not sure how and there to put a call to this method (or different methods) and what parameters (or properties) would I need.
I'd like to hear some ideas.
Thanks in advance.