int.cpp revision 081364debe4793081bf3f50cb82ca7d0999a41d4
/*
* Copyright (C) 2005-2007 Authors:
* Ted Gould <ted@gould.cx>
* Johan Engelen <johan@shouraizou.nl> *
* Jon A. Cruz <jon@joncruz.org>
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gtkmm/adjustment.h>
#include "ui/widget/spinbutton.h"
#include "extension/extension.h"
#include "preferences.h"
#include "int.h"
namespace Inkscape {
namespace Extension {
/** Use the superclass' allocator and set the \c _value. */
bool gui_hidden,
{
const char * defaultval = NULL;
}
if (defaultval != NULL) {
}
}
}
/* We're handling this by just killing both values */
_max = 10;
_min = 0;
}
}
// std::cout << "New Int:: value: " << _value << " max: " << _max << " min: " << _min << std::endl;
}
}
}
/**
* A function to set the \c _value.
* This function sets the internal value, but it also sets the value
* in the preferences structure. To put it in the right place, \c PREF_DIR
* and \c pref_name() are used.
*
* @param in The value to set to.
* @param doc A document that should be used to set the value.
* @param node The node where the value may be placed.
*/
{
}
}
return _value;
}
/** A class to make an adjustment that uses Extension params. */
/** The parameter to adjust. */
SPDocument * _doc;
public:
/** Make the adjustment using an extension and the string
describing the parameter. */
ParamIntAdjustment (ParamInt * param, SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal) :
Gtk::Adjustment(0.0, param->min(), param->max(), 1.0, 10.0, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) {
};
void val_changed (void);
}; /* class ParamIntAdjustment */
/**
* A function to respond to the value_changed signal from the adjustment.
*
* This function just grabs the value from the adjustment and writes
* it to the parameter. Very simple, but yet beautiful.
*/
void ParamIntAdjustment::val_changed(void)
{
//std::cout << "Value Changed to: " << this->get_value() << std::endl;
if (_changeSignal != NULL) {
_changeSignal->emit();
}
}
/**
* Creates a Int Adjustment for a int parameter.
*
* Builds a hbox with a label and a int adjustment in it.
*/
ParamInt::get_widget (SPDocument * doc, Inkscape::XML::Node * node, sigc::signal<void> * changeSignal)
{
if (_gui_hidden) {
return NULL;
}
scale->set_draw_value(false);
}
Inkscape::UI::Widget::SpinButton * spin = Gtk::manage(new Inkscape::UI::Widget::SpinButton(*fadjust, 1.0, 0));
}
{
char startstring[32];
string += startstring;
}
} // namespace Extension
} // namespace Inkscape
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :