From: Markus R. <rol...@us...> - 2007-07-08 14:25:55
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv31439 Modified Files: sparkcontext.cpp sparkcontext.h Log Message: - added method GetContextMenu that create a context menu given a wxScintilla tab Index: sparkcontext.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkcontext.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** sparkcontext.h 23 Jun 2007 14:04:23 -0000 1.5 --- sparkcontext.h 8 Jul 2007 14:24:27 -0000 1.6 *************** *** 31,34 **** --- 31,35 ---- class wxEvtHandler; class wxMenu; + class wxScintilla; class SparkContext *************** *** 50,53 **** --- 51,56 ---- boost::weak_ptr<zeitgeist::Leaf> GetContextNode() const; + wxMenu* GetContextMenu(wxScintilla* edit); + private: SparkContext(); Index: sparkcontext.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/sparkcontext.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** sparkcontext.cpp 8 Jul 2007 13:42:47 -0000 1.6 --- sparkcontext.cpp 8 Jul 2007 14:24:27 -0000 1.7 *************** *** 24,27 **** --- 24,28 ---- #include <zeitgeist/leaf.h> #include <oxygen/sceneserver/scenedict.h> + #include <rsgedit/sparkedit.h> using namespace zeitgeist; *************** *** 88,91 **** --- 89,108 ---- } + wxMenu* SparkContext::GetContextMenu(wxScintilla* edit) + { + if (edit == 0) + { + assert(false); + return 0; + } + + long style = 0; + wxMenu* menu(new wxMenu(SparkEdit::GetInstance().GetFile(edit), 9)); + + menu->Append(ID_TAB_CLOSE, wxT("&Close tab")); + menu->Append(ID_TAB_CLOSE_OTHER, wxT("Close other tabs")); + return menu; + } + wxMenu* SparkContext::GetContextMenu(weak_ptr<Leaf> leaf) { |