mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-06 05:58:06 +02:00
LCL: TDateEdit: displaysettings
git-svn-id: trunk@28084 -
This commit is contained in:
parent
7c80c43236
commit
12bd4b87a6
@ -970,7 +970,8 @@ begin
|
||||
ADate := GetDate;
|
||||
if ADate = NullDate then
|
||||
ADate := SysUtils.Date;
|
||||
ShowCalendarPopup(PopupOrigin, ADate, @CalendarPopupReturnDate, @CalendarPopupShowHide)
|
||||
ShowCalendarPopup(PopupOrigin, ADate, CalendarDisplaySettings,
|
||||
@CalendarPopupReturnDate, @CalendarPopupShowHide)
|
||||
end;
|
||||
|
||||
procedure TDateEdit.DblClick;
|
||||
|
@ -42,14 +42,16 @@ type
|
||||
private
|
||||
FClosed: boolean;
|
||||
FOnReturnDate: TReturnDateEvent;
|
||||
procedure Initialize(const PopupOrigin: TPoint; ADate: TDateTime);
|
||||
procedure Initialize(const PopupOrigin: TPoint; ADate: TDateTime;
|
||||
const DisplaySettings: TDisplaySettings);
|
||||
procedure ReturnDate;
|
||||
protected
|
||||
procedure Paint; override;
|
||||
end;
|
||||
|
||||
procedure ShowCalendarPopup(const Position: TPoint; ADate: TDateTime;
|
||||
OnReturnDate: TReturnDateEvent; OnShowHide: TNotifyEvent = nil);
|
||||
const CalendarDisplaySettings: TDisplaySettings;
|
||||
const OnReturnDate: TReturnDateEvent; const OnShowHide: TNotifyEvent = nil);
|
||||
|
||||
implementation
|
||||
|
||||
@ -58,12 +60,13 @@ implementation
|
||||
{$ENDIF}
|
||||
|
||||
procedure ShowCalendarPopup(const Position: TPoint; ADate: TDateTime;
|
||||
OnReturnDate: TReturnDateEvent; OnShowHide: TNotifyEvent = nil);
|
||||
const CalendarDisplaySettings: TDisplaySettings;
|
||||
const OnReturnDate: TReturnDateEvent; const OnShowHide: TNotifyEvent = nil);
|
||||
var
|
||||
PopupForm: TCalendarPopupForm;
|
||||
begin
|
||||
PopupForm := TCalendarPopupForm.Create(nil);
|
||||
PopupForm.Initialize(Position, ADate);
|
||||
PopupForm.Initialize(Position, ADate, CalendarDisplaySettings);
|
||||
PopupForm.FOnReturnDate := OnReturnDate;
|
||||
PopupForm.OnShow := OnShowHide;
|
||||
PopupForm.OnHide := OnShowHide;
|
||||
@ -124,7 +127,7 @@ begin
|
||||
end;
|
||||
|
||||
procedure TCalendarPopupForm.Initialize(const PopupOrigin: TPoint;
|
||||
ADate: TDateTime);
|
||||
ADate: TDateTime; const DisplaySettings: TDisplaySettings);
|
||||
var
|
||||
ABounds: TRect;
|
||||
begin
|
||||
@ -138,6 +141,7 @@ begin
|
||||
else
|
||||
Top := PopupOrigin.Y;
|
||||
Calendar.DateTime := ADate;
|
||||
Calendar.DisplaySettings:=DisplaySettings;
|
||||
end;
|
||||
|
||||
procedure TCalendarPopupForm.ReturnDate;
|
||||
|
Loading…
Reference in New Issue
Block a user