OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_ | 5 #ifndef VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_ |
6 #define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_ | 6 #define VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <atlbase.h> | 9 #include <atlbase.h> |
10 #include <atlapp.h> | 10 #include <atlapp.h> |
(...skipping 25 matching lines...) Expand all Loading... |
36 CWinTraits<kDefaultEditStyle> >, | 36 CWinTraits<kDefaultEditStyle> >, |
37 public CRichEditCommands<NativeTextfieldWin>, | 37 public CRichEditCommands<NativeTextfieldWin>, |
38 public NativeTextfieldWrapper, | 38 public NativeTextfieldWrapper, |
39 public ui::SimpleMenuModel::Delegate { | 39 public ui::SimpleMenuModel::Delegate { |
40 public: | 40 public: |
41 DECLARE_WND_CLASS(L"ViewsTextfieldEdit"); | 41 DECLARE_WND_CLASS(L"ViewsTextfieldEdit"); |
42 | 42 |
43 explicit NativeTextfieldWin(Textfield* parent); | 43 explicit NativeTextfieldWin(Textfield* parent); |
44 ~NativeTextfieldWin(); | 44 ~NativeTextfieldWin(); |
45 | 45 |
| 46 // Returns true if the current point is close enough to the origin point in |
| 47 // space and time that it would be considered a double click. |
| 48 static bool IsDoubleClick(const POINT& origin, |
| 49 const POINT& current, |
| 50 DWORD elapsed_time); |
| 51 |
| 52 // Returns true if the virtual key code is a digit coming from the numeric |
| 53 // keypad (with or without NumLock on). |extended_key| should be set to the |
| 54 // extended key flag specified in the WM_KEYDOWN/UP where the |key_code| |
| 55 // originated. |
| 56 static bool IsNumPadDigit(int key_code, bool extended_key); |
| 57 |
46 // See the code in textfield.cc that calls this for why this is here. | 58 // See the code in textfield.cc that calls this for why this is here. |
47 void AttachHack(); | 59 void AttachHack(); |
48 | 60 |
49 // Overridden from NativeTextfieldWrapper: | 61 // Overridden from NativeTextfieldWrapper: |
50 virtual string16 GetText() const; | 62 virtual string16 GetText() const; |
51 virtual void UpdateText(); | 63 virtual void UpdateText(); |
52 virtual void AppendText(const string16& text); | 64 virtual void AppendText(const string16& text); |
53 virtual string16 GetSelectedText() const; | 65 virtual string16 GetSelectedText() const; |
54 virtual void SelectAll(); | 66 virtual void SelectAll(); |
55 virtual void ClearSelection(); | 67 virtual void ClearSelection(); |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 273 |
262 // The accessibility state of this object. | 274 // The accessibility state of this object. |
263 int accessibility_state_; | 275 int accessibility_state_; |
264 | 276 |
265 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldWin); | 277 DISALLOW_COPY_AND_ASSIGN(NativeTextfieldWin); |
266 }; | 278 }; |
267 | 279 |
268 } // namespace views | 280 } // namespace views |
269 | 281 |
270 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_ | 282 #endif // VIEWS_CONTROLS_TEXTFIELD_NATIVE_TEXTFIELD_WIN_H_ |
OLD | NEW |