Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "DNA_userdef_types.h"
#include "BLI_listbase.h"
#include "BLI_math_vector.h"
#include "BLI_rect.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_report.h"
#include "BKE_screen.h"
#include "ED_screen.h"
#include "WM_api.h"
#include "WM_types.h"
#include "UI_interface.h"
#include "interface_intern.h"
#include "interface_regions_intern.h"
Go to the source code of this file.
Classes | |
struct | uiPopover |
Functions | |
Popup Menu with Callback or String | |
static void | ui_popover_create_block (bContext *C, uiPopover *pup, wmOperatorCallContext opcontext) |
static uiBlock * | ui_block_func_POPOVER (bContext *C, uiPopupBlockHandle *handle, void *arg_pup) |
static void | ui_block_free_func_POPOVER (void *arg_pup) |
uiPopupBlockHandle * | ui_popover_panel_create (bContext *C, ARegion *butregion, uiBut *but, uiMenuCreateFunc menu_func, void *arg) |
Standard Popover Panels | |
int | UI_popover_panel_invoke (bContext *C, const char *idname, bool keep_open, ReportList *reports) |
Popup Menu API with begin & end | |
uiPopover * | UI_popover_begin (bContext *C, int ui_menu_width, bool from_active_button) |
static void | popover_keymap_fn (wmKeyMap *UNUSED(keymap), wmKeyMapItem *UNUSED(kmi), void *user_data) |
void | UI_popover_end (bContext *C, uiPopover *pup, wmKeyMap *keymap) |
uiLayout * | UI_popover_layout (uiPopover *pup) |
void | UI_popover_once_clear (uiPopover *pup) |
Pop-Over Region
We could even merge them, however menu logic is already over-loaded. PopOver's have the following differences.
Definition in file interface_region_popover.cc.
|
static |
Definition at line 358 of file interface_region_popover.cc.
References uiPopover::block, uiBlock::handle, uiPopupBlockHandle::menuretval, UI_RETURN_OK, and user_data.
Referenced by UI_popover_end().
Definition at line 220 of file interface_region_popover.cc.
References uiPopover::keymap, MEM_freeN, wmWindow::modalhandlers, uiPopover::window, and WM_event_remove_keymap_handler().
Referenced by UI_popover_end(), and ui_popover_panel_create().
|
static |
Definition at line 105 of file interface_region_popover.cc.
References ARegion::alignment, BLI_rctf_cent_x(), BLI_rctf_cent_y(), BLI_rctf_size_x(), uiBut::block, uiPopover::block, uiBlock::bounds_offset, uiPopover::but, uiBlock::buttons, C, center, copy_v2_v2_int(), uiPopupBlockHandle::ctx_region, CTX_wm_region(), uiBlock::direction, ListBase::first, uiBlock::handle, height, uiPopover::layout, LISTBASE_FOREACH, uiPopupBlockHandle::max_size_y, uiPopover::menu_arg, uiPopover::menu_func, uiBlock::minbounds, ARegion::panels, uiPopupBlockHandle::prev_bounds_offset, uiBut::rect, uiPopupBlockHandle::refresh, uiPopupBlockHandle::region, ARegion::regiontype, RGN_ALIGN_BOTTOM, RGN_ALIGN_ENUM_FROM_MASK, RGN_TYPE_IS_HEADER_ANY, UI_block_bounds_set_normal(), UI_block_bounds_set_popup(), UI_block_direction_set(), UI_block_flag_enable(), ui_block_is_menu(), UI_block_layout_resolve(), UI_BLOCK_LOOP, UI_block_region_set(), UI_BLOCK_THEME_STYLE_POPUP, UI_block_theme_style_set(), ui_block_to_window_fl(), ui_but_is_editable(), UI_DIR_CENTER_X, UI_DIR_DOWN, UI_DIR_RIGHT, UI_DIR_UP, UI_MENU_WIDTH_MIN, ui_popover_create_block(), UI_SELECT, UI_SELECT_DRAW, uiPopover::ui_size_x, UI_UNIT_Y, width, WM_OP_INVOKE_REGION_WIN, and rctf::xmin.
Referenced by UI_popover_end(), and ui_popover_panel_create().
Only return handler, and set optional title.
from_active_button | Use the active button for positioning, use when the popover is activated from an operator instead of directly from the button. |
Definition at line 327 of file interface_region_popover.cc.
References uiPopover::block, uiPopover::but, uiPopover::butregion, C, CTX_wm_region(), uiBlock::handle, ui_popover_create_block(), UI_POPOVER_WIDTH_UNITS, UI_region_active_but_get(), uiPopover::ui_size_x, and WM_OP_EXEC_REGION_WIN.
Referenced by UI_popover_panel_invoke().
|
static |
Definition at line 77 of file interface_region_popover.cc.
References BLI_assert, uiPopover::block, uiPopover::but, C, uiBut::context, uiBlock::flag, uiPopover::is_once, uiPopover::layout, UI_block_begin(), UI_block_flag_enable(), UI_BLOCK_KEEP_OPEN, UI_block_layout(), UI_BLOCK_NO_FLIP, UI_BLOCK_POPOVER, UI_BLOCK_POPOVER_ONCE, UI_EMBOSS, UI_LAYOUT_PANEL, UI_LAYOUT_VERTICAL, uiPopover::ui_size_x, UI_style_get_dpi(), uiLayoutContextCopy(), and uiLayoutSetOperatorContext().
Referenced by ui_block_func_POPOVER(), and UI_popover_begin().
Set the whole structure to work.
Definition at line 364 of file interface_region_popover.cc.
References BLI_addhead(), BLI_remlink(), uiPopover::block, uiPopover::but, uiPopover::butregion, C, CTX_wm_window(), uiBlock::flag, uiPopover::keymap, wmEventHandler_Keymap::keymap, uiPopover::keymap_handler, wmWindow::modalhandlers, popover_keymap_fn(), uiPopupBlockHandle::popup, UI_block_flag_disable(), UI_block_flag_enable(), ui_block_free_func_POPOVER(), ui_block_func_POPOVER(), UI_BLOCK_IS_FLIP, UI_BLOCK_KEEP_OPEN, UI_BLOCK_SHOW_SHORTCUT_ALWAYS, ui_popup_block_create(), UI_popup_handlers_add(), uiPopover::window, WM_event_add_keymap_handler_priority(), WM_event_add_mousemove(), and WM_event_set_keymap_handler_post_callback().
Referenced by UI_popover_panel_invoke().
Definition at line 409 of file interface_region_popover.cc.
References uiPopover::layout.
Referenced by UI_popover_panel_invoke().
Definition at line 415 of file interface_region_popover.cc.
References uiPopover::is_once.
Referenced by ui_handle_menu_event().
uiPopupBlockHandle* ui_popover_panel_create | ( | bContext * | C, |
ARegion * | butregion, | ||
uiBut * | but, | ||
uiMenuCreateFunc | menu_func, | ||
void * | arg | ||
) |
Definition at line 230 of file interface_region_popover.cc.
References uiPopover::but, C, uiPopupBlockHandle::can_refresh, CTX_wm_window(), wmWindow::eventstate, float(), uiPopover::is_once, KM_PRESS, LEFTMOUSE, MAX2, uiPopover::menu_arg, uiPopover::menu_func, wmWindow::modalhandlers, uiFontStyle::points, uiPopupBlockHandle::popup, ui_block_free_func_POPOVER(), ui_block_func_POPOVER(), UI_DEFAULT_TEXT_POINTS, UI_POPOVER_WIDTH_UNITS, ui_popup_block_create(), UI_popup_handlers_add(), uiPopover::ui_size_x, UI_style_get_dpi(), PanelType::ui_units_x, uiStyle::widget, uiStyle::widgetlabel, and WM_event_add_mousemove().
Referenced by ui_block_open_begin(), and UI_popover_panel_invoke().
int UI_popover_panel_invoke | ( | bContext * | C, |
const char * | idname, | ||
bool | keep_open, | ||
ReportList * | reports | ||
) |
Definition at line 285 of file interface_region_popover.cc.
References uiPopupBlockCreate::arg, BKE_reportf(), uiPopover::block, C, uiBlock::handle, OPERATOR_CANCELLED, OPERATOR_INTERFACE, OPERATOR_PASS_THROUGH, PanelType::poll, uiPopupBlockHandle::popup_create_vars, uiPopupBlockHandle::region, RPT_ERROR, UI_block_active_only_flagged_buttons(), ui_item_paneltype_func(), UI_paneltype_draw(), UI_popover_begin(), UI_popover_end(), UI_popover_layout(), ui_popover_panel_create(), PanelType::ui_units_x, and WM_paneltype_find().
Referenced by add_driver_button_invoke(), edit_driver_button_exec(), and wm_call_panel_exec().