Skip to content

Commit

Permalink
Use radio buttons instead of checkboxes for pairs
Browse files Browse the repository at this point in the history
  • Loading branch information
justanotheranonymoususer committed Jun 5, 2015
1 parent 1343bd3 commit ecd4ad1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions recaps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,8 @@ BOOL ShowPopupMenu(HWND hWnd)
}

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

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

UINT flags = MF_STRING;
if(layout == g_keyboardInfo.paired)
flags |= MF_CHECKED;
AppendMenu(hPop, flags, ID_LANG + layout, szBuffer);
AppendMenu(hPop, MF_STRING, ID_LANG + layout, szBuffer);
}

// Check the paired language
CheckMenuRadioItem(hPop, ID_LANG, ID_LANG + g_keyboardInfo.count - 1,
ID_LANG + g_keyboardInfo.paired, MF_BYCOMMAND);

AppendMenu(hPop, MF_SEPARATOR, 0, NULL);
AppendMenu(hPop, MF_STRING, ID_EXIT, L"Exit");

Expand Down

0 comments on commit ecd4ad1

Please sign in to comment.