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

Side by Side 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: Slider is only implemented in gtk 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/examples/slider_example.h"
6
7 #include "build/build_config.h"
8 #include "views/fill_layout.h"
9
10 namespace examples {
11
12 SliderExample::SliderExample(ExamplesMain* main) : ExampleBase(main) {
13 }
14
15 SliderExample::~SliderExample() {
16 }
17
18 std::wstring SliderExample::GetExampleTitle() {
19 return L"Slider";
20 }
21
22 void SliderExample::CreateExampleView(views::View* container) {
23 #if !defined(OS_WIN) && !defined(OS_MACOSX)
24 const double min = 0.0;
25 const double max = 100.0;
26 const double step = 1.0;
27 slider_ = new views::Slider(min, max, step,
28 views::Slider::STYLE_DRAW_VALUE, this);
29
30 container->SetLayoutManager(new views::FillLayout);
31 container->AddChildView(slider_);
32 #endif
33 }
34
35 void SliderExample::SliderValueChanged(views::Slider* sender) {
36 PrintStatus(L"Value: %.1f", sender->value());
37 }
38
39 } // namespace examples
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698