mirror of
https://github.com/reactos/reactos.git
synced 2025-07-10 15:34:13 +00:00
[MSPAINT] Add CMainWindow::CanPaste
CORE-18867
This commit is contained in:
parent
19d8862851
commit
bc19bbe408
2 changed files with 12 additions and 5 deletions
|
@ -436,6 +436,16 @@ BOOL CMainWindow::CanRedo() const
|
||||||
return imageModel.CanRedo();
|
return imageModel.CanRedo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL CMainWindow::CanPaste() const
|
||||||
|
{
|
||||||
|
if (toolsModel.GetActiveTool() == TOOL_TEXT && ::IsWindowVisible(textEditWindow))
|
||||||
|
return ::IsClipboardFormatAvailable(CF_UNICODETEXT);
|
||||||
|
|
||||||
|
return (::IsClipboardFormatAvailable(CF_ENHMETAFILE) ||
|
||||||
|
::IsClipboardFormatAvailable(CF_DIB) ||
|
||||||
|
::IsClipboardFormatAvailable(CF_BITMAP));
|
||||||
|
}
|
||||||
|
|
||||||
LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
|
||||||
{
|
{
|
||||||
HMENU menu = (HMENU)wParam;
|
HMENU menu = (HMENU)wParam;
|
||||||
|
@ -465,11 +475,7 @@ LRESULT CMainWindow::OnInitMenuPopup(UINT nMsg, WPARAM wParam, LPARAM lParam, BO
|
||||||
ENABLED_IF(textShown ? hasTextSel : trueSelection));
|
ENABLED_IF(textShown ? hasTextSel : trueSelection));
|
||||||
EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
|
EnableMenuItem(menu, IDM_EDITINVERTSELECTION, ENABLED_IF(trueSelection));
|
||||||
EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
|
EnableMenuItem(menu, IDM_EDITCOPYTO, ENABLED_IF(trueSelection));
|
||||||
EnableMenuItem(menu, IDM_EDITPASTE,
|
EnableMenuItem(menu, IDM_EDITPASTE, ENABLED_IF(CanPaste()));
|
||||||
ENABLED_IF(textShown ? ::IsClipboardFormatAvailable(CF_UNICODETEXT) :
|
|
||||||
(::IsClipboardFormatAvailable(CF_ENHMETAFILE) ||
|
|
||||||
::IsClipboardFormatAvailable(CF_DIB) ||
|
|
||||||
::IsClipboardFormatAvailable(CF_BITMAP))));
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// View menu
|
// View menu
|
||||||
|
|
|
@ -37,6 +37,7 @@ public:
|
||||||
VOID TrackPopupMenu(POINT ptScreen, INT iSubMenu);
|
VOID TrackPopupMenu(POINT ptScreen, INT iSubMenu);
|
||||||
BOOL CanUndo() const;
|
BOOL CanUndo() const;
|
||||||
BOOL CanRedo() const;
|
BOOL CanRedo() const;
|
||||||
|
BOOL CanPaste() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
HMENU m_hMenu;
|
HMENU m_hMenu;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue