You've already forked lazarus-ccr
fpspreadsheet: Public methods AutoRowHeight and AutoColWidth of the WorksheetGrid. Show value of cell's WordWrap in SpreadsheetInspector.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4880 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@@ -7819,7 +7819,7 @@ procedure TsWorkbook.RemoveWorksheet(AWorksheet: TsWorksheet);
|
|||||||
var
|
var
|
||||||
i: Integer;
|
i: Integer;
|
||||||
begin
|
begin
|
||||||
if GetWorksheetCount > 1 then // There must be at least 1 worksheet!
|
if GetWorksheetCount > 1 then // There must be at least 1 worksheet left!
|
||||||
begin
|
begin
|
||||||
i := GetWorksheetIndex(AWorksheet);
|
i := GetWorksheetIndex(AWorksheet);
|
||||||
if (i <> -1) and (AWorksheet <> nil) then
|
if (i <> -1) and (AWorksheet <> nil) then
|
||||||
|
@@ -3020,6 +3020,12 @@ begin
|
|||||||
GetEnumName(TypeInfo(TsVertAlignment), ord(fmt.VertAlignment))
|
GetEnumName(TypeInfo(TsVertAlignment), ord(fmt.VertAlignment))
|
||||||
]));
|
]));
|
||||||
|
|
||||||
|
if (ACell=nil) or not (uffWordwrap in fmt.UsedFormattingFields)
|
||||||
|
then AStrings.Add('Wordwrap=(default)')
|
||||||
|
else AStrings.Add(Format('Wordwrap=%s', [
|
||||||
|
BoolToStr(uffWordwrap in fmt.UsedFormattingFields, true)
|
||||||
|
]));
|
||||||
|
|
||||||
if (ACell=nil) or not (uffBorder in fmt.UsedFormattingFields) then
|
if (ACell=nil) or not (uffBorder in fmt.UsedFormattingFields) then
|
||||||
AStrings.Add('Borders=(none)')
|
AStrings.Add('Borders=(none)')
|
||||||
else
|
else
|
||||||
|
@@ -119,7 +119,7 @@ type
|
|||||||
function GetNumberFormats(ALeft, ATop, ARight, ABottom: Integer): String;
|
function GetNumberFormats(ALeft, ATop, ARight, ABottom: Integer): String;
|
||||||
function GetRowHeights(ARow: Integer): Integer;
|
function GetRowHeights(ARow: Integer): Integer;
|
||||||
function GetShowGridLines: Boolean;
|
function GetShowGridLines: Boolean;
|
||||||
function GetShowHeaders: Boolean;
|
function GetShowHeaders: Boolean; inline;
|
||||||
function GetTextRotation(ACol, ARow: Integer): TsTextRotation;
|
function GetTextRotation(ACol, ARow: Integer): TsTextRotation;
|
||||||
function GetTextRotations(ALeft, ATop, ARight, ABottom: Integer): TsTextRotation;
|
function GetTextRotations(ALeft, ATop, ARight, ABottom: Integer): TsTextRotation;
|
||||||
function GetVertAlignment(ACol, ARow: Integer): TsVertAlignment;
|
function GetVertAlignment(ACol, ARow: Integer): TsVertAlignment;
|
||||||
@@ -273,6 +273,8 @@ type
|
|||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
procedure BeginUpdate;
|
procedure BeginUpdate;
|
||||||
|
procedure AutoColWidth(ACol: Integer);
|
||||||
|
procedure AutoRowHeight(ARow: Integer);
|
||||||
function CellRect(ACol1, ARow1, ACol2, ARow2: Integer): TRect; overload;
|
function CellRect(ACol1, ARow1, ACol2, ARow2: Integer): TRect; overload;
|
||||||
procedure Clear;
|
procedure Clear;
|
||||||
procedure DefaultDrawCell(ACol, ARow: Integer; var ARect: TRect; AState: TGridDrawState); override;
|
procedure DefaultDrawCell(ACol, ARow: Integer; var ARect: TRect; AState: TGridDrawState); override;
|
||||||
@@ -1008,6 +1010,16 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TsCustomWorksheetGrid.AutoColWidth(ACol: Integer);
|
||||||
|
begin
|
||||||
|
AutoAdjustColumn(ACol);
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TscustomWorksheetGrid.AutoRowHeight(ARow: Integer);
|
||||||
|
begin
|
||||||
|
AutoAdjustRow(ARow);
|
||||||
|
end;
|
||||||
|
|
||||||
{@@ ----------------------------------------------------------------------------
|
{@@ ----------------------------------------------------------------------------
|
||||||
Is called when goDblClickAutoSize is in the grid's options and a double click
|
Is called when goDblClickAutoSize is in the grid's options and a double click
|
||||||
has occured at the border of a column header. Sets optimum column with.
|
has occured at the border of a column header. Sets optimum column with.
|
||||||
@@ -3027,7 +3039,7 @@ var
|
|||||||
RTL: Boolean;
|
RTL: Boolean;
|
||||||
begin
|
begin
|
||||||
Result := 0;
|
Result := 0;
|
||||||
if ShowHeaders and ((ACol = 0) or (ARow = 0)) then
|
if (ACol < FHeaderCount) or (ARow < FHeaderCount) then
|
||||||
exit;
|
exit;
|
||||||
if Worksheet = nil then
|
if Worksheet = nil then
|
||||||
exit;
|
exit;
|
||||||
@@ -5746,10 +5758,15 @@ procedure TsCustomWorksheetGrid.SetWordwrap(ACol, ARow: Integer;
|
|||||||
var
|
var
|
||||||
cell: PCell;
|
cell: PCell;
|
||||||
begin
|
begin
|
||||||
if Assigned(Worksheet) then
|
if not Assigned(Worksheet) then
|
||||||
begin
|
exit;
|
||||||
|
|
||||||
|
BeginUpdate;
|
||||||
|
try
|
||||||
cell := Worksheet.GetCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
|
cell := Worksheet.GetCell(GetWorksheetRow(ARow), GetWorksheetCol(ACol));
|
||||||
Worksheet.WriteWordwrap(cell, AValue);
|
Worksheet.WriteWordwrap(cell, AValue);
|
||||||
|
finally
|
||||||
|
EndUpdate;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user