Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Side by Side Diff: views/controls/button/native_button_win.cc

Issue 150051: Fixing focus problems with the combobox (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/controls/button/native_button_win.h ('k') | views/controls/combobox/combobox.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this
2 // source code is governed by a BSD-style license that can be found in the 2 // source code is governed by a BSD-style license that can be found in the
3 // LICENSE file. 3 // LICENSE file.
4 4
5 #include "views/controls/button/native_button_win.h" 5 #include "views/controls/button/native_button_win.h"
6 6
7 #include <commctrl.h> 7 #include <commctrl.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "views/controls/button/checkbox.h" 10 #include "views/controls/button/checkbox.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 return NativeControlWin::ProcessMessage(message, w_param, l_param, result); 90 return NativeControlWin::ProcessMessage(message, w_param, l_param, result);
91 } 91 }
92 92
93 bool NativeButtonWin::OnKeyDown(int vkey) { 93 bool NativeButtonWin::OnKeyDown(int vkey) {
94 bool enter_pressed = vkey == VK_RETURN; 94 bool enter_pressed = vkey == VK_RETURN;
95 if (enter_pressed) 95 if (enter_pressed)
96 native_button_->ButtonPressed(); 96 native_button_->ButtonPressed();
97 return enter_pressed; 97 return enter_pressed;
98 } 98 }
99 99
100 bool NativeButtonWin::NotifyOnKeyDown() const {
101 return true;
102 }
103
104 void NativeButtonWin::CreateNativeControl() { 100 void NativeButtonWin::CreateNativeControl() {
105 DWORD flags = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON; 101 DWORD flags = WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | BS_PUSHBUTTON;
106 if (native_button_->is_default()) 102 if (native_button_->is_default())
107 flags |= BS_DEFPUSHBUTTON; 103 flags |= BS_DEFPUSHBUTTON;
108 HWND control_hwnd = CreateWindowEx(GetAdditionalExStyle(), L"BUTTON", L"", 104 HWND control_hwnd = CreateWindowEx(GetAdditionalExStyle(), L"BUTTON", L"",
109 flags, 0, 0, width(), height(), 105 flags, 0, 0, width(), height(),
110 GetWidget()->GetNativeView(), NULL, NULL, 106 GetWidget()->GetNativeView(), NULL, NULL,
111 NULL); 107 NULL);
112 NativeControlCreated(control_hwnd); 108 NativeControlCreated(control_hwnd);
113 } 109 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 return new NativeCheckboxWin(checkbox); 227 return new NativeCheckboxWin(checkbox);
232 } 228 }
233 229
234 // static 230 // static
235 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper( 231 NativeButtonWrapper* NativeButtonWrapper::CreateRadioButtonWrapper(
236 RadioButton* radio_button) { 232 RadioButton* radio_button) {
237 return new NativeRadioButtonWin(radio_button); 233 return new NativeRadioButtonWin(radio_button);
238 } 234 }
239 235
240 } // namespace views 236 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/button/native_button_win.h ('k') | views/controls/combobox/combobox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698