diff options
Diffstat (limited to 'Project/ElementDataObject.cpp')
-rw-r--r-- | Project/ElementDataObject.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Project/ElementDataObject.cpp b/Project/ElementDataObject.cpp new file mode 100644 index 0000000..e4752ea --- /dev/null +++ b/Project/ElementDataObject.cpp @@ -0,0 +1,39 @@ +#include "ElectricCalculation.h" +#include "ElementDataObject.h" + +ElementDataObject::ElementDataObject(Workspace* workspace) : wxDataObjectSimple(wxDataFormat("PSPCopy")) +{ + m_allElements.GetElementsFromList(workspace->GetElementList()); + std::vector<Text*> textList = workspace->GetTextList(); + + std::vector<Bus*> busList = m_allElements.GetBusList(); + for(int i = 0; i<(int)busList.size(); i++) { + Bus* origBus = busList[i]; + if(origBus->IsSelected()) { + Bus* copyBus = new Bus(); + *copyBus = *origBus; + m_elementsLists->busList.push_back(copyBus); + } + } +} + +ElementDataObject::~ElementDataObject() +{ +} + +size_t ElementDataObject::GetDataSize() const +{ + return sizeof(void*); +} + +bool ElementDataObject::GetDataHere(void* buf) const +{ + *(ElementsLists**)buf = m_elementsLists; + return true; +} + +bool ElementDataObject::SetData(size_t len, const void* buf) +{ + m_elementsLists = *(ElementsLists**)buf; + return true; +} |