unit Unit1;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, NxGridView6, NxColumns6, NxControls6,
  NxCustomGrid6, NxGrid6, Vcl.StdCtrls, NxTypes6, ExtCtrls, NxVirtualGrid6;

type
  TForm1 = class(TForm)
    NextGrid61: TNextGrid6;
    NxReportGridView61: TNxReportGridView6;
    NxTextColumn61: TNxTextColumn6;
    Button1: TButton;
    NxCheckBoxColumn61: TNxCheckBoxColumn6;
    NxTrackbarColumn61: TNxTrackbarColumn6;
    procedure Button1Click(Sender: TObject);
    procedure NextGrid61CellClick(Sender: TObject; ACol, ARow: Integer;
      Button: TMouseButton);
    procedure NextGrid61MouseDown(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure NextGrid61MouseUp(Sender: TObject; Button: TMouseButton;
      Shift: TShiftState; X, Y: Integer);
    procedure NxTextColumn61DrawBackground(Sender: TObject; ACol, ARow: Integer; CellRect: TRect;
      State: TNxCellPaintingState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  NextGrid61.AddRow(1, False);
end;

procedure TForm1.NextGrid61CellClick(Sender: TObject; ACol, ARow: Integer;
  Button: TMouseButton);
begin
  if ACol = 0 then NextGrid61.DeleteRow(ARow);
end;

procedure TForm1.NextGrid61MouseDown(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  NextGrid61.RefreshSelectedCell;
end;

procedure TForm1.NextGrid61MouseUp(Sender: TObject; Button: TMouseButton;
  Shift: TShiftState; X, Y: Integer);
begin
  NextGrid61.RefreshSelectedCell;
end;

procedure TForm1.NxTextColumn61DrawBackground(Sender: TObject; ACol, ARow: Integer; CellRect: TRect;
  State: TNxCellPaintingState);
begin
  with NextGrid61.Canvas do
  begin
    Brush.Color := clBtnFace;
    FillRect(CellRect);
    if csPressed in State then
      Frame3D(NextGrid61.Canvas, CellRect, clBtnShadow, clBtnHighlight, 1)
    else
      Frame3D(NextGrid61.Canvas, CellRect, clBtnHighlight, clBtnShadow, 1);
  end;
end;

end.
