PCem

changeset 89:9c985b55cc4e

Added ability to eject hard drive. ALT no longer opens menus when mouse captured or in fullscreen mode. Patches from HalfMinute.
author TomW
date Mon Mar 24 19:15:11 2014 +0000
parents 2c16e2e509d0
children e1e6f70a0f68
files src/pc.rc src/resources.h src/win.c
diffstat 3 files changed, 38 insertions(+), 5 deletions(-) [+]
line diff
     1.1 --- a/src/pc.rc	Sat Mar 22 19:10:00 2014 +0000
     1.2 +++ b/src/pc.rc	Mon Mar 24 19:15:11 2014 +0000
     1.3 @@ -77,19 +77,20 @@
     1.4      LTEXT           "Memory :",IDC_STATIC,15,156,40,10
     1.5  END
     1.6  
     1.7 -HdConfDlg DIALOGEX 0, 0, 186, 172
     1.8 +HdConfDlg DIALOGEX 0, 0, 210, 172
     1.9  STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
    1.10  CAPTION "Configure Hard Discs"
    1.11  FONT 8, "MS Sans Serif"
    1.12  BEGIN
    1.13 -    DEFPUSHBUTTON   "OK",IDOK,31,152,50,14
    1.14 -    PUSHBUTTON      "Cancel",IDCANCEL,101,152,50,14
    1.15 +    DEFPUSHBUTTON   "OK",IDOK,31+12,152,50,14
    1.16 +    PUSHBUTTON      "Cancel",IDCANCEL,101+12,152,50,14
    1.17      
    1.18      LTEXT           "C:",IDC_STATIC,7,6,27,10
    1.19      EDITTEXT        IDC_EDITC, 7, 22, 136, 12, WS_DISABLED
    1.20      PUSHBUTTON      "...",IDC_CFILE,7 + 136,      22, 16, 14
    1.21      PUSHBUTTON      "New",IDC_CNEW,7 + 136 + 16, 22, 24, 14
    1.22 -    
    1.23 +    PUSHBUTTON      "Eject", IDC_EJECTC, 7 + 136 + 16 + 24, 22, 24, 14
    1.24 +        
    1.25      EDITTEXT        IDC_EDIT1,36,38,16,12, WS_DISABLED
    1.26      EDITTEXT        IDC_EDIT2,94,38,16,12, WS_DISABLED
    1.27      EDITTEXT        IDC_EDIT3,152,38,28,12, WS_DISABLED
    1.28 @@ -102,6 +103,7 @@
    1.29      EDITTEXT        IDC_EDITD, 7, 92, 136, 12, WS_DISABLED
    1.30      PUSHBUTTON      "...",IDC_DFILE,7 + 136,     92, 16, 14
    1.31      PUSHBUTTON      "New",IDC_DNEW,7 + 136 + 16, 92, 24, 14
    1.32 +    PUSHBUTTON      "Eject", IDC_EJECTD, 7 + 136 + 16 + 24, 92, 24, 14
    1.33      
    1.34      EDITTEXT        IDC_EDIT4,36,108,16,12, WS_DISABLED
    1.35      EDITTEXT        IDC_EDIT5,94,108,16,12, WS_DISABLED
     2.1 --- a/src/resources.h	Sat Mar 22 19:10:00 2014 +0000
     2.2 +++ b/src/resources.h	Mon Mar 24 19:15:11 2014 +0000
     2.3 @@ -51,6 +51,8 @@
     2.4  #define IDC_EDITD  1053
     2.5  #define IDC_DFILE  1054
     2.6  #define IDC_DNEW   1055
     2.7 +#define IDC_EJECTC 1056
     2.8 +#define IDC_EJECTD 1057
     2.9  #define IDC_MEMSPIN 1070
    2.10  #define IDC_MEMTEXT 1071
    2.11  #define IDC_STEXT1 1100
     3.1 --- a/src/win.c	Sat Mar 22 19:10:00 2014 +0000
     3.2 +++ b/src/win.c	Mon Mar 24 19:15:11 2014 +0000
     3.3 @@ -1192,6 +1192,29 @@
     3.4                          pause=0;
     3.5                          return TRUE;
     3.6  
     3.7 +                        case IDC_EJECTC:
     3.8 +                        hd[0].spt = 0;
     3.9 +                        hd[0].hpc = 0;
    3.10 +                        hd[0].tracks = 0;
    3.11 +                        ide_fn[0][0] = 0;
    3.12 +                        SetDlgItemText(hdlg, IDC_EDIT1, "0");
    3.13 +                        SetDlgItemText(hdlg, IDC_EDIT2, "0");
    3.14 +                        SetDlgItemText(hdlg, IDC_EDIT3, "0");
    3.15 +                        SetDlgItemText(hdlg, IDC_EDITC, "");
    3.16 +                        hd_changed = 1;
    3.17 +                        return TRUE;
    3.18 +                        case IDC_EJECTD:
    3.19 +                        hd[1].spt = 0;
    3.20 +                        hd[1].hpc = 0;
    3.21 +                        hd[1].tracks = 0;
    3.22 +                        ide_fn[1][0] = 0;
    3.23 +                        SetDlgItemText(hdlg, IDC_EDIT4, "0");
    3.24 +                        SetDlgItemText(hdlg, IDC_EDIT5, "0");
    3.25 +                        SetDlgItemText(hdlg, IDC_EDIT6, "0");
    3.26 +                        SetDlgItemText(hdlg, IDC_EDITD, "");
    3.27 +                        hd_changed = 1;
    3.28 +                        return TRUE;
    3.29 +                        
    3.30                          case IDC_CNEW:
    3.31                          if (DialogBox(hinstance,TEXT("HdNewDlg"),hdlg,hdnewdlgproc) == 1)
    3.32                          {
    3.33 @@ -1703,12 +1726,18 @@
    3.34  //                if (mousecapture)
    3.35                     return 0;
    3.36  //                return DefWindowProc (hwnd, message, wParam, lParam);
    3.37 -                
    3.38 +
    3.39 +                               
    3.40                  case WM_DESTROY:
    3.41                  UnhookWindowsHookEx( hKeyboardHook );
    3.42                  KillTimer(hwnd, TIMER_1SEC);
    3.43                  PostQuitMessage (0);       /* send a WM_QUIT to the message queue */
    3.44                  break;
    3.45 +
    3.46 +                case WM_SYSCOMMAND:
    3.47 +                if (wParam == SC_KEYMENU && HIWORD(lParam) <= 0 && (video_fullscreen || mousecapture))
    3.48 +                        return 0; /*disable ALT key for menu*/
    3.49 +
    3.50                  default:
    3.51  //                        pclog("Def %08X %i\n",message,message);
    3.52                  return DefWindowProc (hwnd, message, wParam, lParam);