Compare commits

..

1 Commits

Author SHA1 Message Date
Quantum
d73e676427 [idd] helper: allow scrolling when mode list is long 2025-11-08 03:39:47 -05:00

View File

@@ -93,7 +93,7 @@ LRESULT CConfigWindow::onCreate()
m_modeGroup.reset(new CGroupBox(L"Custom modes", WS_CHILD | WS_VISIBLE, m_hwnd)); m_modeGroup.reset(new CGroupBox(L"Custom modes", WS_CHILD | WS_VISIBLE, m_hwnd));
m_modeBox.reset(new CListBox(WS_CHILD | WS_VISIBLE | LBS_NOTIFY, m_hwnd)); m_modeBox.reset(new CListBox(WS_CHILD | WS_VISIBLE | WS_VSCROLL | LBS_NOTIFY, m_hwnd));
if (m_modes) if (m_modes)
{ {
m_modeBox->addItem(L"<add new>", -1); m_modeBox->addItem(L"<add new>", -1);
@@ -178,17 +178,9 @@ LRESULT CConfigWindow::onCommand(WORD id, WORD code, HWND hwnd)
int index = m_modeBox->getData(sel); int index = m_modeBox->getData(sel);
auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back(); auto &mode = index >= 0 ? (*m_modes)[index] : m_modes->emplace_back();
mode.width = m_modeWidth->getNumericValue();
try mode.height = m_modeHeight->getNumericValue();
{ mode.refresh = m_modeRefresh->getNumericValue();
mode.width = m_modeWidth->getNumericValue();
mode.height = m_modeHeight->getNumericValue();
mode.refresh = m_modeRefresh->getNumericValue();
}
catch (std::logic_error&)
{
return 0;
}
if (index >= 0) if (index >= 0)
m_modeBox->delItem(sel); m_modeBox->delItem(sel);