@@ -590,11 +590,33 @@ void __fastcall TMainWindow::BtnAboutClick(TObject *Sender)
590590// callback on button-time-start --------------------------------------------
591591void __fastcall TMainWindow::TimeStartFClick (TObject *Sender)
592592{
593+ if (TimeStartF->Checked && TimeEndF->Checked ) {
594+ // Initialize the start time to the end time if the start
595+ // time has just been enabled and is out of order.
596+ gtime_t ts={0 },te={0 };
597+ double tint=0.0 ,tunit=0.0 ;
598+ GetTime (&ts,&te,&tint,&tunit);
599+ if (timediff (te, ts) < 0.0 ) {
600+ TimeY1->Text = TimeY2->Text ;
601+ TimeH1->Text = TimeH2->Text ;
602+ }
603+ }
593604 UpdateEnable ();
594605}
595606// callback on button-time-end ----------------------------------------------
596607void __fastcall TMainWindow::TimeEndFClick (TObject *Sender)
597608{
609+ if (TimeStartF->Checked && TimeEndF->Checked ) {
610+ // Initialize the end time to the start time if the end time
611+ // has just been enabled and is out of order.
612+ gtime_t ts={0 },te={0 };
613+ double tint=0.0 ,tunit=0.0 ;
614+ GetTime (&ts,&te,&tint,&tunit);
615+ if (timediff (te, ts) < 0.0 ) {
616+ TimeY2->Text = TimeY1->Text ;
617+ TimeH2->Text = TimeH1->Text ;
618+ }
619+ }
598620 UpdateEnable ();
599621}
600622// callback on button-time-interval -----------------------------------------
0 commit comments