unit EBStringGrid2;
interface
uses
SysUtils, Classes, Controls, Grids;
type
TEBStringGrid2 =
class(TStringGrid)
private
FCellInte: Integer;
FCellPCentX: single;
FCellFloat2: single;
FCellPCent2: single;
FCellPCent1: single;
FCellFloatX: single;
FCellPCent3: single;
FCellFloat4: single;
FCellFloat3: single;
FCellFloat1: single;
procedure SetCellFloat1(
const Value: single;i,j:integer);
procedure SetCellFloat2(
const Value: single;i,j:integer);
procedure SetCellFloat3(
const Value: single;i,j:integer);
procedure SetCellFloat4(
const Value: single;i,j:integer);
procedure SetCellFloatX(
const Value: single;i,j:integer);
procedure SetCellInte(
const Value: Integer;i,j:integer);
procedure SetCellPCent1(
const Value: single;i,j:integer);
procedure SetCellPCent2(
const Value: single;i,j:integer);
procedure SetCellPCent3(
const Value: single;i,j:integer);
procedure SetCellPCentX(
const Value: single;i,j:integer);
{ Private-Deklarationen }
protected
{ Protected-Deklarationen }
public
{ Public-Deklarationen }
published
{ Published-Deklarationen }
property CellFloatX:single
read FCellFloatX
write SetCellFloatX(i,j:integer);
//*in dieser Zeile
property CellFloat1:single
read FCellFloat1
write SetCellFloat1(i,j:integer);
// kommt die
property CellFloat2:single
read FCellFloat2
write SetCellFloat2(i,j:integer);
// Fehlermeldung
property CellFloat3:single
read FCellFloat3
write SetCellFloat3(i,j:integer);
property CellFloat4:single
read FCellFloat4
write SetCellFloat4(i,j:integer);
property CellPCentX:single
read FCellPCentX
write SetCellPCentX(i,j:integer);
property CellPCent1:single
read FCellPCent1
write SetCellPCent1(i,j:integer);
property CellPCent2:single
read FCellPCent2
write SetCellPCent2(i,j:integer);
property CellPCent3:single
read FCellPCent3
write SetCellPCent3(i,j:integer);
property CellInte:Integer
read FCellInte
write SetCellInte(i,j:integer);
end;
procedure Register;
implementation
{ TEBStringGrid2 }
procedure TEBStringGrid2.SetCellFloat1(
const Value: single;i,j:integer);
begin
FCellFloat1 := roundTo(Value,-1);
Cells[i,j]:=FloatToStr(FCellFloat1);
end;
procedure TEBStringGrid2.SetCellFloat2(
const Value: single;i,j:integer);
begin
FCellFloat2 := roundTo(Value,-2);
Cells[i,j]:=FloatToStr(FCellFloat2);
end;
procedure TEBStringGrid2.SetCellFloat3(
const Value: single;i,j:integer);
begin
FCellFloat3 := roundTo(Value,-3);
Cells[i,j]:=FloatToStr(FCellFloat3);
end;
procedure TEBStringGrid2.SetCellFloat4(
const Value: single;i,j:integer);
begin
FCellFloat4 := roundTo(Value,-4);
Cells[i,j]:=FloatToStr(FCellFloat4);
end;
procedure TEBStringGrid2.SetCellFloatX(
const Value: single;i,j:integer);
begin
FCellFloatX := Value;
Cells[i,j]:=FloatToStr(FCellFloatX);
end;
procedure TEBStringGrid2.SetCellInte(
const Value: Integer;i,j:integer);
begin
FCellInte := Value;
Cells[i,j]:=IntToStr(FCellInte);
end;
procedure TEBStringGrid2.SetCellPCent1(
const Value: single;i,j:integer);
begin
FCellPCent1 := roundTo(100*Value,-1);
Cells[i,j]:=FloatToStr(FCellPCent1);
end;
procedure TEBStringGrid2.SetCellPCent2(
const Value: single;i,j:integer);
begin
FCellPCent2 := roundTo(100*Value,-2);
Cells[i,j]:=FloatToStr(FCellPCent2);
end;
procedure TEBStringGrid2.SetCellPCent3(
const Value: single;i,j:integer);
begin
FCellPCent3 := roundTo(100*Value,-3);
Cells[i,j]:=FloatToStr(FCellPCent3);
end;
procedure TEBStringGrid2.SetCellPCentX(
const Value: single;i,j:integer);
begin
FCellPCentX := 100*Value;
Cells[i,j]:=FloatToStr(FCellPCentX);
end;
procedure Register;
begin
RegisterComponents('
EB_Tools', [TEBStringGrid2]);
end;
end.