View Issue Details

IDProjectCategoryView StatusLast Update
0024532LazarusLCLpublic2013-06-17 11:44
ReporteroceanAssigned ToBart Broersma 
PrioritynormalSeverityfeatureReproducibilityhave not tried
Status closedResolutionfixed 
Product Version1.1 (SVN)Product Build 
Target VersionFixed in Version1.1 (SVN) 
Summary0024532: Shelltreeview missing refresh method
DescriptionShellTreeView1.Refresh(ShellTreeView1.Items.GetFirstNode);

Works in Delphi, but not compile in Lazarus.

Refresh is needed, for example, when insert USB-drive after application is already running
TagsNo tags attached.
Fixed in Revisionr41728
LazTarget-
WidgetsetWin32/Win64
Attached Files
  • shellctrls.pas.patch (699 bytes)
    Index: lcl/shellctrls.pas
    ===================================================================
    --- lcl/shellctrls.pas	(revision 41703)
    +++ lcl/shellctrls.pas	(working copy)
    @@ -79,6 +79,7 @@
         { Other methods specific to Lazarus }
         function  GetPathFromNode(ANode: TTreeNode): string;
         function  GetSelectedNodePath: string;
    +    procedure Refresh(ANode: TTreeNode); overload;
     
         { Properties }
         property ObjectTypes: TObjectTypes read FObjectTypes write FObjectTypes;
    @@ -759,6 +760,11 @@
       Result := GetPathFromNode(Selected);
     end;
     
    +procedure TCustomShellTreeView.Refresh(ANode: TTreeNode);
    +begin
    +  //TODO
    +end;
    +
     {
     SetPath: Path can be
     - Absolute like '/usr/lib'
    
    shellctrls.pas.patch (699 bytes)

Activities

Bart Broersma

2013-06-09 12:19

developer   ~0068147

That would mean we have to make TControl.Refresh virtual.
That might be frowned upon.

Juha Manninen

2013-06-09 12:43

developer   ~0068149

> That would mean we have to make TControl.Refresh virtual.

Not really, when the method is called like:
  ShellTreeView1.Refresh(ShellTreeView1.Items.GetFirstNode);

Besides it has a different parameter signature so it cannot be virtual.

Another thing: the parameter ShellTreeView1.Items.GetFirstNode seems redundant. It could be the default when Nil is passed for example.

Bart Broersma

2013-06-13 00:04

developer   ~0068264

It would make it impossible to call (the current) Refresh.

ocean

2013-06-13 17:40

reporter  

shellctrls.pas.patch (699 bytes)
Index: lcl/shellctrls.pas
===================================================================
--- lcl/shellctrls.pas	(revision 41703)
+++ lcl/shellctrls.pas	(working copy)
@@ -79,6 +79,7 @@
     { Other methods specific to Lazarus }
     function  GetPathFromNode(ANode: TTreeNode): string;
     function  GetSelectedNodePath: string;
+    procedure Refresh(ANode: TTreeNode); overload;
 
     { Properties }
     property ObjectTypes: TObjectTypes read FObjectTypes write FObjectTypes;
@@ -759,6 +760,11 @@
   Result := GetPathFromNode(Selected);
 end;
 
+procedure TCustomShellTreeView.Refresh(ANode: TTreeNode);
+begin
+  //TODO
+end;
+
 {
 SetPath: Path can be
 - Absolute like '/usr/lib'
shellctrls.pas.patch (699 bytes)

ocean

2013-06-13 17:41

reporter   ~0068278

What's wrong with attached (other than method is unimplemented :) )

Bart Broersma

2013-06-13 22:06

developer   ~0068283

I still dislike this. I think it was horrible from Embarcadero to name it Refresh.
Our implementation is far from Delphi compatible, and I doubt it ever will be.
So, why not give up on compatibilty for this control and call the method RefreshNode?

Bart Broersma

2013-06-16 14:58

developer   ~0068329

Please close if OK.

ocean

2013-06-17 11:44

reporter   ~0068346

Seems to work..

But needs to be noted that in Delphi root can't be empty. This is why ShellTreeView1.Refresh(ShellTreeView1.Items.GetFirstNode); always refresh root. In Lazarus GetFirstNode can return A: drive.

Issue History

Date Modified Username Field Change
2013-06-02 08:30 ocean New Issue
2013-06-02 12:30 Bart Broersma Assigned To => Bart Broersma
2013-06-02 12:30 Bart Broersma Status new => assigned
2013-06-09 12:19 Bart Broersma Note Added: 0068147
2013-06-09 12:43 Juha Manninen Note Added: 0068149
2013-06-13 00:04 Bart Broersma Note Added: 0068264
2013-06-13 17:40 ocean File Added: shellctrls.pas.patch
2013-06-13 17:41 ocean Note Added: 0068278
2013-06-13 22:06 Bart Broersma Note Added: 0068283
2013-06-16 14:58 Bart Broersma Fixed in Revision => r41728
2013-06-16 14:58 Bart Broersma LazTarget => -
2013-06-16 14:58 Bart Broersma Note Added: 0068329
2013-06-16 14:58 Bart Broersma Status assigned => resolved
2013-06-16 14:58 Bart Broersma Fixed in Version => 1.1 (SVN)
2013-06-16 14:58 Bart Broersma Resolution open => fixed
2013-06-17 11:44 ocean Note Added: 0068346
2013-06-17 11:44 ocean Status resolved => closed