drag drop oSay

drag drop oSay

Postby Otto » Mon Nov 05, 2007 9:32 pm

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: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Postby Otto » Tue Nov 06, 2007 9:10 am

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

if ::lDrag
??? SendMessage()

Could this be?

Regards,
Otto
User avatar
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Tue Nov 06, 2007 9:19 am

Otto,

Please add this in your PRG:

oSay:lWantClick = .T.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41314
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Otto » Tue Nov 06, 2007 10:44 am

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
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Tue Nov 06, 2007 10:56 am

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

Postby Otto » Tue Nov 06, 2007 11:05 am

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
Otto
 
Posts: 6005
Joined: Fri Oct 07, 2005 7:07 pm

Postby Antonio Linares » Tue Nov 06, 2007 11:17 am

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

Postby Otto » Tue Nov 06, 2007 11:29 am

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 89 guests

cron