Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
| Context not available. | |||||
| #include "DNA_object_types.h" | #include "DNA_object_types.h" | ||||
| #include "DNA_scene_types.h" | #include "DNA_scene_types.h" | ||||
| #include "DNA_screen_types.h" | #include "DNA_screen_types.h" | ||||
| #include "DNA_constraint_types.h" | |||||
| #include "DNA_modifier_types.h" | |||||
| #include "BLI_math.h" | #include "BLI_math.h" | ||||
| #include "BLI_listbase.h" | #include "BLI_listbase.h" | ||||
| Context not available. | |||||
| ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */ | ListBase *drags = event->customdata; /* drop event type has listbase customdata by default */ | ||||
| for (wmd = drags->first; wmd; wmd = wmd->next) { | for (wmd = drags->first; wmd; wmd = wmd->next) { | ||||
| if (wmd->type == WM_DRAG_ID) { | |||||
| /* align these types with UI_but_active_drop_name */ | /* align these types with UI_but_active_drop_name */ | ||||
| if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | if (ELEM(but->type, UI_BTYPE_TEXT, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | ||||
| ID *id = (ID *)wmd->poin; | |||||
| button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); | button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); | ||||
| BLI_strncpy(data->str, id->name + 2, data->maxlen); | |||||
| if (wmd->type == WM_DRAG_ID) { | |||||
| ID *id = (ID *)wmd->poin; | |||||
| BLI_strncpy(data->str, id->name + 2, data->maxlen); | |||||
| } | |||||
| /* phi: does this really make sense for constraints/vertexgroups/modifiers? */ | |||||
| else if (wmd->type == WM_DRAG_DEFGROUP) { | |||||
| bDeformGroup *dg = ((PointerRNA *)wmd->poin)->data; | |||||
| BLI_strncpy(data->str, dg->name, data->maxlen); | |||||
| } | |||||
sergey: If the suggestion above is followed this seems to be really couple of lines only? | |||||
| else if (wmd->type == WM_DRAG_CONSTRAINT) { | |||||
| bConstraint *con = ((PointerRNA *)wmd->poin)->data; | |||||
| BLI_strncpy(data->str, con->name, data->maxlen); | |||||
Not Done Inline ActionsI dont see why this would leak memory, can the comment be removed? campbellbarton: I dont see why this would leak memory, can the comment be removed? | |||||
| } | |||||
| else if (wmd->type == WM_DRAG_MODIFIER) { | |||||
| ModifierData *md = ((PointerRNA *)wmd->poin)->data; | |||||
| BLI_strncpy(data->str, md->name, data->maxlen); | |||||
| } | |||||
| if (ELEM(but->type, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | if (ELEM(but->type, UI_BTYPE_SEARCH_MENU, UI_BTYPE_SEARCH_MENU_UNLINK)) { | ||||
| but->changed = true; | but->changed = true; | ||||
| ui_searchbox_update(C, data->searchbox, but, true); | ui_searchbox_update(C, data->searchbox, but, true); | ||||
| Context not available. | |||||
| button_activate_state(C, but, BUTTON_STATE_EXIT); | button_activate_state(C, but, BUTTON_STATE_EXIT); | ||||
| } | } | ||||
| } | } | ||||
| } | |||||
| } | } | ||||
| Context not available. | |||||
If the suggestion above is followed this seems to be really couple of lines only?