1 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/inc/vcl/seleng.hxx vcl/inc/vcl/seleng.hxx
2 --- vcl.clean/inc/vcl/seleng.hxx 2008-04-01 19:28:32.000000000 -0400
3 +++ vcl/inc/vcl/seleng.hxx 2008-04-03 17:57:26.000000000 -0400
4 @@ -41,6 +41,8 @@ class CommandEvent;
6 #define SELENG_DRAGDROP_TIMEOUT 400
7 #define SELENG_AUTOREPEAT_INTERVAL 50
8 +#define SELENG_AUTOREPEAT_INTERVAL_MIN 25
9 +#define SELENG_AUTOREPEAT_INTERVAL_MAX 300
11 enum SelectionMode { NO_SELECTION, SINGLE_SELECTION, RANGE_SELECTION, MULTIPLE_SELECTION };
13 @@ -103,6 +104,7 @@ private:
14 Timer aWTimer; // erzeugt kuenstliche Mouse-Moves
16 SelectionMode eSelMode;
17 + ULONG nUpdateInterval;
18 // Stufigkeit fuer Mausbewegungen waehrend einer Selektion
19 USHORT nMouseSensitivity;
21 @@ -116,7 +118,8 @@ private:
24 SelectionEngine( Window* pWindow,
25 - FunctionSet* pFunctions = NULL );
26 + FunctionSet* pFunctions = NULL,
27 + ULONG nAutoRepeatInterval = SELENG_AUTOREPEAT_INTERVAL );
30 // TRUE: Event wurde von Selection-Engine verarbeitet.
31 @@ -175,6 +178,8 @@ public:
32 BOOL HasAnchor() const;
33 void SetAnchor( BOOL bAnchor );
35 + void SetUpdateInterval( ULONG nInterval );
37 // wird im Ctor eingeschaltet
38 void ExpandSelectionOnMouseMove( BOOL bExpand = TRUE )
40 diff -urp --exclude=CVS --exclude=unxlngi6.pro --exclude=vcl.vpj vcl.clean/source/window/seleng.cxx vcl/source/window/seleng.cxx
41 --- vcl.clean/source/window/seleng.cxx 2008-04-01 19:28:36.000000000 -0400
42 +++ vcl/source/window/seleng.cxx 2008-04-03 18:24:56.000000000 -0400
43 @@ -63,8 +63,10 @@ inline BOOL SelectionEngine::ShouldDesel
45 *************************************************************************/
47 -SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet ) :
49 +SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet,
50 + ULONG nAutoRepeatInterval ) :
52 + nUpdateInterval( nAutoRepeatInterval )
54 eSelMode = SINGLE_SELECTION;
55 pFunctionSet = pFuncSet;
56 @@ -72,7 +74,7 @@ SelectionEngine::SelectionEngine( Window
59 aWTimer.SetTimeoutHdl( LINK( this, SelectionEngine, ImpWatchDog ) );
60 - aWTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL );
61 + aWTimer.SetTimeout( nUpdateInterval );
64 /*************************************************************************
65 @@ -397,7 +399,7 @@ BOOL SelectionEngine::SelMouseMove( cons
66 if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() ))
70 + aWTimer.SetTimeout( nUpdateInterval );
72 if ( eSelMode != SINGLE_SELECTION )
74 @@ -488,3 +490,27 @@ void SelectionEngine::Command( const CommandEvent& rCEvt )
75 nFlags &= ~SELENG_CMDEVT;
79 +void SelectionEngine::SetUpdateInterval( ULONG nInterval )
81 + if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN)
82 + // Set a lower threshold. On Windows, setting this value too low
83 + // would cause selection to get updated indefinitely.
84 + nInterval = SELENG_AUTOREPEAT_INTERVAL_MIN;
86 + if (nUpdateInterval == nInterval)
87 + // no update needed.
90 + if (aWTimer.IsActive())
92 + // reset the timer right away on interval change.
94 + aWTimer.SetTimeout(nInterval);
98 + aWTimer.SetTimeout(nInterval);
100 + nUpdateInterval = nInterval;