LCL: TDateEdit: displaysettings

git-svn-id: trunk@28084 -
This commit is contained in:
mattias 2010-11-05 01:51:03 +00:00
parent 7c80c43236
commit 12bd4b87a6
2 changed files with 11 additions and 6 deletions

View File

@ -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;

View File

@ -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;