Ticket #96: copy_example.diff
File copy_example.diff, 2.5 KB (added by , 10 years ago) |
---|
-
source/tools/atlas/AtlasUI/ScenarioEditor/Tools/TransformObject.cpp
167 167 obj->GetScenarioEditor().GetObjectSettings().NotifyObservers(); 168 168 return true; 169 169 } 170 else if (evt.GetModifiers() == wxMOD_CONTROL) 171 { 172 switch (evt.GetKeyCode()) 173 { 174 case 'C': //copy 175 POST_MESSAGE(SendToClipBoard,(obj->m_lastSelected)); 176 break; 177 default: 178 break; 179 } 180 } 170 181 else 171 182 return false; 172 183 } … … 203 214 SET_STATE(Waiting); 204 215 205 216 return true; 217 } 218 else if (evt.GetModifiers() == wxMOD_CONTROL) 219 { 220 switch (evt.GetKeyCode()) 221 { 222 case 'C': //copy 223 POST_MESSAGE(SendToClipBoard,(obj->m_lastSelected)); 224 break; 225 default: 226 break; 227 } 206 228 } 207 229 else 208 230 return false; -
source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp
49 49 #include "simulation2/components/ICmpTemplateManager.h" 50 50 #include "simulation2/components/ICmpVisual.h" 51 51 #include "simulation2/helpers/Selection.h" 52 #include "simulation2/system/ParamNode.h" 53 #include "lib/sysdep/clipboard.h" 52 54 53 55 54 56 namespace AtlasMessage { … … 754 756 AtlasView::GetView_Game()->SetBandbox(msg->show, (float)msg->sx0, (float)msg->sy0, (float)msg->sx1, (float)msg->sy1); 755 757 } 756 758 759 MESSAGEHANDLER(SendToClipBoard) 760 { 761 int selectedObject = msg->id; 762 763 CmpPtr<ICmpTemplateManager> cmpTemplateManager(*g_Game->GetSimulation2(), SYSTEM_ENTITY); 764 if (cmpTemplateManager) 765 { 766 const CParamNode* node = cmpTemplateManager->LoadLatestTemplate(selectedObject); 767 768 std::wstring xml = node->ToXML(); 769 770 sys_clipboard_set(xml.c_str()); 771 } 757 772 } 773 } -
source/tools/atlas/GameInterface/Messages.h
628 628 ((bool, lines)) 629 629 ); 630 630 631 MESSAGE(SendToClipBoard, 632 ((int,id))); 633 631 634 ////////////////////////////////////////////////////////////////////////// 632 635 633 636 enum eTriggerListType