Refactor: CString optimizations
[TortoiseGit.git] / src / TortoiseIDiff / NiceTrackbar.h
bloba90cf441c010a4e69f81ed664bbacdfcf2628315
1 // TortoiseIDiff - an image diff viewer in TortoiseSVN
3 // Copyright (C) 2006-2008 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #pragma once
21 /**
22 * \ingroup TortoiseIDiff
23 * Subclassed trackbar control that jumps to the mouse click positions immediately, instead of
24 * changing the value "towards it".
26 class CNiceTrackbar {
27 public:
28 CNiceTrackbar() : m_Window(NULL), m_OrigProc(NULL), m_Dragging(false), m_DragChanged(false) { }
30 HWND GetWindow() const { return m_Window; }
31 bool IsValid() const { return m_Window != NULL; }
33 void ConvertTrackbarToNice( HWND window );
35 private:
36 static LRESULT CALLBACK NiceTrackbarProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
37 void PostMessageToParent (int tbCode) const;
38 bool SetThumb (LPARAM lparamPoint);
40 private:
41 HWND m_Window;
42 WNDPROC m_OrigProc;
43 bool m_Dragging;
44 bool m_DragChanged;