Handle files drag and dropped onto Aegisub
| 80 | |
| 81 | /// Handle files drag and dropped onto Aegisub |
| 82 | class AegisubFileDropTarget final : public wxFileDropTarget { |
| 83 | agi::Context *context; |
| 84 | public: |
| 85 | AegisubFileDropTarget(agi::Context *context) : context(context) { } |
| 86 | bool OnDropFiles(wxCoord, wxCoord, wxArrayString const& filenames) override { |
| 87 | std::vector<agi::fs::path> files; |
| 88 | for (wxString const& fn : filenames) |
| 89 | files.push_back(from_wx(fn)); |
| 90 | agi::dispatch::Main().Async([=, this] { context->project->LoadList(files); }); |
| 91 | return true; |
| 92 | } |
| 93 | }; |
| 94 | |
| 95 | FrameMain::FrameMain() |
| 96 | : wxFrame(nullptr, -1, "", wxDefaultPosition, wxSize(920,700), wxDEFAULT_FRAME_STYLE | wxCLIP_CHILDREN) |
nothing calls this directly
no outgoing calls
no test coverage detected