CView / CEditView 
Author Message
 CView / CEditView

I have an application that is writing the status of a process one line at a
time.  I have tried to make this as simple as possible.  I wanted to use a
CEditView and just keep adding lines to that view.  I cannot figure out how
to do this without using a Paste.

I then create a hack version of CView which gets all sorts of font
information and scrolling information to write a line to the view.

I am not sure which way I should go ?

Is there an easier way to do this ???

Any help would be greatly appreciated.

Pete



Fri, 10 Aug 2001 03:00:00 GMT  
 CView / CEditView

Quote:

> I have an application that is writing the status of a process one line at a
> time.  I have tried to make this as simple as possible.  I wanted to use a
> CEditView and just keep adding lines to that view.  I cannot figure out how
> to do this without using a Paste.

> I then create a hack version of CView which gets all sorts of font
> information and scrolling information to write a line to the view.

> I am not sure which way I should go ?

> Is there an easier way to do this ???

> Any help would be greatly appreciated.

> Pete

It's a little unobvious with the edit control.  To add text use something like this:

   GetEditCtrl.SetSel(INT_MAX, INT_MAX);        // move to end
   GetEditCtrl.ReplaceSel("New Text Line\r\n"); // append text

If 32K chars can build up you'll need to handle ON_EN_ERRSPACE to clear out the oldest when the buffer limit is reached.  That's done with SetSel and Clear.



Fri, 10 Aug 2001 03:00:00 GMT  
 CView / CEditView
void CLIIView::AddLine(CString LineText)
{
 mLineCount++;
 int nLine = GetEditCtrl().GetLineCount() - 1;
 int nIndex = GetEditCtrl().LineIndex(nLine);
 GetEditCtrl().SetSel(nIndex, nIndex);
 GetEditCtrl().ReplaceSel(LineText + "\r\n");

Quote:
}

This works...

Regards,
Evan Petridis.

Quote:

>I have an application that is writing the status of a process one line at a
>time.  I have tried to make this as simple as possible.  I wanted to use a
>CEditView and just keep adding lines to that view.  I cannot figure out how
>to do this without using a Paste.

>I then create a hack version of CView which gets all sorts of font
>information and scrolling information to write a line to the view.

>I am not sure which way I should go ?

>Is there an easier way to do this ???

>Any help would be greatly appreciated.

>Pete



Sat, 11 Aug 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. CView / CEditView

2. Questions about CView / CScrollView / CEditView

3. Change CView to CEditView causes assertion

4. CView with a CView child help

5. Multiple CViews within one CView

6. A CView within a CView..possible?

7. CView::OnDraw vs CView::OnPaint

8. Add CView within CView

9. Updating CView for a Cview attached CToolBar

10. CView talk to another CView???

11. CView & CEditView... both in an MDI App!!

12. BUG with VC7 RC1 with an MFC AppWizard generated CEditView project

 

 
Powered by phpBB® Forum Software