GithubHelp home page GithubHelp logo

Comments (16)

MicrotronX avatar MicrotronX commented on May 18, 2024 1

Here's some code:

onMouseDown of my cxGridView:
`myFileDropSource.Files.Clear; // = tEmptyDropSource where a tvirtualdataformatadapter is connected
TVirtualFileStreamDataFormat(myVirtualDataformatAdapter.DataFormat).FileNames.Clear;
TVirtualFileStreamDataFormat(myVirtualDataformatAdapter.DataFormat).FileNames.add(vdatei); // add some virtual filenames
// manage also a internal list with these filenames, which will be created at myEmptyDropSourceGetData..

// Start the drag operation.
myEmptyDropSource.Execute();`

On the other side, at the form2 i have a tDropComboTarget where the onDrop event is never gets called after your change.

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024 1

can you check the new sources again please

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024 1

you find my email on my github profile

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024

do you have a sample application please?

i changed it, because it produces a memory leak

#41

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

I use this in my big project so no small demo but changing it back solved problems on my side, don't know why but now it works

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024

i can't reproduce it without any informations about the code in the involved eventhandler. the best way is, you can provide a little demo.

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

With your latest changes drag&drop within same app from two different forms is working again. So it seems that this bug is solved.

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

Stop. Not solved. Crazy. Within same app it works without problems. If i start the same app twice and try to Drag&Drop from one to the other, sometimes it works, sometimes it does not.

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

And it seems that the last started app can Drag&Drop TO the first started app but the first started can't Drag&drop files TO the last started app.

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024

ok, i will switch back to the origin code

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

And both apps can drag&drop within the same app from different forms without any problems inkluding our own clipboardformat and dataformat. from one app to the other the own clipboard- and dataformat is not available

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024

and the origin code works as expected in both cases?

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

Will try to do the same, two started exe files and drag&drop between them between different forms within the applications. I had not tested this before your update. After your change it started working within same app and different forms ... as i can remember i had no problems from different apps but will try it again.

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

If i drag and drop to second app, than the debugger (second started app) shows that the on getStream of virtualdataadapter is called and it returns the stream without problems but this stream is never received on app where drop is made:

procedure TmxDateianlagen.VirtualDataAdapter_OnGetStream(Sender: TFileContentsStreamOnDemandClipboardFormat; Index: integer; out AStream: IStream);
var
    Stream:tStream;
    vMemStream: TMemoryStream;
    vFileStream: tFileStream;
vmindex:longint;
begin
    // This event handler is called by TFileContentsStreamOnDemandClipboardFormat
    // when the drop target requests data from the drop source (that's us).
    try
        try
            AStream := nil; vMemStream:=tdateianlagen.FastSave2Memorystream(vmindex); // get the stream of file
Stream:=vMemStream;
            if Stream.Position=0 then begin
                Stream.position:=Stream.size;
            end;

            // ...and return the stream back to the target as an IStream. Note that the
            // target is responsible for deleting the stream (via reference counting).
            AStream := TFixedStreamAdapter.Create(Stream, soOwned);
        finally
            setlength(vlist,0);
        end;
    except
        on e:Exception do begin
            bottompanel.caption:=bottompanel.caption+',Ex:'+e.message;
            if assigned(Stream) then Stream.Free;
            raise;
        end;
    end;
end;

from the-drag-and-drop-component-suite-for-delphi.

MicrotronX avatar MicrotronX commented on May 18, 2024

Can i send you a private demo, i have extracted a some functions into a demo but don't want that to be online. It is a demo with two cx-grids. You can drop a file from explorer into both + drag&drop links between them (internal clipboardformat, dataformat). If you start this app again and try to drag&drop from first app grid to second app grid it does not work.

from the-drag-and-drop-component-suite-for-delphi.

landrix avatar landrix commented on May 18, 2024

thank you, i need to modify your demo, i must remove the components, that i don't have

from the-drag-and-drop-component-suite-for-delphi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.