by Paul Mathews >> Wed, 14 Jul 1999 8:33:33 GMT
Would welcome any improvements by Craig, Dean et al on this method
which has implementation of drag and drop reordering of data by users straightforward.
swap(pFrom : MemberType ; pTo : MemberType) updating;
// Date: 01 January 1999
// User: paulm
// Swap to entries in an array with each other.
vars
vFrom : Integer;
vTo : Integer;begin
vFrom := self.indexOf(pFrom);
vTo := self.indexOf(pTo);
if vFrom < vTo then
self.removeAt(vTo);
self.removeAt(vFrom);
self.insert(vFrom,pTo);
self.insert(vTo,pFrom);
else
self.removeAt(vFrom);
self.removeAt(vTo);
self.insert(vTo,pFrom);
self.insert(vFrom,pTo);
endif;
end;
Paul Mathews
pem@cmsystemsgroup.com.au
Phone: [612] (99717384) Fax[612] (99711679)
(Dee Why,Sydney,Australia)
Please visit our homepage cmsystemsgroup.com.au.