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:
jesus 2007-05-25 20:11:33 +00:00
parent db807d1a6d
commit 6054c81ca5
2 changed files with 13 additions and 4 deletions

View File

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

View File

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