View Full Version : How to get selected line text in SECEditView

07-02-2008, 06:57 AM
I have developed an editor using SECEditView. I want to implement comment/un-comment functionality.

If user selects a line or multiple line, and clicks on uncomment, I want to process each line-text to find "//" and remove it.

How can I implement this?

SECEditController* pCtrl = GetSECEditController();

if (pCtrl->IsSelecting()){ // if some text is selected
pCtrl->GetSelection(lcpSel); //Get the selection
pCtrl->ClearSelection(FALSE); //Removes selection. Do no invalidate the view.

iStart = lcpSel.start.line;
iEnd = lcpSel.end.line;

while (iStart <= iEnd){

Get the text of each line?
find "//" string?
Remove and update the line?


Thanks in advance,