MCPcopy Create free account
hub / github.com/audacity/audacity / OnRemoveClicked

Method OnRemoveClicked

src/prefs/EffectsPrefs.cpp:157–179  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155 }
156
157 void OnRemoveClicked(wxCommandEvent& evt)
158 {
159 const auto index = IndexForId(evt.GetId());
160 const auto baseId = BaseRowIdForIndex(index);
161 //When item is removed from the sizer the tail gets shifted,
162 //but items in mPathCtrls are not. We need to map index from
163 //mPathCtrls to index in mRows
164 mRows->Remove(
165 std::count_if(
166 mPathCtrls.begin(),
167 mPathCtrls.begin() + index,
168 [](const auto ptr) { return ptr != nullptr; }
169 )
170 );
171
172 FindWindowById(baseId, this)->Destroy();
173 FindWindowById(baseId + 1, this)->Destroy();
174 FindWindowById(baseId + 2, this)->Destroy();
175 mPathCtrls[index] = nullptr;
176 mPaths[index] = wxString{};//Don't save path on commit
177
178 wxPostEvent(this, wxCommandEvent(EVT_PLUGIN_LOCATIONS_CHANGED));
179 }
180
181 void OnBrowseClicked(wxCommandEvent& evt)
182 {

Callers

nothing calls this directly

Calls 5

GetIdMethod · 0.80
wxCommandEventClass · 0.50
RemoveMethod · 0.45
beginMethod · 0.45
DestroyMethod · 0.45

Tested by

no test coverage detected