X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fadjust_window.cpp;h=0b62737414f4cc39e8c92e60404c503e970c7710;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=105b72b642c381d9b7ecc61632a4e670b53133df;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/adjust_window.cpp b/synfig-studio/trunk/src/gtkmm/adjust_window.cpp index 105b72b..0b62737 100644 --- a/synfig-studio/trunk/src/gtkmm/adjust_window.cpp +++ b/synfig-studio/trunk/src/gtkmm/adjust_window.cpp @@ -2,19 +2,20 @@ /*! \file adjust_window.cpp ** \brief Adjustment Window Implementation File ** -** $Id: adjust_window.cpp,v 1.1.1.1 2005/01/07 03:34:35 darco Exp $ +** $Id$ ** ** \legal ** Copyright (c) 2004 Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -31,6 +32,8 @@ #include "adjust_window.h" #include "app.h" +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -80,14 +83,15 @@ const Gtk::Adjustment *Adjust_Window::get_child_adjustment() const void Adjust_Window::set_child_adjustment(Gtk::Adjustment *child) { childchanged.disconnect(); - + adj_child = child; - - synfig::info("Adjust: connecting to child signals"); + + // synfig::info("Adjust: connecting to child signals"); + if(child) { childchanged = child->signal_changed().connect(sigc::mem_fun(*this,&Adjust_Window::update_fromchild)); - + update_child(); } } @@ -119,23 +123,23 @@ void Adjust_Window::update_child() if(adj_child) { bool childchanged = false; - + double v = get_value(); double ve = v + get_page_size(); - + //reset child's values if they need to be... if(abs(v - adj_child->get_lower()) > EPSILON) { adj_child->set_lower(v); childchanged = true; } - + if(abs(ve - adj_child->get_upper()) > EPSILON) { adj_child->set_upper(ve); - childchanged = true; + childchanged = true; } - + if(childchanged) { adj_child->changed(); @@ -146,17 +150,17 @@ void Adjust_Window::update_child() void Adjust_Window::update_fromchild() { if(adj_child) - { + { double b = adj_child->get_lower(); double dist = adj_child->get_upper() - b; - + //reset our values if they need to be... if(abs(get_value() - b) > EPSILON) { set_value(b); value_changed(); } - + if(abs(get_page_size() - dist) > EPSILON) { set_page_size(dist);