From: Markus R. <rol...@us...> - 2007-02-23 22:21:41
|
Update of /cvsroot/simspark/simspark/contrib/rsgedit In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv25921 Modified Files: Tag: WIN32 mainframe.cpp mainframe.h Log Message: - added file seclector for agent spawn Index: mainframe.h =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.h,v retrieving revision 1.7.2.6 retrieving revision 1.7.2.7 diff -C2 -d -r1.7.2.6 -r1.7.2.7 *** mainframe.h 18 Feb 2007 14:25:15 -0000 1.7.2.6 --- mainframe.h 23 Feb 2007 22:21:38 -0000 1.7.2.7 *************** *** 96,99 **** --- 96,101 ---- void OnUpdateFileReload(wxUpdateUIEvent& event); + void OnAgentOpen(wxCommandEvent& event); + void OnHelpAbout(wxCommandEvent& event); Index: mainframe.cpp =================================================================== RCS file: /cvsroot/simspark/simspark/contrib/rsgedit/mainframe.cpp,v retrieving revision 1.8.2.8 retrieving revision 1.8.2.9 diff -C2 -d -r1.8.2.8 -r1.8.2.9 *** mainframe.cpp 21 Feb 2007 20:12:25 -0000 1.8.2.8 --- mainframe.cpp 23 Feb 2007 22:21:38 -0000 1.8.2.9 *************** *** 23,27 **** --- 23,29 ---- #include "main.h" #include "propertyframe.h" + #include "agentframe.h" + #include <wx/filename.h> #include <wx/filedlg.h> *************** *** 30,33 **** --- 32,36 ---- #include <rsgedit/res/xpm_open.xpm> #include <rsgedit/res/xpm_reload.xpm> + #include <rsgedit/res/xpm_agent.xpm> #include "aboutdlg.h" *************** *** 62,65 **** --- 65,70 ---- EVT_UPDATE_UI(ID_FILE_OPEN, mainframe::OnUpdateFileOpen) + EVT_MENU(ID_AGENT_OPEN, mainframe::OnAgentOpen) + EVT_MENU(ID_FILE_RELOAD, mainframe::OnFileReload) EVT_UPDATE_UI(ID_FILE_RELOAD, mainframe::OnUpdateFileReload) *************** *** 80,92 **** using namespace oxygen; - // the default height of the log window pane [pixel] - static const int LOGWND_DEFAULT_HEIGHT = 150; - - // the update interval of the log window [milliseconds} - static const int LOGWND_UPDATE_INTERVAL = 100; - - // the default width of the tree window pane [pixel] - static const int TREEWND_DEFAULT_WIDTH = 270; - mainframe::mainframe(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style): wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE), --- 85,88 ---- *************** *** 109,112 **** --- 105,109 ---- wxMenu* wxglade_tmp_menu_1 = new wxMenu(); wxglade_tmp_menu_1->Append(ID_FILE_OPEN, wxT("&Open"), wxT(""), wxITEM_NORMAL); + wxglade_tmp_menu_1->Append(ID_AGENT_OPEN, wxT("Start &Agent"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(ID_FILE_RELOAD, wxT("&Reload"), wxT(""), wxITEM_NORMAL); wxglade_tmp_menu_1->Append(wxID_EXIT, wxT("&Exit"), wxT(""), wxITEM_NORMAL); *************** *** 139,142 **** --- 136,141 ---- mToolBar->AddTool(ID_FILE_RELOAD, wxT("Reload"), wxBitmap(xpm_reload)); mToolBar->AddSeparator(); + mToolBar->AddTool(ID_AGENT_OPEN, wxT("Start Agent"), wxBitmap(xpm_agent)); + mToolBar->AddSeparator(); mToolBar->AddTool(ID_SIM_START, wxT("Start"), wxBitmap(xpm_play)); mToolBar->AddTool(ID_SIM_PAUSE, wxT("Pause"), wxBitmap(xpm_pause)); *************** *** 684,685 **** --- 683,704 ---- dlg.ShowModal(); } + + void mainframe::OnAgentOpen(wxCommandEvent& event) + { + wxString message = "Choose an agent executable to run"; + wxString default_path = "."; + wxString default_filename = ""; + wxString default_extension = ""; + wxString wildcard = "agent executables (*.exe)|*.exe"; + + wxString filename = wxFileSelector(message, default_path, default_filename, default_extension, wildcard); + if (filename.empty() ) + { + return; + } + + agentframe* frame(new agentframe(this, wxID_ANY, filename)); + frame->SetTitle(wxFileName(filename).GetName()); + frame->Show(); + frame->StartAgent(filename); + } |