mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-29 14:31:29 +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;
|
||||||
|
|
||||||
|
@ -406,32 +406,32 @@ const
|
|||||||
VK_8 = $38;
|
VK_8 = $38;
|
||||||
VK_9 = $39;
|
VK_9 = $39;
|
||||||
//3A-40 Undefined
|
//3A-40 Undefined
|
||||||
VK_A = $41;
|
VK_A = $41;
|
||||||
VK_B = $42;
|
VK_B = $42;
|
||||||
VK_C = $43;
|
VK_C = $43;
|
||||||
VK_D = $44;
|
VK_D = $44;
|
||||||
VK_E = $45;
|
VK_E = $45;
|
||||||
VK_F = $46;
|
VK_F = $46;
|
||||||
VK_G = $47;
|
VK_G = $47;
|
||||||
VK_H = $48;
|
VK_H = $48;
|
||||||
VK_I = $49;
|
VK_I = $49;
|
||||||
VK_J = $4A;
|
VK_J = $4A;
|
||||||
VK_K = $4B;
|
VK_K = $4B;
|
||||||
VK_L = $4C;
|
VK_L = $4C;
|
||||||
VK_M = $4D;
|
VK_M = $4D;
|
||||||
VK_N = $4E;
|
VK_N = $4E;
|
||||||
VK_O = $4F;
|
VK_O = $4F;
|
||||||
VK_P = $50;
|
VK_P = $50;
|
||||||
VK_Q = $51;
|
VK_Q = $51;
|
||||||
VK_R = $52;
|
VK_R = $52;
|
||||||
VK_S = $53;
|
VK_S = $53;
|
||||||
VK_T = $54;
|
VK_T = $54;
|
||||||
VK_U = $55;
|
VK_U = $55;
|
||||||
VK_V = $56;
|
VK_V = $56;
|
||||||
VK_W = $57;
|
VK_W = $57;
|
||||||
VK_X = $58;
|
VK_X = $58;
|
||||||
VK_Y = $59;
|
VK_Y = $59;
|
||||||
VK_Z = $5A;
|
VK_Z = $5A;
|
||||||
|
|
||||||
VK_LWIN = $5B;
|
VK_LWIN = $5B;
|
||||||
VK_RWIN = $5C;
|
VK_RWIN = $5C;
|
||||||
@ -663,15 +663,15 @@ const
|
|||||||
MB_ICONSTOP = MB_ICONHAND;
|
MB_ICONSTOP = MB_ICONHAND;
|
||||||
MB_ICONINFORMATION = MB_ICONASTERICK;
|
MB_ICONINFORMATION = MB_ICONASTERICK;
|
||||||
|
|
||||||
IDOK = 1; ID_OK = IDOK;
|
IDOK = 1; ID_OK = IDOK;
|
||||||
IDCANCEL = 2; ID_CANCEL = IDCANCEL;
|
IDCANCEL = 2; ID_CANCEL = IDCANCEL;
|
||||||
IDABORT = 3; ID_ABORT = IDABORT;
|
IDABORT = 3; ID_ABORT = IDABORT;
|
||||||
IDRETRY = 4; ID_RETRY = IDRETRY;
|
IDRETRY = 4; ID_RETRY = IDRETRY;
|
||||||
IDIGNORE = 5; ID_IGNORE = IDIGNORE;
|
IDIGNORE = 5; ID_IGNORE = IDIGNORE;
|
||||||
IDYES = 6; ID_YES = IDYES;
|
IDYES = 6; ID_YES = IDYES;
|
||||||
IDNO = 7; ID_NO = IDNO;
|
IDNO = 7; ID_NO = IDNO;
|
||||||
IDCLOSE = 8; ID_CLOSE = IDCLOSE;
|
IDCLOSE = 8; ID_CLOSE = IDCLOSE;
|
||||||
IDHELP = 9; ID_HELP = IDHELP;
|
IDHELP = 9; ID_HELP = IDHELP;
|
||||||
|
|
||||||
MB_DEFBUTTON1 = $00000000;
|
MB_DEFBUTTON1 = $00000000;
|
||||||
MB_DEFBUTTON2 = $00000100;
|
MB_DEFBUTTON2 = $00000100;
|
||||||
|
Loading…
Reference in New Issue
Block a user