Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When the Parameter combo box in the Parameters dialog gets focus, rebuild the parameter list. #707

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/paramsUi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ class ParamsDialog {
unique_ptr<ParamSource> source;
HWND dialog;
HWND paramCombo;
WNDPROC paramComboOrigProc;
HWND slider;
HWND valueEdit;
HWND valueLabel;
Expand Down Expand Up @@ -461,6 +462,20 @@ class ParamsDialog {
return FALSE;
}

static INT_PTR CALLBACK wndProc(HWND hwnd, UINT msg, WPARAM wParam,
LPARAM lParam
) {
ParamsDialog* dialog = (ParamsDialog*)GetWindowLongPtr(GetParent(hwnd),
GWLP_USERDATA);
if (msg == WM_SETFOCUS && dialog && hwnd == dialog->paramCombo) {
// Changing a param value might update param names; e.g. changing the
// band type in ReaEq.
dialog->updateParamList();
return 0;
}
return CallWindowProc(dialog->paramComboOrigProc, hwnd, msg, wParam, lParam);
}

accelerator_register_t accelReg;
static int translateAccel(MSG* msg, accelerator_register_t* accelReg) {
ParamsDialog* dialog = (ParamsDialog*)accelReg->user;
Expand Down Expand Up @@ -634,6 +649,8 @@ class ParamsDialog {
SetWindowText(this->dialog, this->source->getTitle().c_str());
this->paramCombo = GetDlgItem(this->dialog, ID_PARAM);
WDL_UTF8_HookComboBox(this->paramCombo);
this->paramComboOrigProc = (WNDPROC)SetWindowLongPtr(this->paramCombo,
GWLP_WNDPROC, (LONG_PTR)this->wndProc);
this->slider = GetDlgItem(this->dialog, ID_PARAM_VAL_SLIDER);
// We need to do exotic stuff with this slider that we can't support on Mac:
// 1. Custom step values (TBM_SETLINESIZE, TBM_SETPAGESIZE).
Expand Down