Skip to content

Commit ecd4ad1

Browse files
Use radio buttons instead of checkboxes for pairs
1 parent 1343bd3 commit ecd4ad1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

recaps.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,8 @@ BOOL ShowPopupMenu(HWND hWnd)
248248
}
249249

250250
// Check the main language
251-
CheckMenuRadioItem(hMainLocalePop, 0, g_keyboardInfo.count - 1, g_keyboardInfo.main, MF_BYPOSITION);
251+
CheckMenuRadioItem(hMainLocalePop, ID_MAIN_LANG, ID_MAIN_LANG + g_keyboardInfo.count - 1,
252+
ID_MAIN_LANG + g_keyboardInfo.main, MF_BYCOMMAND);
252253

253254
// Create the main popup menu
254255
HMENU hPop = CreatePopupMenu();
@@ -267,12 +268,13 @@ BOOL ShowPopupMenu(HWND hWnd)
267268
swprintf_s(szBuffer, L"%s <=> %s",
268269
g_keyboardInfo.names[g_keyboardInfo.main], g_keyboardInfo.names[layout]);
269270

270-
UINT flags = MF_STRING;
271-
if(layout == g_keyboardInfo.paired)
272-
flags |= MF_CHECKED;
273-
AppendMenu(hPop, flags, ID_LANG + layout, szBuffer);
271+
AppendMenu(hPop, MF_STRING, ID_LANG + layout, szBuffer);
274272
}
275273

274+
// Check the paired language
275+
CheckMenuRadioItem(hPop, ID_LANG, ID_LANG + g_keyboardInfo.count - 1,
276+
ID_LANG + g_keyboardInfo.paired, MF_BYCOMMAND);
277+
276278
AppendMenu(hPop, MF_SEPARATOR, 0, NULL);
277279
AppendMenu(hPop, MF_STRING, ID_EXIT, L"Exit");
278280

0 commit comments

Comments
 (0)