/*
* Author:
* Bryce Harrington <bryce@bryceharrington.org>
*
* Copyright (C) 2004 Bryce Harrington
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <cmath>
#include "unit-menu.h"
namespace Inkscape {
namespace UI {
namespace Widget {
{
set_active(0);
}
}
{
// Expand the unit widget with unit entries from the unit table
}
return true;
}
{
remove_all();
return setUnitType(unit_type);
}
{
unit_table.addUnit(u, false);
}
{
if (get_active_text() == "") {
}
}
{
// TODO: Determine if 'unit' is available in the dropdown.
// If not, return false
return true;
}
{
if (get_active_text() == "") {
return "";
}
}
{
}
{
}
{
return getUnit()->defaultDigits();
}
{
}
{
return 10 * getDefaultStep();
}
double UnitMenu::getConversion(Glib::ustring const &new_unit_abbr, Glib::ustring const &old_unit_abbr) const
{
if (old_unit_abbr != "no_unit") {
}
// Catch the case of zero or negative unit factors (error!)
if (old_factor < 0.0000001 ||
// TODO: Should we assert here?
return 0.00;
}
}
{
return getUnitType() != UNIT_TYPE_DIMENSIONLESS;
}
{
return getUnitType() == UNIT_TYPE_RADIAL;
}
} // 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 :