/*! \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
*/
/* ========================================================================= */
#include "adjust_window.h"
#include "app.h"
+#include "general.h"
+
#endif
/* === U S I N G =========================================================== */
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();
}
}
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();
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);