summaryrefslogtreecommitdiffstats
path: root/views/examples/radio_button_example.h
diff options
context:
space:
mode:
authorjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 17:22:48 +0000
committerjcampan@chromium.org <jcampan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-20 17:22:48 +0000
commite557d64b1d89a5acbe4b185e63c029c428bd217b (patch)
treeadc254b279329bfae6f1a53cc19a03a3cade7a41 /views/examples/radio_button_example.h
parentdd92c8dc5191650d37501f74bf017e4ad4f664a4 (diff)
downloadchromium_src-e557d64b1d89a5acbe4b185e63c029c428bd217b.zip
chromium_src-e557d64b1d89a5acbe4b185e63c029c428bd217b.tar.gz
chromium_src-e557d64b1d89a5acbe4b185e63c029c428bd217b.tar.bz2
Porting the view examples to Windows.
Some refactoring done to the tests also. See original review at: http://codereview.chromium.org/295013/show BUG=None TEST=Make sure the view examples build and run on Windows and Linux. Review URL: http://codereview.chromium.org/294026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29525 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/examples/radio_button_example.h')
-rw-r--r--views/examples/radio_button_example.h30
1 files changed, 18 insertions, 12 deletions
diff --git a/views/examples/radio_button_example.h b/views/examples/radio_button_example.h
index db0e762..abe5a4c 100644
--- a/views/examples/radio_button_example.h
+++ b/views/examples/radio_button_example.h
@@ -9,7 +9,6 @@
#include "base/string_util.h"
#include "views/controls/button/radio_button.h"
#include "views/controls/button/text_button.h"
-#include "views/controls/tabbed_pane/tabbed_pane.h"
#include "views/examples/example_base.h"
namespace examples {
@@ -17,12 +16,10 @@ namespace examples {
class RadioButtonExample : protected ExampleBase,
private views::ButtonListener {
public:
- RadioButtonExample(views::TabbedPane* tabbed_pane, views::Label* message)
- : ExampleBase(message),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- select_(new views::TextButton(this, L"Select"))),
- ALLOW_THIS_IN_INITIALIZER_LIST(
- status_(new views::TextButton(this, L"Show Status"))) {
+ explicit RadioButtonExample(ExamplesMain* main) : ExampleBase(main) {
+ select_ = new views::TextButton(this, L"Select");
+ status_ = new views::TextButton(this, L"Show Status");
+
int all = arraysize(radio_buttons_);
// divide buttons into 2 groups
@@ -34,11 +31,9 @@ class RadioButtonExample : protected ExampleBase,
group);
}
- views::View* container = new views::View();
- tabbed_pane->AddTab(L"Radio Button", container);
-
- views::GridLayout* layout = new views::GridLayout(container);
- container->SetLayoutManager(layout);
+ container_ = new views::View();
+ views::GridLayout* layout = new views::GridLayout(container_);
+ container_->SetLayoutManager(layout);
views::ColumnSet* column_set = layout->AddColumnSet(0);
column_set->AddColumn(views::GridLayout::FILL, views::GridLayout::FILL,
@@ -55,6 +50,14 @@ class RadioButtonExample : protected ExampleBase,
virtual ~RadioButtonExample() {}
+ virtual std::wstring GetExampleTitle() {
+ return L"Radio Button";
+ }
+
+ virtual views::View* GetExampleView() {
+ return container_;
+ }
+
private:
// Override from ButtonListener
virtual void ButtonPressed(views::Button* sender, const views::Event& event) {
@@ -73,6 +76,9 @@ class RadioButtonExample : protected ExampleBase,
}
}
+ // The view containing this test's controls.
+ views::View* container_;
+
// 6 radio buttons, 0-2 consists 1st group, and 3-5 consists
// 2nd group.
views::RadioButton* radio_buttons_[6];