2 Copyright (C) 1998-99 Paul Barton-Davis
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License as published by
5 the Free Software Foundation; either version 2 of the License, or
6 (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
13 You should have received a copy of the GNU General Public License
14 along with this program; if not, write to the Free Software
15 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 $Id: motionfeedback.h,v 1.1.1.1 2001/11/24 00:44:46 pbd Exp $
20 #ifndef __gtkmm2ext_motion_feedback_h__
21 #define __gtkmm2ext_motion_feedback_h__
23 #include <gdkmm/pixbuf.h>
24 #include <gtkmm/box.h>
25 #include <gtkmm/eventbox.h>
34 class MotionFeedback : public Gtk::VBox
43 MotionFeedback (Glib::RefPtr<Gdk::Pixbuf>,
45 const char *widget_name = NULL,
46 Gtk::Adjustment *adj = NULL,
47 bool with_numeric_display = true,
48 int sub_image_width = 40,
49 int sub_image_height = 40);
50 virtual ~MotionFeedback ();
52 void set_adjustment (Gtk::Adjustment *adj);
53 Gtk::Adjustment *get_adjustment () { return adjustment; }
55 Gtk::Widget& eventwin () { return pixwin; }
56 Gtk::SpinButton& spinner() const { return *value; }
58 gfloat lower () { return _lower; }
59 gfloat upper () { return _upper; }
60 gfloat range () { return _range; }
67 void pixwin_size_request (GtkRequisition *);
69 bool pixwin_button_press_event (GdkEventButton *);
70 bool pixwin_button_release_event (GdkEventButton *);
71 bool pixwin_motion_notify_event (GdkEventMotion *);
72 bool pixwin_key_press_event (GdkEventKey *);
73 bool pixwin_enter_notify_event (GdkEventCrossing *);
74 bool pixwin_leave_notify_event (GdkEventCrossing *);
75 bool pixwin_focus_in_event (GdkEventFocus*);
76 bool pixwin_focus_out_event (GdkEventFocus *);
77 bool pixwin_expose_event (GdkEventExpose*);
78 bool pixwin_scroll_event (GdkEventScroll*);
83 Gtk::HBox* value_packer;
84 Gtk::SpinButton* value;
85 Gtk::Adjustment* adjustment;
86 Glib::RefPtr<Gdk::Pixbuf> pixbuf;
94 bool i_own_my_adjustment;
97 void adjustment_changed ();
102 #endif // __gtkmm2ext_motion_feedback_h__