int.cpp revision 2992b54e5b7839b430b63a4df01abbc6f72f393f
/*
* Copyright (C) 2005-2007 Authors:
* Ted Gould <ted@gould.cx>
* Johan Engelen <johan@shouraizou.nl> *
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include <gtkmm/adjustment.h>
#include <gtkmm/spinbutton.h>
#include "extension/extension.h"
#include "preferences.h"
#include "int.h"
namespace Inkscape {
namespace Extension {
/** \brief 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;
return;
}
/** \brief A function to set the \c _value
\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
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.
*/
int
{
return _value;
}
/** \brief A class to make an adjustment that uses Extension params */
/** The parameter to adjust */
SPDocument * _doc;
public:
/** \brief 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, 0), _pref(param), _doc(doc), _node(node), _changeSignal(changeSignal) {
return;
};
void val_changed (void);
}; /* class ParamIntAdjustment */
/** \brief 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();
}
return;
}
/**
\brief 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);
}
}
/** \brief Return the value as a string */
void
{
char startstring[32];
string += startstring;
return;
}
} /* 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 :