|
|
IntelliMouse support
IntelliMouse is a Microsoft invention that allows you to pan and zoom data in a window using the middle mouse button. The idea saw its light when the new mouse-wheel appeared on Microsoft mouse hardware, and using different combinations of scrolling, clicking and the CTRL and SHIFT keys, one can pan, zoom and scale windows with the middle mouse-button (or mouse-wheel). The IntelliMouse SDK (there is actually an IntelliMouse SDK) defines the following actions:
Scrolling and zooming seems logical actions for the mouse, but "Autoscroll"? These are actually subtle features in various Internet Explorer and Office products. IE lets you move back and forward in the URL history, and Office also defines some neat behaviours in different views.
On some systems the IntelliMouse system may seem to already magically work on all applications you load.
This is because it has the IntelliMouse mouse driver installed. This
driver hooks up all child windows and adds scroll support for many of them,
including the To obtain the "MS Office 97 Logo approval" your application was actually required to support IntelliMouse (I don't think any product have been discarded because of this feature though... or for any missing feature for that matter). This is of course a promotional stunt, but don't be afraid to add cool user-friendly navigation to your own application. Lack of mouse-wheel support is just something that annoys users who are used to work in MS Office products. How to use itThe sample contains a generic class,CIntelliMouseImpl which has
the basic implementation of an IntelliMouse system.
Your software probably requires a different / custom method of scrolling the view,
so re-defining the scrolling mechanism, the way movement is communicated to the
view window or the way the scrolling speed is determined, might be needed.
To do this, you derive from the CIntelliMouseImpl class and implement
your own custom IntelliMouse class where all the scrolling rules are defined.
This will basically just be a simple class where you override the following callback methods:
The base class calls the OnCalculate method to determine the scrolling speed/movement
and the shape of the cursor (arrow points in the direction of the scroll). The remaining
methods are called when one of the IntelliSense actions should be carried out. Internally
these actions will probably end up calling OnCalculate to help them asses
how much to scroll.
To use the class, add your
Now, all you need to do is click on the middle mouse button.
Your window should include support for some kind of scrolling. The sample class provided in the
download file simply manipulates the existing scrollbars in the parent class, and thus
assuming that both
The code subclasses the parent window (identified by Source Code DependenciesMicrosoft Visual C++ 6.0Microsoft WTL 7.0 Library Download Files
Written by Bjarke Viksoe. Article submitted 8/14/2004. To the top
|
|||||||||||||||||||||