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"/>
<ResourceType Value="res"/>
<UseXPManifest Value="True"/>
<Icon Value="0"/>
</General>
<i18n>
<EnableI18N LFM="False"/>

View File

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

View File

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