Continue to improve GtkLengthEntry

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10787 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
John Spray 2006-01-28 16:37:19 +00:00
parent 2ce904c93a
commit 37d42d45f3
3 changed files with 20 additions and 5 deletions

View File

@ -1,9 +1,13 @@
2006-01-28 John Spray <spray@lyx.org>
* GtkLengthEntry.[Ch]: implement signal_changed, setup spin limits
2006-01-27 Bernhard Reiter <ockham@gmx.net>
* GBranch.[Ch], glade/branch.glade: Add the Branches dialog
* Dialogs.C, Makefile.am, glade/Makefile.am: Use GBranch
* GCitation.C, glade/citation.glade: Add some shortcuts,
set shortcut targets correctly plus some minor bc().valid() logic
* GCitation.C, glade/citation.glade: Add some shortcuts,
set shortcut targets correctly plus some minor bc().valid() logic
2006-01-25 Georg Baum <Georg.Baum@post.rwth-aachen.de>

View File

@ -29,10 +29,8 @@ namespace frontend {
GtkLengthEntry::GtkLengthEntry(
BaseObjectType* cobject,
const Glib::RefPtr<Gnome::Glade::Xml>& refGlade)
: Gtk::HBox(cobject), spin_(0.1, 2)
: Gtk::HBox(cobject), adj_(666.0, 0.0, 99999.0, 0.1, 1, 0.0), spin_(adj_, 0.1, 2)
{
spin_.set_range(0.0, 99999.0f);
populateUnitCombo (combo_, true);
relative_ = true;
@ -40,6 +38,14 @@ GtkLengthEntry::GtkLengthEntry(
pack_start (spin_, true, true, 0);
pack_start (combo_, true, true, 0);
show_all();
spin_.signal_changed().connect(sigc::mem_fun(changedsignal_, &sigc::signal<void>::emit));
combo_.signal_changed().connect(sigc::mem_fun(changedsignal_, &sigc::signal<void>::emit));
}
sigc::signal< void >& GtkLengthEntry::signal_changed()
{
return changedsignal_;
}

View File

@ -38,10 +38,15 @@ public:
Gtk::SpinButton *get_spin();
Gtk::ComboBoxText *get_combo();
sigc::signal<void> &signal_changed();
protected:
// spin_ construction depends on adj_, so it must come first
Gtk::Adjustment adj_;
Gtk::SpinButton spin_;
Gtk::ComboBoxText combo_;
sigc::signal<void> changedsignal_;
void emit_changed();
bool relative_;
};