Update of /cvsroot/instantobjects/Source/Core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20827/Core
Modified Files:
InstantPresentation.pas
Log Message:
IsChanged property implementation for TInstantCustomExposer and decendants.
Index: InstantPresentation.pas
===================================================================
RCS file: /cvsroot/instantobjects/Source/Core/InstantPresentation.pas,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** InstantPresentation.pas 5 Jun 2005 20:30:00 -0000 1.18
--- InstantPresentation.pas 13 Jul 2005 23:18:29 -0000 1.19
***************
*** 196,200 ****
FFieldOptions: TInstantFieldOptions;
FFilterBuffer: PChar;
- FIsChanged: Boolean;
FIsOpen: Boolean;
FLimited: Boolean;
--- 196,199 ----
***************
*** 307,310 ****
--- 306,310 ----
function GetCurrentObject: TObject; virtual;
function GetFieldOffset(const Field: TField): Integer;
+ function GetIsChanged: Boolean; virtual;
function GetRecNo: Integer; override;
function GetRecord(Buffer: PChar; GetMode: TGetMode;
***************
*** 416,420 ****
property CurrentObject: TObject read GetCurrentObject;
property HasSubject: Boolean read GetHasSubject;
! property IsChanged: Boolean read FIsChanged;
property ObjectCount: Integer read GetObjectCount;
property Objects[Index: Integer]: TObject read GetObjects;
--- 416,420 ----
property CurrentObject: TObject read GetCurrentObject;
property HasSubject: Boolean read GetHasSubject;
! property IsChanged: Boolean read GetIsChanged;
property ObjectCount: Integer read GetObjectCount;
property Objects[Index: Integer]: TObject read GetObjects;
***************
*** 495,498 ****
--- 495,499 ----
protected
procedure DataEvent(Event: TDataEvent; Info: Longint); override;
+ function GetIsChanged: Boolean; override;
function GetSubject: TObject; override;
procedure MasterChanged(Sender: TObject);
***************
*** 567,570 ****
--- 568,572 ----
function CanAutoOpen: Boolean;
procedure DefineProperties(Filer: TFiler); override;
+ function GetIsChanged: Boolean; override;
function GetSubject: TObject; override;
function HasCommand: Boolean;
***************
*** 2258,2261 ****
--- 2260,2268 ----
end;
+ function TInstantCustomExposer.GetIsChanged: Boolean;
+ begin
+ Result := False;
+ end;
+
function TInstantCustomExposer.GetLimited: Boolean;
begin
***************
*** 2624,2627 ****
--- 2631,2636 ----
InternalRemoveObject(FNewObject);
end;
+ if (State = dsEdit) and (CurrentObject is TInstantObject) then
+ TInstantObject(CurrentObject).IsChanged := False;
if ObjectCount = 0 then
ClearRecord(ActiveBuffer);
***************
*** 3654,3657 ****
--- 3663,3674 ----
end;
+ function TInstantExposer.GetIsChanged: Boolean;
+ begin
+ if HasSubject and (Subject is TInstantObject) then
+ Result := TInstantObject(Subject).IsChanged
+ else
+ Result := False;
+ end;
+
function TInstantExposer.GetSubject: TObject;
begin
***************
*** 3930,3933 ****
--- 3947,3965 ----
end;
+ function TInstantSelector.GetIsChanged: Boolean;
+ var
+ I: Integer;
+ begin
+ Result := False;
+ for I := 0 to Pred(Query.ObjectCount) do
+ if Query.Objects[I] is TInstantObject then
+ begin
+ Result := TInstantObject(Query.Objects[I]).IsChanged;
+ if Result then
+ Break;
+ end;
+ { TODO : Implement check of deleted records after patch bug #1232576 }
+ end;
+
function TInstantSelector.GetSubject: TObject;
begin
|