{ ------------------------------------------------------------- }
{ Purpose : NextDBGrid 6                                        }
{ By      : Bojan Nikolic                                       }
{ For     : BergSoft                                            }
{ ------------------------------------------------------------- }
{ Copyright (C) BergSoft.net 2015. All Rights Reserved.         }
{ ------------------------------------------------------------- }
{$I '..\NxSuite6.inc'}
unit NxDBCells6;

interface

uses
  { Standard }
  Classes, Types, Windows, Messages, Graphics, SysUtils,
  {$IFDEF UI_TYPES}UITypes, {$ELSE}ImgList,{$ENDIF}
  { Data }
  DB,
  { Next Standard 6 }
  NxIntf6, NxClasses6, NxConsts6, NxTypes6,
  { NextGrid 6 }
  NxCells6;

type
  INxDBCells = interface
    ['{16846594-9EE2-4990-BCAF-BF12547D4084}']
    procedure MoveTo(const Index: Integer);
    procedure RevertLocation;
  end;

  INxDBCell = interface(INxCell)
    ['{8F4882FA-9081-452B-85D6-AF0A5BE4FC18}']
  end;

  INxFieldCell = interface
    ['{5EF1A5BF-A4B6-475E-AA4C-F984085911E9}']
    function GetField: TField;
    property Field: TField read GetField;
  end;

  { TNxFieldCell }

  TNxFieldCell = class(TNxCell6, INxFieldCell)
  private
    FActiveRecord: Integer;
    FExpandContent: Boolean;
    FField: TField;
    FNullText: WideString;
    FOwner: INxCells;
    FText: WideString;
    { Property Accessors }
    function GetField: TField;
    procedure SetField(const Value: TField);
    procedure SetNullText(const Value: WideString);
  protected
    procedure AssignField; virtual;
    procedure GetFieldDisplayText;
    { TNxCell6 }
    procedure Changed(UpdateSpread: TNxCellUpdateSpread = cuCell); override;
    { INxBase }
    function GetAsString: WideString; override;

    function GetOwner: INxCells; override;
    { Positioning }
    procedure MoveTo;
    procedure MoveBack;
  public
    constructor Create(AOwner: INxCells); reintroduce;
    { Methods }
    function HasOwner: Boolean; override;
    { Properties }
    property ActiveRecord: Integer read FActiveRecord write FActiveRecord;
    property ExpandContent: Boolean read FExpandContent write FExpandContent;
    property Field: TField read GetField write SetField;
    property NullText: WideString read FNullText write SetNullText;
  end;

  { TNxBooleanFieldCell }

  TNxBooleanFieldCell = class(TNxFieldCell)
  private
    { Fields }
    FValue: Boolean;
  protected
    procedure AssignField; override;
    function GetAsBoolean: Boolean; override;
    function GetAsFloat: Double; override;
    function GetAsInteger: Integer; override;
    procedure SetAsBoolean(const Value: Boolean); override;
    procedure SetAsInteger(const Value: Integer); override;
    procedure SetAsFloat(const Value: Double); override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignValue(Source: INxBase); override;
    procedure SetDummyValue; override;
  end;

  { TNxDateTimeFieldCell }

  TNxDateTimeFieldCell = class(TNxFieldCell)
  private
    { Fields }
    FValue: TDateTime;
  protected
    procedure AssignField; override;
    function GetAsDateTime: TDateTime; override;
    procedure SetAsDateTime(const Value: TDateTime); override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignValue(Source: INxBase); override;
    procedure SetDummyValue; override;
  end;

  { TNxStringFieldCell }

  TNxStringFieldCell = class(TNxFieldCell)
  private
    { Fields }
  protected
    function GetAsBoolean: Boolean; override;
    function GetAsFloat: Double; override;
    function GetAsInteger: Integer; override;
    procedure SetAsFloat(const Value: Double); override;
    procedure SetAsInteger(const Value: Integer); override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignValue(Source: INxBase); override;
    procedure SetDummyValue; override;
  end;

  { TNxFloatFieldCell }

  TNxFloatFieldCell = class(TNxFieldCell)
  private
    { Fields }
    FValue: Double;
  protected
    procedure AssignField; override;
    function GetAsBoolean: Boolean; override;
    function GetAsFloat: Double; override;
    function GetAsInteger: Integer; override;
    procedure SetAsFloat(const Value: Double); override;
    procedure SetAsInteger(const Value: Integer); override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignValue(Source: INxBase); override;
    procedure SetDummyValue; override;
  end;

  { TNxIntegerFieldCell }

  TNxIntegerFieldCell = class(TNxFieldCell)
  private
    { Fields }
    FValue: Integer;
  protected
    procedure AssignField; override;
    function GetAsFloat: Double; override;
    function GetAsInteger: Integer; override;
    procedure SetAsInteger(const Value: Integer); override;
    procedure SetAsFloat(const Value: Double); override;
    procedure SetAsString(const Value: WideString); override;
  public
    procedure AssignValue(Source: INxBase); override;
    procedure SetDummyValue; override;
  end;

  { TNxAutoIncFieldCell }

  TNxAutoIncFieldCell = class(TNxFieldCell)
  private
    { Fields }
    FValue: Integer;
  protected
    function GetAsInteger: Integer; override;
    function GetAsString: WideString; override;
    procedure SetAsInteger(const Value: Integer); override;
  public
    procedure SetDummyValue; override;
  end;

  { TNxLookupFieldCell }

  TNxLookupFieldCell = class(TNxFieldCell)
  private
  end;

  TNxRecordRow6 = class;

  { TNxRecord }

  INxRecord = interface
    ['{CEDDBF85-D063-47C9-A91A-992480378D88}']
    function GetBookmark: TBookmark;
    function GetRecordIndex: Integer;
    procedure SetBookmark(const Value: TBookmark);
    procedure SetRecordIndex(const Value: Integer);
    property Bookmark: TBookmark read GetBookmark write SetBookmark;
    property RecordIndex: Integer read GetRecordIndex write SetRecordIndex;
  end;

  TNxRecord = class(TInterfacedObject, INxRecord)
  private
    FBookmark: TBookmark;
    FRecordIndex: Integer;
    function GetBookmark: TBookmark;
    function GetRecordIndex: Integer;
    procedure SetBookmark(const Value: TBookmark);
    procedure SetRecordIndex(const Value: Integer);
  public
    constructor Create;
    property Bookmark: TBookmark read GetBookmark write SetBookmark;
    property RecordIndex: Integer read GetRecordIndex write SetRecordIndex;
  end;

  INxRecordOwner = interface
    ['{E21FB190-B28E-46BD-881C-3531931DF1F1}']
    function GetRowHeight: Integer;
    procedure AddRecordToList(ARecord: INxRecord);
    procedure RemoveRecordFromList(ARecord: INxRecord);
    procedure Invalidate;
  end;

  { TNxRecordRow6 }

  INxRecordRow = interface
    ['{67D53056-21F0-4BB0-8C5C-CB3C4E739CFE}']
    function GetSelected: Boolean;
    function IsStoreNeeded: Boolean;
    procedure SetIndex(const Value: Integer);
    procedure SetSelected(const Value: Boolean);
    property Selected: Boolean read GetSelected write SetSelected;
  end;

  TNxRecordRow6 = class(TNxRecord, INxRow, INxRecord, INxRecordRow)
  private
    FHeight: Integer;
    FIndex: Integer;
    FOwner: INxRecordOwner;
    FSelected: Boolean;
  private
    function GetAbsoluteIndex: Integer;
    function GetChildRow(const Index: Integer): INxRow;
    function GetChildRowCount: Integer;
    function GetChildShowingCount: Integer;
    function GetCovered: Boolean;
    function GetData: Pointer;
    function GetExpanded: Boolean;
    function GetFiltered: Boolean;
    function GetFirstChild: INxRow;
    function GetHeight: Integer;
    function GetImageIndex: TImageIndex;
    function GetIndex: Integer;
    function GetLastChild: INxRow;
    function GetLastDescendant: INxRow;
    function GetLevel: Integer;
    function GetParentRow: INxRow;
    function GetRefCount: Integer;
    function GetSelected: Boolean;
    function GetShowing: Boolean;
    function GetShowingCount: Integer;
    function GetTag: LongInt;
    function GetVisible: Boolean;
    procedure SetData(const Value: Pointer);
    procedure SetExpanded(const Value: Boolean);
    procedure SetFiltered(const Value: Boolean);
    procedure SetHeight(const Value: Integer);
    procedure SetImageIndex(const Value: TImageIndex);
    procedure SetIndex(const Value: Integer);
    procedure SetParentRow(const Value: INxRow);
    procedure SetSelected(const Value: Boolean);
    procedure SetTag(const Value: LongInt);
    procedure SetVisible(const Value: Boolean);
  protected
    function IsStoreNeeded: Boolean;
  public
    constructor Create(AOwner: INxRecordOwner);

    procedure Add(Parent: INxRow);
    procedure Insert(Parent: INxRow; Index: Integer);

    { Methods }
    procedure AddChildRow(AChildRow: INxRow); overload;
    function AddChildRow(const Count: Integer = 1;
      IgnoreDefaults: Boolean = True): INxCellsRow; overload;
    function AddSiblingRow(const Count: Integer = 1;
      IgnoreDefaults: Boolean = True): INxCellsRow;
    function ChildsShown: Boolean;
    procedure ClearChildren;
    procedure Cleanup;
    procedure Collapse(Recurse: Boolean);
    procedure Delete;
    procedure DeleteChildRow(const Index: Integer);
    procedure Expand(Recurse: Boolean);
    function HasChildren: Boolean;
    function HasParent: Boolean;
    procedure Hide;
    function IndexOf(ChildRow: INxRow): Integer;

    procedure InsertChildRow(Index: Integer; ARow: INxRow); overload;

    function InsertChildRow(const Position, Count: Integer;
      IgnoreDefaults: Boolean = True): INxCellsRow; overload;

    function IsAscendant(AscendantRow: INxRow): Boolean;
    function IsDescendant(DescendantRow: INxRow): Boolean;
    function IsTopLevel: Boolean;
    function IsParentOf(Row: INxRow): Boolean;
    procedure MoveTo(NewParent: INxRow; Position: Integer = -1);
    function NextSibling: INxRow;
    function PrevSibling: INxRow;
    procedure Show;
    procedure ToggleExpanded;
  end;

