client area, scroll bars, and wxEVT_MOUSE_LEAVE

25 views
Skip to first unread message

wsu

unread,
Nov 15, 2025, 2:19:27 AM (6 days ago) Nov 15
to wx-dev
Does the client area include the space occupied by scroll bars, or not?

According to https://docs.wxwidgets.org/latest/classwx_mouse_event.html, wxEVT_MOUSE_LEAVE reports when the mouse exits the client area.  At least in wxMSW, I only get  wxEVT_MOUSE_LEAVE when the mouse goes past the scroll bars.  That suggests the scroll bars are part of the client area.

On the other hand, https://docs.wxwidgets.org/latest/overview_windowsizing.html says the client size is the area in which EVT_PAINT can draw, and I don't think EVT_PAINT can draw over scroll bars.

Also, comparing GetRect() and GetClientRect() seems to show that scroll bars are not part of GetClientRect().

So is there a bug in generating (wxMSW) wxEVT_MOUSE_LEAVE?

Vadim Zeitlin

unread,
Nov 15, 2025, 7:46:09 AM (6 days ago) Nov 15
to wx-...@googlegroups.com
On Fri, 14 Nov 2025 23:19:26 -0800 (PST) 'wsu' via wx-dev wrote:

w> Does the client area include the space occupied by scroll bars, or not?

No, the client area is the, by definition, the area available for the use
by the application.

w> According to https://docs.wxwidgets.org/latest/classwx_mouse_event.html,
w> wxEVT_MOUSE_LEAVE reports when the mouse exits the client area.

This seems wrong, it should says "exits the window".

w> So is there a bug in generating (wxMSW) wxEVT_MOUSE_LEAVE?

I don't think it's a bug (in the code) because this is how the
corresponding Windows message works and I'm almost sure that it's the same
for the other platforms, so it's a documentation bug instead. I'll fix it.

Regards,
VZ
Reply all
Reply to author
Forward
0 new messages