win: Switched status bar to the new media menus

This commit is contained in:
David Hrdlička
2020-04-26 17:59:17 +02:00
parent e85b5549d0
commit 2564b6f24d
3 changed files with 50 additions and 2 deletions

View File

@@ -190,6 +190,10 @@ extern wchar_t *BrowseFolder(wchar_t *saved_path, wchar_t *title);
extern void media_menu_init();
extern void media_menu_reset();
extern int media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam);
extern HMENU media_menu_get_floppy(int id);
extern HMENU media_menu_get_cdrom(int id);
extern HMENU media_menu_get_zip(int id);
extern HMENU media_menu_get_mo(int id);
extern void media_menu_update_floppy(int id);
extern void media_menu_update_cdrom(int id);
extern void media_menu_update_zip(int id);

View File

@@ -421,4 +421,28 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
}
return(1);
}
HMENU
media_menu_get_floppy(int id)
{
return menus[FDD_FIRST + id];
}
HMENU
media_menu_get_cdrom(int id)
{
return menus[CDROM_FIRST + id];
}
HMENU
media_menu_get_zip(int id)
{
return menus[ZIP_FIRST + id];
}
HMENU
media_menu_get_mo(int id)
{
return menus[MO_FIRST + id];
}

View File

@@ -917,12 +917,32 @@ ui_sb_update_panes(void)
static VOID APIENTRY
StatusBarPopupMenu(HWND hwnd, POINT pt, int id)
{
HMENU menu;
if (id >= (sb_parts - 1)) return;
pt.x = id * SB_ICON_WIDTH; /* Justify to the left. */
pt.y = 0; /* Justify to the top. */
ClientToScreen(hwnd, (LPPOINT) &pt);
TrackPopupMenu(sb_menu_handles[id],
switch(sb_part_meanings[id] & 0xF0) {
case SB_FLOPPY:
menu = media_menu_get_floppy(sb_part_meanings[id] & 0x0F);
break;
case SB_CDROM:
menu = media_menu_get_cdrom(sb_part_meanings[id] & 0x0F);
break;
case SB_ZIP:
menu = media_menu_get_zip(sb_part_meanings[id] & 0x0F);
break;
case SB_MO:
menu = media_menu_get_mo(sb_part_meanings[id] & 0x0F);
break;
default:
return;
}
TrackPopupMenu(menu,
TPM_LEFTALIGN | TPM_BOTTOMALIGN | TPM_LEFTBUTTON,
pt.x, pt.y, 0, hwndSBAR, NULL);
}
@@ -1185,7 +1205,7 @@ StatusBarProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
switch (message) {
case WM_COMMAND:
MediaMenuHandler(hwnd, message, wParam, lParam);
media_menu_proc(hwnd, message, wParam, lParam);
return(0);
case WM_LBUTTONDOWN: