From eefbc4082eb71521af6b4932fc5a7b41f671c8cc Mon Sep 17 00:00:00 2001 From: mpohoreski Date: Sun, 26 Feb 2006 02:05:57 +0000 Subject: [PATCH] Right-Click now ejects disk image Shift-Right-Click sets write protection Ctrl-Right-Click clears write protection --- AppleWin/source/Frame.cpp | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/AppleWin/source/Frame.cpp b/AppleWin/source/Frame.cpp index d2050610..86668dcf 100644 --- a/AppleWin/source/Frame.cpp +++ b/AppleWin/source/Frame.cpp @@ -724,10 +724,38 @@ LRESULT CALLBACK FrameWndProc (HWND window, case WM_RBUTTONDOWN: case WM_RBUTTONUP: - if (usingcursor) - JoySetButton(1,(message == WM_RBUTTONDOWN)); - RelayEvent(message,wparam,lparam); - break; + // Right Click on Drive Icon -- eject Disk + if ((buttonover == -1) && (message == WM_RBUTTONUP)) // HACK: BUTTON_NONE + { + int x = LOWORD(lparam); + int y = HIWORD(lparam); + + if ((x >= buttonx) && + (y >= buttony) && + (y <= buttony+BUTTONS*BUTTONCY)) + { + int iButton = (y-buttony-1)/BUTTONCY; + int iDrive = iButton - BTN_DRIVE1; + if ((iButton == BTN_DRIVE1) || (iButton == BTN_DRIVE2)) + { + if (KeybGetShiftStatus()) + DiskProtect( iDrive, true ); + else + if (KeybGetCtrlStatus()) + DiskProtect( iDrive, false ); + else + DiskEject( iDrive ); + FrameRefreshStatus(DRAW_LEDS | DRAW_BUTTON_DRIVES); + DrawButton((HDC)0,iButton); + } + } + } + if (usingcursor) + { + JoySetButton(1,(message == WM_RBUTTONDOWN)); + } + RelayEvent(message,wparam,lparam); + break; case WM_SYSCOLORCHANGE: DeleteGdiObjects();