diff --git a/lcl/editbtn.pas b/lcl/editbtn.pas index 5aba6c1f0b..c9ccd42c29 100644 --- a/lcl/editbtn.pas +++ b/lcl/editbtn.pas @@ -34,7 +34,7 @@ uses type { TCustomEditButton } - TCustomEditButton = class(TEdit) + TCustomEditButton = class(TCustomEdit) private FButton: TSpeedButton; FButtonNeedsFocus: Boolean; @@ -295,7 +295,7 @@ type { TDateEdit } - TDateEdit = class(TEditButton) + TDateEdit = class(TCustomEditButton) private FDialogTitle: TCaption; FDisplaySettings: TDisplaySettings; @@ -314,14 +314,54 @@ type constructor Create(AOwner: TComponent); override; destructor Destroy; override; procedure DateFormatChanged; virtual; + property Date: TDateTime Read FDate Write SetDate; + property Button; published property DialogTitle:TCaption Read FDialogTitle Write FDialogTitle Stored IsStoreTitle; Property CalendarDisplaySettings : TDisplaySettings Read FDisplaySettings Write FDisplaySettings; Property OnAcceptDate : TAcceptDateEvent Read FOnAcceptDAte Write FOnAcceptDate; property OKCaption:TCaption Read FOKCaption Write FOKCaption; property CancelCaption:TCaption Read FCancelCaption Write FCancelCaption; - property Date: TDateTime Read FDate Write SetDate; 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; @@ -828,15 +868,13 @@ var ABitmap: TBitmap; begin inherited Create(AOwner); - FDate:=Now; - Date:=trunc(FDate); - Text:=DateToStr(Date); +// FDate:=Now; + Date:=trunc(Now); +// Text:=DateToStr(Date); FDisplaySettings:=[dsShowHeadings, dsShowDayNames]; DialogTitle:=rsPickDate; OKCaption:='OK'; CancelCaption:='Cancel'; - ReadOnly:=true; - Color:=clBtnFace; ABitmap:=CreateDateGlyph; Button.Glyph:=ABitmap; ABitmap.Free; @@ -892,7 +930,6 @@ end; procedure TDateEdit.SetDate(const Value:TDateTime); begin - if FDate=Value then exit; FDate:=Value; Text:=DateToStr(FDate); end; @@ -913,7 +950,8 @@ begin if B then Text:=DateToStr(FDate); except - raise Exception.Create('Errore in calendar dialog di dateedit'); + on E:Exception do + MessageDlg(E.Message, mtError, [mbOK], 0); end; end; diff --git a/lcl/lcltype.pp b/lcl/lcltype.pp index 18d818b13b..c8a8221758 100644 --- a/lcl/lcltype.pp +++ b/lcl/lcltype.pp @@ -406,32 +406,32 @@ const VK_8 = $38; VK_9 = $39; //3A-40 Undefined - VK_A = $41; - VK_B = $42; - VK_C = $43; - VK_D = $44; - VK_E = $45; - VK_F = $46; - VK_G = $47; - VK_H = $48; - VK_I = $49; - VK_J = $4A; - VK_K = $4B; - VK_L = $4C; - VK_M = $4D; - VK_N = $4E; - VK_O = $4F; - VK_P = $50; - VK_Q = $51; - VK_R = $52; - VK_S = $53; - VK_T = $54; - VK_U = $55; - VK_V = $56; - VK_W = $57; - VK_X = $58; - VK_Y = $59; - VK_Z = $5A; + VK_A = $41; + VK_B = $42; + VK_C = $43; + VK_D = $44; + VK_E = $45; + VK_F = $46; + VK_G = $47; + VK_H = $48; + VK_I = $49; + VK_J = $4A; + VK_K = $4B; + VK_L = $4C; + VK_M = $4D; + VK_N = $4E; + VK_O = $4F; + VK_P = $50; + VK_Q = $51; + VK_R = $52; + VK_S = $53; + VK_T = $54; + VK_U = $55; + VK_V = $56; + VK_W = $57; + VK_X = $58; + VK_Y = $59; + VK_Z = $5A; VK_LWIN = $5B; VK_RWIN = $5C; @@ -663,15 +663,15 @@ const MB_ICONSTOP = MB_ICONHAND; MB_ICONINFORMATION = MB_ICONASTERICK; - IDOK = 1; ID_OK = IDOK; - IDCANCEL = 2; ID_CANCEL = IDCANCEL; - IDABORT = 3; ID_ABORT = IDABORT; - IDRETRY = 4; ID_RETRY = IDRETRY; - IDIGNORE = 5; ID_IGNORE = IDIGNORE; - IDYES = 6; ID_YES = IDYES; - IDNO = 7; ID_NO = IDNO; - IDCLOSE = 8; ID_CLOSE = IDCLOSE; - IDHELP = 9; ID_HELP = IDHELP; + IDOK = 1; ID_OK = IDOK; + IDCANCEL = 2; ID_CANCEL = IDCANCEL; + IDABORT = 3; ID_ABORT = IDABORT; + IDRETRY = 4; ID_RETRY = IDRETRY; + IDIGNORE = 5; ID_IGNORE = IDIGNORE; + IDYES = 6; ID_YES = IDYES; + IDNO = 7; ID_NO = IDNO; + IDCLOSE = 8; ID_CLOSE = IDCLOSE; + IDHELP = 9; ID_HELP = IDHELP; MB_DEFBUTTON1 = $00000000; MB_DEFBUTTON2 = $00000100;