/*
* Authors:
* Bryce Harrington <bryce@bryceharrington.org>
* Derek P. Moore <derekm@hackunix.org>
* buliabyak@gmail.com
*
* Copyright (C) 2004-2005 Authors
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "scalar-unit.h"
#include "spinbutton.h"
namespace Inkscape {
namespace UI {
namespace Widget {
bool mnemonic)
_hundred_percent(0),
_absolute_is_increment(false),
_percentage_is_increment(false)
{
if (_unit_menu == NULL) {
_unit_menu = new UnitMenu();
}
}
bool mnemonic)
_hundred_percent(0),
_absolute_is_increment(false),
_percentage_is_increment(false)
{
}
{
_unit_menu->getDefaultPage());
}
{
// First set the unit
return false;
}
return true;
}
{
}
{
}
{
return _unit_menu->getUnit();
}
{
return _unit_menu->getUnitType();
}
{
}
{
if (units == "") {
// set the value in the default units
} else {
}
}
{
}
{
if (unit_name == "") {
// Return the value in the default units
} else {
}
}
{
_widget->grab_focus();
}
{
}
{
}
{
}
{
// convert from percent to absolute
double convertedVal = 0;
double hundred_converted = _hundred_percent / _unit_menu->getConversion("px"); // _hundred_percent is in px
value += 100;
return convertedVal;
}
{
double convertedVal = 0;
// convert from absolute to percent
if (_hundred_percent == 0) {
convertedVal = 0;
else
convertedVal = 100;
} else {
double hundred_converted = _hundred_percent / _unit_menu->getConversion("px", lastUnits); // _hundred_percent is in px
convertedVal -= 100;
}
return convertedVal;
}
{
return convertedVal;
}
{
}
{
double convertedVal = 0;
} else {
}
}
} // namespace Widget
} // namespace UI
} // 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 :