void DebuggerSettingsDlg::Initialize() { DebuggerMgr &mgr = DebuggerMgr::Get(); wxArrayString debuggers = mgr.GetAvailableDebuggers(); for (size_t i=0; i<debuggers.GetCount(); i++) { //create page per-debugger m_book->AddPage(new DebuggerPage(m_book, debuggers.Item(i)), debuggers.Item(i), true); } m_listCtrl1->InsertColumn(0, wxT("Type")); m_listCtrl1->InsertColumn(1, wxT("Expression")); m_listCtrl1->InsertColumn(2, wxT("Debugger Command")); //add items from the saved items DebuggerConfigTool::Get()->ReadObject(wxT("DebuggerCommands"), &m_data); //Populate the list with the items from the configuration file std::vector<DebuggerCmdData> cmds = m_data.GetCmds(); for (size_t i=0; i<cmds.size(); i++) { DebuggerCmdData cmd = cmds.at(i); long item = AppendListCtrlRow(m_listCtrl1); SetColumnText(m_listCtrl1, item, 0, cmd.GetName()); SetColumnText(m_listCtrl1, item, 1, cmd.GetCommand()); SetColumnText(m_listCtrl1, item, 2, cmd.GetDbgCommand()); } m_listCtrl1->SetColumnWidth(0, 100); m_listCtrl1->SetColumnWidth(1, 200); }
void DebuggerSettingsDlg::OnOk(wxCommandEvent &e) { wxUnusedVar(e); //go over the debuggers and set the debugger path for (size_t i=0; i<(size_t)m_book->GetPageCount(); i++) { DebuggerPage *page = (DebuggerPage *)m_book->GetPage(i); //find the debugger DebuggerInformation info; DebuggerMgr::Get().GetDebuggerInformation(page->m_title, info); //populate the information and save it info.enableDebugLog = page->m_checkBoxEnableLog->GetValue(); info.enablePendingBreakpoints = page->m_checkBoxEnablePendingBreakpoints->GetValue(); info.path = page->m_textCtrDbgPath->GetValue(); info.name = page->m_title; info.breakAtWinMain = page->m_checkBreakAtWinMain->IsChecked(); info.showTerminal = page->m_checkShowTerminal->IsChecked(); info.consoleCommand = EditorConfigST::Get()->GetOptions()->GetProgramConsoleCommand(); info.useRelativeFilePaths = page->m_checkUseRelativePaths->IsChecked(); info.catchThrow = page->m_catchThrow->IsChecked(); info.showTooltips = page->m_showTooltips->IsChecked(); info.startupCommands = page->m_textCtrlStartupCommands->GetValue(); info.maxDisplayStringSize = page->m_spinCtrlNumElements->GetValue(); info.resolveLocals = page->m_checkBoxExpandLocals->IsChecked(); #ifdef __WXMSW__ info.debugAsserts = page->m_checkBoxDebugAssert->IsChecked(); #endif info.autoExpandTipItems = page->m_checkBoxAutoExpand->IsChecked(); DebuggerMgr::Get().SetDebuggerInformation(page->m_title, info); } //copy the commands the serialized object m_data int count = m_listCtrl1->GetItemCount(); std::vector<DebuggerCmdData> cmdArr; for(int i=0; i<count; i++){ DebuggerCmdData cmd; cmd.SetName ( GetColumnText(m_listCtrl1, i, 0) ); cmd.SetCommand ( GetColumnText(m_listCtrl1, i, 1) ); cmd.SetDbgCommand( GetColumnText(m_listCtrl1, i, 2) ); cmdArr.push_back(cmd); } m_data.SetCmds(cmdArr); //save the debugger commands DebuggerConfigTool::Get()->WriteObject(wxT("DebuggerCommands"), &m_data); EndModal(wxID_OK); }
DebuggerPreDefinedTypes PreDefinedTypesPage::GetPreDefinedTypes() { int count = m_listCtrl1->GetItemCount(); DebuggerCmdDataVec cmdArr; for(int i=0; i<count; i++) { DebuggerCmdData cmd; cmd.SetName ( GetColumnText(m_listCtrl1, i, 0) ); cmd.SetCommand ( GetColumnText(m_listCtrl1, i, 1) ); cmd.SetDbgCommand( GetColumnText(m_listCtrl1, i, 2) ); cmdArr.push_back(cmd); } m_data.SetCmds(cmdArr); return m_data; }
PreDefinedTypesPage::PreDefinedTypesPage( wxWindow* parent, const DebuggerPreDefinedTypes& preDefTypes ) : PreDefinedTypesPageBase( parent ) , m_selectedItem(wxNOT_FOUND) { m_data = preDefTypes; m_listCtrl1->InsertColumn(0, _("Type")); m_listCtrl1->InsertColumn(1, _("Expression")); m_listCtrl1->InsertColumn(2, _("Debugger Command")); //Populate the list with the items from the configuration file DebuggerCmdDataVec cmds = m_data.GetCmds(); for (size_t i=0; i<cmds.size(); i++) { DebuggerCmdData cmd = cmds.at(i); long item = AppendListCtrlRow(m_listCtrl1); SetColumnText(m_listCtrl1, item, 0, cmd.GetName()); SetColumnText(m_listCtrl1, item, 1, cmd.GetCommand()); SetColumnText(m_listCtrl1, item, 2, cmd.GetDbgCommand()); } m_listCtrl1->SetColumnWidth(0, 100); m_listCtrl1->SetColumnWidth(1, 200); }