Курсовая работа: Проект текстового редактора
index = m_Edit1.LineFromChar() + 1;
move.m_position = index;
if(move.DoModal() == IDOK)
{
//move.m_edit_pereuti.SetSel(0, -1);
if(index >= m_Edit1.LineIndex(move.m_position-1))
AfxMessageBox(str1);
else
m_Edit1.SetSel(m_Edit1.LineIndex(move.m_position-1),
m_Edit1.LineIndex(move.m_position-1));
}
}
void CMenuDlg::OnInitMenuPopup(CMenu* pPopupMenu, UINT nIndex, BOOL bSysMenu)
{
CDialog::OnInitMenuPopup(pPopupMenu, nIndex, bSysMenu);
CEdit *pEdit = (CEdit *)GetDlgItem(IDC_EDIT1);
int nFerstChar, nSecondChar;
CString strEdit;
pEdit->GetSel(nFerstChar, nSecondChar);
pEdit->GetWindowText(strEdit);
UINT format = CF_TEXT;
BOOL bClipboard = IsClipboardFormatAvailable(format);
//pPopupMenu->EnableMenuItem(ID_Otmenit,
//MF_BYCOMMAND | (bClipboard == FALSE ? MF_GRAYED : MF_ENABLED));
//pPopupMenu->EnableMenuItem(ID_Otmenit,
//MF_BYCOMMAND | (m_bFlag == FALSE ? MF_GRAYED : MF_ENABLED));
pPopupMenu->EnableMenuItem(ID_Wirezat,
MF_BYCOMMAND | (nFerstChar == nSecondChar ? MF_GRAYED : MF_ENABLED));
pPopupMenu->EnableMenuItem(ID_Kopirowat,