void CManagePasswordPolicies::OnEditPpClick( wxCommandEvent& ) { int row = GetSelectedRow(); if (row < 0) return; wxString policyname = m_PolicyNames->GetCellValue(row, 0); PWPolicy st_pp; if (row == 0) { // 1st row is default st_pp = m_st_default_pp; } else { PSWDPolicyMapIter mapIter = m_MapPSWDPLC.find(StringX(policyname.c_str())); if (row != 0 && mapIter == m_MapPSWDPLC.end()) { ASSERT(0); return; } st_pp = mapIter->second; } CPasswordPolicy ppdlg(this, m_core, m_MapPSWDPLC); ppdlg.SetPolicyData(policyname, st_pp); if (ppdlg.ShowModal() == wxID_OK) { ppdlg.GetPolicyData(policyname, st_pp); ASSERT(!policyname.IsEmpty()); UpdatePolicy(policyname, st_pp, CPP_MODIFIED); } }
/** PCHere * * Moves the pc to the current address */ void MemoryGrid::OnPCHere(wxCommandEvent& event) { int addr = -1; addr = GetSelectedRow(); if (addr == -1) return; Refresh(state.pc); state.pc = addr; Refresh(addr); }
/** SetTemppoint * * Sets a temporary breakpoint */ void MemoryGrid::OnTemppoint(wxCommandEvent& event) { int addr = -1; addr = GetSelectedRow(); if (addr == -1) return; bool exist = lc3_add_break(state, (unsigned short) addr, "", "1", 1); if (exist) lc3_remove_break(state, (unsigned short) addr); Refresh(addr); }
/** SetBlackbox * * Sets a blackbox */ void MemoryGrid::OnBlackbox(wxCommandEvent& event) { int addr = -1; addr = GetSelectedRow(); if (addr == -1) return; bool exist = lc3_add_blackbox(state, (unsigned short) addr); if (exist) lc3_remove_blackbox(state, (unsigned short) addr); Refresh(addr); }
/** SetWatchpoint * * Sets a watchpoint */ void MemoryGrid::OnWatchpoint(wxCommandEvent& event) { int addr = -1; addr = GetSelectedRow(); if (addr == -1) return; bool exist = lc3_add_watch(state, false, (unsigned short) addr, "1"); if (exist) lc3_remove_watch(state, false, (unsigned short) addr); Refresh(addr); }
void CManagePasswordPolicies::UpdateDetails() { // Update details table to reflect selected policy, if any if (GetSelectedRow() == -1) return; PWPolicy st_pp = GetSelectedPolicy(); m_PolicyDetails->ClearGrid(); st_pp.Policy2Table(wxRowPutter, m_PolicyDetails); }
PWPolicy CManagePasswordPolicies::GetSelectedPolicy() const { /* If first row or no row selected, then fill in with the database default, otherwise use the name entry */ int row = GetSelectedRow(); if (row > 0) { const wxString policyname = m_PolicyNames->GetCellValue(row, 0); PSWDPolicyMapCIter iter = m_MapPSWDPLC.find(tostringx(policyname)); if (iter == m_MapPSWDPLC.end()) return m_st_default_pp; return iter->second; } else { return m_st_default_pp; } }
/** SetAdvancedpoint * * Sets an Advanced Breakpoint */ void MemoryGrid::OnAdvancedpoint(wxCommandEvent& event) { lc3_breakpoint_info info; int addr = -1; addr = GetSelectedRow(); if (addr == -1) return; bool new_bp = state.breakpoints.find(addr) == state.breakpoints.end(); if (new_bp) { info.addr = addr; info.condition = "1"; info.enabled = true; info.hit_count = 0; info.label = ""; info.max_hits = -1; } else { info = state.breakpoints[addr]; } BreakpointDialog* dialog = new BreakpointDialog(this, info, false); if (dialog->ShowModal() == wxID_OK) { int error; info = dialog->GetInfo(error); if (error) PrintError(error); else state.breakpoints[info.addr] = info; } delete dialog; Refresh(); }
void MainWnd::on_btn_down_clicked() { int count = ui->tableWidget->rowCount(); int row = GetSelectedRow(); if(row >= 0 && row < count - 1) SwitchRows(row, row + 1); }
void MainWnd::on_btn_up_clicked() { int row = GetSelectedRow(); if(row > 0) SwitchRows(row, row - 1); }
void MainWnd::on_btn_remove_clicked() { int row = GetSelectedRow(); ui->tableWidget->removeRow(row == -1 ? 0 : row); Modified = true; }
void MainWnd::on_btn_add_clicked() { int row = GetSelectedRow(); ui->tableWidget->insertRow(row == -1 ? 0 : row + 1); Modified = true; }