Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-11-01 20:30:07 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-11-01 21:01:10 +0300
commit3ec4d0b51bf3a76725e39a57b0f30bec3edc6882 (patch)
tree8d99f8552e0cc465a9469f5d569433cbfa3dab88 /source/blender/editors/include/UI_interface.h
parent07dbff7dc1d5cfca9fbfb74204a2298e16d471b4 (diff)
UI: Add UILayout.operator_menu_hold
This is an operator button that opens a menu when the button is held.
Diffstat (limited to 'source/blender/editors/include/UI_interface.h')
-rw-r--r--source/blender/editors/include/UI_interface.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 8b4f094cb8d..a609a3b51fd 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -136,6 +136,7 @@ enum {
/* block->flag bits 14-17 are identical to but->drawflag bits */
+#define UI_BLOCK_POPUP_HOLD (1 << 18)
#define UI_BLOCK_LIST_ITEM (1 << 19)
#define UI_BLOCK_RADIAL (1 << 20)
@@ -354,6 +355,7 @@ typedef struct uiSearchItems uiSearchItems;
typedef void (*uiButHandleFunc)(struct bContext *C, void *arg1, void *arg2);
typedef void (*uiButHandleRenameFunc)(struct bContext *C, void *arg, char *origstr);
typedef void (*uiButHandleNFunc)(struct bContext *C, void *argN, void *arg2);
+typedef void (*uiButHandleHoldFunc)(struct bContext *C, struct ARegion *butregion, uiBut *but);
typedef int (*uiButCompleteFunc)(struct bContext *C, char *str, void *arg);
typedef struct ARegion *(*uiButSearchCreateFunc)(struct bContext *C, struct ARegion *butregion, uiBut *but);
typedef void (*uiButSearchFunc)(const struct bContext *C, void *arg, const char *str, uiSearchItems *items);
@@ -395,6 +397,7 @@ void UI_popup_menu_reports(struct bContext *C, struct ReportList *reports) ATTR_
int UI_popup_menu_invoke(struct bContext *C, const char *idname, struct ReportList *reports) ATTR_NONNULL(1, 2);
void UI_popup_menu_retval_set(const uiBlock *block, const int retval, const bool enable);
+void UI_popup_menu_but_set(uiPopupMenu *pup, struct ARegion *butregion, uiBut *but);
/* Pie menus */
typedef struct uiPieMenu uiPieMenu;
@@ -726,6 +729,8 @@ bool UI_textbutton_activate_but(const struct bContext *C, uiBut *but);
void UI_but_focus_on_enter_event(struct wmWindow *win, uiBut *but);
+void UI_but_func_hold_set(uiBut *but, uiButHandleHoldFunc func, void *argN);
+
/* Autocomplete
*
* Tab complete helper functions, for use in uiButCompleteFunc callbacks.
@@ -988,6 +993,11 @@ void uiItemFullO(
uiLayout *layout, const char *idname, const char *name, int icon,
struct IDProperty *properties, int context, int flag,
PointerRNA *r_opptr);
+void uiItemFullOMenuHold_ptr(
+ uiLayout *layout, struct wmOperatorType *ot, const char *name, int icon,
+ struct IDProperty *properties, int context, int flag,
+ const char *menu_id, /* extra menu arg. */
+ PointerRNA *r_opptr);
void uiItemR(uiLayout *layout, struct PointerRNA *ptr, const char *propname, int flag, const char *name, int icon);
void uiItemFullR(uiLayout *layout, struct PointerRNA *ptr, struct PropertyRNA *prop, int index, int value, int flag, const char *name, int icon);