lazspreadsheet: Improves debug tool

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2605 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2012-12-27 15:33:51 +00:00
parent d5f6b62914
commit eb0708fe6a
2 changed files with 15 additions and 12 deletions

View File

@ -1,7 +1,7 @@
object lazfpsmainform: Tlazfpsmainform object lazfpsmainform: Tlazfpsmainform
Left = 234 Left = 234
Height = 401 Height = 401
Top = 170 Top = 195
Width = 700 Width = 700
Caption = 'LazSpreadsheet' Caption = 'LazSpreadsheet'
ClientHeight = 401 ClientHeight = 401
@ -11,19 +11,19 @@ object lazfpsmainform: Tlazfpsmainform
LCLVersion = '1.1' LCLVersion = '1.1'
object pagesSheets: TPageControl object pagesSheets: TPageControl
Left = 0 Left = 0
Height = 321 Height = 289
Top = 80 Top = 112
Width = 700 Width = 700
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
end end
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Height = 80 Height = 112
Top = 0 Top = 0
Width = 700 Width = 700
Align = alTop Align = alTop
ClientHeight = 80 ClientHeight = 112
ClientWidth = 700 ClientWidth = 700
TabOrder = 1 TabOrder = 1
object btnLoadSpreadsheet: TButton object btnLoadSpreadsheet: TButton
@ -57,22 +57,23 @@ object lazfpsmainform: Tlazfpsmainform
ParentColor = False ParentColor = False
end end
object buttonReadCellInfo: TButton object buttonReadCellInfo: TButton
Left = 384 Left = 296
Height = 25 Height = 25
Top = 8 Top = 72
Width = 120 Width = 120
Caption = 'Read Cell Info' Caption = 'Read Cell Info'
OnClick = buttonReadCellInfoClick OnClick = buttonReadCellInfoClick
TabOrder = 2 TabOrder = 2
end end
object memoCellData: TMemo object memoCellData: TMemo
Left = 512 Left = 424
Height = 64 Height = 96
Top = 8 Top = 8
Width = 182 Width = 230
Lines.Strings = ( Lines.Strings = (
'memoCellData' 'memoCellData'
) )
ScrollBars = ssVertical
TabOrder = 3 TabOrder = 3
end end
end end

View File

@ -86,9 +86,9 @@ begin
lX := Worksheets[lCurTab].Selection.Left; lX := Worksheets[lCurTab].Selection.Left;
lY := Worksheets[lCurTab].Selection.Top; lY := Worksheets[lCurTab].Selection.Top;
lCurWorksheet := Workbook.GetWorksheetByIndex(lCurTab); lCurWorksheet := Workbook.GetWorksheetByIndex(lCurTab);
lCurCell := lCurWorksheet.GetCell(lX, lY); lCurCell := lCurWorksheet.GetCell(lY, lX);
memoCellData.Lines.Text := ''; memoCellData.Lines.Text := '';
memoCellData.Lines.Add(Format('Col: %d Row: %d (zero-based)', [lX, lY])); memoCellData.Lines.Add(Format('Row: %d Col: %d (zero-based)', [lY, lX]));
memoCellData.Lines.Add(Format('ContentType: %s', [GetEnumName(TypeInfo(TCellContentType), integer(lCurCell^.ContentType))])); memoCellData.Lines.Add(Format('ContentType: %s', [GetEnumName(TypeInfo(TCellContentType), integer(lCurCell^.ContentType))]));
memoCellData.Lines.Add(Format('NumberValue: %f', [lCurCell^.NumberValue])); memoCellData.Lines.Add(Format('NumberValue: %f', [lCurCell^.NumberValue]));
memoCellData.Lines.Add(Format('UTF8StringValue: %s', [lCurCell^.UTF8StringValue])); memoCellData.Lines.Add(Format('UTF8StringValue: %s', [lCurCell^.UTF8StringValue]));
@ -97,6 +97,8 @@ begin
memoCellData.Lines.Add(Format('TextRotation: %s', [GetEnumName(TypeInfo(TsTextRotation), integer(lCurCell^.TextRotation))])); memoCellData.Lines.Add(Format('TextRotation: %s', [GetEnumName(TypeInfo(TsTextRotation), integer(lCurCell^.TextRotation))]));
//memoCellData.Lines.Add(Format('Border: %f', [lCurCell^.NumberValue])); //memoCellData.Lines.Add(Format('Border: %f', [lCurCell^.NumberValue]));
memoCellData.Lines.Add(Format('BackgroundColor: %s', [GetEnumName(TypeInfo(TsColor), integer(lCurCell^.BackgroundColor))])); memoCellData.Lines.Add(Format('BackgroundColor: %s', [GetEnumName(TypeInfo(TsColor), integer(lCurCell^.BackgroundColor))]));
memoCellData.Lines.Add('');
memoCellData.Lines.Add(Format('ReadAsUTF8Text(): %s', [lCurWorksheet.ReadAsUTF8Text(lY, lX)]));
end; end;
procedure Tlazfpsmainform.DeleteAllSheets; procedure Tlazfpsmainform.DeleteAllSheets;