Skip to content

Commit

Permalink
Modify the "Display Columns" dialog. (#2154)
Browse files Browse the repository at this point in the history
- Clear the column description and disable "Move Up" and "Move Down" buttons when no item is selected.
- Select the first item after clicking the "Defaults" button.
  • Loading branch information
tjmprm77 authored Dec 29, 2023
1 parent a17afcb commit 3e3d95c
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Src/DirColsDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,9 @@ void CDirColsDlg::OnDefaults()
m_listColumns.DeleteAllItems();
m_bReset = true;
LoadDefLists();

// Set first item to selected state
SelectItem(0);
}

/**
Expand Down Expand Up @@ -304,6 +307,13 @@ void CDirColsDlg::OnLvnItemchangedColdlgList(NMHDR *pNMHDR, LRESULT *pResult)
EnableDlgItem(IDC_DOWN,
ind != m_listColumns.GetItemCount() - static_cast<int>(m_listColumns.GetSelectedCount()));
}
else
{
// Clear the column description and disable "Move Up" and "Move Down" buttons when no item is selected.
SetDlgItemText(IDC_COLDLG_DESC, _T(""));
EnableDlgItem(IDC_UP, false);
EnableDlgItem(IDC_DOWN, false);
}

// Disable the "OK" button when no items are checked.
bool bChecked = false;
Expand Down

0 comments on commit 3e3d95c

Please sign in to comment.