|
|
@ -2123,7 +2123,7 @@ static void showSaveDialog(CvWindow& window) |
|
|
|
SIZE sz; |
|
|
|
SIZE sz; |
|
|
|
int channels; |
|
|
|
int channels; |
|
|
|
void* data; |
|
|
|
void* data; |
|
|
|
if (icvGetBitmapData(window, sz, channels, data)) |
|
|
|
if (!icvGetBitmapData(window, sz, channels, data)) |
|
|
|
return; // nothing to save
|
|
|
|
return; // nothing to save
|
|
|
|
|
|
|
|
|
|
|
|
char szFileName[MAX_PATH] = ""; |
|
|
|
char szFileName[MAX_PATH] = ""; |
|
|
@ -2206,6 +2206,7 @@ static bool handleMessage(MSG& message, int& keyCode) |
|
|
|
switch (message.message) |
|
|
|
switch (message.message) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case WM_DESTROY: |
|
|
|
case WM_DESTROY: |
|
|
|
|
|
|
|
// fallthru
|
|
|
|
case WM_CHAR: |
|
|
|
case WM_CHAR: |
|
|
|
DispatchMessage(&message); |
|
|
|
DispatchMessage(&message); |
|
|
|
keyCode = (int)message.wParam; |
|
|
|
keyCode = (int)message.wParam; |
|
|
@ -2221,6 +2222,20 @@ static bool handleMessage(MSG& message, int& keyCode) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case WM_KEYDOWN: |
|
|
|
case WM_KEYDOWN: |
|
|
|
|
|
|
|
// Intercept Ctrl+C for copy to clipboard
|
|
|
|
|
|
|
|
if ('C' == message.wParam && (::GetKeyState(VK_CONTROL) >> 15)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
::SendMessage(message.hwnd, WM_COPY, 0, 0); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Intercept Ctrl+S for "save as" dialog
|
|
|
|
|
|
|
|
if ('S' == message.wParam && (::GetKeyState(VK_CONTROL) >> 15)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
showSaveDialog(window); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TranslateMessage(&message); |
|
|
|
TranslateMessage(&message); |
|
|
|
if ((message.wParam >= VK_F1 && message.wParam <= VK_F24) || |
|
|
|
if ((message.wParam >= VK_F1 && message.wParam <= VK_F24) || |
|
|
|
message.wParam == VK_HOME || message.wParam == VK_END || |
|
|
|
message.wParam == VK_HOME || message.wParam == VK_END || |
|
|
@ -2235,13 +2250,7 @@ static bool handleMessage(MSG& message, int& keyCode) |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Intercept Ctrl+C for copy to clipboard
|
|
|
|
// fallthru
|
|
|
|
if ('C' == message.wParam && (::GetKeyState(VK_CONTROL) >> 15)) |
|
|
|
|
|
|
|
::SendMessage(message.hwnd, WM_COPY, 0, 0); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Intercept Ctrl+S for "save as" dialog
|
|
|
|
|
|
|
|
if ('S' == message.wParam && (::GetKeyState(VK_CONTROL) >> 15)) |
|
|
|
|
|
|
|
showSaveDialog(window); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
DispatchMessage(&message); |
|
|
|
DispatchMessage(&message); |
|
|
|