spinbutton.h revision 1c66d2e22f93c21c9dcc7a71d4f1f3e07a5704a8
/*
* Author:
* Johan B. C. Engelen
*
* Copyright (C) 2011 Author
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
#ifndef INKSCAPE_UI_WIDGET_SPINBUTTON_H
#define INKSCAPE_UI_WIDGET_SPINBUTTON_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#endif
#include <gtkmm/spinbutton.h>
/**
* SpinButton widget, that allows entry of simple math expressions (also units, when linked with UnitMenu),
* and allows entry of both '.' and ',' for the decimal, even when in numeric mode.
*
* Calling "set_numeric()" effectively disables the expression parsing. If no unit menu is linked, all unitlike characters are ignored.
*/
{
{
};
#if GTK_CHECK_VERSION(3,0,0)
explicit SpinButton(Glib::RefPtr<Gtk::Adjustment>& adjustment, double climb_rate = 0.0, guint digits = 0)
#else
#endif
{
};
virtual ~SpinButton() {};
double _on_focus_in_value;
void connect_signals();
/**
* This callback function should try to convert the entered text to a number and write it to newvalue.
* It calls a method to evaluate the (potential) mathematical expression.
*
* @retval false No conversion done, continue with default handler.
* @retval true Conversion successful, don't call default handler.
*/
/**
* When focus is obtained, save the value to enable undo later.
* @retval false continue with default handler.
* @retval true don't call default handler.
*/
/**
* Handle specific keypress events, like Ctrl+Z.
*
* @retval false continue with default handler.
* @retval true don't call default handler.
*/
/**
* Undo the editing, by resetting the value upon when the spinbutton got focus.
*/
void undo();
// noncopyable
SpinButton(const SpinButton&);
};
} // namespace Widget
} // namespace UI
} // namespace Inkscape
#endif // INKSCAPE_UI_WIDGET_SPINBUTTON_H
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=c++:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :