diff options
| author | Jon A. Cruz <jon@joncruz.org> | 2011-10-27 04:55:51 +0000 |
|---|---|---|
| committer | Jon A. Cruz <jon@joncruz.org> | 2011-10-27 04:55:51 +0000 |
| commit | 2633767789e4264b13ef91a684accf734fb4e94f (patch) | |
| tree | 0f6bc8d758b8e4bcf01d2dd393166907906c156e /src/ui/widget/spinbutton.h | |
| parent | Cleanup pass on documentation that was dumping garbage into doxygen output. (diff) | |
| download | inkscape-2633767789e4264b13ef91a684accf734fb4e94f.tar.gz inkscape-2633767789e4264b13ef91a684accf734fb4e94f.zip | |
Fixing more broken and split doc comments.
(bzr r10697)
Diffstat (limited to 'src/ui/widget/spinbutton.h')
| -rw-r--r-- | src/ui/widget/spinbutton.h | 39 |
1 files changed, 31 insertions, 8 deletions
diff --git a/src/ui/widget/spinbutton.h b/src/ui/widget/spinbutton.h index df913553d..b7764d979 100644 --- a/src/ui/widget/spinbutton.h +++ b/src/ui/widget/spinbutton.h @@ -1,6 +1,3 @@ -/** - * \brief SpinButton widget, that allows entry of both '.' and ',' for the decimal, even when in numeric mode. - */ /* * Author: * Johan B. C. Engelen @@ -22,7 +19,8 @@ namespace Widget { class UnitMenu; /** - * SpinButton widget, that allows entry of simple math expressions (also units, when linked with UnitMenu). + * 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. */ @@ -50,10 +48,35 @@ protected: UnitMenu *_unit_menu; /// Linked unit menu for unit conversion in entered expressions. void connect_signals(); - int on_input(double* newvalue); - bool on_my_focus_in_event(GdkEventFocus* event); - bool on_my_key_press_event(GdkEventKey* event); - void undo(); + + /** + * 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. + */ + int on_input(double* newvalue); + + /** + * When focus is obtained, save the value to enable undo later. + * @retval false continue with default handler. + * @retval true don't call default handler. + */ + bool on_my_focus_in_event(GdkEventFocus* event); + + /** + * Handle specific keypress events, like Ctrl+Z. + * + * @retval false continue with default handler. + * @retval true don't call default handler. + */ + bool on_my_key_press_event(GdkEventKey* event); + + /** + * Undo the editing, by resetting the value upon when the spinbutton got focus. + */ + void undo(); double on_focus_in_value; |
