TsTimwPicker does not work if cleared in code

Tagged: 

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #61329
    HeDiBo
    Participant

    The TsTimePicker has a problem if it is cleared in code:

    TimePicker.Clear;

    When after this the user tries to enter a time, AC throws an access violation. Also the spin buttons do nothing.

    Sample project is attached.

    • This topic was modified 4 years, 12 months ago by HeDiBo.
    Attachments:
    You must be logged in to view attached files.
    #61332
    HeDiBo
    Participant

    The following code will solve the problem:

          s := Text;
    {$ENDIF}
          if s = '' then begin      (*** DB ***)
             Value := 0;            (*** DB ***)
             s := Text;             (*** DB ***)
          end{if};                  (*** DB ***)
          case FPos of
    

    The spin buttons still don’t do anything, but that’s probably OK.

    #61394
    sergunalpha
    Keymaster

    Thank you, I will check it.

    #61456
    HeDiBo
    Participant

    After reconsideration, to support TNTUNICODE, the best fix may be:

        if Result then begin
          if Text = '' then Value := 0;   (*** DB ***: initialize text to 00:00:00 *)
    {$IFDEF TNTUNICODE}
          c := PWideChar(Text);
    • This reply was modified 4 years, 11 months ago by HeDiBo.
    #61549
    Support
    Keymaster

    Thank you, I will add it in the nearest release.

    #68203
    HeDiBo
    Participant

    Problem fixed. Close this topic, please.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘TsTimwPicker does not work if cleared in code’ is closed to new replies.