diff options
-rw-r--r-- | include/m_skin.h | 2 | ||||
-rw-r--r-- | src/modules/skin/hotkeys.cpp | 34 |
2 files changed, 12 insertions, 24 deletions
diff --git a/include/m_skin.h b/include/m_skin.h index 6f7a5683df..aa36735ab0 100644 --- a/include/m_skin.h +++ b/include/m_skin.h @@ -204,7 +204,7 @@ __inline static INT_PTR SkinPlaySound(const char *name) /*
wParam: 0 when playing sound (1 when sound is being previewed)
- lParam: (char*) pszSoundFile
+ lParam: (TCHAR*) pszSoundFile
Affect: This hook is fired when the sound module needs to play a sound
Note : This event has default processing, if no one HookEvent()'s this event then it will
use the default hook code, which uses PlaySound()
diff --git a/src/modules/skin/hotkeys.cpp b/src/modules/skin/hotkeys.cpp index 6408bcda7d..2d2fd77be0 100644 --- a/src/modules/skin/hotkeys.cpp +++ b/src/modules/skin/hotkeys.cpp @@ -568,20 +568,6 @@ static void sttOptionsDeleteHotkey(HWND hwndList, int idx, THotkeyItem *item) item->rootHotkey->OptChanged = TRUE;
}
-static int sttAlphaSort(const THotkeyItem *p1, const THotkeyItem *p2)
-{
- int res;
- if (res = lstrcmp(p1->getSection(), p2->getSection()))
- return res;
- if (res = lstrcmp(p1->getDescr(), p2->getDescr()))
- return res;
- if (!p1->rootHotkey && p2->rootHotkey)
- return -1;
- if (p1->rootHotkey && !p2->rootHotkey)
- return 1;
- return 0;
-}
-
static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
TCHAR title1[256] = {0}, title2[256] = {0};
@@ -617,7 +603,12 @@ static int CALLBACK sttOptionsSortList(LPARAM lParam1, LPARAM lParam2, LPARAM lP return res;
return 1;
}
- return sttAlphaSort(item1, item2);
+
+ if (res = lstrcmp(item1->getSection(), item2->getSection())) return res;
+ if (res = lstrcmp(item1->getDescr(), item2->getDescr())) return res;
+ if (!item1->rootHotkey && item2->rootHotkey) return -1;
+ if (item1->rootHotkey && !item2->rootHotkey) return 1;
+ return 0;
}
static void sttOptionsAddHotkey(HWND hwndList, THotkeyItem *item)
@@ -703,19 +694,14 @@ static void sttBuildHotkeyList(HWND hwndList) int i, nItems=0;
ListView_DeleteAllItems(hwndList);
- // create the temporary list with language-dependent sort order
- LIST<THotkeyItem> tmpList(hotkeys.getCount(), sttAlphaSort);
- for (i = 0; i < hotkeys.getCount(); i++)
- tmpList.insert( hotkeys[i] );
-
- for (i = 0; i < tmpList.getCount(); i++) {
+ for (i = 0; i < hotkeys.getCount(); i++) {
LVITEM lvi = {0};
- THotkeyItem *item = tmpList[i];
+ THotkeyItem *item = hotkeys[i];
if (item->OptDeleted)
continue;
- if ( !i || lstrcmp(item->ptszSection, tmpList[i-1]->ptszSection)) {
+ if ( !i || lstrcmp(item->ptszSection, hotkeys[i-1]->ptszSection)) {
lvi.mask = LVIF_TEXT|LVIF_PARAM;
lvi.iItem = nItems++;
lvi.iSubItem = 0;
@@ -739,6 +725,8 @@ static void sttBuildHotkeyList(HWND hwndList) ListView_InsertItem(hwndList, &lvi);
sttOptionsSetupItem(hwndList, nItems-1, item);
}
+
+ ListView_SortItemsEx(hwndList, sttOptionsSortList, (LPARAM)hwndList);
}
static void sttOptionsStartEdit(HWND hwndDlg, HWND hwndHotkey)
|