int CxEdit::DeleteLine(int nLine, BOOL bScroll, int nCount /*= 1*/) { if (nCount >= 1) { const int linecount = GetLineCount(); const BOOL bFirstLine = (nLine == 0); const BOOL bLastLine = (nLine == (linecount - 1)); //TRACE("%i,%i,%i\n", LineIndex(nLine - 1), LineLength(nLine - 1), LineIndex(nLine)); const int nStartChar = (bLastLine && (!bFirstLine)) ? (LineIndex(nLine - 1) + LineLength(nLine - 1) + 0) : LineIndex(nLine); const int nEndChar = ((nLine + nCount) >= linecount) ? (LineIndex(linecount - 1) + LineLength(linecount - 1) + 0) : LineIndex(nLine + nCount); const BOOL bReadOnly = IsStyleReadOnly(); if (bReadOnly) { SetReadOnly(FALSE); } SetSel(nStartChar, nEndChar, !bScroll); // end of edit text Clear(); // ..then delete GotoEnd(bScroll); if (bReadOnly) { SetReadOnly(TRUE); } } return GetLineCount(); }
bool AddatBack(int value) { Node *newnode = nullptr; Node *end = nullptr; // we have an empty list if (_head==nullptr) return AddatFront(value); end = GotoEnd(); if (end == nullptr) return false; newnode = new Node(value); end->_next = newnode; return true; }
int CxEdit::AddString(LPCTSTR lpsz, BOOL bScroll /*= TRUE*/, BOOL bCanUndo /*= FALSE*/) { const int line = GotoEnd(bScroll); ReplaceSel(lpsz, bCanUndo); return line; }