Hi,

The TListbox didn't have the drag-n-drop properties published.  This
patch fixes that.  I have tested it under Windows.


NOTE:
I dragged an item from one listbox to another listbox. When I display
the Source.Classname in the DragDrop event, I expected a TListBox
type, but got TDragControlObject instead.
I tested this under Dephi, and did receive a TListBox.

procedure TForm1.ListBox1DragDrop(Sender, Source: TObject; X, Y: Integer);
begin
  if Assigned(Source) then
    ShowMessage(Source.ClassName);
end;

I think the solution to this needs to go into TControl.DoDragMsg()
before the case statement.  The Src variable needs to be assigned the
TDragControlObject.Control value, but some checking needs to be done
first (my fist attempt throws an AV in a TTreeView but work in the
TListbox, so reverted my chances for now).

The Delphi code looks like this:
---------------------------------------
...
    S := Source;
    IsDockOp := S is TDragDockObject;
    if DragInternalObject and not IsDockOp then
      S := (S as TDragControlObject).Control;
    with ScreenToClient(Pos) do
      case DragMessage of
        dmDragEnter, dmDragLeave, dmDragMove:
...
---------------------------------------


Regards,
  - Graeme -

Attachment: stdctrls.pp.patch
Description: Binary data

Reply via email to