VRUT::DropTarget Class Reference

Drag & drop handler. More...

#include <draganddrop.h>

List of all members.

Public Member Functions

 DropTarget (bool _render=true)
 constructor
virtual wxDragResult OnData (wxCoord x, wxCoord y, wxDragResult def)
 Process drop functionality.

Public Attributes

bool render


Detailed Description

Drag & drop handler.

Definition at line 9 of file draganddrop.h.


Constructor & Destructor Documentation

VRUT::DropTarget::DropTarget ( bool  _render = true  )  [inline]

constructor

Definition at line 14 of file draganddrop.h.

00014                                            : render(_render)
00015               {
00016                      SetDataObject(new wxFileDataObject);
00017               }


Member Function Documentation

virtual wxDragResult VRUT::DropTarget::OnData ( wxCoord  x,
wxCoord  y,
wxDragResult  def 
) [inline, virtual]

Process drop functionality.

Definition at line 20 of file draganddrop.h.

00021               {
00022                      if ( !GetData() )
00023                             return wxDragNone;
00024 
00025                      //OnDropURL(x, y, ((wxFileDataObject *)m_dataObject)->GetURL());
00026                      if (m_dataObject->IsSupported( wxDF_FILENAME ))
00027                      {
00028                             std::vector<SCENE_ID> IDlist;
00029                             SCENE_ID maxSceneID=0;
00030                             if (render)
00031                             {
00032                                    KERNEL->sceneManager->GetSceneIDs(IDlist);
00033                                    maxSceneID = (IDlist.size()>0)? IDlist.at(IDlist.size()-1)+1: 0;
00034                             }
00035                             wxArrayString fileNames=((wxFileDataObject *)m_dataObject)->GetFilenames();
00036                             for (size_t i=0; i<fileNames.size(); i++)
00037                             {
00038                                    wxCommandEvent ev = Event::GET_EVT_IO_SCENE_IMPORT(fileNames[i]);
00039                                    KERNEL->GetMessageSink()->PostEvent(ev);
00040                                    if (render)
00041                                    {
00042                                           wxCommandEvent ev1 = Event::GET_EVT_RENDER_SCENE(SCENE_ID(maxSceneID+i));
00043                                           KERNEL->GetMessageSink()->PostEvent(ev1);
00044                                    }
00045                             }
00046                      }
00047                      return def;
00048               }


Member Data Documentation

Definition at line 12 of file draganddrop.h.


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

Generated on Tue Mar 10 14:41:41 2009 for VRUT by  doxygen 1.5.5