Closed uuiid closed 2 years ago
Error in mouse position when dragging file 拖拽文件时传入鼠标位置错误
class tree : public nana::form { nana::treebox p_tree; nana::place p_layout; nana::menu p_menu; public: tree() : p_tree(*this) , p_layout(*this) , p_menu() { p_layout.div("<tree>"); auto k_f = p_tree.first(); auto tset = p_tree.insert("root", "root"); p_tree.insert("r2", "2"); p_tree.insert("r3", "3"); p_tree.insert("r4", "4"); // SPDLOG_INFO(tset.level()); tset.append("1", "1"); tset.append("2", "2"); tset.append("3", "3"); tset.append("4", "4"); p_layout.field("tree") << p_tree; p_menu.append("clear", [this](const nana::menu::item_proxy& in_) { p_tree.clear(); }); p_menu.append("clear root", [this](const nana::menu::item_proxy& in_) { p_tree.find("root").clear(); }); p_menu.append("clear null", [this, tset](const nana::menu::item_proxy& in_) { p_tree.erase("root"); }); p_tree.events().mouse_down(nana::menu_popuper(p_menu)); p_tree.enable_dropfiles(true); p_tree.events().mouse_dropfiles.connect([this](const nana::arg_dropfiles& in_) { // nana::detail::bedrock::instance().wd_manager().calc_window_point(); // auto pos = in_.pos; // nana::API::calc_screen_point(in_.window_handle,pos); this->p_menu.popup(in_.window_handle, in_.pos.x, in_.pos.y); }); p_layout.collocate(); }; };
The PR for the issue is merged
Error in mouse position when dragging file 拖拽文件时传入鼠标位置错误![image](https://user-images.githubusercontent.com/46096697/124858645-0b96cd00-dfe1-11eb-854c-99deab0943db.png)