summaryrefslogtreecommitdiff
path: root/examples/apps
diff options
context:
space:
mode:
Diffstat (limited to 'examples/apps')
-rw-r--r--examples/apps/nanoedit/mainfrm.pas12
1 files changed, 10 insertions, 2 deletions
diff --git a/examples/apps/nanoedit/mainfrm.pas b/examples/apps/nanoedit/mainfrm.pas
index 5cece909..93f8f8a6 100644
--- a/examples/apps/nanoedit/mainfrm.pas
+++ b/examples/apps/nanoedit/mainfrm.pas
@@ -40,6 +40,7 @@ type
procedure miPasteClicked(Sender: TObject);
procedure btnGOClick(Sender: TObject);
procedure memEditorChanged(Sender: TObject);
+ procedure UpdateStatus(const AMessage: TfpgString);
public
procedure AfterCreate; override;
end;
@@ -67,7 +68,7 @@ begin
s := StringReplace(s, 'file://', '', []);
memEditor.LoadFromFile(s);
FFilename := s;
- lblStatusText.Text := FFilename;
+ UpdateStatus(FFilename);
end;
end;
@@ -81,6 +82,7 @@ begin
begin
memEditor.Lines.LoadFromFile(dlg.FileName);
FFileName := dlg.FileName;
+ UpdateStatus(FFileName);
end;
finally
dlg.Free;
@@ -98,6 +100,7 @@ begin
if dlg.RunSaveFile then
begin
memEditor.Lines.SaveToFile(dlg.FileName);
+ UpdateStatus(Format('<%s> successfully saved.', [FFileName]));
end;
finally
dlg.Free;
@@ -116,7 +119,7 @@ begin
begin
memEditor.Lines.SaveToFile(dlg.FileName);
FFilename := dlg.FileName;
- lblStatusText.Text := FFilename;
+ UpdateStatus(Format('<%s> successfully saved.', [FFileName]));
end;
finally
dlg.Free;
@@ -223,6 +226,11 @@ begin
}
end;
+procedure TMainForm.UpdateStatus(const AMessage: TfpgString);
+begin
+ lblStatusText.Text := AMessage;
+end;
+
procedure TMainForm.AfterCreate;
begin
{@VFD_BODY_BEGIN: MainFrom}