diff options
author | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-08 01:13:25 +0000 |
---|---|---|
committer | jcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-08 01:13:25 +0000 |
commit | e8e0f3691a410d6de40bfff021b0da33425f36cb (patch) | |
tree | eba7275ce7aac42fb014896f2b65a09026c0499c /chrome/views/native_button.h | |
parent | 4adc70599db32d760184ec908f11c7d000b6b79c (diff) | |
download | chromium_src-e8e0f3691a410d6de40bfff021b0da33425f36cb.zip chromium_src-e8e0f3691a410d6de40bfff021b0da33425f36cb.tar.gz chromium_src-e8e0f3691a410d6de40bfff021b0da33425f36cb.tar.bz2 |
In dialogs, when the focus moves to a button, that button should become the default button.
When the focus is not a button, then the default button should be the one the delegate specifies.
BUG=4132
TEST=Open the option dialog. OK should be the default and focused button. Move the focus around by pressing tab. When a button is selected, it should be the default button.
Review URL: http://codereview.chromium.org/10230
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@5056 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views/native_button.h')
-rw-r--r-- | chrome/views/native_button.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chrome/views/native_button.h b/chrome/views/native_button.h index 03b03b0..655c49c 100644 --- a/chrome/views/native_button.h +++ b/chrome/views/native_button.h @@ -34,6 +34,8 @@ class NativeButton : public NativeControl { void SetLabel(const std::wstring& l); const std::wstring GetLabel() const; + std::string GetClassName() const; + class Listener { public: // @@ -53,6 +55,11 @@ class NativeButton : public NativeControl { // on both sides of the button for each directions void SetPadding(CSize size); + // Sets/unsets this button as the default button. The default button is the + // one triggered when enter is pressed. It is displayed with a blue border. + void SetDefaultButton(bool is_default_button); + bool IsDefaultButton() const { return is_default_; } + virtual LRESULT OnNotify(int w_param, LPNMHDR l_param); virtual LRESULT OnCommand(UINT code, int id, HWND source); @@ -83,6 +90,9 @@ class NativeButton : public NativeControl { // guidelines. Default is true. Set this to false if you want slim buttons. void set_enforce_dlu_min_size(bool value) { enforce_dlu_min_size_ = value; } + // The view class name. + static const char kViewClassName[]; + protected: virtual HWND CreateNativeControl(HWND parent_container); |