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 UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
7 | 7 |
8 #include "ui/views/view.h" | 8 #include "ui/views/view.h" |
9 | 9 |
10 namespace views { | 10 namespace views { |
(...skipping 17 matching lines...) Expand all Loading... | |
28 public: | 28 public: |
29 virtual ~Button(); | 29 virtual ~Button(); |
30 | 30 |
31 // Button states for various button sub-types. | 31 // Button states for various button sub-types. |
32 // TODO(msw): Add toggled state for checkboxes, radio buttons, etc. | 32 // TODO(msw): Add toggled state for checkboxes, radio buttons, etc. |
33 enum ButtonState { | 33 enum ButtonState { |
34 STATE_NORMAL = 0, | 34 STATE_NORMAL = 0, |
35 STATE_HOVERED, | 35 STATE_HOVERED, |
36 STATE_PRESSED, | 36 STATE_PRESSED, |
37 STATE_DISABLED, | 37 STATE_DISABLED, |
38 STATE_TOGGLED, | |
msw
2013/05/16 22:40:05
nit: I'd prefer this ordered before STATE_DISABLED
tfarina
2013/05/18 00:54:08
removed
| |
38 STATE_COUNT, | 39 STATE_COUNT, |
39 }; | 40 }; |
40 | 41 |
41 // Button styles with associated images and border painters. | 42 // Button styles with associated images and border painters. |
42 // TODO(msw): Add "Blue Button", Checkbox, Radio, Menu, ComboBox, etc. | 43 // TODO(msw): Add "Blue Button", Menu, ComboBox, etc. |
43 enum ButtonStyle { | 44 enum ButtonStyle { |
44 STYLE_BUTTON = 0, | 45 STYLE_BUTTON = 0, |
45 STYLE_TEXTBUTTON, | 46 STYLE_TEXTBUTTON, |
46 STYLE_NATIVE_TEXTBUTTON, | 47 STYLE_NATIVE_TEXTBUTTON, |
48 STYLE_CHECKBOX, | |
49 STYLE_RADIO, | |
47 STYLE_COUNT, | 50 STYLE_COUNT, |
48 }; | 51 }; |
49 | 52 |
50 void SetTooltipText(const string16& tooltip_text); | 53 void SetTooltipText(const string16& tooltip_text); |
51 | 54 |
52 int tag() const { return tag_; } | 55 int tag() const { return tag_; } |
53 void set_tag(int tag) { tag_ = tag; } | 56 void set_tag(int tag) { tag_ = tag; } |
54 | 57 |
55 void SetAccessibleName(const string16& name); | 58 void SetAccessibleName(const string16& name); |
56 | 59 |
(...skipping 24 matching lines...) Expand all Loading... | |
81 // The id tag associated with this button. Used to disambiguate buttons in | 84 // The id tag associated with this button. Used to disambiguate buttons in |
82 // the ButtonListener implementation. | 85 // the ButtonListener implementation. |
83 int tag_; | 86 int tag_; |
84 | 87 |
85 DISALLOW_COPY_AND_ASSIGN(Button); | 88 DISALLOW_COPY_AND_ASSIGN(Button); |
86 }; | 89 }; |
87 | 90 |
88 } // namespace views | 91 } // namespace views |
89 | 92 |
90 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ | 93 #endif // UI_VIEWS_CONTROLS_BUTTON_BUTTON_H_ |
OLD | NEW |