lazspreadsheet: Adds a label to show the coordinates of the current cell

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2675 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2013-02-12 12:23:29 +00:00
parent e70e659419
commit b74fcb2b85
4 changed files with 19 additions and 3 deletions

View File

@ -8,7 +8,6 @@
<Title Value="lazspreadsheet"/> <Title Value="lazspreadsheet"/>
<ResourceType Value="res"/> <ResourceType Value="res"/>
<UseXPManifest Value="True"/> <UseXPManifest Value="True"/>
<Icon Value="0"/>
</General> </General>
<i18n> <i18n>
<EnableI18N LFM="False"/> <EnableI18N LFM="False"/>

View File

@ -37,7 +37,7 @@ object lazfpsmainform: Tlazfpsmainform
end end
object editSourceFile: TFileNameEdit object editSourceFile: TFileNameEdit
Left = 136 Left = 136
Height = 21 Height = 23
Top = 8 Top = 8
Width = 136 Width = 136
DialogOptions = [] DialogOptions = []
@ -52,7 +52,7 @@ object lazfpsmainform: Tlazfpsmainform
Left = 8 Left = 8
Height = 15 Height = 15
Top = 14 Top = 14
Width = 116 Width = 106
Caption = 'Source Spreadsheet:' Caption = 'Source Spreadsheet:'
ParentColor = False ParentColor = False
end end
@ -76,5 +76,13 @@ object lazfpsmainform: Tlazfpsmainform
ScrollBars = ssVertical ScrollBars = ssVertical
TabOrder = 3 TabOrder = 3
end end
object labelCurCell: TLabel
Left = 8
Height = 15
Top = 40
Width = 66
Caption = 'Current Cell:'
ParentColor = False
end
end end
end end

View File

@ -20,6 +20,7 @@ type
btnLoadSpreadsheet: TButton; btnLoadSpreadsheet: TButton;
buttonReadCellInfo: TButton; buttonReadCellInfo: TButton;
editSourceFile: TFileNameEdit; editSourceFile: TFileNameEdit;
labelCurCell: TLabel;
Label2: TLabel; Label2: TLabel;
memoCellData: TMemo; memoCellData: TMemo;
pagesSheets: TPageControl; pagesSheets: TPageControl;
@ -30,6 +31,7 @@ type
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
private private
{ private declarations } { private declarations }
procedure HandleSelectionChanged(Sender: TObject; aCol, aRow: Integer);
public public
{ public declarations } { public declarations }
Worksheets: array of TsWorksheetGrid; Worksheets: array of TsWorksheetGrid;
@ -72,6 +74,7 @@ begin
Worksheets[i].Align := alClient; Worksheets[i].Align := alClient;
//Worksheets[i].Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll] //Worksheets[i].Options = [goFixedVertLine, goFixedHorzLine, goVertLine, goHorzLine, goRangeSelect, goEditing, goSmoothScroll]
Worksheets[i].LoadFromWorksheet(lCurWorksheet); Worksheets[i].LoadFromWorksheet(lCurWorksheet);
Worksheets[i].OnSelection := @HandleSelectionChanged;
lCurPage.Caption := lCurWorksheet.Name; lCurPage.Caption := lCurWorksheet.Name;
end; end;
end; end;
@ -124,5 +127,11 @@ begin
Workbook.Free; Workbook.Free;
end; end;
procedure Tlazfpsmainform.HandleSelectionChanged(Sender: TObject; aCol,
aRow: Integer);
begin
labelCurCell.Caption := Format('Current Cell: Row=%d Col=%d', [ARow, ACol]);
end;
end. end.