| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ | 5 #ifndef UI_VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ |
| 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ | 6 #define UI_VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/views/controls/scrollbar/base_scroll_bar.h" | 9 #include "ui/views/controls/scrollbar/base_scroll_bar.h" |
| 10 | 10 |
| 11 namespace views { | 11 namespace views { |
| 12 | 12 |
| 13 namespace { | 13 namespace { |
| 14 class BitmapScrollBarThumb; | 14 class BitmapScrollBarThumb; |
| 15 } | 15 } |
| 16 | 16 |
| 17 /////////////////////////////////////////////////////////////////////////////// | 17 /////////////////////////////////////////////////////////////////////////////// |
| 18 // | 18 // |
| 19 // BitmapScrollBar | 19 // BitmapScrollBar |
| 20 // | 20 // |
| 21 // A ScrollBar subclass that implements a scroll bar rendered using bitmaps | 21 // A ScrollBar subclass that implements a scroll bar rendered using images |
| 22 // that the user provides. There are bitmaps for the up and down buttons, as | 22 // that the user provides. There are images for the up and down buttons, as |
| 23 // well as for the thumb and track. This is intended for creating UIs that | 23 // well as for the thumb and track. This is intended for creating UIs that |
| 24 // have customized, non-native appearances, like floating HUDs etc. | 24 // have customized, non-native appearances, like floating HUDs etc. |
| 25 // | 25 // |
| 26 /////////////////////////////////////////////////////////////////////////////// | 26 /////////////////////////////////////////////////////////////////////////////// |
| 27 class VIEWS_EXPORT BitmapScrollBar : public BaseScrollBar, | 27 class VIEWS_EXPORT BitmapScrollBar : public BaseScrollBar, |
| 28 public ButtonListener { | 28 public ButtonListener { |
| 29 public: | 29 public: |
| 30 BitmapScrollBar(bool horizontal, bool show_scroll_buttons); | 30 BitmapScrollBar(bool horizontal, bool show_scroll_buttons); |
| 31 virtual ~BitmapScrollBar() { } | 31 virtual ~BitmapScrollBar() { } |
| 32 | 32 |
| 33 // A list of parts that the user may supply bitmaps for. | 33 // A list of parts that the user may supply images for. |
| 34 enum ScrollBarPart { | 34 enum ScrollBarPart { |
| 35 // The button used to represent scrolling up/left by 1 line. | 35 // The button used to represent scrolling up/left by 1 line. |
| 36 PREV_BUTTON = 0, | 36 PREV_BUTTON = 0, |
| 37 // The button used to represent scrolling down/right by 1 line. | 37 // The button used to represent scrolling down/right by 1 line. |
| 38 // IMPORTANT: The code assumes the prev and next | 38 // IMPORTANT: The code assumes the prev and next |
| 39 // buttons have equal width and equal height. | 39 // buttons have equal width and equal height. |
| 40 NEXT_BUTTON, | 40 NEXT_BUTTON, |
| 41 // The top/left segment of the thumb on the scrollbar. | 41 // The top/left segment of the thumb on the scrollbar. |
| 42 THUMB_START_CAP, | 42 THUMB_START_CAP, |
| 43 // The tiled background image of the thumb. | 43 // The tiled background image of the thumb. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // True if the scroll buttons at each end of the scroll bar should be shown. | 84 // True if the scroll buttons at each end of the scroll bar should be shown. |
| 85 bool show_scroll_buttons_; | 85 bool show_scroll_buttons_; |
| 86 | 86 |
| 87 DISALLOW_COPY_AND_ASSIGN(BitmapScrollBar); | 87 DISALLOW_COPY_AND_ASSIGN(BitmapScrollBar); |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 } // namespace views | 90 } // namespace views |
| 91 | 91 |
| 92 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ | 92 #endif // UI_VIEWS_CONTROLS_SCROLLBAR_BITMAP_SCROLL_BAR_H_ |
| OLD | NEW |