From: Markus R. <rol...@us...> - 2007-06-23 14:05:37
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv8917 Modified Files: sparkglcanvas.cpp Log Message: - detect right clicks on the currently selected node in the OpenGl Canvas and show the context menu Index: sparkglcanvas.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkglcanvas.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** sparkglcanvas.cpp 23 Jun 2007 13:48:11 -0000 1.12 --- sparkglcanvas.cpp 23 Jun 2007 14:05:33 -0000 1.13 *************** *** 53,56 **** --- 53,57 ---- using namespace boost; + using namespace zeitgeist; using namespace kerosin; using namespace salt; *************** *** 278,281 **** --- 279,304 ---- event.Skip(); + if (SparkContext::GetInstance().HasSelection()) + { + weak_ptr<RenderNode> node = PickNode(); + shared_ptr<Leaf> selection = + SparkContext::GetInstance().GetSelection().lock(); + + if ( + (! node.expired()) && + (node.lock() == selection) + ) + { + wxMenu* menu = + SparkContext::GetInstance().GetContextMenu(selection); + + if (menu != 0) + { + PopupMenu(menu); + return; + } + } + } + Input input(Input::eButton, Input::IC_MOUSE_RIGHT); input.mData.l = 1; |