diff options
author | Graeme Geldenhuys <graemeg@gmail.com> | 2013-09-11 10:30:42 +0100 |
---|---|---|
committer | Graeme Geldenhuys <graemeg@gmail.com> | 2013-09-11 10:30:42 +0100 |
commit | 660cd7146b24bfa04688ae4aa0b95ff0f6dfd613 (patch) | |
tree | b8594aa21ab68d35154aecb13b2712e21c4dfc0d /examples/apps | |
parent | e5c26324bd2199f3e54ce10834b30c712987057d (diff) | |
download | fpGUI-660cd7146b24bfa04688ae4aa0b95ff0f6dfd613.tar.xz |
nanoedit: Now gives feedback in status bar area.
Diffstat (limited to 'examples/apps')
-rw-r--r-- | examples/apps/nanoedit/mainfrm.pas | 12 |
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} |