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

Side by Side Diff: ui/views/examples/text_example.cc

Issue 9875001: views: Rename Combobox "selected getter/setter" accessors to something more accurate. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: combo box -> combobox Created 8 years, 8 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 | « ui/views/examples/text_example.h ('k') | no next file » | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ui/views/examples/text_example.h" 5 #include "ui/views/examples/text_example.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "ui/base/resource/resource_bundle.h" 8 #include "ui/base/resource/resource_bundle.h"
9 #include "ui/gfx/canvas.h" 9 #include "ui/gfx/canvas.h"
10 #include "ui/views/controls/button/checkbox.h" 10 #include "ui/views/controls/button/checkbox.h"
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 183
184 Combobox* TextExample::AddCombobox(GridLayout* layout, 184 Combobox* TextExample::AddCombobox(GridLayout* layout,
185 const char* name, 185 const char* name,
186 const char** strings, 186 const char** strings,
187 int count) { 187 int count) {
188 layout->StartRow(0, 0); 188 layout->StartRow(0, 0);
189 layout->AddView(new Label(ASCIIToUTF16(name))); 189 layout->AddView(new Label(ASCIIToUTF16(name)));
190 ExampleComboboxModel* new_model = new ExampleComboboxModel(strings, count); 190 ExampleComboboxModel* new_model = new ExampleComboboxModel(strings, count);
191 example_combobox_model_.push_back(new_model); 191 example_combobox_model_.push_back(new_model);
192 Combobox* combo_box = new Combobox(new_model); 192 Combobox* combo_box = new Combobox(new_model);
193 combo_box->SetSelectedItem(0); 193 combo_box->SetSelectedIndex(0);
194 combo_box->set_listener(this); 194 combo_box->set_listener(this);
195 layout->AddView(combo_box, kNumColumns - 1, 1); 195 layout->AddView(combo_box, kNumColumns - 1, 1);
196 return combo_box; 196 return combo_box;
197 } 197 }
198 198
199 void TextExample::CreateExampleView(View* container) { 199 void TextExample::CreateExampleView(View* container) {
200 text_view_ = new TextExampleView; 200 text_view_ = new TextExampleView;
201 201
202 GridLayout* layout = new GridLayout(container); 202 GridLayout* layout = new GridLayout(container);
203 container->SetLayoutManager(layout); 203 container->SetLayoutManager(layout);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 text_flags |= gfx::Canvas::HIDE_PREFIX; 363 text_flags |= gfx::Canvas::HIDE_PREFIX;
364 break; 364 break;
365 } 365 }
366 } 366 }
367 text_view_->set_text_flags(text_flags); 367 text_view_->set_text_flags(text_flags);
368 text_view_->SchedulePaint(); 368 text_view_->SchedulePaint();
369 } 369 }
370 370
371 } // namespace examples 371 } // namespace examples
372 } // namespace views 372 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/examples/text_example.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698