HexEdit/HexEditView.cpp
void CHexEditView::OnUpdateTextPaste(CCmdUI* pCmdUI)
{
	BOOL bEnable = !GetDocument()->read_only() && ::IsClipboardFormatAvailable(CF_TEXT);

	if (pCmdUI->m_pSubMenu != NULL)
	{
		// This happens when popup menu itself is drawn
		pCmdUI->m_pMenu->EnableMenuItem(pCmdUI->m_nIndex,
			MF_BYPOSITION | (bEnable ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)));
	}
	else
		pCmdUI->Enable(bEnable);

//    if (GetDocument()->read_only())
//        pCmdUI->Enable(FALSE);                  // Disallow paste if file is read only
//    else
//        pCmdUI->Enable(::IsClipboardFormatAvailable(CF_TEXT));
}
// Update handler that turns on user interface options (Paste etc) if there is
// text on the clipboard -- ie. there is text that can be pasted into the document

Update handler that turns on user interface options (Paste etc) if there is
text on the clipboard -- ie. there is text that can be pasted into the document
Update handler that turns on user interface options ( Paste etc ) if there is text on the clipboard -- ie . there is text that can be pasted into the document
void CHexEditView::OnUpdateTextPaste(CCmdUI* pCmdUI)
{
	BOOL bEnable = !GetDocument()->read_only() && ::IsClipboardFormatAvailable(CF_TEXT);
	if (pCmdUI->m_pSubMenu != NULL)
	{
		pCmdUI->m_pMenu->EnableMenuItem(pCmdUI->m_nIndex,
			MF_BYPOSITION | (bEnable ? MF_ENABLED : (MF_DISABLED | MF_GRAYED)));
	}
	else
		pCmdUI->Enable(bEnable);
}
void CHexEditView :: OnUpdateTextPaste ( CCmdUI * pCmdUI ) { BOOL bEnable = ! GetDocument ( ) -> read_only ( ) && :: IsClipboardFormatAvailable ( CF_TEXT ) ; if ( pCmdUI -> m_pSubMenu != NULL ) { pCmdUI -> m_pMenu -> EnableMenuItem ( pCmdUI -> m_nIndex , MF_BYPOSITION | ( bEnable ? MF_ENABLED : ( MF_DISABLED | MF_GRAYED ) ) ) ; } else pCmdUI -> Enable ( bEnable ) ; }
Update handler that turns on user interface options (Paste etc) if there is
text on the clipboard -- ie.
Update handler that turns on user interface options ( Paste etc ) if there is text on the clipboard -- ie .
// This happens when popup menu itself is drawn
 //    if (GetDocument()->read_only())
 //        pCmdUI->Enable(FALSE);                  // Disallow paste if file is read only
 //    else
 //        pCmdUI->Enable(::IsClipboardFormatAvailable(CF_TEXT));
