drag drop oSay

Post Reply
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

drag drop oSay

Post 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
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post by Otto »

I think there is SendMessage missing in the
METHOD LButtonUp CLASS TControl
if lDragging
...

if ::lDrag
??? SendMessage()

Could this be?

Regards,
Otto
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post by Antonio Linares »

Otto,

Please add this in your PRG:

oSay:lWantClick = .T.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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()
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Post 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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Otto
Posts: 4470
Joined: Fri Oct 07, 2005 7:07 pm
Contact:

Post 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
Post Reply