From 2d1efe3fec4393cb2a0da2e68e593b8074790e7b Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Fri, 15 Feb 2002 19:41:16 +0000 Subject: [PATCH] added Alt-PrintScreen handling (SciTech won't be happy till we do everything Windows do...) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14237 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mgl/window.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/mgl/window.cpp b/src/mgl/window.cpp index 4de9b27e9b..b9db7ceb62 100644 --- a/src/mgl/window.cpp +++ b/src/mgl/window.cpp @@ -104,7 +104,7 @@ static wxWindowMGL* wxGetTopLevelParent(wxWindowMGL *win) } // An easy way to capture screenshots: -static void wxCaptureScreenshot() +static void wxCaptureScreenshot(bool activeWindowOnly) { #ifdef __DOS__ #define SCREENSHOT_FILENAME _T("sshot%03i.png") @@ -119,9 +119,15 @@ static void wxCaptureScreenshot() screenshot.Printf(SCREENSHOT_FILENAME, screenshot_num++); } while ( wxFileExists(screenshot) && screenshot_num < 1000 ); - g_displayDC->savePNGFromDC(screenshot.mb_str(), 0, 0, - g_displayDC->sizex(), - g_displayDC->sizey()); + wxRect r(0, 0, g_displayDC->sizex(), g_displayDC->sizey()); + + if ( activeWindowOnly && gs_activeFrame ) + { + r.Intersect(gs_activeFrame->GetRect()); + } + + g_displayDC->savePNGFromDC(screenshot.mb_str(), + r.x, r. y, r.width, r.height); wxMessageBox(_("Screenshot captured: ") + wxString(screenshot)); } @@ -438,7 +444,7 @@ static bool wxHandleSpecialKeys(wxKeyEvent& event) ) #endif { - wxCaptureScreenshot(); + wxCaptureScreenshot(event.m_altDown/*only active wnd?*/); return TRUE; } -- 2.45.2