Results 1 to 40 of 260

Thread: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive features

Hybrid View

  1. #1
    Member
    Join Date
    Aug 2018
    Location
    nomadic within UK
    Posts
    43

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    I have now had a really good look at these controls and continue to be very impressed.
    Having access to the source code is great, and having them written in VB is even better.
    I have made my own little test program to evaluate these, it crashes quite often in the IDE but the compiled EXE is file.
    Here is a slightly expanded list of bugs, issues, and requests for additional functionality.

    ucBrowse

    1 Double update sometimes giving noticable flicker

    2 Not consistently getting focus (click the listview, then pressing up/down arrow on keyboard
    does not always send these keystrokes to the control.)
    ucTree has similar issue.

    smaller issues

    3 Selecting a file with .SelectedFile = name is case sensitive
    Probably better if it is not, or could this be an option????

    4 When selecting a file then if it is not visible it does not become visible
    (user needs to scroll to find the file)
    Automatic scrolling to make the file visible would be good, an "EnsureVisible" method even better.

    >>>>>>>>>>>>>>>>>>>> Extra Functionality.

    ucTree

    5 An EnterFocus event.

    6 a SetFocus method equivalent to SetFocusonFiles in ucBrowse

    7 "Show Hidden" functionality similar to ucBrowse

    8 a property to disable the right click menu.

    ucBrowse

    9 a method to select an item by location, in paticular to select the first item.
    (maybe I can already do this?.....am working on it)

    ucBrowse and ucTree

    10 Control of cursor/highlight colours
    ...when I say cursor I mean the highlight bar showing the selected component, not the mousepointer

    Its a different shade of blue in ucBrowse and ucTree.
    Can they be the same? even better can this be a user property please?

    (you give user control of the background colour so it would make sense to have
    user control of this too?)

    and what would be really good....

    when the ucTree/ucBrowse does not have the focus the highlight bar becomes a very light
    grey colour (at least on my PC), could we have a property to control this colour too?

    11 Rapid Update/refresh problem.

    When navigating the ucTree rapidly with keyboard up/down keys the ucBrowse can sometimes not
    update quickly enough and the updates stack up.
    I have had a look at my current LogicNP controls to see how they behave....
    If clicking a folder in the Tree then the list/browse updates imediately.
    If navigating with the keyboard a short delay is built in (I estimate about 700msec) and the list update
    only occurs if no other navigation has taken place in this time.

    12 Possible issue with "My Computer" display, more details later

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jul 2010
    Location
    NYC
    Posts
    7,673

    Re: [VB6] ucShellBrowse: A modern replacement for Drive/FileList w/ extensive feature

    Quote Originally Posted by dmrvb View Post
    I have now had a really good look at these controls and continue to be very impressed.
    Having access to the source code is great, and having them written in VB is even better.
    I have made my own little test program to evaluate these, it crashes quite often in the IDE but the compiled EXE is file.
    Here is a slightly expanded list of bugs, issues, and requests for additional functionality.

    ucBrowse

    1 Double update sometimes giving noticable flicker

    2 Not consistently getting focus (click the listview, then pressing up/down arrow on keyboard
    does not always send these keystrokes to the control.)
    ucTree has similar issue.

    smaller issues

    3 Selecting a file with .SelectedFile = name is case sensitive
    Probably better if it is not, or could this be an option????

    4 When selecting a file then if it is not visible it does not become visible
    (user needs to scroll to find the file)
    Automatic scrolling to make the file visible would be good, an "EnsureVisible" method even better.

    >>>>>>>>>>>>>>>>>>>> Extra Functionality.

    ucTree

    5 An EnterFocus event.

    6 a SetFocus method equivalent to SetFocusonFiles in ucBrowse

    7 "Show Hidden" functionality similar to ucBrowse

    8 a property to disable the right click menu.

    ucBrowse

    9 a method to select an item by location, in paticular to select the first item.
    (maybe I can already do this?.....am working on it)

    ucBrowse and ucTree

    10 Control of cursor/highlight colours
    ...when I say cursor I mean the highlight bar showing the selected component, not the mousepointer

    Its a different shade of blue in ucBrowse and ucTree.
    Can they be the same? even better can this be a user property please?

    (you give user control of the background colour so it would make sense to have
    user control of this too?)

    and what would be really good....

    when the ucTree/ucBrowse does not have the focus the highlight bar becomes a very light
    grey colour (at least on my PC), could we have a property to control this colour too?

    11 Rapid Update/refresh problem.

    When navigating the ucTree rapidly with keyboard up/down keys the ucBrowse can sometimes not
    update quickly enough and the updates stack up.
    I have had a look at my current LogicNP controls to see how they behave....
    If clicking a folder in the Tree then the list/browse updates imediately.
    If navigating with the keyboard a short delay is built in (I estimate about 700msec) and the list update
    only occurs if no other navigation has taken place in this time.

    12 Possible issue with "My Computer" display, more details later
    1- Can you describe in more detail? There might be a little flicker but it only updates the redraw every once in a while so hasn't been too bad in a while; is this with the default settings or with other options for high performance mode and preloading?

    2- Ugh.. you can't imagine how many hours I spent trying to get focus to work. I don't know that it can possibly get better than the extremely complicated focusing system it's got now due to inherent limitations of VB6 apps on modern Windows, but if you can be more specific on how I could replicate the exact issue (and on what OS) I'll give it a shot.

    3- Could definitely make it an option. I honestly don't recall right now (I've been on hiatus from all things programming for 8 months or so-- btw, sorry for the long delayed reply due to that) whether there's an problems adding an Optional to a PropertyLet, but since there are none in the control...
    If you wanted to update yours until I work that out, you could make it case insensitive as follows:

    -Go to Public Property Let SelectedFile(sName As String)

    -Change If LVEntries(lp).sName = sName Then to If LCase$(LVEntries(lp).sName) = LCase$(sName) Then

    Edit: Here's the new function I'm going to be adding to the next version, since it's impossible to add Optional arguments to the previous one. This one is much better, it allows wildcards... so if Multiselect is enabled you could e.g. select *.exe:
    Code:
    'First, this new enum will be added up in the control defs:
    Public Enum SB_ITEMSEL_MODE
        SBIM_FilesAndFolders = 0&
        SBIM_FilesOnly = 1&
        SBIM_FoldersOnly = 2&
    End Enum
    
    'Then this function is added:
    Public Function SetSelectedItemsEx(sName As String, Optional bDeselectPrev As Boolean = True, Optional nMaxMatches As Long = 0&, Optional iSelectType As SB_ITEMSEL_MODE = SBIM_FilesOnly, Optional bEnsureVisible = True, Optional bCaseSensitive As Boolean = False) As Long
    'bDeselectPrev - Clears any existing selection.
    'nMaxMatches - If sName contains wildcards, specifies maximum matches. 0 = unlimited. Does not override Multiselect; so if Multiselect is False, any value larger than 1 is invalid.
    'iSelectType - Match sName against Files only, Folders only, or both.
    'bEnsureVisible - Scrolls the selected item into view. If multiple selections made, applied to the first match.
    'bCaseSensitive - Applies both with and without wildcards.
    'Returns files selected.
    'Note: First match receives focus.
    Dim i As Long
    Dim lp As Long
    Dim lCnt As Long
    Dim sCp1 As String, sCp2 As String
    Dim nMt As Long
    Dim nEV As Long
    
    lCnt = SendMessage(hLVS, LVM_GETITEMCOUNT, 0&, ByVal 0&)
    
    If bDeselectPrev Then
        ListView_SetItemState hLVS, -1, 0&, LVIS_FOCUSED Or LVIS_SELECTED
    End If
    
    For i = 0 To (lCnt - 1)
        lp = GetLVItemlParam(hLVS, i)
        If (iSelectType = SBIM_FilesOnly) And (LVEntries(lp).bFolder = True) Then GoTo nxt
        If (iSelectType = SBIM_FoldersOnly) And (LVEntries(lp).bFolder = False) Then GoTo nxt
        sCp1 = LVEntries(lp).sName: sCp2 = sName
        If bCaseSensitive = False Then
            sCp1 = LCase$(sCp1): sCp2 = LCase$(sCp2)
        End If
        If PathMatchSpecW(StrPtr(sCp1), StrPtr(sCp2)) Then
            nMt = nMt + 1
            If nMt = 1 Then
                ListView_SetItemState hLVS, i, LVIS_FOCUSED Or LVIS_SELECTED, LVIS_FOCUSED Or LVIS_SELECTED
                nEV = i
            Else
                ListView_SetItemState hLVS, i, LVIS_SELECTED, LVIS_SELECTED
            End If
            If ((nMaxMatches > 0&) And (nMt = nMaxMatches)) Or (m_MultiSelect = False) Then Exit For
        End If
    nxt:
    Next i
    LVSetSelection
    If nMt Then SendMessage hLVS, LVM_ENSUREVISIBLE, nEV, ByVal 1&
    SetSelectedItemsEx = nMt
    End Function
    4- An exposed EnsureVisible method is a great idea, will definitely add in next update. In the mean time of course you could add SendMessage hLVS, LVM_ENSUREVISIBLE, i, ByVal 1& at the end.

    5-8- You're right probably should have had those already.

    9- There's not a 1-and-done method for that, but you could certainly navigate to a path, set a module-level flag, then when receiving a DirectoryChanged event, which fires after the new one has been loaded, if your flag is True use .SelectFile to select a specific file, or call SetFocusOnFiles True[,True] to select the first file-- the first True is the option to select the first file if none if already selected (which will be the case with a newly loaded folder), and the 2nd True, if used, is to ensure you select the first *file*, as in ignore the folders.

    10- Definitely haven't seen them in different colors before, and I test the demos where they're both loaded in both Win7 and Win10... I'm not sure how that's possible unless the ExplorerStyle option is set to a different value in one control than the other, they both default to enabling it. It's controlled by windows; the control would have to be 100% owner draw to change that.

    When the control selection color goes to gray when out of focus or not is controlled by the ShowSelAlways option, which is available in both controls.

    11- I'll take a look at this behavior. There are some timing codes in there that prevent bugs, could be causing that.

    12- Let me know; I've tested the items my system has to display in Windows 7 and an older Windows 10 version, it's possible other items or newer Windows versions have issues. There are some known issues with the display in Windows 10. Certain items report properties they shouldn't have, resulting in e.g. drawing percent full bars for special folders that aren't drives... these need to be flagged manually.

    Edit: I might know what you mean. I hadn't noticed it on the Windows 10 version on my laptop, but on my new system... it's grouping the Special Folders with the drives. This is due to an error where it's failing to get the relative pidl of the folders in the initial loop where the Categories are detected (something only applicable in this very special case). It seems the folders get suitable relative pidls elsewhere, so I fixed this by making, in LVLoadFolder, this bolded line conditional (adding the If statement):
    Code:
                    If LVEntries(nCur).pidlRel = 0& Then
                        psfCur.ParseDisplayName hLVS, 0&, StrPtr(LVEntries(nCur).sNameFull), 0&, LVEntries(nCur).pidlRel, 0&
                    End If
    Last edited by fafalone; Jan 8th, 2022 at 07:05 AM.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width