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

Unified Diff: ui/views/examples/radio_button_example.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/examples/radio_button_example.h ('k') | ui/views/examples/scroll_view_example.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/examples/radio_button_example.cc
diff --git a/ui/views/examples/radio_button_example.cc b/ui/views/examples/radio_button_example.cc
deleted file mode 100644
index 5e3c7dd4a3c9f917683741c795f58adc527d022f..0000000000000000000000000000000000000000
--- a/ui/views/examples/radio_button_example.cc
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/views/examples/radio_button_example.h"
-
-#include "base/strings/stringprintf.h"
-#include "base/strings/utf_string_conversions.h"
-#include "ui/views/controls/button/label_button.h"
-#include "ui/views/controls/button/radio_button.h"
-#include "ui/views/layout/grid_layout.h"
-#include "ui/views/view.h"
-
-namespace views {
-namespace examples {
-
-RadioButtonExample::RadioButtonExample()
- : ExampleBase("Radio Button"),
- count_(0) {
-}
-
-RadioButtonExample::~RadioButtonExample() {
-}
-
-void RadioButtonExample::CreateExampleView(View* container) {
- select_ = new LabelButton(this, base::ASCIIToUTF16("Select"));
- status_ = new LabelButton(this, base::ASCIIToUTF16("Show Status"));
-
- int group = 1;
- for (size_t i = 0; i < arraysize(radio_buttons_); ++i) {
- radio_buttons_[i] = new RadioButton(
- base::UTF8ToUTF16(base::StringPrintf(
- "Radio %d in group %d", static_cast<int>(i) + 1, group)),
- group);
- radio_buttons_[i]->set_listener(this);
- }
-
- GridLayout* layout = new GridLayout(container);
- container->SetLayoutManager(layout);
-
- ColumnSet* column_set = layout->AddColumnSet(0);
- column_set->AddColumn(GridLayout::FILL, GridLayout::FILL,
- 1.0f, GridLayout::USE_PREF, 0, 0);
- for (size_t i = 0; i < arraysize(radio_buttons_); ++i) {
- layout->StartRow(0, 0);
- layout->AddView(radio_buttons_[i]);
- }
- layout->StartRow(0, 0);
- layout->AddView(select_);
- layout->StartRow(0, 0);
- layout->AddView(status_);
-}
-
-void RadioButtonExample::ButtonPressed(Button* sender, const ui::Event& event) {
- if (sender == select_) {
- radio_buttons_[2]->SetChecked(true);
- } else if (sender == status_) {
- // Show the state of radio buttons.
- PrintStatus("Group: 1:%s, 2:%s, 3:%s",
- BoolToOnOff(radio_buttons_[0]->checked()),
- BoolToOnOff(radio_buttons_[1]->checked()),
- BoolToOnOff(radio_buttons_[2]->checked()));
- } else {
- PrintStatus("Pressed! count:%d", ++count_);
- }
-}
-
-} // namespace examples
-} // namespace views
« no previous file with comments | « ui/views/examples/radio_button_example.h ('k') | ui/views/examples/scroll_view_example.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698