fixes for new button code; don't even make destructible sources non-writable; add...
[ardour.git] / libs / gtkmm2ext / gtkmm2ext / pixscroller.h
1 #ifndef __gtkmm2ext_pixscroller_h__ 
2 #define __gtkmm2ext_pixscroller_h__
3
4 #include <gtkmm/drawingarea.h>
5 #include <gtkmm/adjustment.h>
6 #include <gdkmm.h>
7
8 namespace Gtkmm2ext {
9
10 class PixScroller : public Gtk::DrawingArea
11 {
12   public:
13         PixScroller(Gtk::Adjustment& adjustment, 
14                     Glib::RefPtr<Gdk::Pixbuf> slider,
15                     Glib::RefPtr<Gdk::Pixbuf> rail);
16
17         bool on_expose_event (GdkEventExpose*);
18         bool on_motion_notify_event (GdkEventMotion*);
19         bool on_button_press_event (GdkEventButton*);
20         bool on_button_release_event (GdkEventButton*);
21         bool on_scroll_event (GdkEventScroll*);
22         void on_size_request (GtkRequisition*);
23
24   protected:
25         Gtk::Adjustment& adj;
26
27   private:
28         Glib::RefPtr<Gdk::Pixbuf> rail;
29         Glib::RefPtr<Gdk::Pixbuf> slider;
30         Gdk::Rectangle sliderrect;
31         Gdk::Rectangle railrect;
32         GdkWindow* grab_window;
33         double grab_y;
34         double grab_start;
35         int overall_height;
36         bool dragging;
37         
38         float default_value;
39
40         void adjustment_changed ();
41 };
42
43 } // namespace
44
45 #endif /* __gtkmm2ext_pixscroller_h__ */