Recent

Author Topic: [solved] TDateTimePicker - bug in Lazarus?  (Read 765 times)

Nicole

  • Hero Member
  • *****
  • Posts: 970
[solved] TDateTimePicker - bug in Lazarus?
« on: August 01, 2022, 11:17:45 am »
I was told to upload anything in this forum, what I think it may be a bug.
I am relatively new to Lazaus, so I am insecure

So I upload
- a project simplified
- the lazarus.log
- the text below:

Do this:
- start the program
- go to the last Tab "neu"
- focus your attention on the DateTimePicker
- select the second RadioButton
- the DateTimePicker is gone


I suspect it may have something to do with
DateTimePicker_TerminEintrag.Kind
dkDateTime
dkDate
dkTime

These were the items, I worked with in the recent hours

(attachemend deleted)
« Last Edit: August 01, 2022, 12:39:21 pm by Nicole »

kirchfritz

  • Jr. Member
  • **
  • Posts: 53
  • WIN10 LAZ 2.2.4 FPC 3.2.2
Re: TDateTimePicker - bug in Lazarus?
« Reply #1 on: August 01, 2022, 12:00:07 pm »
Hi Nicole,

I was not able to load and compile your demo program.

unit_notizen.pas(15,21) Fatal: Kann Unit_myStringList nicht finden verwendet von unit_Notizen des Projektinspektors.

kirchfritz

  • Jr. Member
  • **
  • Posts: 53
  • WIN10 LAZ 2.2.4 FPC 3.2.2
Re: TDateTimePicker - bug in Lazarus?
« Reply #2 on: August 01, 2022, 12:08:25 pm »
Hi Nicole,

if you inspect your radio button click event:

Code: Pascal  [Select][+][-]
  1. procedure TForm_Notizen.RadioGroup_TerminNeuClick(Sender: TObject);
  2. begin
  3.     DateTimePicker_TerminEintrag.Visible:=false;
  4.  
  5.     if RadioGroup_TerminNeu.ItemIndex=0 then
  6.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ0;
  7.    if RadioGroup_TerminNeu.ItemIndex=1 then
  8.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ1;
  9.    if RadioGroup_TerminNeu.ItemIndex=2 then
  10.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ2;
  11.    if RadioGroup_TerminNeu.ItemIndex=3 then
  12.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ3;
  13.  
  14.    if (RadioGroup_TerminNeu.ItemIndex=4) then begin
  15.       DateTimePicker_TerminEintrag.Visible:=true;
  16.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ4;
  17.    end;
  18.  
  19.    if (RadioGroup_TerminNeu.ItemIndex=5) then begin
  20.       DateTimePicker_TerminEintrag.Visible:=true;
  21.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ4;
  22.    end;
  23.  
  24.     if RadioGroup_TerminNeu.ItemIndex=6 then
  25.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ6;
  26.  
  27.    if RadioGroup_TerminNeu.ItemIndex=7 then
  28.       Panel_TeminNeuUHilfe.Color:=Farbe_Typ7;
  29.  
  30.     if RadioGroup_TerminNeu.ItemIndex=8 then
  31.           Panel_TeminNeuUHilfe.Color:=Farbe_Typ8;
  32.  
  33.      if RadioGroup_TerminNeu.ItemIndex=9 then
  34.           Panel_TeminNeuUHilfe.Color:=Farbe_Typ9;
  35.  
  36. end;          
  37.  

in the very first step you hide the dateTimePicker_TerminEintrag
and then you set the visibility to TRUE, only when
RadioGroup_TerminNeu.ItemIndex is 4 or 5.

If you click the second radiobutton, then the visibilty of the DataTimepicker will never change.


Nicole

  • Hero Member
  • *****
  • Posts: 970
Re: TDateTimePicker - bug in Lazarus?
« Reply #3 on: August 01, 2022, 12:38:37 pm »
Thank you so much!!
This is the silly mistake: I had two pickers, one for time-kind and one for date-kind (my old Delphi did not allow both).
The time-kind I hid when not needed.

A rename action left the name of the time-kind instead of the name of the date-kind-picker.
I needed somebody else to tell me the obvious.

 

TinyPortal © 2005-2018