Blender V4.3
interface_region_popover.cc File Reference
#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.hh"
#include "BKE_report.hh"
#include "BKE_screen.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "UI_interface.hh"
#include "interface_intern.hh"

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, ARegion *region, uiPopover *pup, wmOperatorCallContext opcontext)
 
static uiBlockui_block_func_POPOVER (bContext *C, uiPopupBlockHandle *handle, void *arg_pup)
 
static void ui_block_free_func_POPOVER (void *arg_pup)
 
uiPopupBlockHandleui_popover_panel_create (bContext *C, ARegion *butregion, uiBut *but, uiPopoverCreateFunc popover_func, const PanelType *panel_type)
 
Standard Popover Panels
int UI_popover_panel_invoke (bContext *C, const char *idname, bool keep_open, ReportList *reports)
 
Popup Menu API with begin & end
uiPopoverUI_popover_begin (bContext *C, int ui_menu_width, bool from_active_button)
 
static void popover_keymap_fn (wmKeyMap *, wmKeyMapItem *, void *user_data)
 
void UI_popover_end (bContext *C, uiPopover *pup, wmKeyMap *keymap)
 
uiLayoutUI_popover_layout (uiPopover *pup)
 
void UI_popover_once_clear (uiPopover *pup)
 

Detailed Description

Pop-Over Region

Note
This is very close to interface_region_menu_popup.cc.

We could even merge them, however menu logic is already over-loaded. PopOver's have the following differences.

  • UI is not constrained to a list.
  • Pressing a button won't close the pop-over.
  • Different draw style (to show this is has different behavior from a menu).
  • PanelType are used instead of MenuType.
  • No menu flipping support.
  • No moving the menu to fit the mouse cursor.
  • No key accelerators to access menu items (if we add support they would work differently).
  • No arrow key navigation.
  • No menu memory.
  • No title.

Definition in file interface_region_popover.cc.

Function Documentation

◆ popover_keymap_fn()

static void popover_keymap_fn ( wmKeyMap * ,
wmKeyMapItem * ,
void * user_data )
static

◆ ui_block_free_func_POPOVER()

static void ui_block_free_func_POPOVER ( void * arg_pup)
static

◆ ui_block_func_POPOVER()

◆ UI_popover_begin()

uiPopover * UI_popover_begin ( bContext * C,
int ui_menu_width,
bool from_active_button )

Only return handler, and set optional title.

Parameters
from_active_buttonUse the active button for positioning, use when the popover is activated from an operator instead of directly from the button.

Definition at line 349 of file interface_region_popover.cc.

References uiPopover::block, uiPopover::but, uiPopover::butregion, 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().

◆ ui_popover_create_block()

static void ui_popover_create_block ( bContext * C,
ARegion * region,
uiPopover * pup,
wmOperatorCallContext opcontext )
static

◆ UI_popover_end()

◆ UI_popover_layout()

uiLayout * UI_popover_layout ( uiPopover * pup)

Definition at line 429 of file interface_region_popover.cc.

References uiPopover::layout.

Referenced by UI_popover_panel_invoke().

◆ UI_popover_once_clear()

void UI_popover_once_clear ( uiPopover * pup)

Definition at line 435 of file interface_region_popover.cc.

References uiPopover::is_once.

Referenced by ui_handle_menu_event().

◆ ui_popover_panel_create()

◆ UI_popover_panel_invoke()