Rx Box Procedures

RX Library

UNIT BoxProcs

Routine
BoxDragOver
Routine
BoxMoveAllItems
Routine
BoxMoveFocusedItem
Routine
BoxMoveFocusedItem

This is the low level code to manipulate the dual dialog box.


Routine BoxDragOver
Declaration: procedure BoxDragOver(List: TCustomListBox; Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean; Sorted: Boolean);

This is Intended to be used in the OnDragOver event handlers.

BoxDragOver example:
procedure TMyForm.MyListDragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);
begin
__BoxDragOver(MyList, Source, X, Y, State, Accept, MyList.Sorted);
__if State = dsDragLeave then
____(Source as TListBox).DragCursor := crDrag;
__if (State = dsDragEnter) and ((Source as TListBox).SelCount > 1) then
____(Source as TListBox).DragCursor := crMultiDrag;
end;


Routine BoxMoveAllItems
Declaration: procedure BoxMoveAllItems(SrcList, DstList: TCustomListBox);

Copies all items from SrcList to the DstList and then clears the SrcList.

BoxMoveAllItems example:
BoxMoveAllItems(DstList, SrcList);


Routine BoxMoveFocusedItem
Declaration: procedure BoxMoveFocusedItem(List: TCustomListBox; DstIndex: Integer);

Indended to be used in the OnDragDrop event handlers.

BoxMoveFocusedItem example:
procedure TMyForm.SrcListDragDrop(Sender, Source: TObject; X, Y: Integer);
begin
__if Source = DstList then
____ExclBtnClick(SrcList)
__else
____if Source = SrcList then
____begin
______BoxMoveFocusedItem(SrcList, SrcList.ItemAtPos(Point(X, Y), True));
____end;
end;


Routine BoxMoveSelectedItems
Declaration: procedure BoxMoveSelectedItems(SrcList, DstList: TCustomListBox);

Moves all selected items from the SrcList to the DstList.

BoxMoveSelectedItems example:
procedure TMyForm.IncBtnClick(Sender: TObject);
begin
__BoxMoveSelectedItems(SrcList, DstList);
end;


Index Page | About | Download
Creation Date: 4 Feb 1998 | Last Update: 16 Mar 2000