* @brief Default dialog constructor.
* @param [in] pParent Dialog's parent component (window).
*/
-CDirColsDlg::CDirColsDlg(CWnd* pParent /*=NULL*/)
+CDirColsDlg::CDirColsDlg(CWnd* pParent /*= nullptr*/)
: CTrDialog(CDirColsDlg::IDD, pParent)
, m_bReset(false)
{
// Show selection across entire row.
// Also enable infotips.
m_listColumns.SetExtendedStyle(LVS_EX_CHECKBOXES | LVS_EX_FULLROWSELECT | LVS_EX_INFOTIP);
- m_listColumns.InsertColumn(0, _T(""), LVCFMT_LEFT, pointToPixel(112));
+ m_listColumns.InsertColumn(0, _T(""), LVCFMT_LEFT, pointToPixel(148));
}
/**
{
// Get current column data
String text = m_listColumns.GetItemText(index, 0);
- bool checked = m_listColumns.GetCheck(index);
+ bool checked = !!m_listColumns.GetCheck(index);
UINT state = m_listColumns.GetItemState(index, LVIS_SELECTED);
DWORD_PTR data = m_listColumns.GetItemData(index);
/**
* @brief Move selected items one position up or down.
- * @param [in] bUp If TRUE items are moved up,
- * if FALSE items are moved down.
+ * @param [in] bUp If `true` items are moved up,
+ * if `false` items are moved down.
*/
void CDirColsDlg::MoveSelectedItems(bool bUp)
{
int firstInd = -1;
POSITION pos = m_listColumns.GetFirstSelectedItemPosition();
- while (pos)
+ while (pos != nullptr)
{
int ind = m_listColumns.GetNextSelectedItem(pos);
int newInd = bUp ? ind - 1: ind + 1;
*/
void CDirColsDlg::OnUp()
{
- MoveSelectedItems(TRUE);
+ MoveSelectedItems(true);
}
/**
*/
void CDirColsDlg::OnDown()
{
- MoveSelectedItems(FALSE);
+ MoveSelectedItems(false);
}
/**
for (int i = 0; i < m_listColumns.GetItemCount(); i++)
{
- bool checked = m_listColumns.GetCheck(i);
+ bool checked = !!m_listColumns.GetCheck(i);
DWORD_PTR data = m_listColumns.GetItemData(i);
column & col1 = m_cols[data];
if (checked)
{
POSITION pos = m_listColumns.GetFirstSelectedItemPosition();
- if (pos)
+ if (pos != nullptr)
{
int ind = m_listColumns.GetNextSelectedItem(pos);
DWORD_PTR data = m_listColumns.GetItemData(ind);