mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 17:00:57 +02:00
LCL, opening a form with dbcalendar opens the lfm file instead of form designer, issue #8906
git-svn-id: trunk@11202 -
This commit is contained in:
parent
db807d1a6d
commit
6054c81ca5
@ -765,6 +765,7 @@ Type
|
||||
|
||||
procedure SetDataField(Value: string);
|
||||
procedure SetDataSource(Value: TDataSource);
|
||||
procedure UpdateDate(const AValue: string);
|
||||
protected
|
||||
procedure Loaded; override;
|
||||
procedure Notification(AComponent: TComponent;
|
||||
|
@ -26,10 +26,10 @@
|
||||
//update the caption on next record etc...
|
||||
procedure TDBCalendar.DataChange(Sender: TObject);
|
||||
begin
|
||||
if FDataLink.Field <> nil then
|
||||
inherited Date := FDataLink.Field.AsString//this is wrong, but Text seems Broken
|
||||
if FDatalink.Active and (FDataLink.Field <> nil) then
|
||||
UpdateDate(FDatalink.Field.Text)
|
||||
else
|
||||
inherited Date := '';
|
||||
UpdateDate('');
|
||||
end;
|
||||
|
||||
procedure TDBCalendar.EditingChange(Sender: TObject);
|
||||
@ -44,7 +44,6 @@ end;
|
||||
procedure TDBCalendar.UpdateData(Sender: TObject);
|
||||
begin
|
||||
FDataLink.Field.Text := Text;
|
||||
FDataLink.Field.AsString := Text;// I shouldn't have to do this, but text seems broken
|
||||
end;
|
||||
|
||||
procedure TDBCalendar.FocusRequest(Sender: TObject);
|
||||
@ -104,6 +103,15 @@ begin
|
||||
FDataLink.DataSource := Value;
|
||||
end;
|
||||
|
||||
procedure TDBCalendar.UpdateDate(const AValue: string);
|
||||
begin
|
||||
if AValue='' then
|
||||
// TODO: do dbcalendar needs some visual feedback
|
||||
// that current date is invalid?
|
||||
else
|
||||
inherited date := AValue;
|
||||
end;
|
||||
|
||||
{ Protected Methods}
|
||||
procedure TDBCalendar.Loaded;
|
||||
begin
|
||||
|
Loading…
Reference in New Issue
Block a user