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

Unified Diff: views/examples/slider_example.cc

Issue 6366008: views: Move implementations of ComboboxExample and SliderExample to source file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: next line Created 9 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 | « views/examples/slider_example.h ('k') | views/views.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/examples/slider_example.cc
diff --git a/views/examples/slider_example.cc b/views/examples/slider_example.cc
new file mode 100644
index 0000000000000000000000000000000000000000..1ae8c73dcf154ccd9ec7d239290a25273e7eae7b
--- /dev/null
+++ b/views/examples/slider_example.cc
@@ -0,0 +1,39 @@
+// 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/slider_example.h"
+
+#include "build/build_config.h"
+#include "views/fill_layout.h"
+
+namespace examples {
+
+SliderExample::SliderExample(ExamplesMain* main) : ExampleBase(main) {
+}
+
+SliderExample::~SliderExample() {
+}
+
+std::wstring SliderExample::GetExampleTitle() {
+ return L"Slider";
+}
+
+void SliderExample::CreateExampleView(views::View* container) {
+#if !defined(OS_WIN) && !defined(OS_MACOSX)
+ const double min = 0.0;
+ const double max = 100.0;
+ const double step = 1.0;
+ slider_ = new views::Slider(min, max, step,
+ views::Slider::STYLE_DRAW_VALUE, this);
+
+ container->SetLayoutManager(new views::FillLayout);
+ container->AddChildView(slider_);
+#endif
+}
+
+void SliderExample::SliderValueChanged(views::Slider* sender) {
+ PrintStatus(L"Value: %.1f", sender->value());
+}
+
+} // namespace examples
« no previous file with comments | « views/examples/slider_example.h ('k') | views/views.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698