Browse Source

Added virtual GetFileTypeIcon method to FileBrowser.

Mark Sibly 8 years ago
parent
commit
8bf3a9b753
1 changed files with 12 additions and 1 deletions
  1. 12 1
      modules/mojox/filebrowser.monkey2

+ 12 - 1
modules/mojox/filebrowser.monkey2

@@ -178,7 +178,7 @@ Class FileBrowser Extends TreeView
 			child.Text=f
 			child._path=fpath
 			
-			Local icon:=_fileTypeIcons[ExtractExt( f ).ToLower()]
+			Local icon:=GetFileTypeIcon( fpath )
 			
 			If i<dirs.Length
 				If Not icon icon=_dirIcon
@@ -231,6 +231,17 @@ Class FileBrowser Extends TreeView
 		Return _fileTypeIcons
 	End
 	
+	Protected
+	
+	Method GetFileTypeIcon:Image( path:String ) Virtual
+	
+		Local ext:=ExtractExt( path )
+		If Not ext Return Null
+		
+		Return GetFileTypeIcons()[ ext.ToLower() ]
+	End
+	
+	
 	Private
 	
 	Global _fileTypeIcons:StringMap<Image>