* fpspreadsheet: fpsgrid: show hourglass when loading/saving files

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@3105 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
bigchimp
2014-05-27 12:19:28 +00:00
parent 6eaee845bc
commit 82da39dd9f
2 changed files with 40 additions and 29 deletions

View File

@ -4,8 +4,7 @@ program fpsvisual;
uses
Interfaces, // this includes the LCL widgetset
Forms, mainform, LResources, laz_fpspreadsheet_visual
{ you can add units after this };
Forms, mainform, LResources, laz_fpspreadsheet_visual;
{$R *.res}

View File

@ -570,7 +570,14 @@ begin
exit;
if SaveDialog.Execute then
begin
Screen.Cursor := crHourglass;
try
WorksheetGrid.SaveToSpreadsheetFile(SaveDialog.FileName);
finally
Screen.Cursor := crDefault;
end;
end;
end;
procedure TForm1.CbBackgroundColorGetColors(Sender: TCustomColorBox; Items: TStrings);
@ -659,6 +666,8 @@ var
i: Integer;
begin
// Load file
Screen.Cursor := crHourglass;
try
WorksheetGrid.LoadFromSpreadsheetFile(UTF8ToSys(AFileName));
// Update user interface
@ -673,7 +682,7 @@ begin
SetupBackgroundColorBox;
// Create a tab in the pagecontrol for each worksheet contained in the workbook
// This would be easer with a TTabControl. This has display issues, though.
// This would be easier with a TTabControl. This has display issues, though.
pages := TStringList.Create;
try
WorksheetGrid.GetSheets(pages);
@ -687,6 +696,9 @@ begin
end;
WorksheetGridSelection(nil, WorksheetGrid.Col, WorksheetGrid.Row);
finally
Screen.Cursor := crDefault;
end;
end;
procedure TForm1.PageControl1Change(Sender: TObject);