[lazarus] Drag and Drop - The Saga Continues
dvortex at netcourrier.com
Fri Apr 7 11:23:10 EDT 2000
I beleive the first way would be "easier" to port to other
interface. tracking the mouse only involve "lcl" code, whereas the second
one is based on the "gtk" way (underlying).
my 2 bits
On Fri, 7 Apr 2000, Shane Miller wrote:
> OK, I want to start this discussion on Drag and Drop before coding it.
> My idea's on how Drag and Drop can be implemented.
> Method 1: By tracking the MouseMOve and MouseDown and MouseUp messages we can implement drag and drop within the LCL. When the Mouse Button is pressed and a move occus we set a global "Dragging" flag along with a "draggingcontrol" flag or something to track within what control the dragging began.
> If the mouse button is lifted and the mouse is within a control other than the "draggingcontrol" control then we know they are attempting to do a drag_drop. This is a very simplified explanation.
> Method 2: Starting with GTK, it is already built into the widgets. So, when dragging begins a signal occus "drag_start" (or something like that). We can set up message methods
> Procedure DragStart(var msg TDragMsg) ; message LM_DRAGSTART;
> Procedure DragStart(var msg TDragMsg) ; message LM_DRAGDROP;
> Procedure DragStart(var msg TDragMsg) ; message LM_DRAGMOVE;
> and track the dragging there. Each widget sset would have to handle the dragging themselves. This would be the easier of the two as long as the widget sets each support certain things like these "drag messages" and such.
> What is everyone's thought? I have implemented it both ways so far. The first is quite a bit more involved but it's similiar to the method used in Delphi. However, that's not needed in this case. By remaining similiar to Delphi in this case gains us nothing so that should not be a deciding factor.
> To unsubscribe: mail lazarus-request at miraclec.com with
> "unsubscribe" as the Subject
> archives at http://www.miraclec.com/list_archives/lazarus
More information about the Lazarus