Report foobar2000 Advanced settings check and radio states
Native tree descriptions previously omitted state-image bits. As a result, foobar2000 Advanced Preferences read setting names without their boolean values, and changing a checkbox without moving focus could go unnoticed. Include TVIS_STATEIMAGEMASK in the native item key so polling observes state changes even when Wine omits WinEvents. Report checked and not-checked states for standard checkbox-tree images while preserving selected and expanded/collapsed states. All queries remain read-only and retain the existing target-architecture buffer layouts and bounded query behavior. Foobar2000 also uses image indexes 3 and 4 for radio choices in its Advanced settings tree. Expose those entries as radio buttons with the corresponding check state. Restrict this application-defined mapping to foobar2000.exe and its Preferences category/settings control identities. Leave unrelated state images uninterpreted rather than inventing mixed checkbox states. Extend the controls fixture with checkbox changes that emit no WinEvent, custom images, and foobar-style radio transitions. Add a foobar-controls runner mode using the application's basename. Exercise identical control IDs and images under an unrelated basename to guard against applying the compatibility mapping to other programs. Account for Wine initializing checkbox images when the fixture first appears. Document support and the manual Preferences acceptance procedure. Validation: - Controls and foobar-controls fixtures passed in both 64-bit and 32-bit. - All six CTests passed: foreground focus, MSAA states, text limits, 64/32-bit review capture, and hook safety. - Existing menu and editor integrations passed, including Unicode, selection/deletion feedback, password exclusion and read-only controls. - A private copy of foobar2000 2.26.1 exposed Advanced setting labels, numeric values, checkbox Space toggles and radio states, plus Components row names and version/module descriptions through the recording reader. - Installed the verified helper alongside the Cthulhu session-bus fix; the user subsequently confirmed that the live changes look good. Recorded events alone do not establish physical Braille acceptance. No foobar2000 settings were changed in the user's live installation.
This commit is contained in:
1 parent
24c35d7954
commit
0763498472
5 files changed
+161
-8
No files matched your search
@@ -4,7 +4,7 @@
|
||||
#include <windows.h>
|
||||
#include <commctrl.h>
|
||||
|
||||
static HWND tabs, atlTabs, tree, combo, edit, button, list;
|
||||
static HWND tabs, atlTabs, tree, combo, edit, button, list, statusTree, settingsTree;
|
||||
static HTREEITEM root;
|
||||
static int step;
|
||||
|
||||
@@ -36,6 +36,58 @@ static LRESULT CALLBACK window_proc(HWND window, UINT message, WPARAM wp, LPARAM
|
||||
case 15: focus_control(tree); break;
|
||||
case 16: SendMessageW(tree, TVM_DELETEITEM, 0, (LPARAM)TVI_ROOT); break;
|
||||
case 17: focus_control(list); break;
|
||||
case 18:
|
||||
SetWindowLongPtrW(tree, GWL_STYLE, GetWindowLongPtrW(tree, GWL_STYLE) | TVS_CHECKBOXES);
|
||||
SendMessageW(tree, TVM_INSERTITEMW, 0, (LPARAM)&(TVINSERTSTRUCTW){
|
||||
.hParent = TVI_ROOT, .hInsertAfter = TVI_LAST,
|
||||
.item = {.mask = TVIF_TEXT | TVIF_STATE, .pszText = L"Enable playback β",
|
||||
.stateMask = TVIS_STATEIMAGEMASK, .state = INDEXTOSTATEIMAGEMASK(1)}});
|
||||
SendMessageW(tree, TVM_SELECTITEM, TVGN_CARET,
|
||||
SendMessageW(tree, TVM_GETNEXTITEM, TVGN_ROOT, 0));
|
||||
focus_control(tree);
|
||||
break;
|
||||
case 19: {
|
||||
TVITEMW item = {0};
|
||||
item.mask = TVIF_STATE;
|
||||
item.hItem = (HTREEITEM)SendMessageW(tree, TVM_GETNEXTITEM, TVGN_CARET, 0);
|
||||
item.stateMask = TVIS_STATEIMAGEMASK;
|
||||
item.state = INDEXTOSTATEIMAGEMASK(2);
|
||||
// Do not send a WinEvent: the focus poll must notice the new state.
|
||||
SendMessageW(tree, TVM_SETITEMW, 0, (LPARAM)&item);
|
||||
break;
|
||||
}
|
||||
case 20: {
|
||||
TVITEMW item = {0};
|
||||
item.mask = TVIF_STATE | TVIF_TEXT;
|
||||
item.pszText = L"Custom checkbox icon";
|
||||
item.hItem = (HTREEITEM)SendMessageW(tree, TVM_GETNEXTITEM, TVGN_CARET, 0);
|
||||
item.stateMask = TVIS_STATEIMAGEMASK;
|
||||
item.state = INDEXTOSTATEIMAGEMASK(3);
|
||||
SendMessageW(tree, TVM_SETITEMW, 0, (LPARAM)&item);
|
||||
break;
|
||||
}
|
||||
case 21: focus_control(statusTree); break;
|
||||
case 22: {
|
||||
TVITEMW item = {0};
|
||||
item.mask = TVIF_STATE;
|
||||
item.hItem = (HTREEITEM)SendMessageW(settingsTree, TVM_GETNEXTITEM, TVGN_CARET, 0);
|
||||
item.stateMask = TVIS_STATEIMAGEMASK;
|
||||
item.state = INDEXTOSTATEIMAGEMASK(3);
|
||||
// Wine initializes checkbox images when the window is first shown.
|
||||
// Install the application's custom image after that initialization.
|
||||
SendMessageW(settingsTree, TVM_SETITEMW, 0, (LPARAM)&item);
|
||||
focus_control(settingsTree);
|
||||
break;
|
||||
}
|
||||
case 23: {
|
||||
TVITEMW item = {0};
|
||||
item.mask = TVIF_STATE;
|
||||
item.hItem = (HTREEITEM)SendMessageW(settingsTree, TVM_GETNEXTITEM, TVGN_CARET, 0);
|
||||
item.stateMask = TVIS_STATEIMAGEMASK;
|
||||
item.state = INDEXTOSTATEIMAGEMASK(4);
|
||||
SendMessageW(settingsTree, TVM_SETITEMW, 0, (LPARAM)&item);
|
||||
break;
|
||||
}
|
||||
default: DestroyWindow(window); break;
|
||||
}
|
||||
return 0;
|
||||
@@ -76,7 +128,7 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPSTR args, int show)
|
||||
tab.pszText = L"Second Playlist";
|
||||
SendMessageW(atlTabs, TCM_INSERTITEMW, 1, (LPARAM)&tab);
|
||||
tree = CreateWindowW(WC_TREEVIEWW, L"Tree1", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
|
||||
10, 110, 300, 170, window, NULL, instance, NULL);
|
||||
10, 110, 300, 170, window, (HMENU)1068, instance, NULL);
|
||||
TVINSERTSTRUCTW node = {0};
|
||||
node.hParent = TVI_ROOT;
|
||||
node.hInsertAfter = TVI_LAST;
|
||||
@@ -105,6 +157,23 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE previous, LPSTR args, int show)
|
||||
390, 220, 200, 80, window, NULL, instance, NULL);
|
||||
SendMessageW(list, LB_ADDSTRING, 0, (LPARAM)L"Rock & roll && blues");
|
||||
SendMessageW(list, LB_SETCURSEL, 0, 0);
|
||||
statusTree = CreateWindowW(WC_TREEVIEWW, L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP,
|
||||
500, 310, 170, 60, window, NULL, instance, NULL);
|
||||
node.hParent = TVI_ROOT;
|
||||
node.item.mask = TVIF_TEXT | TVIF_STATE;
|
||||
node.item.pszText = L"Status image";
|
||||
node.item.stateMask = TVIS_STATEIMAGEMASK;
|
||||
node.item.state = INDEXTOSTATEIMAGEMASK(2);
|
||||
HTREEITEM status = (HTREEITEM)SendMessageW(statusTree, TVM_INSERTITEMW, 0, (LPARAM)&node);
|
||||
SendMessageW(statusTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)status);
|
||||
// Reproduce foobar's native control identities and application-defined
|
||||
// radio images. The runner tests this under matching and unrelated names.
|
||||
settingsTree = CreateWindowW(WC_TREEVIEWW, L"", WS_CHILD | WS_VISIBLE | WS_TABSTOP | TVS_CHECKBOXES,
|
||||
500, 370, 170, 40, window, (HMENU)1181, instance, NULL);
|
||||
node.item.pszText = L"Radio option";
|
||||
node.item.state = INDEXTOSTATEIMAGEMASK(3);
|
||||
HTREEITEM radio = (HTREEITEM)SendMessageW(settingsTree, TVM_INSERTITEMW, 0, (LPARAM)&node);
|
||||
SendMessageW(settingsTree, TVM_SELECTITEM, TVGN_CARET, (LPARAM)radio);
|
||||
ShowWindow(window, SW_SHOW);
|
||||
SetForegroundWindow(window);
|
||||
focus_control(tabs);
|
||||
|
||||
Reference in new issue
Block a user