13
0

Re-synced and fixed doi.h.

git-svn-id: svn://localhost/trunk/ardour2@23 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Taybin Rutkin 2005-09-25 17:29:50 +00:00
parent df74b4a591
commit e4b9aed743
9 changed files with 25 additions and 19 deletions

View File

@ -25,7 +25,7 @@ gtkmm2ext.Merge ([
domain = 'libgtkmm2ext'
gtkmm2ext.Append(DOMAIN=domain,MAJOR=0,MINOR=8,MICRO=0)
gtkmm2ext.Append(DOMAIN=domain,MAJOR=0,MINOR=8,MICRO=1)
gtkmm2ext.Append(CXXFLAGS="-DPACKAGE=\\\"" + domain + "\\\"")
gtkmm2ext.Append(CCFLAGS="-DLIBSIGC_DISABLE_DEPRECATED")
gtkmm2ext.Append(PACKAGE=domain)

View File

@ -33,7 +33,7 @@ const unsigned int AutoSpin::initial_timer_interval = 500; /* msecs */
const unsigned int AutoSpin::timer_interval = 20; /* msecs */
const unsigned int AutoSpin::climb_timer_calls = 5; /* between climbing */
AutoSpin::AutoSpin (Gtk::Adjustment &adjr, gfloat cr)
AutoSpin::AutoSpin (Gtk::Adjustment &adjr, gfloat cr, bool round_to_steps_yn)
: adjustment (adjr),
climb_rate (cr)
@ -44,6 +44,7 @@ AutoSpin::AutoSpin (Gtk::Adjustment &adjr, gfloat cr)
have_timer = false;
need_timer = false;
timer_calls = 0;
round_to_steps = round_to_steps_yn;
}
void
@ -164,7 +165,10 @@ AutoSpin::_timer (void *arg)
void
AutoSpin::set_value (gfloat value)
{
adjustment.set_value (value);
if (round_to_steps)
adjustment.set_value (floor((value / step_increment) + 0.5f) * step_increment);
else
adjustment.set_value (value);
}
bool
@ -193,7 +197,7 @@ AutoSpin::adjust_value (gfloat increment)
}
}
adjustment.set_value (val);
set_value(val);
return done;
}
@ -253,6 +257,8 @@ AutoSpin::set_bounds (gfloat init, gfloat up, gfloat down, bool with_reset)
{
adjustment.set_upper(up);
adjustment.set_lower(down);
initial = init;
adjustment.changed ();

View File

@ -33,7 +33,7 @@ Choice::Choice (string prompt,
int n;
vector<string>::iterator i;
set_position (WIN_POS_MOUSE);
set_position (Gtk::WIN_POS_CENTER);
set_name ("ChoiceWindow");
add (packer);

View File

@ -29,8 +29,8 @@ using namespace Gtk;
using namespace Gtkmm2ext;
using namespace sigc;
ClickBox::ClickBox (Gtk::Adjustment *adjp, const string &name)
: AutoSpin (*adjp)
ClickBox::ClickBox (Gtk::Adjustment *adjp, const string &name, bool round_to_steps)
: AutoSpin (*adjp,0,round_to_steps)
{
print_func = default_printer;
print_arg = 0;
@ -68,9 +68,8 @@ ClickBox::button_release_handler (GdkEventButton* ev)
case 2:
case 3:
stop_spinning (0);
remove_modal_grab();
break;
default:
remove_modal_grab();
break;
}
return true;

View File

@ -29,7 +29,7 @@ class AutoSpin
{
public:
AutoSpin (Gtk::Adjustment &adj, gfloat cr = 0);
AutoSpin (Gtk::Adjustment &adj, gfloat cr = 0, bool round_to_steps_yn = false);
Gtk::Adjustment &get_adjustment() { return adjustment; }
@ -54,6 +54,7 @@ class AutoSpin
bool wrap;
gint timeout_tag;
bool left_is_decrement;
bool round_to_steps;
static const unsigned int initial_timer_interval;
static const unsigned int timer_interval;

View File

@ -31,7 +31,7 @@ namespace Gtkmm2ext {
class ClickBox : public Gtk::DrawingArea, public AutoSpin
{
public:
ClickBox (Gtk::Adjustment *adj, const std::string &name);
ClickBox (Gtk::Adjustment *adj, const std::string &name, bool round_to_steps = false);
~ClickBox ();
void set_print_func(void (*pf)(char buf[32], Gtk::Adjustment &, void *),

View File

@ -25,12 +25,12 @@
/* XXX g++ 2.95 can't compile this as pair of member function templates */
template<class T> gint idle_delete (T *obj) { delete obj; return FALSE; }
template<class T> void delete_when_idle (T *obj) {
Gtk::Main::idle.connect (sigc::bind (sigc::slot (idle_delete<T>), obj));
template<typename T> gint idle_delete (T *obj) { delete obj; return FALSE; }
template<typename T> void delete_when_idle (T *obj) {
Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete<T>), obj));
}
template<class T> gint delete_on_unmap (GdkEventAny *ignored, T *obj) {
Gtk::Main::idle.connect (sigc::bind (sigc::slot (idle_delete<T>), obj));
template<typename T> gint delete_on_unmap (GdkEventAny *ignored, T *obj) {
Glib::signal_idle().connect (sigc::bind (sigc::ptr_fun (idle_delete<T>), obj));
return FALSE;
}

View File

@ -1,13 +1,13 @@
#ifndef __ardour_gtk_stop_signal_h__
#define __ardour_gtk_stop_signal_h__
#include <gtk--/widget.h>
#include <gtkmm.h>
#include <gtk/gtksignal.h>
static inline gint
stop_signal (Gtk::Widget& widget, const char *signal_name)
{
gtk_signal_emit_stop_by_name (GTK_OBJECT(widget.gtkobj()), signal_name);
gtk_signal_emit_stop_by_name (GTK_OBJECT(widget.gobj()), signal_name);
return TRUE;
}

View File

@ -60,7 +60,7 @@ PixScroller::PixScroller (Adjustment& a, Pix& pix)
overall_height = railrect.get_height() + sliderrect.get_height();
sliderrect.set_y((int) rint ((overall_height - sliderrect.get_height()) * (adj.get_upper() - adj.get_value())));
railrect.set_x((sliderrect.get_width() / 2) - 3);
railrect.set_x((sliderrect.get_width() / 2) - 2);
}
void