summaryrefslogtreecommitdiffstats
path: root/views/examples/button_example.cc
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-29 00:55:26 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-29 00:55:26 +0000
commit6c4769153ba6cb2f3c6414aaa3a2d2d48a15c235 (patch)
tree9665473a05646bdd1b422a303b73752aa17addfe /views/examples/button_example.cc
parent456a670db8cb72c5c000f26a012fb0730a5658b6 (diff)
downloadchromium_src-6c4769153ba6cb2f3c6414aaa3a2d2d48a15c235.zip
chromium_src-6c4769153ba6cb2f3c6414aaa3a2d2d48a15c235.tar.gz
chromium_src-6c4769153ba6cb2f3c6414aaa3a2d2d48a15c235.tar.bz2
views: Move the implementation of ButtonExample from the header to the source file.
BUG=None TEST=run out/Debug/views_examples, everything should works as before. Review URL: http://codereview.chromium.org/6288017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@73049 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/examples/button_example.cc')
-rw-r--r--views/examples/button_example.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/views/examples/button_example.cc b/views/examples/button_example.cc
new file mode 100644
index 0000000..d27a5d2
--- /dev/null
+++ b/views/examples/button_example.cc
@@ -0,0 +1,35 @@
+// 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 "views/examples/button_example.h"
+
+#include "views/layout/fill_layout.h"
+#include "views/view.h"
+
+namespace examples {
+
+ButtonExample::ButtonExample(ExamplesMain* main)
+ : ExampleBase(main),
+ count_(0) {
+}
+
+ButtonExample::~ButtonExample() {
+}
+
+std::wstring ButtonExample::GetExampleTitle() {
+ return L"Text Button";
+}
+
+void ButtonExample::CreateExampleView(views::View* container) {
+ button_ = new views::TextButton(this, L"Button");
+ container->SetLayoutManager(new views::FillLayout);
+ container->AddChildView(button_);
+}
+
+void ButtonExample::ButtonPressed(views::Button* sender,
+ const views::Event& event) {
+ PrintStatus(L"Pressed! count:%d", ++count_);
+}
+
+} // namespace examples