taskDialog

Hi

i use AdvTaskDialog with an inputType = itTime, and when whatever i use (InputText or InputDateTime) i receive a date and not a time variable. something wrong ?

regards

olivier

You can get the time via

AdvInputTaskDialog.InputDateTime: TDateTime;

We'll fix the issue that the Text returns the date, but using InputDateTime directly is easier and recommended.

Thanks bruno

but i would like to apologize. In fact i used to get the time : DateToStr in place of TimeToStr :(

so stupid :(

just a proposal : possibility to use or not the seconds

regards

olivier

However, there is still a bug ;)

I set the InputDateTime to Now,
i Change the time into the field to another time
i click ok and in the DialogbuttonClick event the InputDateTime variable remais the first value AND NOT the "output" value :(

oliveir

  1. Next update will have a new property AdvInputTaskDialog.DateTimeFormat: string to control the format

    2) I cannot reproduce an issue with the output value.
    Test code:

    procedure TForm5.Button1Click(Sender: TObject);
    begin
      AdvInputTaskDialog1.DateTimeFormat := 'hh:mm';
      AdvInputTaskDialog1.InputType := itTime;
      AdvInputTaskDialog1.InputDateTime := Now;
      AdvInputTaskDialog1.Execute;
      caption := TimeToStr(AdvInputTaskDialog1.InputDateTime);
    end;

    This always shows in the caption the correct last entered date time.

Hi

this is the code I used (as compare yours, i modify the label throughout the buttonclock event, is it wrong ?):

procedure TForm8.AdvInputTaskDialog1DialogButtonClick(Sender: TObject; ButtonID: Integer);
begin
     //
   IF ButtonID = mrOk THEN
   begin
       Label1.Caption := TimeToStr(AdvInputTaskDialog1.InputDateTime);
   END; // Fin de IF
end;

procedure TForm8.Button1Click(Sender: TObject);
begin
               AdvInputTaskDialog1.InputText := TimeToStr(GetTime);
               AdvInputTaskDialog1.InputDateTime := Now;
               AdvInputTaskDialog1.Execute;

end;

When OnDialogButtonClick is triggered, the dialog is not yet closed, hence the properties referring to input controls text is not yet updated.
We've modified this now and in the next update, you will have the updated values also in this event.

Thanks a lot

kind regards

olivier