Jump to content

ChooseFileFolder - Interim Version 11 Mar 21


Recommended Posts

  • Moderators

c.haslam,

Oops! Thanks for that, I will release a fix later today. :thumbsup:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Replies 346
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

INTERIM VERSION 11 Mar 21 A bug in the x64 implementation of some the library TreeView functions meant that some replacement working functions were added to the UDF. Now the Beta TreeView library

Ascend4nt and Yashied, Thank you both for your efforts. I mentioned a tutorial on this x64 compatability problem to enlighten hobbyist coders like me the last time it came up - I suppose both o

It works perfect for me. (I did not test too much. just $hParent stuff)   Saludos

Posted Images

  • Moderators

BUGFIX VERSION 18 Apr 15

Fixed: A variable first declared inside an If statement - sorry about that. :>

New zip in first post. :)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • 1 month later...

Melba23

+ 4   - Do not display Hidden files/folders
+ 8   - Do not display System files/folders

can we add a new switch - "+ protected" --> if file is both attributed +4 and +8 then don't show file..

and change + 4 and + 8 switches to (if selected switch +4 or +8 and <> "protected" then don't show file..
like this this we differentiate more needed types 

Thanks
Deye

Link to post
Share on other sites
  • Moderators

Deye,

Just to be clear, are you asking to hide files that are both hidden and system, but show files which are only one or the other? Obviously using +12 currently will hide files which have one or other of the attributes, so I just want to be sure I understand the request.

If this is indeed the case, this would actually require a change to the standard _FileListToArrayRec function, as it is that which the UDF uses to get the file lists - so could I ask you to open a feature request in Trac.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • 3 weeks later...
  • Moderators

BUGFIX VERSION 11 Jun 15

Fixed: A variable declared inside a first Case statement and not recognised in another. This is not picked up by Au3Check and only caused a problem under a specific parameter set. Sorry about that.

New code in the first post.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • Moderators

232showtime,

Glad you like it.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • 1 month later...

Oh, great and wise Melba23, one of your tiny-brained worshipers beseeches you for guidance!

First, I can't begin to thank you sufficiently for this amazing UDF!  What I like most of all is that we can use it without a GUI.

But my tiny brain must also be defective since I can't begin to fathom what the difference is between "0 + 16" and "16" :blink:

Consider this code from some of your examples: "$sRet = _CFF_Choose("Ex 8 - Multiple checkboxes", 300, 500, -1, -1, "", Default, 0 + 16, -1)"
How could that possibly be different than "$sRet = _CFF_Choose("Ex 8 - Multiple checkboxes", 300, 500, -1, -1, "", Default, 16, -1)" ??

I mean, this kind of thing is simply setting bit flags, right? But 0 sets no bits at all, so what possible use is specifying it in the code?

Well, that's not my main reason for posting this, which is to ask what I'm doing wrong with the following code:

$L_Ret = _CFF_Choose($Cmy_Title, 300, 500, -1, -1, "", Default, 2 + 4 + 8 + 16 + 32, -1)

What I'm trying to do is get a list of an arbitrary number of non-hidden folders ONLY from any volume on the system (files should not be seen or be selectable).  That's why I must not specify 0 as one of the $iDisplay parameters (if it actually makes any difference?)

But when I try that, all I get are the drive roots and nothing at all underneath them!  No files and no folders whatsoever. What am I doing wrong?

If it matters, unlike your example code, I do not call "_CFF_RegMsg()" since this is not a GUI script and thus I have no need of any handlers (unless I'm wrong about that...)

Little help, please, Master?

 

 

Link to post
Share on other sites
  • Moderators

Mbee,

I seem to remember that I coded the flag as "0 + 16" in the examples just to make the point that using the "16" option will only work if you use the "0" option as the basic display.  If you use one of the other basic options (1-3) then it has no effect - as described in the function header:

; 0     - Entire folder tree and all matching files within folders - only files can be selected
; 1     - All matching files within the specified folder - subfolders are not displayed
; 2     - Entire folder tree only - no files.  Doubleclicks will expand, not select, item
; 3     - As 2 but doubleclicks will select item if it has no children
[...]
; + 16  - Both files and folders selectable if basic $iDisplay set to 0 - folders have trailing \

If you set the basic display to 1 (files only) or 2/3 (folders only) then adding a flag which allows both files and folders to be selected when only one of them is displayed is of little use.

As to the main question: you need to register at least the WM_NOTIFY handler as the UDF uses it to expand the tree when you click on a node. Once again, this is explained in the function header:

Registers WM_NOTIFY for TreeView doubleclick and item expansion and WM_COMMAND for list focus

So you would need to use:

_CFF_RegMsg(True, False)

$L_Ret = _CFF_Choose($Cmy_Title, 300, 500, -1, -1, "", Default, 2 + 4 + 8 + 32, -1)

Now you will be able to expand the tree - there is no need for the "16" because, as explained above, you are only displaying folders so it is ignored.

All clear now?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

Mbee,

I seem to remember that I coded the flag as "0 + 16" in the examples just to make the point that using the "16" option will only work if you use the "0" option as the basic display.  If you use one of the other basic options (1-3) then it has no effect - as described in the function header...

 

Ah, I see. Thanks for explaining that!

As to the main question: you need to register at least the WM_NOTIFY handler as the UDF uses it to expand the tree when you click on a node. Once again, this is explained in the function header:

Registers WM_NOTIFY for TreeView doubleclick and item expansion and WM_COMMAND for list focus

So you would need to use:

_CFF_RegMsg(True, False)

$L_Ret = _CFF_Choose($Cmy_Title, 300, 500, -1, -1, "", Default, 2 + 4 + 8 + 32, -1)

Now you will be able to expand the tree - there is no need for the "16" because, as explained above, you are only displaying folders so it is ignored.

All clear now?

Yes, thanks!

By the way, after reading my post, I began to fear that the praise I heaped on you might have come across like assholish mockery or something.  I assure you that is NOT what I intended!  I've read a lot of your posts and have used several of your truly excellent UDFs and code snippets, and I meant to honor them -and- you.  Please forgive me if I inadvertently offended...

 

M23

Link to post
Share on other sites
  • Moderators

Mbee,

might have come across like assholish mockery or something

No, I understood it was genuine - if a little OTT - but I will still respond even if you do not go to such lengths.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites
  • 3 weeks later...

@Melba23 Is it possible to display a specific file type in treeview ?. I have used your function for "*.exe" , but it displays some empty items in treeview with the exe files. 

Edited by kcvinu

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to post
Share on other sites
  • Moderators

kcvinu,

If you set the $sMask parameter to ""*.exe" you should only get only the exe files displayed - as long as you have the $iDisplay parameter set correctly. Please let me see the code you are using to call the UDF - and if possible a screenshot of what you get returned along with a list of what is actually in there. That way I can try and reproduce the problem (if indeed there is one).

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

Sure  :)

$sRet = _CFF_Choose("Experiment", 300, 500, -1, -1, "K:\", "*exe", 0,-1)

And here is Screenshot of result. You see this, there is some blank entries with exe files. Those are not exe files.

 000106.jpg

Edited by kcvinu
Adding extra info

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to post
Share on other sites
  • Moderators

kcvinu,

This example script shows all the .exe files in the AutoIt installation - does it work for you?

#include <MsgBoxConstants.au3>
#include "ChooseFileFolder.au3"

Global $sRootFolder = StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", Default, -1))
ConsoleWrite($sRootFolder & @CRLF)

; Register handlers
Global $sRet = _CFF_RegMsg()
If Not $sRet Then
    MsgBox(16, "Failure!", "Handler not registered")
    Exit
EndIf



$sRet = _CFF_Choose("Choose an .exe file", 300, 500, -1, -1, $sRootFolder, "*.exe", 0)
If $sRet Then
    MsgBox($MB_SYSTEMMODAL + $MB_ICONINFORMATION, "Chosen", "Selected:" & @CRLF & @CRLF & $sRet)
Else
    MsgBox($MB_SYSTEMMODAL + $MB_ICONINFORMATION, "Ooh Err", "No Selection")
EndIf

There are some empty folders in the expanded tree - because there are no exe files within them.  Is that what you meant by "empty items"?  If so, then it is a not a bug but just the way that the UDF opens the tree - until a branch is expanded the UDF has no idea what is inside. Any subfolders are obviously shown as there might be other .exe files within them deeper n the tree.

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

So, how to avoid these empty folders from appearing in treeview ?. 

Edit: Got it. I need to play with this --- _GUICtrlTreeView_Delete() :)

 

Edited by kcvinu

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to post
Share on other sites
  • Moderators

kcvinu,

Pretty obviously you cannot prevent it. if you want to expand a tree and only display a certain file type then you will always get "empty" places where none of the files are found. The only alternative would be to fully expand the tree, determine any completely empty branches, and then eliminate them before displaying the result. But as I found in the early versions of this UDF, expanding the whole tree before display was prohibitively slow - so I changed to the current method which only expands the tree branches when required. As a result you always get all the folders/subfolders within the tree, even when empty. But why do you see this as a problem?

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to post
Share on other sites

Because, when i am going to select a file from the tree, it's a time wasting task to expand a child item and another item, then there is nothing and it's an empty folder. I only want to display the exe files only. Anyway, i think i can find a remedy for this. I think i can atleast disable the empty items.

My Contributions

UDF Link Viewer   --- A tool to visit the links of some most important UDFs 

 Includer_2  ----- A tool to type the #include statement automatically 

 Digits To Date  ----- date from 3 integer values

PrintList ----- prints arrays into console for testing.

 Alert  ------ An alternative for MsgBox 

 MousePosition ------- A simple tooltip display of mouse position

GRM Helper -------- A littile tool to help writing code with GUIRegisterMsg function

Access_UDF  -------- An UDF for working with access database files. (.*accdb only)

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...