Ember
Loading...
Searching...
No Matches
EmberForge::XMLFileDropTarget Class Reference

File drop target for XML files. More...

#include <XMLFileDropTarget.h>

Inheritance diagram for EmberForge::XMLFileDropTarget:

Public Types

using FileDropCallback = std::function<void(const wxString &filePath, bool loadInCurrentScene)>

Public Member Functions

 XMLFileDropTarget (FileDropCallback callback)
 Construct a new XMLFileDropTarget.
bool OnDropFiles (wxCoord x, wxCoord y, const wxArrayString &filenames) override
 Called when files are dropped.

Private Attributes

FileDropCallback m_callback

Detailed Description

File drop target for XML files.

This class handles drag and drop of XML files onto the scene view. It validates that the dropped file is a single XML file and calls the provided callback to load it.

Definition at line 16 of file XMLFileDropTarget.h.

Member Typedef Documentation

◆ FileDropCallback

using EmberForge::XMLFileDropTarget::FileDropCallback = std::function<void(const wxString &filePath, bool loadInCurrentScene)>

Definition at line 18 of file XMLFileDropTarget.h.

Constructor & Destructor Documentation

◆ XMLFileDropTarget()

EmberForge::XMLFileDropTarget::XMLFileDropTarget ( FileDropCallback callback)
inlineexplicit

Construct a new XMLFileDropTarget.

Parameters
callbackFunction to call when a valid XML file is dropped Parameters: filePath, loadInCurrentScene (true if Ctrl is pressed)

Definition at line 25 of file XMLFileDropTarget.h.

Member Function Documentation

◆ OnDropFiles()

bool EmberForge::XMLFileDropTarget::OnDropFiles ( wxCoord x,
wxCoord y,
const wxArrayString & filenames )
inlineoverride

Called when files are dropped.

Parameters
xX coordinate of drop location
yY coordinate of drop location
filenamesArray of dropped file paths
Returns
true if the drop was handled successfully

Definition at line 34 of file XMLFileDropTarget.h.

Member Data Documentation

◆ m_callback

FileDropCallback EmberForge::XMLFileDropTarget::m_callback
private

Definition at line 69 of file XMLFileDropTarget.h.


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