Skip to content

Commit

Permalink
ListView: fix column header context menu when a langpack is used [rea…
Browse files Browse the repository at this point in the history
…per-oss#942]

SWS automatically sorts context menus if a langpack is loaded. This
breaks the column header context menu. This patch ensure the column
header context menu is never sorted.

Fixes reaper-oss#942.
  • Loading branch information
cfillion committed Jan 17, 2018
1 parent 400c3c1 commit ab365e8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sws_wnd.cpp
Expand Up @@ -1329,17 +1329,17 @@ bool SWS_ListView::DoColumnMenu(int x, int y)
EditListItemEnd(true); // fix possible crash

HMENU hMenu = CreatePopupMenu();
AddToMenu(hMenu, __LOCALIZE("Visible columns","sws_menu"), 0);
AddToMenuOrdered(hMenu, __LOCALIZE("Visible columns","sws_menu"), 0);
EnableMenuItem(hMenu, 0, MF_BYPOSITION | MF_GRAYED);

for (int i = 0; i < m_iCols; i++)
{
AddToMenu(hMenu, m_pCols[i].cLabel, i + 1);
AddToMenuOrdered(hMenu, m_pCols[i].cLabel, i + 1);
if (m_pCols[i].iPos != -1)
CheckMenuItem(hMenu, i+1, MF_BYPOSITION | MF_CHECKED);
}
AddToMenu(hMenu, SWS_SEPARATOR, 0);
AddToMenu(hMenu, __LOCALIZE("Reset","sws_menu"), m_iCols + 1);
AddToMenuOrdered(hMenu, SWS_SEPARATOR, 0);
AddToMenuOrdered(hMenu, __LOCALIZE("Reset","sws_menu"), m_iCols + 1);

iCol = TrackPopupMenu(hMenu, TPM_RETURNCMD, x, y, 0, m_hwndList, NULL);
DestroyMenu(hMenu);
Expand Down

0 comments on commit ab365e8

Please sign in to comment.