mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 12:30:36 +02:00
TDateEdit - fix color, ReadOnly, move property Date to public sections from Aleksey
git-svn-id: trunk@10189 -
This commit is contained in:
parent
dbe0e57b27
commit
64d075fa75
@ -34,7 +34,7 @@ uses
|
|||||||
type
|
type
|
||||||
{ TCustomEditButton }
|
{ TCustomEditButton }
|
||||||
|
|
||||||
TCustomEditButton = class(TEdit)
|
TCustomEditButton = class(TCustomEdit)
|
||||||
private
|
private
|
||||||
FButton: TSpeedButton;
|
FButton: TSpeedButton;
|
||||||
FButtonNeedsFocus: Boolean;
|
FButtonNeedsFocus: Boolean;
|
||||||
@ -295,7 +295,7 @@ type
|
|||||||
|
|
||||||
{ TDateEdit }
|
{ TDateEdit }
|
||||||
|
|
||||||
TDateEdit = class(TEditButton)
|
TDateEdit = class(TCustomEditButton)
|
||||||
private
|
private
|
||||||
FDialogTitle: TCaption;
|
FDialogTitle: TCaption;
|
||||||
FDisplaySettings: TDisplaySettings;
|
FDisplaySettings: TDisplaySettings;
|
||||||
@ -314,14 +314,54 @@ type
|
|||||||
constructor Create(AOwner: TComponent); override;
|
constructor Create(AOwner: TComponent); override;
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure DateFormatChanged; virtual;
|
procedure DateFormatChanged; virtual;
|
||||||
|
property Date: TDateTime Read FDate Write SetDate;
|
||||||
|
property Button;
|
||||||
published
|
published
|
||||||
property DialogTitle:TCaption Read FDialogTitle Write FDialogTitle Stored IsStoreTitle;
|
property DialogTitle:TCaption Read FDialogTitle Write FDialogTitle Stored IsStoreTitle;
|
||||||
Property CalendarDisplaySettings : TDisplaySettings Read FDisplaySettings Write FDisplaySettings;
|
Property CalendarDisplaySettings : TDisplaySettings Read FDisplaySettings Write FDisplaySettings;
|
||||||
Property OnAcceptDate : TAcceptDateEvent Read FOnAcceptDAte Write FOnAcceptDate;
|
Property OnAcceptDate : TAcceptDateEvent Read FOnAcceptDAte Write FOnAcceptDate;
|
||||||
property OKCaption:TCaption Read FOKCaption Write FOKCaption;
|
property OKCaption:TCaption Read FOKCaption Write FOKCaption;
|
||||||
property CancelCaption:TCaption Read FCancelCaption Write FCancelCaption;
|
property CancelCaption:TCaption Read FCancelCaption Write FCancelCaption;
|
||||||
property Date: TDateTime Read FDate Write SetDate;
|
|
||||||
property ReadOnly default true;
|
property ReadOnly default true;
|
||||||
|
|
||||||
|
Property ButtonOnlyWhenFocused;
|
||||||
|
Property ButtonWidth;
|
||||||
|
property Action;
|
||||||
|
property Align;
|
||||||
|
property Anchors;
|
||||||
|
property AutoSize;
|
||||||
|
property BorderSpacing;
|
||||||
|
property Color;
|
||||||
|
property Constraints;
|
||||||
|
property CharCase;
|
||||||
|
property Glyph;
|
||||||
|
property NumGlyphs;
|
||||||
|
property DragMode;
|
||||||
|
property EchoMode;
|
||||||
|
property Enabled;
|
||||||
|
property Font;
|
||||||
|
property MaxLength;
|
||||||
|
property OnChange;
|
||||||
|
property OnChangeBounds;
|
||||||
|
property OnClick;
|
||||||
|
property OnEditingDone;
|
||||||
|
property OnEnter;
|
||||||
|
property OnExit;
|
||||||
|
Property OnKeyDown;
|
||||||
|
property OnKeyPress;
|
||||||
|
Property OnKeyUp;
|
||||||
|
Property OnMouseDown;
|
||||||
|
Property OnMouseMove;
|
||||||
|
property OnMouseUp;
|
||||||
|
property OnResize;
|
||||||
|
property ParentFont;
|
||||||
|
property ParentShowHint;
|
||||||
|
property PasswordChar;
|
||||||
|
property PopupMenu;
|
||||||
|
property ShowHint;
|
||||||
|
property TabStop;
|
||||||
|
property TabOrder;
|
||||||
|
property Visible;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -828,15 +868,13 @@ var
|
|||||||
ABitmap: TBitmap;
|
ABitmap: TBitmap;
|
||||||
begin
|
begin
|
||||||
inherited Create(AOwner);
|
inherited Create(AOwner);
|
||||||
FDate:=Now;
|
// FDate:=Now;
|
||||||
Date:=trunc(FDate);
|
Date:=trunc(Now);
|
||||||
Text:=DateToStr(Date);
|
// Text:=DateToStr(Date);
|
||||||
FDisplaySettings:=[dsShowHeadings, dsShowDayNames];
|
FDisplaySettings:=[dsShowHeadings, dsShowDayNames];
|
||||||
DialogTitle:=rsPickDate;
|
DialogTitle:=rsPickDate;
|
||||||
OKCaption:='OK';
|
OKCaption:='OK';
|
||||||
CancelCaption:='Cancel';
|
CancelCaption:='Cancel';
|
||||||
ReadOnly:=true;
|
|
||||||
Color:=clBtnFace;
|
|
||||||
ABitmap:=CreateDateGlyph;
|
ABitmap:=CreateDateGlyph;
|
||||||
Button.Glyph:=ABitmap;
|
Button.Glyph:=ABitmap;
|
||||||
ABitmap.Free;
|
ABitmap.Free;
|
||||||
@ -892,7 +930,6 @@ end;
|
|||||||
|
|
||||||
procedure TDateEdit.SetDate(const Value:TDateTime);
|
procedure TDateEdit.SetDate(const Value:TDateTime);
|
||||||
begin
|
begin
|
||||||
if FDate=Value then exit;
|
|
||||||
FDate:=Value;
|
FDate:=Value;
|
||||||
Text:=DateToStr(FDate);
|
Text:=DateToStr(FDate);
|
||||||
end;
|
end;
|
||||||
@ -913,7 +950,8 @@ begin
|
|||||||
if B then
|
if B then
|
||||||
Text:=DateToStr(FDate);
|
Text:=DateToStr(FDate);
|
||||||
except
|
except
|
||||||
raise Exception.Create('Errore in calendar dialog di dateedit');
|
on E:Exception do
|
||||||
|
MessageDlg(E.Message, mtError, [mbOK], 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user