From 0d267737e23ba7032377a1aa2884d40a14025a39 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 16 Nov 2015 06:26:25 +1100 Subject: UI: support cycling callback for non RNA menus --- source/blender/editors/include/UI_interface.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/editors/include') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index fc824dc58df..108fcdda613 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -361,6 +361,13 @@ typedef void (*uiBlockHandleFunc)(struct bContext *C, void *arg, int event); typedef void (*uiMenuCreateFunc)(struct bContext *C, struct uiLayout *layout, void *arg1); typedef void (*uiMenuHandleFunc)(struct bContext *C, void *arg, int event); +/** + * Used for cycling menu values without opening the menu (Ctrl-Wheel). + * \param direction: forward or backwards [1 / -1]. + * \param arg1: uiBut.poin (as with #uiMenuCreateFunc). + * \return true when the button was changed. + */ +typedef bool (*uiMenuStepFunc)(struct bContext *C, int direction, void *arg1); /* Popup Menus * @@ -693,6 +700,8 @@ void UI_but_func_drawextra_set( void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2); +void UI_but_func_menu_step_set(uiBut *but, uiMenuStepFunc func); + void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *argN); void UI_but_tooltip_timer_remove(struct bContext *C, uiBut *but); -- cgit v1.2.3