ui::DragResponse¶
Header: winui/ui/DragDrop.hpp.
A drop target's answer to a drag over it: what a drop there would do, and what the pointer shows meanwhile.
Returned by Element::drag_over() and the handler set with Element::on_drag_over(), which are asked when the drag comes over the element and at every move after. A refusal (operation None, the default) passes the question on to the next drop target up the tree. The first one that accepts gets the drop.
Example:
auto zone = std::make_unique<ui::BorderControl>();
zone->set_allow_drop(true);
zone->on_drag_over([](const ui::DragEventArgs& e)
{
if (e.data.files.empty())
{
return ui::DragResponse{};
}
return ui::DragResponse{.operation = ui::DataPackageOperation::Copy, .caption = "Attach"};
});
| Field | Type | Default | |
|---|---|---|---|
operation |
DataPackageOperation |
DataPackageOperation::None |
What a drop here would do; None refuses it. |
caption |
std::string |
Text shown in a small box beside the pointer; empty shows none. | |
glyph_visible |
bool |
true |
Whether the operation glyph is shown beside the pointer. |