Blender V5.0
blender::ui::GridViewItemDropTarget Class Reference

#include <UI_grid_view.hh>

Inherits blender::ui::DropTargetInterface.

Public Member Functions

 GridViewItemDropTarget (AbstractGridView &view)
template<class ViewType>
ViewType & get_view () const
Public Member Functions inherited from blender::ui::DropTargetInterface
 DropTargetInterface ()=default
virtual ~DropTargetInterface ()=default
virtual bool can_drop (const wmDrag &drag, const char **r_disabled_hint) const =0
virtual std::optional< DropLocationchoose_drop_location (const ARegion &region, const wmEvent &event) const
virtual std::string drop_tooltip (const DragInfo &drag) const =0
virtual bool on_drop (bContext *C, const DragInfo &drag) const =0

Protected Attributes

AbstractGridViewview_

Detailed Description

Class to define the behavior when dropping something onto/into a view item, plus the behavior when dragging over this item. An item can return a drop target for itself via a custom implementation of #AbstractGridViewItem::create_drop_target().

Definition at line 152 of file UI_grid_view.hh.

Constructor & Destructor Documentation

◆ GridViewItemDropTarget()

blender::ui::GridViewItemDropTarget::GridViewItemDropTarget ( AbstractGridView & view)

Definition at line 185 of file grid_view.cc.

References view, and view_.

Member Function Documentation

◆ get_view()

template<class ViewType>
ViewType & blender::ui::GridViewItemDropTarget::get_view ( ) const
inline

Request the view the item is registered for as type #ViewType. Throws a std::bad_cast exception if the view is not of the requested type.

Definition at line 247 of file UI_grid_view.hh.

References view_.

Member Data Documentation

◆ view_

AbstractGridView& blender::ui::GridViewItemDropTarget::view_
protected

Definition at line 154 of file UI_grid_view.hh.

Referenced by get_view(), and GridViewItemDropTarget().


The documentation for this class was generated from the following files: