Page 1 of 1

drag drop oSay

Posted: Mon Nov 05, 2007 9:32 pm
by Otto
Could someone show me what I am doing wrong that oSay drag doesn’t fire a oWnd:bDropOver?

// FiveWin - own Drag&Drop new features !!!

#include "FiveWin.ch"

static oWnd

//----------------------------------------------------------------------------//

function Main()

local oSay, oCrs, oIco1, oIco2, oIco3

DEFINE CURSOR oCrs DRAG

DEFINE WINDOW oWnd TITLE "FiveWin own Drag&Drop features"

oWnd:bDropOver = { || MsgStop( "Hey, don't litter here !!!" ) }

@ 4, 5 ICON oIco1 FILENAME "..\icons\Recycle2.ico" OF oWnd
@ 8, 15 SAY oSay PROMPT "Test" COLORS nRGB( 255, 0, 0 ) , nRGB( 55, 55, 255) of Ownd

oSay:lDrag = .t.
oSay:oDragCursor = oCrs

oIco1:oDragCursor = oCrs


ACTIVATE WINDOW oWnd

return nil

Posted: Tue Nov 06, 2007 9:10 am
by Otto
I think there is SendMessage missing in the
METHOD LButtonUp CLASS TControl
if lDragging
...

if ::lDrag
??? SendMessage()

Could this be?

Regards,
Otto

Posted: Tue Nov 06, 2007 9:19 am
by Antonio Linares
Otto,

Please add this in your PRG:

oSay:lWantClick = .T.

Posted: Tue Nov 06, 2007 10:44 am
by Otto
Does not help:

Please could you check the LButtonUp method.
If you are in drag modus ::lDrag is true and in the
if ::lDrag
endif
there is no sendmessage.
Regards,
Otto

Posted: Tue Nov 06, 2007 10:56 am
by Antonio Linares
Otto,

The SAYs don't react to the mouse. Its a standard Windows behavior.

You have to modify Class TSay Method HandleEvent()

Posted: Tue Nov 06, 2007 11:05 am
by Otto
Hello Antonio,
I don't understand this.
I thought if you inherit you have the methods of the parent object.
Is this wrong?
Regards,
Otto

Posted: Tue Nov 06, 2007 11:17 am
by Antonio Linares
Otto,

You are right. But as I have commented you, a SAY control will not receive mouse events. You can test this modifying method HandleEvent(), or consider to use another control, not a SAY.

Posted: Tue Nov 06, 2007 11:29 am
by Otto
Hello Antonio,

I think it is the same with the other controls.

What is the problem if I change
return 0 to

return Super:LButtonUp( nRow, nCol, nKeyFlags )

in the LButtonUp method.

Then it is working. Do we face other problems.
Regards,
Otto