scalar-unit.h revision a4030d5ca449e7e384bc699cd249ee704faaeab0
/**
* \brief Scalar Unit Widget - A labelled text box, with spin buttons and
* optional icon or suffix, for entering the values of various unit
* types.
*
* 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.
*/
#ifndef INKSCAPE_UI_WIDGET_SCALAR_UNIT_H
#define INKSCAPE_UI_WIDGET_SCALAR_UNIT_H
#include "scalar.h"
#include "unit-menu.h"
{
bool mnemonic = true);
UnitType getUnitType() const;
void setHundredPercent(double number);
void setAbsoluteIsIncrement(bool value);
void setPercentageIsIncrement(bool value);
double PercentageToAbsolute(double value);
double AbsoluteToPercentage(double value);
double getAsPercentage();
void setFromPercentage(double value);
void on_unit_changed();
double _hundred_percent; // the length that corresponds to 100%, in px, for %-to/from-absolute conversions
bool _absolute_is_increment; // if true, 120% with _hundred_percent=100px gets converted to/from 20px; otherwise, to/from 120px
bool _percentage_is_increment; // if true, 120px with _hundred_percent=100px gets converted to/from 20%; otherwise, to/from 120%
};
} // namespace Widget
} // namespace UI
} // namespace Inkscape
#endif // INKSCAPE_UI_WIDGET_SCALAR_UNIT_H
/*
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 :