summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2010-09-12 00:48:02 +0200
committerGraeme Geldenhuys <graemeg@gmail.com>2010-09-12 00:48:02 +0200
commit1ddf10edb868df99bf2db3b36a6d9532896409f8 (patch)
tree2a906d6961cb187b49e3fa2082268283fbf1eee0 /src/gui
parentef921e0b24e374a1e29f870690b346df6d178daf (diff)
downloadfpGUI-1ddf10edb868df99bf2db3b36a6d9532896409f8.tar.xz
Select Directory Dialog: now has images with the folder nodes in treeview
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fpg_dialogs.pas3
-rw-r--r--src/gui/selectdirdialog.inc18
2 files changed, 19 insertions, 2 deletions
diff --git a/src/gui/fpg_dialogs.pas b/src/gui/fpg_dialogs.pas
index ea124dae..074f0a4c 100644
--- a/src/gui/fpg_dialogs.pas
+++ b/src/gui/fpg_dialogs.pas
@@ -52,7 +52,8 @@ uses
fpg_spinedit,
fpg_tab,
fpg_menu,
- fpg_iniutils;
+ fpg_iniutils,
+ fpg_imagelist;
type
TfpgMsgDlgType = (mtAbout, mtWarning, mtError, mtInformation, mtConfirmation,
diff --git a/src/gui/selectdirdialog.inc b/src/gui/selectdirdialog.inc
index d09f11c8..715f5569 100644
--- a/src/gui/selectdirdialog.inc
+++ b/src/gui/selectdirdialog.inc
@@ -7,6 +7,7 @@
tv: TfpgTreeView;
FRootDir: TfpgString;
FShowHidden: Boolean;
+ FImagelist: TfpgImageList;
function GetAbsolutePath(Node: TfpgTreeNode): TfpgString;
procedure InitializeTreeview;
procedure SetRootDir(const AValue: TfpgString);
@@ -19,6 +20,7 @@
{$ENDIF}
public
constructor Create(AOwner: TComponent); override;
+ destructor Destroy; override;
procedure AfterCreate; override;
{ return the selected directory or set initial selected dir }
property SelectedDir: TfpgString read GetSelectedDir write SetSelectedDir;
@@ -158,6 +160,7 @@ begin
for i := 0 to SortList.Count - 1 do
begin
NewNode := Node.AppendText(SortList[i]);
+ NewNode.ImageIndex := 0;
// NewNode := TV.Items.AddChild(Node, SortList[i]);
// if subdirectories then indicate so.
{ Todo: Fix this by adding HasChildren to Treeview }
@@ -245,9 +248,20 @@ end;
{$ENDIF}
constructor TfpgSelectDirDialog.Create(AOwner: TComponent);
+var
+ img: TfpgImage;
begin
inherited Create(AOwner);
FShowHidden := False;
+ FImagelist := TfpgImageList.Create;
+ img := fpgImages.GetImage('stdimg.folder').ImageFromSource;
+ FImageList.AddImage(img);
+end;
+
+destructor TfpgSelectDirDialog.Destroy;
+begin
+ FImagelist.Free;
+ inherited Destroy;
end;
procedure TfpgSelectDirDialog.AfterCreate;
@@ -263,7 +277,9 @@ begin
begin
Name := 'tv';
SetPosition(FSpacing, FSpacing, 288, 322);
- OnExpand :=@NodeExpanded;
+ ImageList := FImageList;
+ ShowImages := True;
+ OnExpand := @NodeExpanded;
end;
// reposition buttons