MouseEnter/Exit and Canvas Control Paint events

Hi Folks,

We’ve just received reports (and duplicated) a situation where all of the Canvasses on a Window are having their Paint events act as if the mouse pointer is hovering over all of them if the pointer is over any of them when the window containing the canvasses is initially drawn.

These are not a control array and their MouseEnter/Exit code sets or clears a Hover boolean and the calls a refresh on itself. I was using Me.Refresh, but changed it to the actual control name for each to see if that sorts it. The result is the same - all three repaint even though the mouse is only hovering over one of hem when it is shown. I also have to move the mouse over each of the canvasses to return them to their normal state and operation.

If the mouse pointer is not over any of the canvasses on launch, everything displays as expected with only the button involved in the mouse motion reacting and painting.

If it matters - the canvasses in question are wrapped in another canvas and that canvas is on a page of a PagePanel.

This occurs in both debug and built versions under 19r1.1 and 19r3.2.

Ideas?

does swapping refresh for invalidate make any difference ?

uh did I miss something ?

[quote=478895:@Norman Palardy]does swapping refresh for invalidate make any difference ?

uh did I miss something ?[/quote]

19r3.2  --.1

[quote=478895:@Norman Palardy]does swapping refresh for invalidate make any difference ?
[/quote]
Invalidate just adds a noticeable delay between the window displaying and the canvas highlight effect drawing, but the result is the same.

[quote=478895:@Norman Palardy]uh did I miss something ?
[/quote]
My post is suffering from CoViD 19 and that’s bit-rot.

Does the same thing happen in windows or is it a mac only issue?
Are you able to replicate this in a new demo project?

[quote=478903:@JulianS]Does the same thing happen in windows or is it a mac only issue?
Are you able to replicate this in a new demo project?[/quote]
All three platforms and yes.

I also removed the Refresh/Invalidate call and it still happens.

Here’s the Paint code from each:

If Hover Then g.Forecolor = &cE3FFE390 g.FillRoundRect 0, 0, g.Width, g.Height, 12, 12 Else g.ForeColor = &cFFFFFFFF g.FillRoundRect 0, 0, g.Width, g.Height, 12, 12 End If

I just removed the PagePanel in the demo so the layout hierarchy is - Window -> Wrapper Canvas -> Button Canvasses and everything works as expected with the button canvasses only firing wen the mouse enters or exits.

This must be related to the ever present list of PagePanel/TabPanel display issues.

Worked around then? I’d be interested in seeing that demo project as I’m sure William would in feedback.

For project, I added a new PagePanel and placed it at the bottom of the control stack followed by shifting the original controls to make sure that they were parented properly and now the issue doesn’t occur.

Dynamic and random Bug Injection - my favorite coding paradigm :S