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

Method PopulateList

src/BatchProcessDialog.cpp:724–754  ·  view source on GitHub ↗

This clears and updates the contents of mList, the commands for the current macro.

Source from the content-addressed store, hash-verified

722
723/// This clears and updates the contents of mList, the commands for the current macro.
724void MacrosWindow::PopulateList()
725{
726 int topItem = mList->GetTopItem();
727 mList->DeleteAllItems();
728
729 for (int i = 0; i < mMacroCommands.GetCount(); i++) {
730 AddItem(mMacroCommands.GetCommand(i),
731 mMacroCommands.GetParams(i));
732 }
733 /*i18n-hint: This is the last item in a list.*/
734 AddItem(_("- END -"), wxT(""));
735
736 // Select the name in the list...this will fire an event.
737 if (mSelectedCommand >= (int)mList->GetItemCount()) {
738 mSelectedCommand = 0;
739 }
740 mList->SetItemState(mSelectedCommand,
741 wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED,
742 wxLIST_STATE_SELECTED | wxLIST_STATE_FOCUSED);
743 if( 0 <= topItem && topItem < (int)mList->GetItemCount())
744 {
745 // Workaround for scrolling being windows only.
746 // Try to scroll back to where we once were...
747 mList->EnsureVisible( (int)mList->GetItemCount() -1 );
748 mList->EnsureVisible( topItem );
749 // And then make sure whatever is selected is still visible...
750 if (mSelectedCommand >= 0) {
751 mList->EnsureVisible( mSelectedCommand );
752 }
753 }
754}
755
756/// Add one item into mList
757void MacrosWindow::AddItem(const CommandID &Action, const wxString &Params)

Callers

nothing calls this directly

Calls 4

AddItemFunction · 0.85
GetParamsMethod · 0.80
GetCountMethod · 0.45
GetCommandMethod · 0.45

Tested by

no test coverage detected