var
  AutoPostEdit: Boolean = False;

implementation

uses
  Math;

{ TNxFieldCell }

procedure TNxFieldCell.AssignField;
begin
  IsNull := FField.IsNull;
  GetFieldDisplayText;
end;

procedure TNxFieldCell.Changed(UpdateSpread: TNxCellUpdateSpread);
begin
  FOwner.Control.CellChanged(Self, UpdateSpread);
end;

constructor TNxFieldCell.Create;
begin
  inherited Create;

  { Init. }
  FActiveRecord := -1;
  FExpandContent := False;
  FField := nil;
  FNullText := '';
  FOwner := AOwner;
end;

function TNxFieldCell.GetAsString: WideString;
begin
  Result := FText;
end;

function TNxFieldCell.GetField: TField;
begin
  Result := FField;
end;

procedure TNxFieldCell.GetFieldDisplayText;
begin
  if FField.IsNull then FText := FNullText else
  begin

    if FExpandContent
      then FText := FField.AsString { BLOB's content }
      else FText := FField.DisplayText;

  end;
end;

function TNxFieldCell.GetOwner: INxCells;
begin
  Result := FOwner;
end;

function TNxFieldCell.HasOwner: Boolean;
begin
  Result := True;
end;

procedure TNxFieldCell.MoveBack;
var
  Ref: INxDBCells;
begin
  if Supports(Owner, INxDBCells, Ref) then Ref.RevertLocation;
end;

procedure TNxFieldCell.MoveTo;
var
  Ref: INxDBCells;
begin
  if Supports(Owner, INxDBCells, Ref) then Ref.MoveTo(FActiveRecord);
end;

procedure TNxFieldCell.SetField(const Value: TField);
begin
  FField := Value;
  if Assigned(FField) then AssignField;
end;

procedure TNxFieldCell.SetNullText(const Value: WideString);
begin
  FNullText := Value;
end;

{ TNxBooleanFieldCell }

procedure TNxBooleanFieldCell.AssignField;
begin
  inherited;
  FValue := FField.AsBoolean;
end;

procedure TNxBooleanFieldCell.AssignValue(Source: INxBase);
begin
  AsBoolean := Source.AsBoolean;
end;

function TNxBooleanFieldCell.GetAsBoolean: Boolean;
begin
  Result := FValue;
end;

function TNxBooleanFieldCell.GetAsFloat: Double;
begin
  Result := IfThen(AsBoolean, 1, 0);
end;

function TNxBooleanFieldCell.GetAsInteger: Integer;
begin
  Result := IfThen(AsBoolean, 1, 0);
end;

procedure TNxBooleanFieldCell.SetAsBoolean(const Value: Boolean);
begin
  if (Field <> nil) and Field.CanModify then
  begin
    try
      Field.DataSet.DisableControls;
      MoveTo;
      Field.DataSet.Edit;
      Field.AsBoolean := Value;
      if AutoPostEdit then Field.DataSet.Post;
    finally
      MoveBack;
      Field.DataSet.EnableControls;
    end;
    AssignField; { Set FText & FValue }
  end;

  inherited; { Notify }
end;

procedure TNxBooleanFieldCell.SetAsFloat(const Value: Double);
begin
  AsBoolean := Value = 1;
end;

procedure TNxBooleanFieldCell.SetAsInteger(const Value: Integer);
begin
  AsBoolean := Value = 1;
end;

procedure TNxBooleanFieldCell.SetAsString(const Value: WideString);
begin
  AsBoolean := StrToBoolEx(Value);
end;

procedure TNxBooleanFieldCell.SetDummyValue;
begin
  AsBoolean := True;
end;

{ TNxDateTimeFieldCell }

procedure TNxDateTimeFieldCell.AssignField;
begin
  inherited;
  FValue := FField.AsDateTime;
end;

procedure TNxDateTimeFieldCell.AssignValue(Source: INxBase);
begin
  AsDateTime := Source.AsDateTime;
end;

function TNxDateTimeFieldCell.GetAsDateTime: TDateTime;
begin
  Result := FValue;
end;

procedure TNxDateTimeFieldCell.SetAsDateTime(const Value: TDateTime);
begin
  if (Field <> nil) and Field.CanModify then
  begin
    try
      Field.DataSet.DisableControls;
      Field.DataSet.Edit;
      MoveTo;
      Field.AsDateTime := Value;
      if AutoPostEdit then Field.DataSet.Post;
    finally
      MoveBack;
      Field.DataSet.EnableControls;
    end;
    AssignField; { Set FText & FValue }
  end;

  inherited; { Notify }
end;

procedure TNxDateTimeFieldCell.SetAsString(const Value: WideString);
var
  DateTimeValue: TDateTime;
begin
  if TryStrToDateTime(Value, DateTimeValue) then
  begin
    AsDateTime := DateTimeValue;
  end;
end;

procedure TNxDateTimeFieldCell.SetDummyValue;
begin
  AsDateTime := Now;
end;

{ TNxStringFieldCell }

procedure TNxStringFieldCell.AssignValue(Source: INxBase);
begin
  AsString := Source.AsString;
end;

function TNxStringFieldCell.GetAsBoolean: Boolean;
begin
  Result := StrToBoolEx(FText);
end;

function TNxStringFieldCell.GetAsFloat: Double;
begin
  Result := StrToFloatDef(FText, 0);
end;

function TNxStringFieldCell.GetAsInteger: Integer;
begin
  Result := StrToIntDef(FText, 0);
end;

procedure TNxStringFieldCell.SetAsFloat(const Value: Double);
begin
  AsString := FloatToStr(Value);
end;

procedure TNxStringFieldCell.SetAsInteger(const Value: Integer);
begin
  AsString := IntToStr(Value);
end;

procedure TNxStringFieldCell.SetAsString(const Value: WideString);
begin
  if (Field <> nil) and Field.CanModify then
  begin
    try
      Field.DataSet.DisableControls;
      MoveTo;
      Field.DataSet.Edit;
      Field.AsString := Value;
      if AutoPostEdit then Field.DataSet.Post;
    finally
      MoveBack;
      Field.DataSet.EnableControls;
    end;
    AssignField; { Set FText }
  end;

  inherited; { Notify }
end;

procedure TNxStringFieldCell.SetDummyValue;
begin
  AsString := 'Next';
end;

{ TNxFloatFieldCell }

procedure TNxFloatFieldCell.AssignField;
begin
  inherited;
  FValue := FField.AsFloat;
end;

procedure TNxFloatFieldCell.AssignValue(Source: INxBase);
begin
  AsFloat := Source.AsFloat;
end;

function TNxFloatFieldCell.GetAsBoolean: Boolean;
begin
  Result := FValue = 1;
end;

function TNxFloatFieldCell.GetAsFloat: Double;
begin
  Result := FValue;
end;

function TNxFloatFieldCell.GetAsInteger: Integer;
begin
  Result := Round(FValue);
end;

procedure TNxFloatFieldCell.SetAsFloat(const Value: Double);
begin
  FValue := Value;
  if (Field <> nil) and Field.CanModify then
  begin
    try
      Field.DataSet.DisableControls;
      MoveTo;
      Field.DataSet.Edit;
      Field.AsFloat := Value;
      if AutoPostEdit then Field.DataSet.Post;
    finally
      MoveBack;
      Field.DataSet.EnableControls;
    end;
    AssignField; { Set FText }
  end;

  inherited; { Notify }
end;

procedure TNxFloatFieldCell.SetAsInteger(const Value: Integer);
begin
  AsFloat := Value;
end;

procedure TNxFloatFieldCell.SetAsString(const Value: WideString);
begin
  AsFloat := StrToFloat(Value);
end;

procedure TNxFloatFieldCell.SetDummyValue;
begin
  AsFloat := 1234.5;
end;

{ TNxIntegerFieldCell }

procedure TNxIntegerFieldCell.AssignField;
begin
  inherited;
  FValue := FField.AsInteger;
end;

procedure TNxIntegerFieldCell.AssignValue(Source: INxBase);
begin
  AsInteger := Source.AsInteger;
end;

function TNxIntegerFieldCell.GetAsFloat: Double;
begin
  Result := FValue;
end;

function TNxIntegerFieldCell.GetAsInteger: Integer;
begin
  Result := FValue;
end;

procedure TNxIntegerFieldCell.SetAsFloat(const Value: Double);
begin
  AsInteger := Round(Value);
end;

procedure TNxIntegerFieldCell.SetAsInteger(const Value: Integer);
begin
  FValue := Value;
  if (Field <> nil) and Field.CanModify then
  begin
    try
      Field.DataSet.DisableControls;
      MoveTo;
      Field.DataSet.Edit;
      Field.AsInteger := Value;
      if AutoPostEdit then Field.DataSet.Post;
    finally
      MoveBack;
      Field.DataSet.EnableControls;
    end;
    AssignField; { Set FText }
  end;

  inherited; { Notify }
end;

procedure TNxIntegerFieldCell.SetAsString(const Value: WideString);
begin
  AsInteger := StrToInt(Value);
end;

procedure TNxIntegerFieldCell.SetDummyValue;
begin
  AsInteger := 123;
end;

{ TNxAutoIncFieldCell }

function TNxAutoIncFieldCell.GetAsInteger: Integer;
begin
  Result := FValue;
end;

function TNxAutoIncFieldCell.GetAsString: WideString;
begin
  Result := IntToStr(AsInteger);
end;

procedure TNxAutoIncFieldCell.SetAsInteger(const Value: Integer);
begin
  FValue := Value;
  { note: don't call inherited here }
end;

procedure TNxAutoIncFieldCell.SetDummyValue;
begin
  AsInteger := 1;
end;

{ TNxRecord }

constructor TNxRecord.Create;
begin
  FRecordIndex := -1;
end;

function TNxRecord.GetBookmark: TBookmark;
begin
  Result := FBookmark;
end;

function TNxRecord.GetRecordIndex: Integer;
begin
  Result := FRecordIndex;
end;

procedure TNxRecord.SetBookmark(const Value: TBookmark);
begin
  FBookmark := Value;
end;

procedure TNxRecord.SetRecordIndex(const Value: Integer);
begin
  FRecordIndex := Value;
end;

{ TNxRecordRow6 }

procedure TNxRecordRow6.AddChildRow(AChildRow: INxRow);
begin

end;

procedure TNxRecordRow6.Add(Parent: INxRow);
begin

end;

function TNxRecordRow6.AddChildRow(const Count: Integer;
  IgnoreDefaults: Boolean): INxCellsRow;
begin
  Result := nil;
end;

function TNxRecordRow6.AddSiblingRow(const Count: Integer; IgnoreDefaults: Boolean): INxCellsRow;
begin
  Result := nil;
end;

function TNxRecordRow6.ChildsShown: Boolean;
begin
  Result := False;
end;

procedure TNxRecordRow6.Cleanup;
begin

end;

procedure TNxRecordRow6.ClearChildren;
begin

end;

procedure TNxRecordRow6.Collapse(Recurse: Boolean);
begin

end;

constructor TNxRecordRow6.Create(AOwner: INxRecordOwner);
begin
  FHeight := 0;
  FOwner := AOwner;
  FSelected := False;
end;

procedure TNxRecordRow6.Delete;
begin

end;

procedure TNxRecordRow6.DeleteChildRow(const Index: Integer);
begin

end;

procedure TNxRecordRow6.Expand(Recurse: Boolean);
begin

end;

function TNxRecordRow6.GetAbsoluteIndex: Integer;
begin
  Result := 0;
end;

function TNxRecordRow6.GetChildRow(const Index: Integer): INxRow;
begin
  Result := nil;
end;

function TNxRecordRow6.GetChildRowCount: Integer;
begin
  Result := 0;
end;

function TNxRecordRow6.GetChildShowingCount: Integer;
begin
  Result := 0;
end;

function TNxRecordRow6.GetCovered: Boolean;
begin
  Result := False;
end;

function TNxRecordRow6.GetData: Pointer;
begin
  Result := nil;
end;

function TNxRecordRow6.GetExpanded: Boolean;
begin
  Result := True;
end;

function TNxRecordRow6.GetFiltered: Boolean;
begin
  Result := False;
end;

function TNxRecordRow6.GetFirstChild: INxRow;
begin
  Result := nil;
end;

function TNxRecordRow6.GetHeight: Integer;
begin
  if FHeight > 0 then Result := FHeight else Result := FOwner.GetRowHeight;
end;

function TNxRecordRow6.GetImageIndex: TImageIndex;
begin
  Result := -1;
end;

function TNxRecordRow6.GetIndex: Integer;
begin
  Result := FIndex;
end;

function TNxRecordRow6.GetLastChild: INxRow;
begin
  Result := nil;
end;

function TNxRecordRow6.GetLastDescendant: INxRow;
begin
  Result := nil;
end;

function TNxRecordRow6.GetLevel: Integer;
begin
  Result := 0;
end;

function TNxRecordRow6.GetParentRow: INxRow;
begin
  Result := nil;
end;

function TNxRecordRow6.GetRefCount: Integer;
begin
  Result := 0;
end;

function TNxRecordRow6.GetSelected: Boolean;
begin
  Result := FSelected;
end;

function TNxRecordRow6.GetShowing: Boolean;
begin
  Result := True;
end;

function TNxRecordRow6.GetShowingCount: Integer;
begin
  Result := 0;
end;

function TNxRecordRow6.GetTag: LongInt;
begin
  Result := 0;
end;

function TNxRecordRow6.GetVisible: Boolean;
begin
  Result := True;
end;

function TNxRecordRow6.HasChildren: Boolean;
begin
  Result := False;
end;

function TNxRecordRow6.HasParent: Boolean;
begin
  Result := False;
end;

procedure TNxRecordRow6.Hide;
begin

end;

function TNxRecordRow6.IndexOf(ChildRow: INxRow): Integer;
begin
  Result := -1;
end;

procedure TNxRecordRow6.Insert(Parent: INxRow; Index: Integer);
begin

end;

procedure TNxRecordRow6.InsertChildRow(Index: Integer; ARow: INxRow);
begin

end;

function TNxRecordRow6.InsertChildRow(const Position, Count: Integer;
  IgnoreDefaults: Boolean): INxCellsRow;
begin

end;

function TNxRecordRow6.IsParentOf(Row: INxRow): Boolean;
begin
  Result := False;
end;

function TNxRecordRow6.IsStoreNeeded: Boolean;
begin
  Result := (FHeight <> 0) or (FSelected = True);
end;

function TNxRecordRow6.IsTopLevel: Boolean;
begin
  Result := True;
end;

procedure TNxRecordRow6.MoveTo(NewParent: INxRow; Position: Integer);
begin

end;

function TNxRecordRow6.NextSibling: INxRow;
begin
  Result := nil;
end;

function TNxRecordRow6.PrevSibling: INxRow;
begin
  Result := nil;
end;

procedure TNxRecordRow6.SetData(const Value: Pointer);
begin

end;

procedure TNxRecordRow6.SetExpanded(const Value: Boolean);
begin

end;

procedure TNxRecordRow6.SetFiltered(const Value: Boolean);
begin

end;

procedure TNxRecordRow6.SetHeight(const Value: Integer);
begin
  if Value <> FHeight then
  begin
    FHeight := Value;
    if FHeight <> 0 then FOwner.AddRecordToList(Self as INxRecord) else
    begin
      if not IsStoreNeeded then
      begin
        FOwner.RemoveRecordFromList(Self as INxRecord);
      end;
    end;
    FOwner.Invalidate;
  end;
end;

procedure TNxRecordRow6.SetImageIndex(const Value: TImageIndex);
begin

end;

procedure TNxRecordRow6.SetIndex(const Value: Integer);
begin
  FIndex := Value;
end;

procedure TNxRecordRow6.SetParentRow(const Value: INxRow);
begin

end;

procedure TNxRecordRow6.SetSelected(const Value: Boolean);
begin
  if Value <> FSelected then
  begin
    FSelected := Value;
    if IsStoreNeeded then FOwner.AddRecordToList(Self as INxRecord);
  end;
end;

procedure TNxRecordRow6.SetTag(const Value: Integer);
begin

end;

procedure TNxRecordRow6.SetVisible(const Value: Boolean);
begin

end;

procedure TNxRecordRow6.Show;
begin

end;

procedure TNxRecordRow6.ToggleExpanded;
begin

end;

function TNxRecordRow6.IsAscendant(AscendantRow: INxRow): Boolean;
begin
  Result := False;
end;

function TNxRecordRow6.IsDescendant(DescendantRow: INxRow): Boolean;
begin
  Result := False;
end;

end.
