mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 20:03:12 +00:00
[MSPAINT] Use CF_DIB instead of CF_BITMAP (#5349)
CF_BITMAP is not recommended format for copying. In fact, Win10 won't accept it. - Use CF_DIB clipboard format instead of CF_BITMAP in copying. - Use CF_ENHMETAFILE, CF_DIB, or CF_BITMAP in pasting. - Add BitmapToClipboardDIB, BitmapFromClipboardDIB, and BitmapFromHEMF helper functions to dib.cpp. - Re-enable paste by fixing the bug that is embugged in the previous commit. - Enable Cut, Copy, Paste, and Delete on text editing box by modifying OnInitMenuPopup. - Add IDS_CANTPASTE resource string to show message on paste failure. CORE-18867
This commit is contained in:
parent
aaa0cb6724
commit
9f56e67bc2
38 changed files with 320 additions and 45 deletions
|
@ -410,15 +410,9 @@ void CTextEditWindow::Reposition()
|
|||
CRect rcImage;
|
||||
canvasWindow.GetImageRect(rcImage);
|
||||
|
||||
if (rc.bottom > rcImage.bottom)
|
||||
::OffsetRect(&rc, 0, rcImage.Height());
|
||||
|
||||
if (rc.right > rcImage.right)
|
||||
::OffsetRect(&rc, rcImage.Width(), 0);
|
||||
|
||||
// FIXME: Smartly restrict the position and size by using WM_WINDOWPOSCHANGING
|
||||
if (rc.left < 0)
|
||||
::OffsetRect(&rc, -rc.left, 0);
|
||||
|
||||
if (rc.top < 0)
|
||||
::OffsetRect(&rc, 0, -rc.top);
|
||||
|
||||
|
@ -433,3 +427,24 @@ LRESULT CTextEditWindow::OnMouseWheel(UINT nMsg, WPARAM wParam, LPARAM lParam, B
|
|||
{
|
||||
return ::SendMessage(GetParent(), nMsg, wParam, lParam);
|
||||
}
|
||||
|
||||
LRESULT CTextEditWindow::OnCut(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
LRESULT ret = DefWindowProc(nMsg, wParam, lParam);
|
||||
Invalidate(TRUE); // Redraw
|
||||
return ret;
|
||||
}
|
||||
|
||||
LRESULT CTextEditWindow::OnPaste(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
LRESULT ret = DefWindowProc(nMsg, wParam, lParam);
|
||||
FixEditPos(NULL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
LRESULT CTextEditWindow::OnClear(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||
{
|
||||
LRESULT ret = DefWindowProc(nMsg, wParam, lParam);
|
||||
Invalidate(TRUE); // Redraw
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue