oohg / core

Files needed to build and use OOHG's libraries
https://oohg.github.io
GNU General Public License v2.0
8 stars 11 forks source link

OnMouseMove events and Frame controls #398

Closed fyurisich closed 2 years ago

fyurisich commented 3 years ago

I think i have another bug with onmousemove events. this one is about frames. If add a frame then then onmousemove events are triggered by the parent window onmousemove function. But if I add a tooltip to the frame then the onmousemove is not triggered. Further more I discovered with the use of Spy++ that when no tooltip then WM_MOUSEMOVE is processed by the parent window. But if you have a tooltip then the WM_MOUSEMOVE message is sent to the frame windows handle. I could not find a solution for this.

Thanks Nikos

include "oohg.ch"

PROCEDURE MAIN()

DEFINE WINDOW Form_1 ; obj form_1; AT 0,0 ; WIDTH 800 ; HEIGHT 600 ; TITLE 'MouseMove Events' ; MAIN ; on mousemove form1_mousemove()

@ 0,0 LABEL label2 obj label2 parent form_1 value "asasasasasasasa" autosize

@ 30, 30 FRAME frame1 obj frame1 width 150 height 150 caption "With Tooltip" tooltip "With Tooltip" @ 30, 200 FRAME frame2 obj frame2 width 150 height 150 caption "Without Tooltip"

END WINDOW

CENTER WINDOW Form_1 ACTIVATE WINDOW Form_1

RETURN

function form1_mousemove() local x,y LOCAL obj:=_OOHG_ThisObject x=_OOHG_MouseRow y=_OOHG_MouseCol if !obj:lform x += obj:nRow y += obj:nCol endif label2:Value := obj:name+" : " + "Form - Row " + hb_ntos(x) + " Col " + hb_ntos(y) RETURN

Originally posted by @nchristophi in https://github.com/oohg/core/issues/397#issuecomment-864962244

nchristophi commented 3 years ago

Fernando,

The only fix I could think of is in the code I sent you add this line

frame1:OnMouseMove={|| form1_mousemove()}

after the frame is defined. Then the event is processed as expected.

Thanks Nikos

fyurisich commented 3 years ago

I've uploaded some improvements to FRAME control and a new GROUPBOX control. See some samples at https://github.com/oohg/samples/tree/master/groupbox and https://github.com/oohg/samples/tree/master/frame

fyurisich commented 2 years ago

Fixed. See cf7f1f01a55e753b79fac34a1bb48077218b6b47 87d01dfe79ef25e0ecaea2cf2c966bbaff2edde4