From 21ccd08ac64921d7f29cbaa9d94347da0a0c859e Mon Sep 17 00:00:00 2001 From: Cm Wang <35757455+chunmingwang@users.noreply.github.com> Date: Fri, 27 Sep 2024 08:02:04 +0800 Subject: [PATCH] Add files via upload --- FileBrowser.rc | 4 ++-- FileBrowser.vfp | 2 +- frmBrowser.frm | 53 +++++++++++++++++++++++++++++++++++-------------- 3 files changed, 41 insertions(+), 18 deletions(-) diff --git a/FileBrowser.rc b/FileBrowser.rc index b411e20..b0c0bf5 100644 --- a/FileBrowser.rc +++ b/FileBrowser.rc @@ -3,8 +3,8 @@ #define APP_TITLE_STR "FileBrowser\0" #define VER_FILEDESCRIPTION_STR "FileBrowser\0" -#define VER_FILEVERSION 0,0,0,478 -#define VER_FILEVERSION_STR "0.0.0.478\0" +#define VER_FILEVERSION 0,0,0,560 +#define VER_FILEVERSION_STR "0.0.0.560\0" #define VER_LEGALCOPYRIGHT_STR "CM.Wang\0" diff --git a/FileBrowser.vfp b/FileBrowser.vfp index d4afb6c..3fabe5b 100644 --- a/FileBrowser.vfp +++ b/FileBrowser.vfp @@ -9,7 +9,7 @@ OpenProjectAsFolder=false MajorVersion=0 MinorVersion=0 RevisionVersion=0 -BuildVersion=478 +BuildVersion=560 AutoIncrementVersion=false ApplicationTitle="FileBrowser" ApplicationIcon="" diff --git a/frmBrowser.frm b/frmBrowser.frm index f141750..5b7e317 100644 --- a/frmBrowser.frm +++ b/frmBrowser.frm @@ -24,17 +24,16 @@ Using My.Sys.Forms Type frmBrowserType Extends Form - mRootNode As TreeNode Ptr - mSelectPath As WString Ptr mClosing As Boolean mListing As Boolean + mRootNode As TreeNode Ptr + mSelectPath As WString Ptr - Declare Function Path2ComboEx Overload (ByRef Sender As ComboBoxEx, Path As Const WString) As Integer - - Declare Function RootInit() As PTreeNode - Declare Sub RootList() Declare Function FindNode(Path As WString) As TreeNode Ptr + Declare Function Path2ComboEx(ByRef Sender As ComboBoxEx, Path As Const WString) As Integer + Declare Function RootInit() As PTreeNode Declare Sub FileList(ByRef Item As TreeNode, ByVal LV As Boolean = True) + Declare Sub RootList() Declare Sub Form_Create(ByRef Sender As Control) Declare Sub Form_Show(ByRef Sender As Form) @@ -62,7 +61,7 @@ Dim As TreeView TreeView1 Dim As ListView ListView1 Dim As PopupMenu PopupMenu1 - Dim As MenuItem MenuItem1, MenuItem2, MenuItem3, MenuItem4, MenuItem5, MenuItem6, MenuOpen, MenuBrowser, MenuItem9, MenuNotepad + Dim As MenuItem MenuItem1, MenuItem2, MenuItem3, MenuItem4, MenuItem5, MenuItem6, MenuOpen, MenuBrowser, MenuItem9, MenuNotepad, MenuItem7, MenuItem8 Dim As StatusBar StatusBar1 Dim As StatusPanel StatusPanel1 Dim As Splitter Splitter1 @@ -143,6 +142,7 @@ .ExtraMargins.Bottom = 5 .Images = @ImageList1 .SelectedImages = @ImageList1 + .ContextMenu = @PopupMenu1 .SetBounds 5, 35, 200, 599 .Designer = @This '.OnNodeClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As TreeView, ByRef Item As TreeNode), @TreeView1_NodeClick) @@ -265,7 +265,7 @@ With MenuItem3 .Name = "MenuItem3" .Designer = @This - .Caption = "Small Icon" + .Caption = ML("Small Icon") .Tag = @"2" .OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @MenuView_Click) .Parent = @PopupMenu1 @@ -297,6 +297,22 @@ .OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @MenuView_Click) .Parent = @PopupMenu1 End With + ' MenuItem7 + With MenuItem7 + .Name = "MenuItem7" + .Designer = @This + .Caption = "-" + .Parent = @PopupMenu1 + End With + ' MenuItem8 + With MenuItem8 + .Name = "MenuItem8" + .Designer = @This + .Caption = ML("Dark mode") + .OnClick = Cast(Sub(ByRef Designer As My.Sys.Object, ByRef Sender As MenuItem), @MenuView_Click) + .Checked = true + .Parent = @PopupMenu1 + End With ' ImageList1 With ImageList1 .Name = "ImageList1" @@ -442,7 +458,7 @@ End Function Private Sub frmBrowserType.RootList() 'Debug.Print "RootList" - 'desktop,document,video,music + 'desktop,documents,pictures,videos,music Dim pFileInfo As SHFILEINFO Dim pIIDL As ITEMIDLIST Ptr Dim pPath As WString * MAX_PATH @@ -556,15 +572,15 @@ Private Sub frmBrowserType.FileList(ByRef Item As TreeNode, ByVal LV As Boolean If LV Then ListView1.ListItems.Add(pWFD.cFileName, pFileInfo.iIcon) i = ListView1.ListItems.Count - 1 - ListView1.ListItems.Item(i)->Text(1) = Format(WFD2Size(@pWFD), "#,#") - ListView1.ListItems.Item(i)->Text(2) = WFD2TimeStr(pWFD.ftLastWriteTime) - ListView1.ListItems.Item(i)->Text(3) = WFD2TimeStr(pWFD.ftCreationTime) - ListView1.ListItems.Item(i)->Text(4) = WFD2TimeStr(pWFD.ftLastAccessTime) + ListView1.ListItems.Item(i)->Text(1) = Format(WFD2Bytes(@pWFD), "#,#") + ListView1.ListItems.Item(i)->Text(2) = WFD2TimeStr(@pWFD.ftLastWriteTime) + ListView1.ListItems.Item(i)->Text(3) = WFD2TimeStr(@pWFD.ftCreationTime) + ListView1.ListItems.Item(i)->Text(4) = WFD2TimeStr(@pWFD.ftLastAccessTime) If pWFD.dwFileAttributes And FILE_ATTRIBUTE_DIRECTORY Then ListView1.ListItems.Item(i)->Text(1) = "