Blender V5.0
blender::ed::object::shapekey::ShapeKeyDropTarget Class Reference

Inherits blender::ui::TreeViewItemDropTarget.

Public Member Functions

 ShapeKeyDropTarget (ui::AbstractTreeViewItem &item, ui::DropBehavior behavior, KeyBlock &drop_kb, int index)
bool can_drop (const wmDrag &drag, const char **) const override
std::string drop_tooltip (const ui::DragInfo &drag_info) const override
bool on_drop (bContext *C, const ui::DragInfo &drag_info) const override
Public Member Functions inherited from blender::ui::TreeViewItemDropTarget
 TreeViewItemDropTarget (AbstractTreeViewItem &view_item, DropBehavior behavior=DropBehavior::Insert)
std::optional< DropLocationchoose_drop_location (const ARegion &region, const wmEvent &event) const override
template<class ViewType>
ViewType & get_view () const
Public Member Functions inherited from blender::ui::DropTargetInterface
 DropTargetInterface ()=default
virtual ~DropTargetInterface ()=default

Additional Inherited Members

Protected Attributes inherited from blender::ui::TreeViewItemDropTarget
AbstractTreeViewItemview_item_
const DropBehavior behavior_

Detailed Description

Definition at line 100 of file interface_template_shape_key_tree.cc.

Constructor & Destructor Documentation

◆ ShapeKeyDropTarget()

blender::ed::object::shapekey::ShapeKeyDropTarget::ShapeKeyDropTarget ( ui::AbstractTreeViewItem & item,
ui::DropBehavior behavior,
KeyBlock & drop_kb,
int index )
inline

Member Function Documentation

◆ can_drop()

bool blender::ed::object::shapekey::ShapeKeyDropTarget::can_drop ( const wmDrag & drag,
const char ** r_disabled_hint ) const
inlineoverridevirtual

Check if the data dragged with drag can be dropped on the element this drop target is for.

Parameters
r_disabled_hintReturn a static string to display to the user, explaining why dropping isn't possible on this UI element. Shouldn't be done too aggressively, e.g. don't set this if the drag-type can't be dropped here; only if it can but there's another reason it can't be dropped. Can assume this is a non-null pointer.

Implements blender::ui::DropTargetInterface.

Definition at line 114 of file interface_template_shape_key_tree.cc.

References wmDrag::poin, wmDrag::type, and WM_DRAG_SHAPE_KEY.

◆ drop_tooltip()

std::string blender::ed::object::shapekey::ShapeKeyDropTarget::drop_tooltip ( const ui::DragInfo & drag) const
inlineoverridevirtual

Custom text to display when dragging over the element using this drop target. Should explain what happens when dropping the data onto this UI element. Will only be used if #DropTargetInterface::can_drop() returns true, so the implementing override doesn't have to check that again. The returned value must be a translated string.

Implements blender::ui::DropTargetInterface.

Definition at line 128 of file interface_template_shape_key_tree.cc.

References blender::ui::After, blender::ui::Before, BLI_assert_unreachable, blender::ui::DragInfo::drop_location, blender::ui::Into, and TIP_.

◆ on_drop()

bool blender::ed::object::shapekey::ShapeKeyDropTarget::on_drop ( bContext * C,
const ui::DragInfo & drag ) const
inlineoverridevirtual

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