| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // These classes define a text field widget that can be used in the views UI | 5 // These classes define a text field widget that can be used in the views UI |
| 6 // toolkit. | 6 // toolkit. |
| 7 | 7 |
| 8 #ifndef CHROME_VIEWS_TEXT_FIELD_H__ | 8 #ifndef CHROME_VIEWS_TEXT_FIELD_H__ |
| 9 #define CHROME_VIEWS_TEXT_FIELD_H__ | 9 #define CHROME_VIEWS_TEXT_FIELD_H__ |
| 10 | 10 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 | 129 |
| 130 // Sets the default width of the text control. See default_width_in_chars_. | 130 // Sets the default width of the text control. See default_width_in_chars_. |
| 131 void set_default_width_in_chars(int default_width) { | 131 void set_default_width_in_chars(int default_width) { |
| 132 default_width_in_chars_ = default_width; | 132 default_width_in_chars_ = default_width; |
| 133 } | 133 } |
| 134 | 134 |
| 135 // Removes the border from the edit box, giving it a 2D look. | 135 // Removes the border from the edit box, giving it a 2D look. |
| 136 void RemoveBorder(); | 136 void RemoveBorder(); |
| 137 | 137 |
| 138 // Disable the edit control. | 138 // Disable the edit control. |
| 139 // NOTE: this does NOT change the read only property. |
| 139 void SetEnabled(bool enabled); | 140 void SetEnabled(bool enabled); |
| 140 | 141 |
| 141 private: | 142 private: |
| 142 class Edit; | 143 class Edit; |
| 143 | 144 |
| 144 // Invoked by the edit control when the value changes. This method set | 145 // Invoked by the edit control when the value changes. This method set |
| 145 // the text_ member variable to the value contained in edit control. | 146 // the text_ member variable to the value contained in edit control. |
| 146 // This is important because the edit control can be replaced if it has | 147 // This is important because the edit control can be replaced if it has |
| 147 // been deleted during a window close. | 148 // been deleted during a window close. |
| 148 void SyncText(); | 149 void SyncText(); |
| 149 | 150 |
| 150 // Reset the text field native control. | 151 // Reset the text field native control. |
| 151 void ResetNativeControl(); | 152 void ResetNativeControl(); |
| 152 | 153 |
| 154 // Resets the background color of the edit. |
| 155 void UpdateEditBackgroundColor(); |
| 156 |
| 153 // This encapsulates the HWND of the native text field. | 157 // This encapsulates the HWND of the native text field. |
| 154 HWNDView* native_view_; | 158 HWNDView* native_view_; |
| 155 | 159 |
| 156 // This inherits from the native text field. | 160 // This inherits from the native text field. |
| 157 Edit* edit_; | 161 Edit* edit_; |
| 158 | 162 |
| 159 // This is the current listener for events from this control. | 163 // This is the current listener for events from this control. |
| 160 Controller* controller_; | 164 Controller* controller_; |
| 161 | 165 |
| 162 StyleFlags style_; | 166 StyleFlags style_; |
| (...skipping 25 matching lines...) Expand all Loading... |
| 188 // Calculates the insets for the text field. | 192 // Calculates the insets for the text field. |
| 189 void CalculateInsets(gfx::Insets* insets); | 193 void CalculateInsets(gfx::Insets* insets); |
| 190 | 194 |
| 191 DISALLOW_EVIL_CONSTRUCTORS(TextField); | 195 DISALLOW_EVIL_CONSTRUCTORS(TextField); |
| 192 }; | 196 }; |
| 193 | 197 |
| 194 } // namespace views | 198 } // namespace views |
| 195 | 199 |
| 196 #endif // CHROME_VIEWS_TEXT_FIELD_H__ | 200 #endif // CHROME_VIEWS_TEXT_FIELD_H__ |
| 197 | 201 |
| OLD | NEW |