Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_buttons/buttons_ops.c
| Show First 20 Lines • Show All 66 Lines • ▼ Show 20 Lines | static int toolbox_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event)) | ||||
| bScreen *sc = CTX_wm_screen(C); | bScreen *sc = CTX_wm_screen(C); | ||||
| SpaceButs *sbuts = CTX_wm_space_buts(C); | SpaceButs *sbuts = CTX_wm_space_buts(C); | ||||
| PointerRNA ptr; | PointerRNA ptr; | ||||
| uiPopupMenu *pup; | uiPopupMenu *pup; | ||||
| uiLayout *layout; | uiLayout *layout; | ||||
| RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr); | RNA_pointer_create(&sc->id, &RNA_SpaceProperties, sbuts, &ptr); | ||||
| pup = uiPupMenuBegin(C, IFACE_("Align"), ICON_NONE); | pup = UI_popup_menu_begin(C, IFACE_("Align"), ICON_NONE); | ||||
| layout = uiPupMenuLayout(pup); | layout = UI_popup_menu_layout(pup); | ||||
| uiItemsEnumR(layout, &ptr, "align"); | uiItemsEnumR(layout, &ptr, "align"); | ||||
| uiPupMenuEnd(C, pup); | UI_popup_menu_end(C, pup); | ||||
| return OPERATOR_INTERFACE; | return OPERATOR_INTERFACE; | ||||
| } | } | ||||
| void BUTTONS_OT_toolbox(wmOperatorType *ot) | void BUTTONS_OT_toolbox(wmOperatorType *ot) | ||||
| { | { | ||||
| /* identifiers */ | /* identifiers */ | ||||
| ot->name = "Toolbox"; | ot->name = "Toolbox"; | ||||
| ▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Lines | static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event) | ||||
| FileBrowseOp *fbo; | FileBrowseOp *fbo; | ||||
| char *str; | char *str; | ||||
| if (CTX_wm_space_file(C)) { | if (CTX_wm_space_file(C)) { | ||||
| BKE_report(op->reports, RPT_ERROR, "Cannot activate a file selector, one already open"); | BKE_report(op->reports, RPT_ERROR, "Cannot activate a file selector, one already open"); | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| } | } | ||||
| uiFileBrowseContextProperty(C, &ptr, &prop); | UI_context_active_but_prop_get_filebrowser(C, &ptr, &prop); | ||||
| if (!prop) | if (!prop) | ||||
| return OPERATOR_CANCELLED; | return OPERATOR_CANCELLED; | ||||
| str = RNA_property_string_get_alloc(&ptr, prop, NULL, 0, NULL); | str = RNA_property_string_get_alloc(&ptr, prop, NULL, 0, NULL); | ||||
| /* useful yet irritating feature, Shift+Click to open the file | /* useful yet irritating feature, Shift+Click to open the file | ||||
| * Alt+Click to browse a folder in the OS's browser */ | * Alt+Click to browse a folder in the OS's browser */ | ||||
| ▲ Show 20 Lines • Show All 80 Lines • Show Last 20 Lines | |||||