Skip to content

Commit

Permalink
Fix handling of combo-box selection changes in Options
Browse files Browse the repository at this point in the history
  • Loading branch information
rafalh committed Aug 24, 2024
1 parent 870f869 commit e991954
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
25 changes: 12 additions & 13 deletions launcher/OptionsDisplayDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,20 @@ void OptionsDisplayDlg::UpdateColorDepthCombo()
m_color_depth_combo.SetCurSel(m_conf.res_bpp == 16 ? index_16 : index_32);
}

LRESULT OptionsDisplayDlg::OnNotify([[ maybe_unused ]] WPARAM wparam, LPARAM lparam)
BOOL OptionsDisplayDlg::OnCommand(WPARAM wparam, [[ maybe_unused ]] LPARAM lparam)
{
auto& nmhdr = *reinterpret_cast<LPNMHDR>(lparam);
switch (nmhdr.code) {
case CBN_SELCHANGE:
if (nmhdr.idFrom == IDC_ADAPTER_COMBO) {
OnAdapterChange();
if (HIWORD(wparam) == CBN_SELCHANGE) {
switch (LOWORD(wparam)) {
case IDC_ADAPTER_COMBO:
OnAdapterChange();
break;
case IDC_WND_MODE_COMBO:
OnWindowModeChange();
break;
case IDC_COLOR_DEPTH_COMBO:
OnColorDepthChange();
break;
}
else if (nmhdr.idFrom == IDC_WND_MODE_COMBO) {
OnWindowModeChange();
}
else if (nmhdr.idFrom == IDC_COLOR_DEPTH_COMBO) {
OnColorDepthChange();
}
break;
}
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion launcher/OptionsDisplayDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class OptionsDisplayDlg : public CDialog

protected:
BOOL OnInitDialog() override;
LRESULT OnNotify(WPARAM wparam, LPARAM lparam) override;
BOOL OnCommand(WPARAM wparam, LPARAM lparam) override;

private:
void InitToolTip();
Expand Down

0 comments on commit e991954

Please sign in to comment.