diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/seleng.hxx vcl/inc/vcl/seleng.hxx --- vcl.clean/inc/vcl/seleng.hxx 2008-04-01 19:28:32.000000000 -0400 +++ vcl/inc/vcl/seleng.hxx 2008-04-03 17:57:26.000000000 -0400 @@ -54,6 +54,7 @@ class CommandEvent; // Timerticks #define SELENG_DRAGDROP_TIMEOUT 400 #define SELENG_AUTOREPEAT_INTERVAL 50 +#define SELENG_AUTOREPEAT_INTERVAL_MAX 300 enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION }; @@ -103,6 +104,7 @@ private: Timer aWTimer; // erzeugt kuenstliche Mouse-Moves MouseEvent aLastMove; SelectionMode eSelMode; + ULONG nUpdateInterval; // Stufigkeit fuer Mausbewegungen waehrend einer Selektion USHORT nMouseSensitivity; USHORT nLockedMods; @@ -116,7 +118,8 @@ private: public: SelectionEngine( Window* pWindow, - FunctionSet* pFunctions = NULL ); + FunctionSet* pFunctions = NULL, + ULONG nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL ); ~SelectionEngine(); // TRUE: Event wurde von Selection-Engine verarbeitet. @@ -175,6 +178,8 @@ public: BOOL HasAnchor() const; void SetAnchor( BOOL bAnchor ); + void SetUpdateInterval( ULONG nInterval ); + // wird im Ctor eingeschaltet void ExpandSelectionOnMouseMove( BOOL bExpand = TRUE ) { diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/source/window/seleng.cxx vcl/source/window/seleng.cxx --- vcl.clean/source/window/seleng.cxx 2008-04-01 19:28:36.000000000 -0400 +++ vcl/source/window/seleng.cxx 2008-04-03 18:24:56.000000000 -0400 @@ -41,7 +41,7 @@ #include #include - +#include inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const @@ -63,8 +63,10 @@ inline BOOL SelectionEngine::ShouldDesel |* *************************************************************************/ -SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) : - pWin( pWindow ) +SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet, + ULONG nAutoRepeatInterval ) : + pWin( pWindow ), + nUpdateInterval( nAutoRepeatInterval ) { eSelMode = SINGLE_SELECTION; pFunctionSet = pFuncSet; @@ -72,7 +74,7 @@ SelectionEngine::SelectionEngine( Window nLockedMods = 0; aWTimer.SetTimeoutHdl( LINK( this, SelectionEngine, ImpWatchDog ) ); - aWTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL ); + aWTimer.SetTimeout( nUpdateInterval ); } /************************************************************************* @@ -397,7 +399,7 @@ BOOL SelectionEngine::SelMouseMove( cons if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() )) return TRUE; - + aWTimer.SetTimeout( nUpdateInterval ); aWTimer.Start(); if ( eSelMode != SINGLE_SELECTION ) { @@ -493,3 +495,20 @@ void SelectionEngine::Command( const Com nFlags &= ~SELENG_CMDEVT; } } + +void SelectionEngine::SetUpdateInterval( ULONG nInterval ) +{ + if (nUpdateInterval == nInterval) + // no update needed. + return; + + nUpdateInterval = nInterval; + + if (aWTimer.IsActive()) + { + // reset the timer right away on interval change. + aWTimer.Stop(); + aWTimer.SetTimeout(nUpdateInterval); + aWTimer.Start(); + } +}