From eb0708fe6a9a793957cbdef2edb0e363614ef789 Mon Sep 17 00:00:00 2001 From: sekelsenmat Date: Thu, 27 Dec 2012 15:33:51 +0000 Subject: [PATCH] lazspreadsheet: Improves debug tool git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2605 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- applications/lazspreadsheet/mainform.lfm | 21 +++++++++++---------- applications/lazspreadsheet/mainform.pas | 6 ++++-- 2 files changed, 15 insertions(+), 12 deletions(-) diff --git a/applications/lazspreadsheet/mainform.lfm b/applications/lazspreadsheet/mainform.lfm index 3c95def64..d6b08b109 100644 --- a/applications/lazspreadsheet/mainform.lfm +++ b/applications/lazspreadsheet/mainform.lfm @@ -1,7 +1,7 @@ object lazfpsmainform: Tlazfpsmainform Left = 234 Height = 401 - Top = 170 + Top = 195 Width = 700 Caption = 'LazSpreadsheet' ClientHeight = 401 @@ -11,19 +11,19 @@ object lazfpsmainform: Tlazfpsmainform LCLVersion = '1.1' object pagesSheets: TPageControl Left = 0 - Height = 321 - Top = 80 + Height = 289 + Top = 112 Width = 700 Align = alClient TabOrder = 0 end object Panel1: TPanel Left = 0 - Height = 80 + Height = 112 Top = 0 Width = 700 Align = alTop - ClientHeight = 80 + ClientHeight = 112 ClientWidth = 700 TabOrder = 1 object btnLoadSpreadsheet: TButton @@ -57,22 +57,23 @@ object lazfpsmainform: Tlazfpsmainform ParentColor = False end object buttonReadCellInfo: TButton - Left = 384 + Left = 296 Height = 25 - Top = 8 + Top = 72 Width = 120 Caption = 'Read Cell Info' OnClick = buttonReadCellInfoClick TabOrder = 2 end object memoCellData: TMemo - Left = 512 - Height = 64 + Left = 424 + Height = 96 Top = 8 - Width = 182 + Width = 230 Lines.Strings = ( 'memoCellData' ) + ScrollBars = ssVertical TabOrder = 3 end end diff --git a/applications/lazspreadsheet/mainform.pas b/applications/lazspreadsheet/mainform.pas index d0b8e9fd5..1a8d03ac8 100644 --- a/applications/lazspreadsheet/mainform.pas +++ b/applications/lazspreadsheet/mainform.pas @@ -86,9 +86,9 @@ begin lX := Worksheets[lCurTab].Selection.Left; lY := Worksheets[lCurTab].Selection.Top; lCurWorksheet := Workbook.GetWorksheetByIndex(lCurTab); - lCurCell := lCurWorksheet.GetCell(lX, lY); + lCurCell := lCurWorksheet.GetCell(lY, lX); 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('NumberValue: %f', [lCurCell^.NumberValue])); 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('Border: %f', [lCurCell^.NumberValue])); 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; procedure Tlazfpsmainform.DeleteAllSheets;