[DUG] TTaskDialog with progress bar
Robert Martin
rob at chreos.co.nz
Fri Jul 11 15:26:11 NZST 2014
Ok I have this sorted now
Here is what I have learnt...
1) Embercaderos documentation for TTaskDialog is terrible. Eve n
compared to their other documentation its especially bad.
2) There is not much documentation on the web, I guess people don't use
TTaskDialog which is a shame because it should be pretty awesome.
3) The XE2 (and perhaps other languages too) implementation is missing
pretty obvious functionality. You can have a progressbar that moves to
100% but once it hits 100% you might want to close it, simple right,
just call TaskDialog.Close or maybe set TaskDialog.ModalResult := mrOk?
Nope no close method and setting ModalResult, unlike (almost ?) every
other component does not close it. For anybody searching the web in
vain for how to do this, here it is....
Windows.SendMessage(TaskDialog.Handle, WM_CLOSE, 0, 0); //Close dialog,
there is no component support for closing !
Its that simple!
Another thing for web searcher....
If you want to use the OnTimer() method be sure to set the
[ftCallbackTimer] flags. You would think the docs for OnTimer would say
something like... 'Triggered every x where flags set includes
[ftCallbackTimer].
<End Rant/>
Rob
On 11/07/2014 1:17 p.m., Robert Martin wrote:
> Hi
>
> I have made some progress on this. I have it working by setting a flag
> in the OnExpanded event (fExpanded := not fExpanded) and read that value
> on the timer. Seems to work well. I am just trying to work out how to
> do the same with the TMS component which I really want to use, it
> provides support for XP whcih many still use.
>
> Cheers
> Rob
>
> On 11/07/2014 9:44 a.m., Robert Martin wrote:
>> Hi
>>
>> I have been trying to build a TTaskDialog that shows the progress of an
>> Http download. I want to have it so the user can click the extra
>> details button and see file size, downloaded amount and download speed.
>>
>> All of the above works, however for some reason changing the
>> .ExpandedText (to update the display) in the OnTimer seems to auto
>> expand the detail (the user doesn't have to clcik for more detail) and
>> the contract button disappears. If I don't update the .ExpandedText
>> everything works ok.
>>
>> I tried the code below
>>
>> //test code
>> procedure TForm2.TaskDialog1Timer(Sender: TObject; TickCount: Cardinal;
>> var Reset: Boolean);
>> begin
>> if (TaskDialog1.Expanded = True) then begin
>> TaskDialog1.ExpandedText := TaskDialog1.ExpandedText + 'a';
>> end;
>>
>> TaskDialog1.ProgressBar.Position :=
>> TaskDialog1.ProgressBar.Position + 1;
>> end;
>>
>> However the TaskDialog1.Expanded never seems to get set to true, no
>> matter how many times I expand or hide the detail.
>>
>> Any ideas where to go? The Delphi help on this stuff is terrible and
>> there doesn't seem to be much on the web with respect to progressbars
>> and callbacks.
>>
>> p.s. I also have the TMS version of this component which seems to
>> perform identically, it has the same fault but doesn't even seem to have
>> the .Expanded property.
>>
>> Cheers
>> Rob
>> _______________________________________________
>> NZ Borland Developers Group - Delphi mailing list
>> Post: delphi at listserver.123.net.nz
>> Admin: http://delphi.org.nz/mailman/listinfo/delphi
>> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
>>
>>
>> -----
>> No virus found in this message.
>> Checked by AVG - www.avg.com
>> Version: 2014.0.4716 / Virus Database: 3986/7832 - Release Date: 07/10/14
>>
>>
> _______________________________________________
> NZ Borland Developers Group - Delphi mailing list
> Post: delphi at listserver.123.net.nz
> Admin: http://delphi.org.nz/mailman/listinfo/delphi
> Unsubscribe: send an email to delphi-request at listserver.123.net.nz with Subject: unsubscribe
>
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2014.0.4716 / Virus Database: 3986/7832 - Release Date: 07/10/14
>
>
More information about the Delphi
mailing list