Re: Adding string to Memo



J French wrote:
On Sat, 29 Oct 2005 12:11:04 -0700, Jamie
<jamie_5_not_valid_after_5_Please@xxxxxxxxxxx> wrote:

<snip>

i could be wrong here but i thinkn selectstart is the
API level indexer.


Yes, that is right


 if you use the "Text" property, it should give you
the raw string like it is seen in the control.
then using Insert(Memo1.Text, theStringToPutin,Memo1.SelectStart);
memo1.Refresh and repaint may have to be used..


That would work, but it is making the machine (and Delphi) do a heck
of a lot of work
- the TMemo.Text property needs to be grabbed from the the real text
held within Windows, which boils down to a WM_GETTEXT, a string
creation, a string re-allocation as it is resized, then a WM_SETTEXT

It is possible that if one is going to do a lot of insertions in one
go (say a find an replace) that doing it outside the API would be
faster and clearer.


seems strange that i always thought delphi kept a copy of the string
in the stringlist ? so where are you saving anything?


-- Real Programmers Do things like this. http://webpages.charter.net/jamie_5

.



Relevant Pages

  • Re: Adding string to Memo
    ... >i could be wrong here but i thinkn selectstart is the ... >API level indexer. ... >the raw string like it is seen in the control. ...
    (alt.comp.lang.borland-delphi)
  • Re: Draw a string on JPanel
    ... > I want to draw a string on JPanel based on user input. ... > in the code to force the repaint. ... you call setText on the panel. ... you do this to a container, the container also needs to be revalidated. ...
    (comp.lang.java.programmer)
  • Re: Making lists visible
    ... >I've got a list in my program and I'e written code to add a string to it. ... >However I can't see it on the GUI that I've designed. ... You can try adding a manual repaint after your add. ... did you do the add with a thread other than the Swing thread. ...
    (comp.lang.java.programmer)
  • Re: JTree not updating after deleting a node in DnD
    ... The idea is you make a great string of changes to your model. ... DON'T repaint until you are done. ... Roedy Green Canadian Mind Products ...
    (comp.lang.java.gui)