<< Return to Main Index

< Return to Class Index

class CGXIntelliMousePlugin: public CGXMouseWheelPlugin

CGXIntelliMousePlugin provides support for intelli-mouse' mouse-wheel scrolling, zooming and panning (auto-scrolling).

Here is a short overview of the functionality implemented by the component. The implementation is very similar to MS Excel and Internet Explorer. The following features are provided:

·Scrolling by rolling the mouse wheel

·Scroll horizontally by clicking SHIFT and rolling the mouse wheel

·Zoom in and out by clicking CTRL and rolling the mouse wheel

The CGXIntelliMousePlugin class integrates fine into any advanced view that may process itself a lot of window messages.

Using the intelli-mouse wheel component with any view or window

a) Add a pointer to the plug-in object in your view class and allocate a CGXIntelliMousePlugin and call CGXIntelliMousePlugin::Plugin at initialization time.

b) Override WindowProc and call the HandleMessage method of the plug-in component.

Using the mouse-wheel component with CGXGridCore

With CGXGridCore adding mouse-wheel support is even easier. CGXGridCore already provides internally the necessary dispatching of messages in the WindowProc method. All you need to do is register the mouse-wheel component. To do this, simply call


      EnableIntelliMouse(); 

at initialization time of your grid (for example in OnInitialUpdate.)

EnableIntelliMouse calls CGXGridCore::AddPlugin. AddPlugin registers the plug-in component within the grid. This registration is necessary to let the grid know that it should dispatch WindowProc events to this component. When the grid goes out of scope the plugin-object will be automatically destroyed.

See the section "Plug-in Components" for more information and a tutorial how to implement and use plug-in components in your application.

See the OnIMouseGetZoom and OnIMouseSetZoom methods in the CGXMouseWheelPlugin class reference how to add support for mouse-wheel zooming in your view or window.

Note

Mouse-wheel scrolling only works with Visual C++ version 6.0 or higher.
If you are using an earlier version of MFC, this class will only add support for mouse-wheel panning (auto-scrolling). Rolling the mouse-wheel will have no effect.

See also the notes on special considerations about dialogs in CGXGridCore::EnableIntelliMouse.

#include <gxall.h>

See Also

CGXPluginComponent CGXMouseWheelPlugin CGXGridCore::AddPlugin CGXGridCore::EnableIntelliMouse

CGXIntelliMousePlugin

Class Members