void CompilerMainPage::InitializePatterns() { // Clear the content m_listErrPatterns->DeleteAllItems(); m_listWarnPatterns->DeleteAllItems(); // Populate with new content CHECK_PTR_RET(m_compiler); const Compiler::CmpListInfoPattern& errPatterns = m_compiler->GetErrPatterns(); Compiler::CmpListInfoPattern::const_iterator itPattern; for(itPattern = errPatterns.begin(); itPattern != errPatterns.end(); ++itPattern) { long item = AppendListCtrlRow(m_listErrPatterns); SetColumnText(m_listErrPatterns, item, 0, itPattern->pattern); SetColumnText(m_listErrPatterns, item, 1, itPattern->fileNameIndex); SetColumnText(m_listErrPatterns, item, 2, itPattern->lineNumberIndex); SetColumnText(m_listErrPatterns, item, 3, itPattern->columnIndex); } const Compiler::CmpListInfoPattern& warnPatterns = m_compiler->GetWarnPatterns(); for(itPattern = warnPatterns.begin(); itPattern != warnPatterns.end(); ++itPattern) { long item = AppendListCtrlRow(m_listWarnPatterns); SetColumnText(m_listWarnPatterns, item, 0, itPattern->pattern); SetColumnText(m_listWarnPatterns, item, 1, itPattern->fileNameIndex); SetColumnText(m_listWarnPatterns, item, 2, itPattern->lineNumberIndex); SetColumnText(m_listWarnPatterns, item, 3, itPattern->columnIndex); } }
void DbSettingDialog::LoadHistory() { // recent sqlite files wxArrayString files = DoLoadSqliteHistory(); m_listCtrlRecentFiles->DeleteAllItems(); for(size_t i = 0; i < files.Count(); i++) { int idx = AppendListCtrlRow(m_listCtrlRecentFiles); SetColumnText(m_listCtrlRecentFiles, idx, 0, files.Item(i)); } #ifdef DBL_USE_MYSQL DbConnectionInfoVec mySqlConns = DoLoadMySQLHistory(); m_listBox2->Clear(); for(size_t i = 0; i < mySqlConns.size(); i++) { m_listBox2->Append(mySqlConns.at(i).GetConnectionName()); } #endif #ifdef DBL_USE_POSTGRES DbConnectionInfoVec pgSqlConns = DoLoadPgSQLHistory(); m_listBoxPg->Clear(); for(size_t i = 0; i < pgSqlConns.size(); i++) { m_listBoxPg->Append(pgSqlConns.at(i).GetConnectionName()); } #endif }
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 ReconcileProjectFiletypesDlg::SetRegex(const wxString& regex) { int n = m_listCtrlRegexes->GetItemCount(); AppendListCtrlRow(m_listCtrlRegexes); SetColumnText(m_listCtrlRegexes, n, 0, regex.AfterFirst('|')); SetColumnText(m_listCtrlRegexes, n, 1, regex.BeforeFirst('|')); }
void CompilerMainPage::InitializeFileTypes() { // populate the list control wxWindowUpdateLocker locker(m_listCtrlFileTypes); m_listCtrlFileTypes->DeleteAllItems(); CHECK_PTR_RET(m_compiler); m_selectedFileType = -1; std::map<wxString, Compiler::CmpFileTypeInfo> fileTypes = m_compiler->GetFileTypes(); std::map<wxString, Compiler::CmpFileTypeInfo>::iterator iter = fileTypes.begin(); for(; iter != fileTypes.end(); iter++) { Compiler::CmpFileTypeInfo ft = iter->second; long item = AppendListCtrlRow(m_listCtrlFileTypes); SetColumnText(m_listCtrlFileTypes, item, 0, ft.extension); SetColumnText( m_listCtrlFileTypes, item, 1, ft.kind == Compiler::CmpFileKindSource ? _("Source") : _("Resource")); SetColumnText(m_listCtrlFileTypes, item, 2, ft.compilation_line); } m_listCtrlFileTypes->SetColumnWidth(0, 70); m_listCtrlFileTypes->SetColumnWidth(1, 70); m_listCtrlFileTypes->SetColumnWidth(2, wxLIST_AUTOSIZE); }
void CompilerMainPage::OnNewFileType(wxCommandEvent& event) { EditCmpFileInfo dlg(wxGetTopLevelParent(this)); if(dlg.ShowModal() == wxID_OK) { long newItem = AppendListCtrlRow(m_listCtrlFileTypes); SetColumnText(m_listCtrlFileTypes, newItem, 2, dlg.GetCompilationLine()); SetColumnText(m_listCtrlFileTypes, newItem, 0, dlg.GetExtension().Lower()); SetColumnText(m_listCtrlFileTypes, newItem, 1, dlg.GetKind()); m_isDirty = true; } }
void CompilerMainPage::OnBtnAddWarnPattern(wxCommandEvent& event) { CompilerPatternDlg dlg(wxGetTopLevelParent(this), _("Add compiler warning pattern")); if(dlg.ShowModal() == wxID_OK) { m_isDirty = true; long item = AppendListCtrlRow(m_listWarnPatterns); SetColumnText(m_listWarnPatterns, item, 0, dlg.GetPattern()); SetColumnText(m_listWarnPatterns, item, 1, dlg.GetFileIndex()); SetColumnText(m_listWarnPatterns, item, 2, dlg.GetLineIndex()); SetColumnText(m_listWarnPatterns, item, 3, dlg.GetColumnIndex()); } }
void CompilerMainPage::AddSwitch(const wxString& name, const wxString& value, bool choose) { long item = AppendListCtrlRow(m_listSwitches); SetColumnText(m_listSwitches, item, 0, name); SetColumnText(m_listSwitches, item, 1, value); if(choose) { m_selSwitchName = name; m_selSwitchValue = value; } m_listSwitches->SetColumnWidth(0, wxLIST_AUTOSIZE); m_listSwitches->SetColumnWidth(0, 100); }
void MacrosDlg::AddMacro(const wxString& name, const wxString& desc) { long row = AppendListCtrlRow(m_listCtrlMacros); SetColumnText(m_listCtrlMacros, row, 0, name); SetColumnText(m_listCtrlMacros, row, 1, desc); // Only fill third column if we can and may expand the macros if (m_project && m_editor && name != "$(ProjectFiles)" && name != "$(ProjectFilesAbs)") { wxString value = ExpandVariables(name, m_project, m_editor); SetColumnText(m_listCtrlMacros, row, 2, value); } else { // No third column here... don't fill it or we get an assertion } }
int OpenResourceDialog::DoAppendLine(const wxString& col1, const wxString& col2, const wxString &col3, bool boldFont, OpenResourceDialogItemData* clientData) { int index = AppendListCtrlRow(m_listOptions); SetColumnText(m_listOptions, index, 0, col1); SetColumnText(m_listOptions, index, 1, col2); SetColumnText(m_listOptions, index, 2, col3); m_listOptions->SetItemPtrData(index, (wxUIntPtr)(clientData)); // Mark implementations with bold font wxFont font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT); if(boldFont) font.SetWeight(wxBOLD); m_listOptions->SetItemFont(index, font); return index; }
void NewClassDlg::OnButtonAdd(wxCommandEvent& event) { NewIneritanceDlg* dlg = new NewIneritanceDlg(this, m_mgr); if(dlg->ShowModal() == wxID_OK) { // add new parent to our class // now set the text to this column long item = AppendListCtrlRow(m_listCtrl1); SetColumnText(m_listCtrl1, item, 0, dlg->GetParentName()); SetColumnText(m_listCtrl1, item, 1, dlg->GetAccess()); SetColumnText(m_listCtrl1, item, 2, dlg->GetFileName()); m_listCtrl1->Refresh(); } dlg->Destroy(); }
void SymbolsDialog::AddSymbol(const TagEntryPtr &tag, bool sel) { //------------------------------------------------------- // Populate the columns //------------------------------------------------------- wxString line; line << tag->GetLine(); long index = AppendListCtrlRow(m_results); SetColumnText(m_results, index, 0, tag->GetFullDisplayName()); SetColumnText(m_results, index, 1, tag->GetKind()); SetColumnText(m_results, index, 2, tag->GetFile()); SetColumnText(m_results, index, 3, line); SetColumnText(m_results, index, 4, tag->GetPattern()); // list ctrl can reorder items, so use returned index to insert tag m_tags.insert(m_tags.begin()+index, tag); }
void WatchesTable::AddExpression(const wxString &expr) { //make sure that the expression does not exist int count = m_listTable->GetItemCount(); for (int i=0; i<count; i++) { wxString exp = this->GetColumnText(i, 0); if (exp == expr) { wxMessageBox(_("A similar expression already exist in the watches table"), wxT("EmbeddedLite"), wxOK | wxICON_INFORMATION); return; } } long item = AppendListCtrlRow(m_listTable); this->SetColumnText(item, 0, expr); //info.SetState(wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED); //item = m_listTable->InsertItem(info); m_listTable->SetColumnWidth(0, 200); m_listTable->SetColumnWidth(1, 600); }
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); }
void ExternalToolDlg::DoUpdateEntry(const wxString& id, const wxString& name, const wxString& path, const wxString& workingDirectory, const wxString& arguments, const wxString& icon16, const wxString& icon24, bool captureOutput, bool saveAllFiles, bool callOnFileSave) { // try to see if 'id' already exist in the list control long item(wxNOT_FOUND); for(size_t i = 0; i < (size_t)m_listCtrlTools->GetItemCount(); i++) { if(GetColumnText(m_listCtrlTools, i, 0) == id) { item = i; // Delete old data ExternalToolData* data = (ExternalToolData*)m_listCtrlTools->GetItemData(item); if(data) delete data; break; } } // append new row if(item == wxNOT_FOUND) { item = AppendListCtrlRow(m_listCtrlTools); } SetColumnText(m_listCtrlTools, item, 0, id); SetColumnText(m_listCtrlTools, item, 1, name); SetColumnText(m_listCtrlTools, item, 2, path); ExternalToolData* data = new ExternalToolData( id, name, path, workingDirectory, arguments, icon16, icon24, captureOutput, saveAllFiles, callOnFileSave); m_listCtrlTools->SetItemPtrData(item, wxUIntPtr(data)); }
void ExternalToolDlg::SetTools(const std::vector<ToolInfo>& tools) { m_listCtrlTools->Freeze(); for(size_t i = 0; i < (size_t)m_listCtrlTools->GetItemCount(); i++) { ExternalToolData* data = (ExternalToolData*)m_listCtrlTools->GetItemData(i); wxDELETE(data); } m_listCtrlTools->DeleteAllItems(); for(size_t i = 0; i < tools.size(); i++) { ToolInfo ti = tools.at(i); long item = AppendListCtrlRow(m_listCtrlTools); ExternalToolData* data = new ExternalToolData(ti); m_listCtrlTools->SetItemPtrData(item, wxUIntPtr(data)); SetColumnText(m_listCtrlTools, item, 0, ti.GetId()); SetColumnText(m_listCtrlTools, item, 1, ti.GetName()); SetColumnText(m_listCtrlTools, item, 2, ti.GetPath()); } m_listCtrlTools->Thaw(); }
void BreakpointsListctrl::Initialise(std::vector<BreakpointInfo>& bps) { Freeze(); DeleteAllItems(); std::vector<BreakpointInfo>::iterator iter = bps.begin(); for (; iter != bps.end(); ++iter) { long item = AppendListCtrlRow(this); // Store the internal and external ids struct bpd_IDs IDs(*iter); SetColumnText(this, item, col_id, IDs.GetIdAsString(), wxNOT_FOUND); wxString type; if (iter->is_temp) { type = _("Temp. "); } type += ((iter->bp_type==BP_type_watchpt) ? _("Watchpoint") : _("Breakpoint")); SetColumnText(this, item, col_type, type, wxNOT_FOUND); wxString disabled; if (!iter->is_enabled) { disabled = _("disabled"); } SetColumnText(this, item, col_enabled, disabled ); SetColumnText(this, item, col_at, iter->at ); SetColumnText(this, item, col_what, iter->what); // A breakpoint will have either a file/lineno or a function-name (e.g.main(), or a memory address) // A watchpoint will have watchpt_data (the variable it's watching). Display that in the 'Function' col if ((iter->bp_type==BP_type_watchpt) && (!iter->watchpt_data.IsEmpty())) { SetColumnText(this, item, col_functionname, iter->watchpt_data, wxNOT_FOUND); } else if (!iter->function_name.IsEmpty()) { SetColumnText(this, item, col_functionname, iter->function_name, wxNOT_FOUND); } else if (iter->memory_address.IsEmpty() == false) { wxString addr; addr << iter->memory_address; SetColumnText(this, item, col_memory, addr, wxNOT_FOUND); } else { SetColumnText(this, item, col_file, iter->file, wxNOT_FOUND); wxString line; line << iter->lineno; SetColumnText(this, item, col_lineno, line, wxNOT_FOUND); } wxString ignore; if (iter->ignore_number) { ignore << iter->ignore_number; } SetColumnText(this, item, col_ignorecount, ignore, wxNOT_FOUND); wxString extras; // Extras are conditions, or a commandlist. If both (unlikely!) just show the condition if (!iter->conditions.IsEmpty()) { extras = iter->conditions; } else if (!iter->commandlist.IsEmpty()) { extras = iter->commandlist; } if (!extras.IsEmpty()) { // We don't want to try to display massive commandlist spread over several lines... int index = extras.Find(wxT("\\n")); if (index != wxNOT_FOUND) { extras = extras.Left(index) + wxT("..."); } SetColumnText(this, item, col_extras, extras, wxNOT_FOUND); } } Thaw(); }