[Gcblue-commits] gcb_wx/src/scriptinterface tcSimPythonInterface.cpp,1.21,1.22
Status: Alpha
Brought to you by:
ddcforge
|
From: Dewitt C. <ddc...@us...> - 2004-12-02 04:17:38
|
Update of /cvsroot/gcblue/gcb_wx/src/scriptinterface In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31820/src/scriptinterface Modified Files: tcSimPythonInterface.cpp Log Message: Sonar work Index: tcSimPythonInterface.cpp =================================================================== RCS file: /cvsroot/gcblue/gcb_wx/src/scriptinterface/tcSimPythonInterface.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** tcSimPythonInterface.cpp 23 Nov 2004 23:30:58 -0000 1.21 --- tcSimPythonInterface.cpp 2 Dec 2004 04:17:25 -0000 1.22 *************** *** 69,72 **** --- 69,86 ---- mpMenu->AddItem(caption, command, param); } + + /** + * Adds a menu item with command string and command parameter + * @param caption caption for menu item + * @param command command string for item + * @param textParam std::string parameter + */ + void tcMenuInterface::AddItemWithTextParam(std::string caption, std::string command, + std::string textParam) + { + if (mpMenu == NULL) {return;} + mpMenu->AddItem(caption, command, textParam); + } + /** * Adds a menu item that gets a coordinate or target from the user via a mouse click *************** *** 349,353 **** } ! void tcSimPythonInterface::ProcessCommand(std::string command, int param) { std::string s = "Menu."; --- 363,367 ---- } ! void tcSimPythonInterface::ProcessCommand(std::string command, int param, std::string textParam) { std::string s = "Menu."; *************** *** 366,369 **** --- 380,389 ---- s += zBuff; } + else if (textParam.length() > 0) + { + s += ",'"; + s += textParam; + s += "'"; + } s += ")\n"; *************** *** 586,589 **** --- 606,610 ---- .def("AddItem", &tcMenuInterface::AddItem) .def("AddItemWithParam", &tcMenuInterface::AddItemWithParam) + .def("AddItemWithTextParam", &tcMenuInterface::AddItemWithTextParam) .def("AddItemUI",&tcMenuInterface::AddItemUI) .def("AddItemUIWithParam",&tcMenuInterface::AddItemUIWithParam) |