Changeset 100 for trunk/Forms/UFormContact.pas
- Timestamp:
- Feb 8, 2022, 5:13:22 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormContact.pas
r95 r100 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, StdCtrls, 9 9 ComCtrls, ActnList, Menus, ExtCtrls, ExtDlgs, Buttons, UContact, LCLIntf, 10 UFormProperties ;10 UFormProperties, DateUtils{$IFDEF LCLGTK2}, Gtk2Globals{$ENDIF}; 11 11 12 12 type … … 23 23 ButtonOk: TButton; 24 24 ButtonPrevious: TButton; 25 CalendarDialog1: TCalendarDialog; 25 26 EditAim: TEdit; 26 27 EditCategories: TEdit; … … 173 174 PopupMenuPhoto: TPopupMenu; 174 175 SavePictureDialog1: TSavePictureDialog; 176 SpeedButtonBirthDay: TSpeedButton; 177 SpeedButtonAniversary: TSpeedButton; 175 178 SpeedButtonHomeEmail: TSpeedButton; 176 179 SpeedButtonEmail: TSpeedButton; … … 195 198 procedure FormDestroy(Sender: TObject); 196 199 procedure FormShow(Sender: TObject); 197 procedure peedButtonHomeWebClick(Sender: TObject); 200 procedure SpeedButtonHomeWebClick(Sender: TObject); 201 procedure SpeedButtonAniversaryClick(Sender: TObject); 202 procedure SpeedButtonBirthDayClick(Sender: TObject); 198 203 procedure SpeedButtonEmailClick(Sender: TObject); 199 204 procedure SpeedButtonHomeEmailClick(Sender: TObject); … … 246 251 UCore, UCommon; 247 252 253 function DateToISO(Date: TDateTime): string; 254 begin 255 Result := FormatDateTime('yyyy-mm-dd', Date); 256 end; 257 248 258 { TFormContact } 249 259 250 260 procedure TFormContact.FormShow(Sender: TObject); 251 261 begin 262 {$IFDEF LCLGTK2} 263 // GTK2 bug workaround https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/35720 264 if Visible then LastMouse.WinControl := PageControlContact.ActivePage; 265 {$ENDIF} 252 266 Core.PersistentForm1.Load(Self); 253 267 … … 266 280 end; 267 281 268 procedure TFormContact. peedButtonHomeWebClick(Sender: TObject);282 procedure TFormContact.SpeedButtonHomeWebClick(Sender: TObject); 269 283 begin 270 284 if EditHomeWeb.Text <> '' then OpenURL(EditHomeWeb.Text); 285 end; 286 287 procedure TFormContact.SpeedButtonAniversaryClick(Sender: TObject); 288 var 289 Date: TDateTime; 290 begin 291 if TryISOStrToDate(EditAniversary.Text, Date) then 292 CalendarDialog1.Date := Date 293 else CalendarDialog1.Date := Now; 294 if CalendarDialog1.Execute then 295 EditAniversary.Text := DateToISO(CalendarDialog1.Date); 296 end; 297 298 procedure TFormContact.SpeedButtonBirthDayClick(Sender: TObject); 299 var 300 Date: TDateTime; 301 begin 302 if TryISOStrToDate(EditBirthday.Text, Date) then 303 CalendarDialog1.Date := Date 304 else CalendarDialog1.Date := Now; 305 if CalendarDialog1.Execute then 306 EditBirthday.Text := DateToISO(CalendarDialog1.Date); 271 307 end; 272 308
Note:
See TracChangeset
for help on using the changeset viewer.