Permalink
Browse files

Move DetectTripleClicks out of EditorCtrl.

  • Loading branch information...
adamv committed Jun 7, 2009
1 parent 362bab7 commit c6332877ec291be0cd429f504351226473f1d997
Showing with 55 additions and 23 deletions.
  1. +25 −0 src/DetectTripleClicks.cpp
  2. +20 −0 src/DetectTripleClicks.h
  3. +2 −23 src/EditorCtrl.h
  4. +8 −0 src/e.vcproj
View
@@ -0,0 +1,25 @@
+#include "DetectTripleClicks.h"
+#include <wx/stopwatch.h>
+
+DetectTripleClicks::DetectTripleClicks():
+ m_doubleClickedLine(-1),
+ m_timer(new wxStopWatch())
+{}
+
+DetectTripleClicks::~DetectTripleClicks() {
+ delete m_timer;
+}
+
+void DetectTripleClicks::Reset() {
+ m_doubleClickedLine = -1;
+ m_timer->Pause();
+}
+
+void DetectTripleClicks::Start(int doubleClickedLine){
+ m_doubleClickedLine = doubleClickedLine;
+ m_timer->Start();
+}
+
+bool DetectTripleClicks::TripleClickedLine(int line_id){
+ return m_doubleClickedLine == line_id && m_timer->Time() < 250;
+}
View
@@ -0,0 +1,20 @@
+#ifndef __DETECTTRIPLECLICKS_H__
+#define __DETECTTRIPLECLICKS_H__
+
+class wxStopWatch;
+
+class DetectTripleClicks {
+public:
+ DetectTripleClicks();
+ ~DetectTripleClicks();
+
+ void Reset();
+ void Start(int doubleClickedLine);
+ bool TripleClickedLine(int line_id);
+
+private:
+ int m_doubleClickedLine;
+ wxStopWatch* m_timer;
+};
+
+#endif
View
@@ -20,17 +20,18 @@
#endif
#include <wx/dnd.h>
+#include <wx/caret.h>
#include "Catalyst.h"
#include "Lines.h"
-#include <wx/caret.h>
#include "styler_searchhl.h"
#include "styler_syntax.h"
#include "SnippetHandler.h"
#include "key_hook.h"
#include "FindFlags.h"
#include "BundleItemType.h"
#include "BracketHighlight.h"
+#include "DetectTripleClicks.h"
#include "IFoldingEditor.h"
#include "IEditorDoAction.h"
@@ -632,28 +633,6 @@ class EditorCtrl : public KeyHookable<wxControl>,
// Drag'n'Drop
wxPoint m_dragStartPos;
- class DetectTripleClicks {
- public:
- DetectTripleClicks(): m_doubleClickedLine(-1) {}
- void Reset() {
- m_doubleClickedLine = -1;
- m_timer.Pause();
- };
-
- void Start(int doubleClickedLine){
- m_doubleClickedLine = doubleClickedLine;
- m_timer.Start();
- };
-
- bool TripleClickedLine(int line_id){
- return m_doubleClickedLine == line_id && m_timer.Time() < 250;
- };
-
- private:
- int m_doubleClickedLine;
- wxStopWatch m_timer;
- };
-
DetectTripleClicks m_tripleClicks;
enum SelMode {
View
@@ -1993,6 +1993,14 @@
RelativePath="CrashFileNames.h"
>
</File>
+ <File
+ RelativePath=".\DetectTripleClicks.cpp"
+ >
+ </File>
+ <File
+ RelativePath=".\DetectTripleClicks.h"
+ >
+ </File>
<File
RelativePath="DirWatcher.cpp"
>

0 comments on commit c633287

Please sign in to comment.