diff options
author | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-11-26 09:31:29 +0000 |
---|---|---|
committer | graemeg <graemeg@ae50a9b5-8222-0410-bf8d-8a13f76226bf> | 2007-11-26 09:31:29 +0000 |
commit | 185798546587486561b894003f91aec3fe1409f6 (patch) | |
tree | 4eccd3a3d9d470c6ffefc3e2a1f9b078f7d5220f /src | |
parent | 4488d8401ec96ba69bd9b59795cd4cd07252a1ce (diff) | |
download | fpGUI-185798546587486561b894003f91aec3fe1409f6.tar.xz |
* Correctly set the default value for some properties in the TreeView.
* Implemented double clicking on files in the Open/Save dialog.
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/gui_dialogs.pas | 15 | ||||
-rw-r--r-- | src/gui/gui_tree.pas | 8 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/gui/gui_dialogs.pas b/src/gui/gui_dialogs.pas index b8d2b648..94a388af 100644 --- a/src/gui/gui_dialogs.pas +++ b/src/gui/gui_dialogs.pas @@ -21,9 +21,9 @@ unit gui_dialogs; { TODO: - * Try and abstract the code to remove all IFDEF's + * Try and refactor the code to remove all IFDEF's * Implement MessageDlg with icons and buttons [Work-In-Progress] - * Select Directory dialog + * Select Directory dialog (treeview style) } {.$Define DEBUG} @@ -748,10 +748,13 @@ var e: TFileEntry; begin e := grid.CurrentEntry; - if (e <> nil) and (e.EntryType = etDir) then - begin - SetCurrentDirectory(e.Name); - end; + if (e = nil) then + Exit; //==> + + if (e.EntryType = etDir) then + SetCurrentDirectory(e.Name) + else if (e.EntryType = etFile) then + btnOKClick(Sender); end; procedure TfpgFileDialog.SetFilter(const Value: string); diff --git a/src/gui/gui_tree.pas b/src/gui/gui_tree.pas index 5bd5e686..aef8507d 100644 --- a/src/gui/gui_tree.pas +++ b/src/gui/gui_tree.pas @@ -192,13 +192,13 @@ type property RootNode: TfpgTreeNode read GetRootNode; property Selection: TfpgTreeNode read FSelection write SetSelection; published - property DefaultColumnWidth: word read FDefaultColumnWidth write SetDefaultColumnWidth; + property DefaultColumnWidth: word read FDefaultColumnWidth write SetDefaultColumnWidth default 15; property FontDesc: string read GetFontDesc write SetFontDesc; - property ScrollWheelDelta: integer read FScrollWheelDelta write FScrollWheelDelta; + property ScrollWheelDelta: integer read FScrollWheelDelta write FScrollWheelDelta default 15; property ShowColumns: boolean read FShowColumns write SetShowColumns default False; property ShowImages: boolean read FShowImages write SetShowImages default False; - property TreeLineColor: TfpgColor read FTreeLineColor write SetTreeLineColor; - property TreeLineStyle: TfpgLineStyle read FTreeLineStyle write SetTreeLineStyle; + property TreeLineColor: TfpgColor read FTreeLineColor write SetTreeLineColor default clShadow1; + property TreeLineStyle: TfpgLineStyle read FTreeLineStyle write SetTreeLineStyle default lsDot; property OnChange: TNotifyEvent read FOnChange write FOnChange; property OnExpand: TfpgTreeExpandEvent read FOnExpand write FOnExpand; end; |