From: Markus R. <rol...@us...> - 2007-07-08 13:41:32
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv14703 Modified Files: mainframe.cpp mainframe.h Log Message: - added OnContextKinematic handler that creates a kinematic frame with the currently selected node as its parent - updating kinematic frames in mainframe::RefreshProperties Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mainframe.h 23 Jun 2007 13:36:28 -0000 1.16 --- mainframe.h 8 Jul 2007 13:41:28 -0000 1.17 *************** *** 112,115 **** --- 112,116 ---- void OnContextProperties(wxCommandEvent& event); + void OnContextKinematic(wxCommandEvent& event); void OnContextEditSource(wxCommandEvent& event); void OnContextCopyFileName(wxCommandEvent& event); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** mainframe.cpp 23 Jun 2007 13:36:28 -0000 1.22 --- mainframe.cpp 8 Jul 2007 13:41:28 -0000 1.23 *************** *** 23,26 **** --- 23,27 ---- #include "main.h" #include "propertyframe.h" + #include "kinematicframe.h" #include "agentframe.h" #include "sparkedit.h" *************** *** 91,94 **** --- 92,96 ---- EVT_MENU(ID_CONTEXT_COPY_FILENAME, mainframe::OnContextCopyFileName) EVT_MENU(ID_CONTEXT_COPY_PATH, mainframe::OnContextCopyPath) + EVT_MENU(ID_CONTEXT_KINEMATIC, mainframe::OnContextKinematic) EVT_BUTTON(ID_LOG_CLEAR, mainframe::OnLogClear) *************** *** 704,707 **** --- 706,725 ---- } + void mainframe::OnContextKinematic(wxCommandEvent& event) + { + weak_ptr<Leaf> leaf = SparkContext::GetInstance().GetContextNode(); + if (leaf.expired()) + { + assert(false); + return; + } + + wxString location(leaf.lock()->GetFullPath().c_str(), wxConvUTF8); + + kinematicFrame* frame(new kinematicFrame(this, wxID_ANY, location)); + frame->SetParent(leaf); + frame->SetTitle(location); + frame->Show(); + } void mainframe::OnContextProperties(wxCommandEvent& event) *************** *** 827,836 **** { propertyframe* pf = dynamic_cast<propertyframe*>(node->GetData()); ! if (pf == 0) { continue; } ! pf->RefreshProperties(); } } --- 845,860 ---- { propertyframe* pf = dynamic_cast<propertyframe*>(node->GetData()); ! if (pf != 0) { + pf->RefreshProperties(); continue; } ! kinematicFrame* kf = dynamic_cast<kinematicFrame*>(node->GetData()); ! if (kf != 0) ! { ! kf->RefreshProperties(); ! continue; ! } } } *************** *** 854,863 **** { propertyframe* pf = dynamic_cast<propertyframe*>(node->GetData()); ! if (pf == 0) { continue; } ! pf->UpdateCached(); } } --- 878,893 ---- { propertyframe* pf = dynamic_cast<propertyframe*>(node->GetData()); ! if (pf != 0) { + pf->UpdateCached(); continue; } ! kinematicFrame* kf = dynamic_cast<kinematicFrame*>(node->GetData()); ! if (kf != 0) ! { ! kf->UpdateCached(); ! continue; ! } } } |