 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Geir Bratlie Guest
|
Posted: Fri Nov 14, 2003 3:39 pm Post subject: Status when retrieving headers (IdIMAP4) |
|
|
Hi!
I want to show a progressbar when the IdIMAP4 retrieves header list when
selecting a mailbox. I've tried to use the OnWork, but the IdIMAP4 does not
fire OnWork when retrieving headers.
Anyone have any clue on how to do this?
Kind regards,
Geir Bratlie
<snip>
IdIMAP41.RetrieveOnSelect:=rsHeaders;
IdIMAP41.Connect;
sl:=Tstringlist.create;
IDIMAP41.ListMailBoxes(sl);
if sl.count>0 then
IdIMAP41.SelectMailBox(sl[0]);
sl.free;
<snip>
|
|
| Back to top |
|
 |
Simon Devlin Guest
|
Posted: Sat Nov 15, 2003 9:53 pm Post subject: Re: Status when retrieving headers (IdIMAP4) |
|
|
No, but I've had this elsewhere with Indy before (NNTP) and ended up
deriving my own TStringList descendant that overrode .Add() and fired an
event. Just used this as a receptacle for the headers instead of a regular
TStringList.
* Define a base type*
type
TTriggeredStringlistBase = class(TStringList)
private
FOnNewString: TTriggeredNewString;
FTriggerEvery: integer;
public
constructor Create; // override;
function Add(const S: string): Integer; override;
procedure Done; virtual; abstract;
property TriggerEvery: integer read FTriggerEvery write FTriggerEvery;
end;
constructor TTriggeredStringlistBase.Create;
begin
inherited Create;
FTriggerEvery := 250;
end;
function TTriggeredStringListBase.Add(const s: string): integer;
begin
Result := inherited Add(s);
end;
* Then descend and add my event *
TOnNewArticle = procedure(const ArticleData, Group: string; const Count:
integer) of object;
TArticleList = class(TTriggeredStringlistBase)
private
FOnNewArticle: TOnNewArticle;
FGroup: string;
public
constructor Create; overload;
constructor Create(const Group: string); overload;
function Add(const ArticleData: string): integer; override;
procedure Done;
property OnNewArticle: TOnNewArticle read FOnNewArticle write
FOnNewArticle;
property Group: string read FGroup write FGroup;
end;
Should be easy enough to adapt.
HTH
"Geir Bratlie" <remove_geir (AT) royal (DOT) no> wrote
| Quote: | Hi!
I want to show a progressbar when the IdIMAP4 retrieves header list when
selecting a mailbox. I've tried to use the OnWork, but the IdIMAP4 does
not
fire OnWork when retrieving headers.
Anyone have any clue on how to do this?
Kind regards,
Geir Bratlie
snip
IdIMAP41.RetrieveOnSelect:=rsHeaders;
IdIMAP41.Connect;
sl:=Tstringlist.create;
IDIMAP41.ListMailBoxes(sl);
if sl.count>0 then
IdIMAP41.SelectMailBox(sl[0]);
sl.free;
snip
|
|
|
| Back to top |
|
 |
Geir Bratlie Guest
|
Posted: Sun Nov 16, 2003 2:27 pm Post subject: Re: Status when retrieving headers (IdIMAP4) |
|
|
Hi!
Thank you for your suggestion!
I've ended ut retrieving the headers manually, one by one.
-Geir-
"Simon Devlin" <simon.devlin> skrev i melding
news:3fb6a0ab$1 (AT) newsgroups (DOT) borland.com...
| Quote: | No, but I've had this elsewhere with Indy before (NNTP) and ended up
deriving my own TStringList descendant that overrode .Add() and fired an
event. Just used this as a receptacle for the headers instead of a
regular
TStringList.
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|