diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-09-18 08:45:36 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-09-18 08:45:36 +0000 |
commit | 0eeb6c3e6d1a9d072b59ecc3f7742d090e3339bd (patch) | |
tree | aac8e378024a4be5d5fce984ae298bce78fe0a80 /src/gui | |
parent | 62315fc3d566047896a37eb6c6e721c6c8072f46 (diff) | |
download | fpGUI-0eeb6c3e6d1a9d072b59ecc3f7742d090e3339bd.tar.xz |
* Minor fix for the Save button state in the File Save dialog
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/gui_dialogs.pas | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/gui_dialogs.pas b/src/gui/gui_dialogs.pas index 715685d4..49303f17 100644 --- a/src/gui/gui_dialogs.pas +++ b/src/gui/gui_dialogs.pas @@ -130,6 +130,8 @@ type procedure FilterChange(Sender: TObject); procedure DirChange(Sender: TObject); procedure UpDirClick(Sender: TObject); + procedure edFilenameChanged(Sender: TObject); + procedure UpdateButtonState; protected procedure HandleKeyPress(var keycode: word; var shiftstate: TShiftState; var consumed: boolean); override; procedure btnOKClick(Sender: TObject); override; @@ -717,10 +719,7 @@ begin if grid.CurrentEntry.EntryType <> etDir then edFileName.Text := grid.CurrentEntry.Name; - if FOpenMode then - btnOK.Enabled := grid.CurrentEntry.EntryType = etFile - else - btnOK.Enabled := edFileName.Text <> ''; + UpdateButtonState; lbFileInfo.Text := s; end; @@ -840,6 +839,7 @@ begin Anchors := [anLeft, anRight, anBottom]; Text := ''; FontDesc := '#Edit1'; + OnChange := @edFilenameChanged; end; { Filter section } @@ -913,7 +913,7 @@ begin inherited Create(AOwner); WindowTitle := 'File Selection'; Width := 640; - Height := 410; // 460; + Height := 410; WindowPosition := wpScreenCenter; FSpacing := 10; @@ -949,6 +949,19 @@ begin SetCurrentDirectory('..'); end; +procedure TfpgFileDialog.edFilenameChanged(Sender: TObject); +begin + UpdateButtonState; +end; + +procedure TfpgFileDialog.UpdateButtonState; +begin + if FOpenMode then + btnOK.Enabled := grid.CurrentEntry.EntryType = etFile + else + btnOK.Enabled := edFileName.Text <> ''; +end; + procedure TfpgFileDialog.SetCurrentDirectory(const ADir: string); var ds: string; |