[DUG] tMemo, Stop updating
Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve -- Steve Peacocke http://stevepeacocke.blogspot.com/ ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
Re: [DUG] tMemo, Stop updating
Steve Memo1.lines.Beginupdate? or something like that Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
RE: [DUG] tMemo, Stop updating
Try LockWindowUpdate with the handle of your TMemo, followed by LockWindowUpdate(0) when you're done. HTH, C. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Peacocke Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
RE: [DUG] tMemo, Stop updating
Look at and use BeginUpdate and EndUpdate. Can't remember if it's a method of TMemo or a method of the TMemo.Lines property. Best Regards, Chua, Chee Wee CCNA, MCSE, SCJP, SCSA, CodeGear(tm), from Borland Where developers matter www.codegear.com I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
Re: [DUG] tMemo, Stop updating
Perhaps: sl := TStringList.Create; sl.Assign(memo1.lines); //process sl memo1.lines.Assign(sl); Alister Christie Computers for People Ph: 04 471 1849 Fax: 04 471 1266 http://www.salespartner.co.nz PO Box 13085 Johnsonville Wellington Steve Peacocke wrote: Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
RE: [DUG] tMemo, Stop updating
Yep. Memo.Lines.BeginUpdate; // Do stuff Memo.Lines.EndUpdate; This works with anything that is based on TStrings. Stacey -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Neven MacEwan Sent: Wednesday, 1 August 2007 16:13 To: NZ Borland Developers Group - Delphi List Subject: Re: [DUG] tMemo, Stop updating Steve Memo1.lines.Beginupdate? or something like that Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
Re: [DUG] tMemo, Stop updating
No, Thanks, but sorry that won't work. BeginUpdate will be for Data enabled components. This is a simple tmemo. Thanks anyway Steve On 01/08/07, Neven MacEwan [EMAIL PROTECTED] wrote: Steve Memo1.lines.Beginupdate? or something like that Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe -- Steve Peacocke http://stevepeacocke.blogspot.com/ ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
RE: [DUG] tMemo, Stop updating
No.No.No. Do not use LockWindowUpdate for these kind of cases. LockWindowUpdate is to be used for drag and drop cursor operations and nothing else (my basic understanding of it's development - check up in Raymond Chen blog about this) If you want to stop drawing use (any window handle can be used) SendMessage( AForm.Handle, WM_SETREDRAW, 0, 0); //Disable redrawing of window try finally SendMessage( AForm.Handle, WM_SETREDRAW, 1, 0); //Turn drawing on again. end Instead. Myles. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Conor Boyd Sent: Wednesday, 1 August 2007 04:13 To: NZ Borland Developers Group - Delphi List Subject: RE: [DUG] tMemo, Stop updating Try LockWindowUpdate with the handle of your TMemo, followed by LockWindowUpdate(0) when you're done. HTH, C. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Peacocke Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe Attention: This communication is confidential and may be legally privileged. If you are not the intended recipient, please do not use, disclose, copy or distribute it, other than to return it to us with your confirmation that it has been deleted from your system. ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
Re: [DUG] tMemo, Stop updating
Ah - Lines DOES have BeginUpdate and EndUpdate methods, and they work. LockWindowUpdate(memo1.Handle); seemed to also work too, but did something funny near the end where it started to update when it was about 80% through. Thanks people. Steve On 01/08/07, Alister Christie [EMAIL PROTECTED] wrote: Perhaps: sl := TStringList.Create; sl.Assign(memo1.lines); //process sl memo1.lines.Assign(sl); Alister Christie Computers for People Ph: 04 471 1849 Fax: 04 471 1266 http://www.salespartner.co.nz PO Box 13085 Johnsonville Wellington Steve Peacocke wrote: Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe -- Steve Peacocke http://stevepeacocke.blogspot.com/ ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
Re: [DUG] tMemo, Stop updating
Yes it will work! TMemo uses TMemoStrings On Wed, 01 Aug 2007 16:20, Steve Peacocke wrote: No, Thanks, but sorry that won't work. BeginUpdate will be for Data enabled components. This is a simple tmemo. Thanks anyway Steve On 01/08/07, Neven MacEwan [EMAIL PROTECTED] wrote: Steve Memo1.lines.Beginupdate? or something like that Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? Steve ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
RE: [DUG] tMemo, Stop updating
Actually, if you start looking at the Tmemo code, which uses TMemostrings, you will find the begin update actually calls SendMessage(Memo.Handle, WM_SETREDRAW, Ord(not Updating), 0); so it is perfectly fine to call Begin adn end update on memos. Jeremy -Original Message- From: Myles Penlington [EMAIL PROTECTED] To: NZ Borland Developers Group - Delphi List delphi@delphi.org.nz Date: Wed, 1 Aug 2007 16:24:13 +1200 Subject: RE: [DUG] tMemo, Stop updating No.No.No. Do not use LockWindowUpdate for these kind of cases. LockWindowUpdate is to be used for drag and drop cursor operations and nothing else (my basic understanding of it's development - check up in Raymond Chen blog about this) If you want to stop drawing use (any window handle can be used) SendMessage( AForm.Handle, WM_SETREDRAW, 0, 0); //Disable redrawing of window try finally SendMessage( AForm.Handle, WM_SETREDRAW, 1, 0); //Turn drawing on again. end Instead. Myles. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Conor Boyd Sent: Wednesday, 1 August 2007 04:13 To: NZ Borland Developers Group - Delphi List Subject: RE: [DUG] tMemo, Stop updating Try LockWindowUpdate with the handle of your TMemo, followed by LockWindowUpdate(0) when you're done. HTH, C. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steve Peacocke Bloody stupid question I know, but I spent all day traversing 3 tons of spaghetti code and my mind is mush. Is there a way that I can tell a tMemo component not to keep updating when I process all the lines. I have a tMemo component with, lets say 5-10,000 lines. I want to process through each of those lines updating certain ones where necessary. for i := 0 to Memo1.lines.Count - 1 do If (Memo1.lines[i] = 'I can use this line') then DoThingsToTheLine; The problems is that I want to have the tMemo remain on the form, but I don't want it to keep updating to try to keep up with the current line that I'm processing. I've already tried Memo1.Enabled := false, but the frigging thing still keeps updating. I don't want to make it invisible as it looks really horrible. Any suggestions? ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi [http://delphi.org.nz/mailman/listinfo/delphi] Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe Attention: This communication is confidential and may be legally privileged. If you are not the intended recipient, please do not use, disclose, copy or distribute it, other than to return it to us with your confirmation that it has been deleted from your system. ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi [http://delphi.org.nz/mailman/listinfo/delphi] Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe
Re: [DUG] tMemo, Stop updating
On 01/08/07, Jeremy Coulter [EMAIL PROTECTED] wrote: Actually, if you start looking at the Tmemo code, which uses TMemostrings, you will find the begin update actually calls SendMessage(Memo.Handle, WM_SETREDRAW, Ord(not Updating), 0); so it is perfectly fine to call Begin adn end update on memos. Jeremy Thanks Jeremy and others, Apologies, I was thinking of the objects TMemo and TCustomMemo. The property Lines (not TMemostrings that I can see) is a TStrings object which does indeed have the BeginUpdate and EndUpdate methods. I have used these and it works a treat. Thanks. Steve -- Steve Peacocke http://stevepeacocke.blogspot.com/ ___ NZ Borland Developers Group - Delphi mailing list Post: delphi@delphi.org.nz Admin: http://delphi.org.nz/mailman/listinfo/delphi Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe