dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[DotGNU]Mouse question


From: Brian Luft
Subject: [DotGNU]Mouse question
Date: Tue, 2 Sep 2003 01:10:04 -0500

Hey all,

I've been writing the ListBox control.  Have a few questions:

1. I wrote a function to return the width of the three border styles. Since this can vary between themes, I put this into IThemePainter/DefaultThemePainter. Is this the best place for this?

2. I want to support the case when the user is selecting list items by clicking and dragging, and then drags the mouse above or below the list box. This should make the listbox scroll in that direction, and select the items on the way. I've been using OnMouseMove for dragging inside the control, but I don't know how to get mouse move messages when the cursor is outside the control.

It was mentioned that XSharp gets mouse messages for the root window. I don't want to use XSharp directly though, because then my control won't port to other platforms. Furthermore, I don't think that will work on OSX -- Apple X11 is rootless. And on Windows, there's no way to get global mouse events without installing a system hook, which is bad news. I looked around a bit and Microsoft suggests <http://www.microsoft.com/msj/1098/c/c1098.aspx> using a timer to poll for the mouse position -- ack!

I'm thinking that using a timer when the mouse leaves my control is the only way to do this. Does anybody have a better idea, I hope? :) Also, would this code be better in the toolkit class? Then we could use the actual root window messages on XSharp, and use the timer on Win32, etc. Thoughts?

Thanks.  Brian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]