|
Blender
V2.93
|
#include <stdarg.h>#include <stdlib.h>#include <string.h>#include "MEM_guardedalloc.h"#include "DNA_userdef_types.h"#include "BLI_listbase.h"#include "BLI_math.h"#include "BLI_ghash.h"#include "BLI_rect.h"#include "BLI_string.h"#include "BLI_utildefines.h"#include "BKE_context.h"#include "BKE_report.h"#include "BKE_screen.h"#include "WM_api.h"#include "WM_types.h"#include "RNA_access.h"#include "UI_interface.h"#include "BLT_translation.h"#include "ED_screen.h"#include "interface_intern.h"#include "interface_regions_intern.h"Go to the source code of this file.
Classes | |
| struct | uiPopupMenu |
PopUp Menu Region
Definition in file interface_region_menu_popup.c.
|
static |
Definition at line 171 of file interface_region_menu_popup.c.
References ARegion::alignment, BLI_findindex(), BLI_rctf_size_x(), uiPopupMenu::block, uiPopupMenu::but, uiBlock::buttons, C, CTX_wm_region(), uiBlock::direction, uiBut::drawstr, uiBlock::flag, uiBlock::handle, height, uiPopupMenu::layout, LISTBASE_FOREACH, uiPopupMenu::menu_arg, uiPopupMenu::menu_func, min_ii(), uiBlock::minbounds, NULL, uiPopupMenu::popup, uiBut::rect, uiPopupBlockHandle::region, ARegion::regiontype, RGN_ALIGN_BOTTOM, RGN_ALIGN_ENUM_FROM_MASK, RGN_TYPE_IS_HEADER_ANY, uiPopupMenu::slideout, UI_block_bounds_set_menu(), UI_block_bounds_set_text(), UI_block_direction_set(), UI_block_flag_enable(), UI_block_layout_resolve(), UI_BLOCK_LOOP, UI_BLOCK_MOVEMOUSE_QUIT, UI_BLOCK_NUMSELECT, UI_block_order_flip(), UI_BLOCK_POPUP_MEMORY, UI_block_region_set(), UI_BLOCK_THEME_STYLE_POPUP, UI_block_theme_style_set(), ui_but_activate_over(), ui_but_is_editable(), UI_DIR_DOWN, UI_DIR_RIGHT, UI_DIR_UP, UI_MENU_WIDTH_MIN, ui_popup_menu_memory_get(), UI_UNIT_X, UI_UNIT_Y, ARegion::uiblocks, uiLayoutGetUnitsX(), width, rctf::xmin, and rctf::ymin.
Referenced by ui_popup_menu_create(), and UI_popup_menu_end().
| int ui_but_menu_step | ( | uiBut * | but, |
| int | direction | ||
| ) |
Definition at line 73 of file interface_region_menu_popup.c.
References uiBut::block, uiBlock::evil_C, uiBut::menu_step_func, uiBut::poin, RNA_property_enum_get(), RNA_property_enum_step(), uiBut::rnapoin, uiBut::rnaprop, uiBut::str, and ui_but_menu_step_poll().
Referenced by ui_do_but_BLOCK().
| bool ui_but_menu_step_poll | ( | const uiBut * | but | ) |
Definition at line 64 of file interface_region_menu_popup.c.
References BLI_assert, uiBut::menu_step_func, NULL, PROP_ENUM, RNA_property_type(), uiBut::rnaprop, uiBut::type, and UI_BTYPE_MENU.
Referenced by ui_but_menu_step(), and ui_but_supports_cycling().
Definition at line 655 of file interface_region_menu_popup.c.
References C, ED_region_tag_refresh_ui(), uiBlock::handle, LISTBASE_FOREACH, wmWindow::modalhandlers, bScreen::regionbase, ui_popup_block_free(), UI_popup_handlers_remove(), and WM_window_get_active_screen().
Referenced by dialog_exec_cb(), wm_block_autorun_warning_enable_scripts(), wm_block_autorun_warning_ignore(), wm_block_autorun_warning_reload_with_scripts(), wm_block_close(), wm_block_file_close_cancel(), wm_block_file_close_discard(), and wm_block_file_close_save().
| void UI_popup_block_ex | ( | bContext * | C, |
| uiBlockCreateFunc | func, | ||
| uiBlockHandleFunc | popup_func, | ||
| uiBlockCancelFunc | cancel_func, | ||
| void * | arg, | ||
| wmOperator * | op | ||
| ) |
Definition at line 608 of file interface_region_menu_popup.c.
References C, uiPopupBlockHandle::can_refresh, uiPopupBlockHandle::cancel_func, CTX_wm_window(), ListBase::first, wmWindow::modalhandlers, NULL, uiPopupBlockHandle::popup, uiPopupBlockHandle::popup_arg, uiPopupBlockHandle::popup_func, uiPopupBlockHandle::popup_op, uiPopupBlockHandle::region, uiPopupBlockHandle::retvalue, UI_block_active_only_flagged_buttons(), ui_popup_block_create(), UI_popup_handlers_add(), ARegion::uiblocks, and WM_event_add_mousemove().
Referenced by popup_add_shortcut_func(), WM_operator_props_dialog_popup(), wm_operator_props_popup_ex(), and WM_operator_ui_popup().
| void UI_popup_block_invoke | ( | bContext * | C, |
| uiBlockCreateFunc | func, | ||
| void * | arg, | ||
| void(*)(void *arg) | arg_free | ||
| ) |
Definition at line 600 of file interface_region_menu_popup.c.
References C, and UI_popup_block_invoke_ex().
Referenced by merged_element_search_menu_invoke(), node_find_node_invoke(), popup_change_shortcut_func(), wm_about_invoke(), wm_close_file_dialog(), WM_enum_search_invoke(), WM_enum_search_invoke_previews(), WM_operator_redo_popup(), wm_splash_invoke(), and wm_test_autorun_warning().
| void UI_popup_block_invoke_ex | ( | bContext * | C, |
| uiBlockCreateFunc | func, | ||
| void * | arg, | ||
| void(*)(void *arg) | arg_free, | ||
| bool | can_refresh | ||
| ) |
Definition at line 582 of file interface_region_menu_popup.c.
References C, uiPopupBlockHandle::can_refresh, CTX_wm_window(), ListBase::first, wmWindow::modalhandlers, NULL, uiPopupBlockHandle::popup, uiPopupBlockHandle::region, UI_block_active_only_flagged_buttons(), ui_popup_block_create(), UI_popup_handlers_add(), ARegion::uiblocks, and WM_event_add_mousemove().
Referenced by UI_popup_block_invoke(), and wm_search_menu_invoke().
| bool UI_popup_block_name_exists | ( | const bScreen * | screen, |
| const char * | name | ||
| ) |
Definition at line 674 of file interface_region_menu_popup.c.
References LISTBASE_FOREACH, bScreen::regionbase, and STREQ.
| uiPopupMenu* UI_popup_menu_begin | ( | bContext * | C, |
| const char * | title, | ||
| int | icon | ||
| ) |
Definition at line 437 of file interface_region_menu_popup.c.
References C, and UI_popup_menu_begin_ex().
Referenced by armature_parent_set_invoke(), context_menu_invoke(), driver_dvar_invalid_name_query_cb(), dyntopo_warning_popup(), gpencil_layer_change_invoke(), insert_key_menu_invoke(), keyingset_active_menu_invoke(), make_override_library_invoke(), make_proxy_invoke(), move_to_collection_invoke(), node_group_separate_invoke(), object_hide_collection_invoke(), outliner_operator_menu(), parent_set_invoke_menu(), pose_groups_menu_invoke(), pose_ik_add_invoke(), poselib_add_menu_invoke(), repeat_history_invoke(), screen_area_options_invoke(), screen_context_menu_invoke(), select_grouped_collection(), select_orientation_invoke(), text_resolve_conflict_invoke(), toggle_cyclic_invoke(), ui_item_menu_hold(), ui_popup_context_menu_for_button(), ui_popup_context_menu_for_panel(), UI_popup_menu_invoke(), undo_history_invoke(), unpack_all_invoke(), unpack_item_invoke(), unpack_menu(), uv_mark_seam_invoke(), WM_menu_invoke_ex(), WM_operator_confirm_message_ex(), and workspace_add_invoke().
| uiPopupMenu* UI_popup_menu_begin_ex | ( | bContext * | C, |
| const char * | title, | ||
| const char * | block_name, | ||
| int | icon | ||
| ) |
Only return handler, and set optional title.
| block_name | Assigned to uiBlock.name (useful info for debugging). |
Definition at line 380 of file interface_region_menu_popup.c.
References BLI_snprintf(), uiPopupMenu::block, C, uiBut::drawflag, uiBlock::flag, uiBlock::handle, uiPopupMenu::layout, MEM_callocN, NULL, uiBlock::puphash, UI_block_begin(), UI_BLOCK_IS_FLIP, UI_block_layout(), UI_BLOCK_POPUP_MEMORY, UI_BTYPE_LABEL, UI_BUT_TEXT_LEFT, UI_EMBOSS_PULLDOWN, UI_LAYOUT_MENU, UI_LAYOUT_VERTICAL, UI_MENU_PADDING, ui_popup_menu_hash(), UI_style_get_dpi(), UI_UNIT_Y, uiDefBut(), uiDefIconTextBut(), uiItemS(), uiLayoutSetOperatorContext(), and WM_OP_EXEC_REGION_WIN.
Referenced by UI_popup_menu_begin(), and UI_popup_menu_reports().
| void UI_popup_menu_but_set | ( | uiPopupMenu * | pup, |
| struct ARegion * | butregion, | ||
| uiBut * | but | ||
| ) |
Setting the button makes the popup open from the button instead of the cursor.
Definition at line 445 of file interface_region_menu_popup.c.
References uiPopupMenu::but, and uiPopupMenu::butregion.
Referenced by ui_item_menu_hold().
| uiPopupBlockHandle* ui_popup_menu_create | ( | bContext * | C, |
| ARegion * | butregion, | ||
| uiBut * | but, | ||
| uiMenuCreateFunc | menu_func, | ||
| void * | arg | ||
| ) |
Definition at line 311 of file interface_region_menu_popup.c.
References uiBut::block, uiPopupMenu::block, uiPopupMenu::but, C, uiBut::context, CTX_wm_window(), wmWindow::eventstate, uiBlock::flag, uiPopupMenu::layout, MEM_callocN, MEM_freeN, uiPopupMenu::menu_arg, uiPopupMenu::menu_func, wmWindow::modalhandlers, uiPopupMenu::mx, uiPopupMenu::my, NULL, uiPopupBlockHandle::popup, uiPopupMenu::popup, PROP_ENUM, RNA_property_type(), uiBut::rnaprop, uiPopupMenu::slideout, UI_block_begin(), ui_block_func_POPUP(), ui_block_is_menu(), UI_block_layout(), UI_BLOCK_NO_FLIP, UI_BLOCK_NUMSELECT, UI_EMBOSS_PULLDOWN, UI_LAYOUT_MENU, UI_LAYOUT_VERTICAL, UI_MENU_PADDING, ui_popup_block_create(), UI_popup_handlers_add(), UI_style_get_dpi(), uiLayoutContextCopy(), uiLayoutSetOperatorContext(), WM_event_add_mousemove(), WM_OP_INVOKE_REGION_WIN, wmEvent::x, and wmEvent::y.
Referenced by ui_block_open_begin().
| void UI_popup_menu_end | ( | bContext * | C, |
| uiPopupMenu * | pup | ||
| ) |
Definition at line 452 of file interface_region_menu_popup.c.
References uiPopupMenu::but, uiPopupMenu::butregion, C, CTX_wm_window(), wmWindow::eventstate, MEM_freeN, wmWindow::modalhandlers, uiPopupMenu::mx, uiPopupMenu::my, NULL, uiPopupBlockHandle::popup, uiPopupMenu::popup, ui_block_func_POPUP(), ui_popup_block_create(), UI_popup_handlers_add(), WM_event_add_mousemove(), wmEvent::x, and wmEvent::y.
Referenced by armature_parent_set_invoke(), context_menu_invoke(), driver_dvar_invalid_name_query_cb(), dyntopo_warning_popup(), gpencil_layer_change_invoke(), insert_key_menu_invoke(), keyingset_active_menu_invoke(), make_override_library_invoke(), make_proxy_invoke(), move_to_collection_invoke(), node_group_separate_invoke(), object_hide_collection_invoke(), outliner_operator_menu(), parent_set_invoke_menu(), pose_groups_menu_invoke(), pose_ik_add_invoke(), poselib_add_menu_invoke(), repeat_history_invoke(), screen_area_options_invoke(), screen_context_menu_invoke(), select_grouped_collection(), select_orientation_invoke(), text_resolve_conflict_invoke(), toggle_cyclic_invoke(), ui_item_menu_hold(), ui_popup_context_menu_for_panel(), UI_popup_menu_end_or_cancel(), UI_popup_menu_invoke(), UI_popup_menu_reports(), undo_history_invoke(), unpack_all_invoke(), unpack_item_invoke(), unpack_menu(), uv_mark_seam_invoke(), WM_menu_invoke_ex(), WM_operator_confirm_message_ex(), and workspace_add_invoke().
| bool UI_popup_menu_end_or_cancel | ( | bContext * | C, |
| uiPopupMenu * | pup | ||
| ) |
Definition at line 477 of file interface_region_menu_popup.c.
References uiPopupMenu::block, C, uiBlock::handle, MEM_freeN, NULL, UI_block_free(), UI_block_is_empty_ex(), UI_block_layout_resolve(), and UI_popup_menu_end().
Referenced by ui_popup_context_menu_for_button().
| uint ui_popup_menu_hash | ( | const char * | str | ) |
Definition at line 105 of file interface_region_menu_popup.c.
References BLI_ghashutil_strhash, and str.
Referenced by UI_pie_menu_begin(), and UI_popup_menu_begin_ex().
| int UI_popup_menu_invoke | ( | bContext * | C, |
| const char * | idname, | ||
| ReportList * | reports | ||
| ) |
Definition at line 550 of file interface_region_menu_popup.c.
References BKE_reportf(), C, IFACE_, MenuType::label, NULL, OPERATOR_CANCELLED, OPERATOR_INTERFACE, OPERATOR_PASS_THROUGH, RPT_ERROR, UI_menutype_draw(), UI_popup_menu_begin(), UI_popup_menu_end(), UI_popup_menu_layout(), WM_menutype_find(), and WM_menutype_poll().
| uiLayout* UI_popup_menu_layout | ( | uiPopupMenu * | pup | ) |
Definition at line 490 of file interface_region_menu_popup.c.
References uiPopupMenu::layout.
Referenced by armature_parent_set_invoke(), context_menu_invoke(), driver_dvar_invalid_name_query_cb(), dyntopo_warning_popup(), gpencil_layer_change_invoke(), insert_key_menu_invoke(), keyingset_active_menu_invoke(), make_override_library_invoke(), make_proxy_invoke(), move_to_collection_invoke(), node_group_separate_invoke(), object_hide_collection_invoke(), outliner_operator_menu(), parent_set_invoke_menu(), pose_groups_menu_invoke(), pose_ik_add_invoke(), poselib_add_menu_invoke(), repeat_history_invoke(), screen_area_options_invoke(), screen_context_menu_invoke(), select_grouped_collection(), select_orientation_invoke(), text_resolve_conflict_invoke(), toggle_cyclic_invoke(), ui_item_menu_hold(), ui_popup_context_menu_for_button(), ui_popup_context_menu_for_panel(), UI_popup_menu_invoke(), UI_popup_menu_reports(), undo_history_invoke(), unpack_all_invoke(), unpack_item_invoke(), unpack_menu(), uv_mark_seam_invoke(), WM_menu_invoke_ex(), WM_operator_confirm_message_ex(), and workspace_add_invoke().
Definition at line 111 of file interface_region_menu_popup.c.
References uiBlock::buttons, uiBut::flag, hash, LISTBASE_FOREACH, NULL, uiBlock::puphash, uiBut::str, UI_BUT_HAS_SEP_CHAR, and ui_popup_string_hash().
Referenced by ui_popup_menu_memory_get(), and ui_popup_menu_memory_set().
Definition at line 142 of file interface_region_menu_popup.c.
References NULL, and ui_popup_menu_memory__internal().
Referenced by ui_block_func_POPUP().
Definition at line 147 of file interface_region_menu_popup.c.
References ui_popup_menu_memory__internal().
Referenced by button_activate_exit().
| void UI_popup_menu_reports | ( | bContext * | C, |
| ReportList * | reports | ||
| ) |
Definition at line 501 of file interface_region_menu_popup.c.
References BLI_snprintf(), BLI_strncpy(), C, CTX_wm_window(), IFACE_, ReportList::list, LISTBASE_FOREACH, MIN2, NULL, ReportList::printlevel, UI_icon_from_report_type(), UI_MAX_DRAW_STR, UI_popup_menu_begin_ex(), UI_popup_menu_end(), UI_popup_menu_layout(), uiItemL(), and uiItemS().
Referenced by wm_handler_fileselect_do(), and wm_operator_reports().
|
static |
Definition at line 89 of file interface_region_menu_popup.c.
References BLI_ghashutil_strhash, BLI_ghashutil_strhash_n(), hash, NULL, str, and UI_SEP_CHAR.
Referenced by ui_popup_menu_memory__internal().