<< Return to Main Index

< Return to Class Index

class CGXMouseWheelPlugin: public CGXPluginComponent

CGXMouseWheelPlugin provides support for intelli-mouse' mouse-wheel scrolling and zooming.

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

If you want add mouse-wheel panning (auto-scrolling when you hold down the mouse-wheel button) check out CGXIntelliMousePlugin.

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

Using the mouse-wheel component with any view or window

a) Add a pointer to the plug-in object in your view class and allocate a CGXMouseWheelPlugin and call CGXMouseWheelPlugin::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


      EnableMouseWheel(); 

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

EnableMouseWheel 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 below how to add support for mouse-wheel zooming in your view or window.

Note

Mouse-wheel scrolling only works with Visual C++ versions 6.0 or higher.
If you are using an earlier version of MFC, this class will do nothing. 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 CGXIntelliMousePlugin CGXGridCore::AddPlugin CGXGridCore::EnableMouseWheel

CGXMouseWheelPlugin

Class Members