Merge branch 'master' of https://github.com/86Box/86Box into feature/savquest

This commit is contained in:
RichardG867
2021-08-03 21:45:54 -03:00
13 changed files with 189 additions and 90 deletions

View File

@@ -59,6 +59,8 @@ BEGIN
END
POPUP "&View"
BEGIN
MENUITEM "&Hide status bar", IDM_VID_HIDE_STATUS_BAR
MENUITEM SEPARATOR
MENUITEM "&Resizeable window", IDM_VID_RESIZE
MENUITEM "R&emember size && position", IDM_VID_REMEMBER
MENUITEM SEPARATOR

View File

@@ -1075,7 +1075,10 @@ plat_setfullscreen(int on)
GetClientRect(hwndMain, &rect);
temp_x = rect.right - rect.left + 1;
temp_y = rect.bottom - rect.top + 1 - sbar_height;
if (hide_status_bar)
temp_y = rect.bottom - rect.top + 1;
else
temp_y = rect.bottom - rect.top + 1 - sbar_height;
} else {
if (dpi_scale) {
temp_x = MulDiv((vid_resize & 2) ? fixed_size_x : unscaled_size_x, dpi, 96);
@@ -1086,7 +1089,10 @@ plat_setfullscreen(int on)
}
/* Main Window. */
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
if (hide_status_bar)
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
else
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
}
/* Render window. */

View File

@@ -103,11 +103,11 @@ media_menu_set_name_cartridge(int drive)
wchar_t name[512], fn[512];
MENUITEMINFO mii = { 0 };
if (strlen(floppyfns[drive]) == 0) {
if (strlen(cart_fns[drive]) == 0) {
_swprintf(name, plat_get_string(IDS_2150),
drive + 1, plat_get_string(IDS_2057));
} else {
mbstoc16s(fn, floppyfns[drive], sizeof_w(fn));
mbstoc16s(fn, cart_fns[drive], sizeof_w(fn));
_swprintf(name, plat_get_string(IDS_2150),
drive + 1, fn);
}
@@ -608,7 +608,7 @@ media_menu_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
break;
case IDM_CARTRIDGE_IMAGE:
ret = file_dlg_st(hwnd, IDS_2151, floppyfns[id], NULL, 0);
ret = file_dlg_st(hwnd, IDS_2151, cart_fns[id], NULL, 0);
if (! ret)
cartridge_mount(id, openfilestring, wp);
break;

View File

@@ -1070,6 +1070,7 @@ static BOOL CALLBACK
win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
{
int c = 0, d = 0;
int e;
switch (message) {
case WM_INITDIALOG:
@@ -1107,7 +1108,8 @@ win_settings_video_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
}
settings_enable_window(hdlg, IDC_COMBO_VIDEO, !(machines[temp_machine].flags & MACHINE_VIDEO_ONLY));
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(temp_gfxcard));
e = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_VIDEO)];
settings_enable_window(hdlg, IDC_CONFIGURE_VID, video_card_has_config(e));
settings_enable_window(hdlg, IDC_CHECK_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI));
settings_set_check(hdlg, IDC_CHECK_VOODOO, temp_voodoo);
settings_enable_window(hdlg, IDC_BUTTON_VOODOO, (machines[temp_machine].flags & MACHINE_BUS_PCI) && temp_voodoo);
@@ -2152,7 +2154,7 @@ win_settings_hard_disks_update_item(HWND hdlg, int i, int column)
wsprintf(szText, plat_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
break;
case HDD_BUS_SCSI:
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id >> 4 & 15);
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id & 15);
break;
}
lvI.pszText = szText;
@@ -2226,7 +2228,7 @@ win_settings_hard_disks_recalc_list(HWND hdlg)
wsprintf(szText, plat_get_string(IDS_4612), temp_hdd[i].ide_channel >> 1, temp_hdd[i].ide_channel & 1);
break;
case HDD_BUS_SCSI:
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id >> 4 & 15);
wsprintf(szText, plat_get_string(IDS_4613), temp_hdd[i].scsi_id >> 4, temp_hdd[i].scsi_id & 15);
break;
}
lvI.pszText = szText;

View File

