diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-24 23:08:24 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-24 23:08:24 +0400 |
commit | 8bf206ce4b5fb3d8bb0e143d9b5e8422f71aefc7 (patch) | |
tree | a9b333a7bdfd20100a6e0299ca5ca04a4ecc86c6 | |
parent | d74cf435755ebf4b69efc015e49ccdc2f77ad6e5 (diff) |
edit to 55549, replace fake click event with call to uiButActiveOnly().
also make it more clear args are for rna buttons.
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 3 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 23 |
2 files changed, 10 insertions, 16 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index a446b1d98a3..54f10d2ff30 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -643,7 +643,8 @@ void uiBlockSetDrawExtraFunc(uiBlock *block, void (*func)(const struct bContext *C, void *, void *, void *, struct rcti *rect), void *arg1, void *arg2); -void UI_textbutton_activate_event(const struct bContext *C, struct ARegion *ar, void *basepoin, const char *identifier); +void UI_textbutton_activate_event(const struct bContext *C, struct ARegion *ar, + const void *rna_poin_data, const char *rna_prop_id); void uiButSetFocusOnEnter(struct wmWindow *win, uiBut *but); diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 7afc00f5a07..8b8e8ceaa9c 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -7456,18 +7456,20 @@ void UI_remove_popup_handlers(ListBase *handlers, uiPopupBlockHandle *popup) WM_event_remove_ui_handler(handlers, ui_handler_popup, ui_handler_remove_popup, popup, FALSE); } -void UI_textbutton_activate_event(const bContext *C, ARegion *ar, void *basepoin, const char *identifier) +void UI_textbutton_activate_event(const bContext *C, ARegion *ar, + const void *rna_poin_data, const char *rna_prop_id) { uiBlock *block; - uiBut *but; + uiBut *but = NULL; for (block = ar->uiblocks.first; block; block = block->next) { for (but = block->buttons.first; but; but = but->next) { if (but->type == TEX) { - if (but->rnaprop && but->rnapoin.data == basepoin) - if (strcmp(RNA_property_identifier(but->rnaprop), identifier)==0) + if (but->rnaprop && but->rnapoin.data == rna_poin_data) { + if (STREQ(RNA_property_identifier(but->rnaprop), rna_prop_id)) { break; - + } + } } } if (but) @@ -7475,16 +7477,7 @@ void UI_textbutton_activate_event(const bContext *C, ARegion *ar, void *basepoin } if (but) { - wmWindow *win = CTX_wm_window(C); - wmEvent event; - - event = *(win->eventstate); /* XXX huh huh? make api call */ - event.type = EVT_BUT_OPEN; - event.val = KM_PRESS; - event.customdata = but; - event.customdatafree = FALSE; - wm_event_add(win, &event); - + uiButActiveOnly(C, block, but); } } |