@@ -68,6 +68,7 @@ int rctrl_is_lalt = 0;
int user_resize = 0;
int fixed_size_x = 0, fixed_size_y = 0;
int kbd_req_capture = 0;
int hide_status_bar = 0;
extern char openfilestring[512];
extern WCHAR wopenfilestring[512];
@@ -257,12 +258,6 @@ video_set_filter_menu(HMENU menu)
static void
ResetAllMenus(void)
{
#ifndef DEV_BRANCH
/* FIXME: until we fix these.. --FvK */
EnableMenuItem(menuMain, IDM_CONFIG_LOAD, MF_DISABLED);
EnableMenuItem(menuMain, IDM_CONFIG_SAVE, MF_DISABLED);
#endif
CheckMenuItem(menuMain, IDM_ACTION_RCTRL_IS_LALT, MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_ACTION_KBD_REQ_CAPTURE, MF_UNCHECKED);
@@ -292,6 +287,7 @@ ResetAllMenus(void)
# endif
#endif
CheckMenuItem(menuMain, IDM_VID_HIDE_STATUS_BAR, MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_FORCE43, MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_INVERT, MF_UNCHECKED);
@@ -358,6 +354,7 @@ ResetAllMenus(void)
# endif
#endif
CheckMenuItem(menuMain, IDM_VID_HIDE_STATUS_BAR, hide_status_bar ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_FORCE43, force_43?MF_CHECKED:MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_OVERSCAN, enable_overscan?MF_CHECKED:MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_INVERT, invert_display ? MF_CHECKED : MF_UNCHECKED);
@@ -705,6 +702,18 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
config_save();
break;
case IDM_VID_HIDE_STATUS_BAR:
hide_status_bar ^= 1;
CheckMenuItem(hmenu, IDM_VID_HIDE_STATUS_BAR, hide_status_bar ? MF_CHECKED : MF_UNCHECKED);
ShowWindow(hwndSBAR, hide_status_bar ? SW_HIDE : SW_SHOW);
GetWindowRect(hwnd, &rect);
if (hide_status_bar)
MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top - sbar_height, TRUE);
else
MoveWindow(hwnd, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top + sbar_height, TRUE);
config_save();
break;
case IDM_VID_RESIZE:
vid_resize ^= 1;
CheckMenuItem(hmenu, IDM_VID_RESIZE, (vid_resize & 1) ? MF_CHECKED : MF_UNCHECKED);
@@ -723,7 +732,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
temp_y = unscaled_size_y;
}
ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height);
if (hide_status_bar)
ResizeWindowByClientArea(hwnd, temp_x, temp_y);
else
ResizeWindowByClientArea(hwnd, temp_x, temp_y + sbar_height);
if (mouse_capture) {
ClipCursor(&rect);
@@ -1009,7 +1021,10 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
}
/* Main Window. */
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
if (hide_status_bar)
ResizeWindowByClientArea(hwndMain, temp_x, temp_y);
else
ResizeWindowByClientArea(hwndMain, temp_x, temp_y + sbar_height);
} else if (!user_resize)
doresize = 1;
break;
@@ -1039,8 +1054,12 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
if (!(pos->flags & SWP_NOSIZE) || !user_resize) {
plat_vidapi_enable(0);
MoveWindow(hwndSBAR, 0, rect.bottom - sbar_height, sbar_height, rect.right, TRUE);
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom - sbar_height, TRUE);
if (hide_status_bar)
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom, TRUE);
else {
MoveWindow(hwndSBAR, 0, rect.bottom - sbar_height, sbar_height, rect.right, TRUE);
MoveWindow(hwndRender, 0, 0, rect.right, rect.bottom - sbar_height, TRUE);
}
GetClientRect(hwndRender, &rect);
if (dpi_scale) {
@@ -1423,6 +1442,8 @@ ui_init(int nCmdShow)
/* Get the actual height of the status bar */
GetWindowRect(hwndSBAR, &sbar_rect);
sbar_height = sbar_rect.bottom - sbar_rect.top;
if (hide_status_bar)
ShowWindow(hwndSBAR, SW_HIDE);
/* Set up main window for resizing if configured. */
if (vid_resize == 1)
@@ -1445,7 +1466,10 @@ ui_init(int nCmdShow)
scrnsz_x = fixed_size_x;
scrnsz_y = fixed_size_y;
}
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
if (hide_status_bar)
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y);
else
ResizeWindowByClientArea(hwndMain, scrnsz_x, scrnsz_y + sbar_height);
}
/* Reset all menus to their defaults. */
@@ -1689,7 +1713,10 @@ plat_resize(int x, int y)
x = MulDiv(x, dpi, 96);
y = MulDiv(y, dpi, 96);
}
ResizeWindowByClientArea(hwndMain, x, y + sbar_height);
if (hide_status_bar)
ResizeWindowByClientArea(hwndMain, x, y);
else
ResizeWindowByClientArea(hwndMain, x, y + sbar_height);
}
}