Jump to content

ChooseFileFolder - Interim Version 11 Mar 21


Melba23
 Share

Recommended Posts

  • Moderators

nobbitry,

Thanks for that.

Nikolas92,

Can you let me see the line you used to call the UDF - perhaps you made a small syntax error resulting in the limited dispay.

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 comment
Share on other sites

I tested it with example 8 from Example File 1 on windows 10 enterprise x64 (default settings). I compiled script for 64 bit.

#NoTrayIcon
#RequireAdmin
#include "ChooseFileFolder.au3"

Local $sRet, $aRet

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

; Choose multiple files/folders using checkboxes - all checked items returned
$sRet = _CFF_Choose("Ex 8 - Multiple checkboxes", 300, 500, -1, -1, "", Default, 0 + 16, -1)
If $sRet Then
    $aRet = StringSplit($sRet, "|")
    $sRet = ""
    For $i = 1 To $aRet[0]
        $sRet &= $aRet[$i] & @CRLF
    Next
    MsgBox(0, "Ex 8 - Multiple checkboxes", "Selected:" & @CRLF & @CRLF & $sRet)
Else
    MsgBox(0, "Ex 8", "No Selection")
EndIf

 

Edited by Nikolas92
Link to comment
Share on other sites

  • Moderators

Nikolas92,

Good to hear - but it should not make a difference so I will still take a look once at the code once I get a moment to myself after our houseguests have gone.

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 comment
Share on other sites

Sorry, forgot to mention that I found that GUICtrlCreateTreeView was causing problem while trying to make something similar to example 8 of ChooseFileFolder, I dont know if GUICtrlCreateTreeView is reason of my problems with ChooseFileFolder. This works for me:

; www.autoitscript.com/forum/topic/183381-delayed-guictrltreeview-get-index/
; www.autoitscript.com/forum/topic/100583-treeview-expand-event/
; www.autoitscript.com/forum/topic/111457-selective-folders-selection/
; www.autoitscript.com/forum/topic/80327-filebrowser-with-treeview/
; www.autoitscript.com/forum/topic/144469-solved-dynamic-directory-treeview/

#NoTrayIcon
#RequireAdmin
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <TreeViewConstants.au3>
#include <WindowsConstants.au3>
#Include <GuiTreeView.au3>
#Include <File.au3>

Opt("WinWaitDelay", 0)
Opt("MouseClickDelay", 0)
Opt("MouseClickDownDelay", 0)
Opt("MouseClickDragDelay", 0)
Opt("SendKeyDelay", 0)
Opt("SendKeyDownDelay", 0)
Opt("WinTitleMatchMode", 3)
Opt('GUIOnEventMode', 1)
Opt('GUICloseOnEsc' , 1)

Global $CheckBoxCount = 0
Global $CheckedItems = ''
Global $hGUI = GUICreate("Select files and folders", 530, 400, -1, -1)
Global $hTreeView = _GUICtrlTreeView_Create($hGUI, 0, 0, 530, 370, BitOR($TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_CHECKBOXES))
Global $button = GUICtrlCreateButton("Show checked", 0, 370, 90, 30, $SS_Center)
GUISetBkColor(0xCECECE)
GUICtrlSetOnEvent($button, '_Checked')
GUISetOnEvent($GUI_EVENT_CLOSE, '_AllExit')
$hImage = _GUIImageList_Create(16, 16, 5, 2)
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 4)
_GUIImageList_AddIcon($hImage, @SystemDir & "\shell32.dll", 54)
_GUICtrlTreeView_SetNormalImageList($hTreeView, $hImage)
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
GUISetState(@SW_SHOW, $hGUI)

$aDrives = DriveGetDrive('FIXED')
If IsArray($aDrives) Then
   For $i = 1 To $aDrives[0]
      If DriveStatus($aDrives[$i]) = 'READY' Then
         $Root = _GUICtrlTreeView_AddChild($hTreeView, '', StringUpper($aDrives[$i]), 0)
         _GUICtrlTreeView_SetChildren($hTreeView, $Root, True)
      EndIf
   Next
EndIf
$aDrives = DriveGetDrive('REMOVABLE')
If IsArray($aDrives) Then
   For $i = 1 To $aDrives[0]
      If DriveStatus($aDrives[$i]) = 'READY' Then
         $Root = _GUICtrlTreeView_AddChild($hTreeView, '', StringUpper($aDrives[$i]), 0)
         _GUICtrlTreeView_SetChildren($hTreeView, $Root, True)
      EndIf
   Next
EndIf

While 1
   Sleep(1000)
WEnd

Func _AllExit()
   GUIDelete($hGUI)
   Exit
EndFunc

Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
   #forceref $hWnd, $iMsg, $wParam
   Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR
   $tNMHDR = DllStructCreate($tagNMHDR, $lParam)
   $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
   $iCode = DllStructGetData($tNMHDR, "Code")
   Switch $hWndFrom
   Case $hTreeView
      Switch $iCode
      Case $NM_CLICK
         $aPos = GUIGetCursorInfo($hGUI)
         $ObjectClicked = _GUICtrlTreeView_HitTest($hTreeView, $aPos[0], $aPos[1])
         $cItem = _GUICtrlTreeView_HitTestItem($hTreeView, $aPos[0], $aPos[1])
         If $ObjectClicked = '16' Then
            If _GUICtrlTreeView_GetExpanded($hTreeView, $cItem) = True Then
               ControlTreeView($hGUI, "", $hTreeView, "Collapse", $cItem)
            Else
               $sSelectedPath = StringReplace(_GUICtrlTreeView_GetTree($hTreeView, $cItem), "|", "\")
               If _GUICtrlTreeView_GetChildCount($hTreeView, $cItem) <= 0 Then
                  _SearchFolder($cItem, $sSelectedPath)
               EndIf
            EndIf
         ElseIf $ObjectClicked = '64' Then
            If _GUICtrlTreeView_GetChecked($hTreeView, $cItem) = False Then
               ; checked
               $CheckBoxCount = $CheckBoxCount + 1
               $sSelectedPath = StringReplace(_GUICtrlTreeView_GetTree($hTreeView, $cItem), "|", "\")
               If not StringInStr($sSelectedPath, '\') Then $sSelectedPath = $sSelectedPath & '\'
               $CheckedItems = $CheckedItems & $sSelectedPath & @CRLF
            Else
               ; unchecked
               $CheckBoxCount = $CheckBoxCount - 1
               $sSelectedPath = StringReplace(_GUICtrlTreeView_GetTree($hTreeView, $cItem), "|", "\")
               If not StringInStr($sSelectedPath, '\') Then $sSelectedPath = $sSelectedPath & '\'
               $CheckedItems = StringReplace($CheckedItems, $sSelectedPath & @CRLF, '')
            EndIf
         EndIf
      Case $NM_DBLCLK
         $aPos = GUIGetCursorInfo($hGUI)
         $ObjectClicked = _GUICtrlTreeView_HitTest($hTreeView, $aPos[0], $aPos[1])
         $cItem = _GUICtrlTreeView_HitTestItem($hTreeView, $aPos[0], $aPos[1])
         If $ObjectClicked = '2' or $ObjectClicked = '4' Then
            If _GUICtrlTreeView_GetExpanded($hTreeView, $cItem) = True Then
               ControlTreeView($hGUI, "", $hTreeView, "Collapse", $cItem)
            Else
               $sSelectedPath = StringReplace(_GUICtrlTreeView_GetTree($hTreeView, $cItem), "|", "\")
               If _GUICtrlTreeView_GetChildCount($hTreeView, $cItem) <= 0 Then
                  _SearchFolder($cItem, $sSelectedPath)
               EndIf
            EndIf
         EndIf
      Case $TVN_SELCHANGINGA, $TVN_SELCHANGINGW
         Return 1
      Case $NM_SETFOCUS
         Return 1
      EndSwitch
   EndSwitch
   Return $GUI_RUNDEFMSG
EndFunc

Func _SearchFolder($cParent, $sPath)
   $aFolderList = _FileListToArray($sPath, "*", $FLTA_FOLDERS)
   If IsArray($aFolderList) Then
      For $i = 1 To $aFolderList[0]
         $hItem = _GUICtrlTreeView_AddChild($hTreeView, $cParent, $aFolderList[$i], 0)
         _GUICtrlTreeView_SetChildren($hTreeView, $hItem, True)
      Next
   EndIf
   $aFileList = _FileListToArray($sPath, "*", $FLTA_FILES)
   If IsArray($aFileList) Then
      For $i = 1 To $aFileList[0]
         _GUICtrlTreeView_AddChild($hTreeView, $cParent, $aFileList[$i], 1, 1)
      Next
   EndIf
   If _GUICtrlTreeView_GetChildCount($hTreeView, $cParent) <= 0 Then
      _GUICtrlTreeView_SetChildren($hTreeView, $cParent, False)
   EndIf
EndFunc

Func _Checked()
   If $CheckBoxCount = '0' Then
      MsgBox(0, '', 'Nothing checked.')
      Return
   Else
      $FileList = ''
      $FolderList = ''
      $BurnList = StringSplit($CheckedItems, @LF)
      For $i = 1 to $BurnList[0] - 1
         $path = StringStripCR($BurnList[$i])
         If StringInStr(FileGetAttrib($path), "D") = 0 Then
            ; File
            $FileList = $FileList & $path & @CRLF
         Else
            ; Folder
            $FolderList = $FolderList & $path & @CRLF
         EndIf
      Next
      If $FileList <> '' Then MsgBox(0,'Checked files',$FileList)
      If $FolderList <> '' Then MsgBox(0,'Checked folders',$FolderList)
   EndIf
EndFunc

Treeview Explorer.au3

Edited by Nikolas92
Link to comment
Share on other sites

  • Moderators

NEW VERSION 16 Feb 17

New: When using checkboxes and only files are to be returned, only files will display checkboxes. However, if any item is prechecked all items will display checkboxes to indicate the full path - but as before checked folders will only be returned if the UDF has been instructed to do so (+ 16 added to the $iDisplay parameter).

New UDF and examples 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 comment
Share on other sites

  • 2 months later...
  • Moderators

c.haslam,

Just use the Exclude_Folders section of the $sMask parameter - something like this:

$sRet = _CFF_Choose("Select a file", 300, 500, Default, Default, "M:\", "*.*||$RECYCLE.BIN")

This is explained in the _CFF_Choose function header. There are always worth a read when the UDF author has gone to the trouble to write them!

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 comment
Share on other sites

  • 2 weeks later...

Thank you.

I am now trying to show only folders (with their parents) that contain .jpg files. Also, I would like folders that contain .jpg files to be emphasized: preferably in color, or bolded. Is this possible with ChooseFileFolder?

Here is my code:

_CFF_Choose('Jpeg dirs on H: drive',Default,Default,Default,Default,'h:','*.jpg||$RECYCLE.BIN',2)

Your expand when needed makes a big difference!

Edited by c.haslam
Spoiler

CDebug Dumps values of variables including arrays and DLL structs, to a GUI, to the Console, and to the Clipboard

 

Link to comment
Share on other sites

  • Moderators

c.haslam,

I am afraid the answer is NO to both of those questions:

- The UDF cannot only display folders which contain a certain file type. Your code as it stands will simply not display any folder that is not named "*.jpg".

- And there is no way to highlight specific folders.

Sorry about that.

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 comment
Share on other sites

  • 5 months later...

Howdy!

After hating my hard-coded treeview item every time I use my GUI, I finally stumbled on your UDF. Just what I was looking for!

I must be doing something weird/wrong though.

My use case: I am trying to select a folder and return the path. I would prefer not to see files. Looks like you have settings just for that, which is great.

What is happening: If I select "option 3" for _CFF_Embed it does seem to work when I doubleclick something. This can only be used on a folder which contains no subfolders, as those would just open the folder on doubleclick. If I hit the Enter key, it sort of works, but outputs the folder without the last 1 or 2 characters, or sometimes returns no path at all, returns @extended set to 1 (edit: which looks to be what is expected when you hit Enter), and then freezes/gets stuck in that function?

Some code I have been working on:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <TreeViewConstants.au3>
#include <GuiTreeView.au3>
#include <ButtonConstants.au3>
#include <ChooseFileFolder.au3>


Opt("GUIOnEventMode", 1)
Opt("GUICoordMode", 1)




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


    $GUI_Main = GUICreate("PDF Scan Move & Rename - ", 808, 550, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_CLIPCHILDREN))
    GUISetBkColor(0xECECEC)

    GUICtrlCreateLabel(" Custom text description:", 8, 6, 534, 16)
    $gui_treeview1 = GUICtrlCreateTreeView(3, 28, 400, 450)
    $gobutton = GUICtrlCreateButton("Go", 730, 500, 60, 30, $BS_CENTER)


    GUICtrlSetOnEvent($gobutton, "go_button")
    GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")

    GUISetState(@SW_SHOW)

    While $GUILoop1 = 1
        Sleep(200)
    WEnd

Func go_button()
    $superTest = _CFF_Embed($gui_treeview1,"D:\TestFolder","*|test1",3)
    ConsoleWrite(@error & " - " & @extended & " - " & $superTest & @CRLF)
EndFunc


Func CLOSEClicked()
    Exit
EndFunc

 

I attached a folder structure to save time for anyone that might want to look at this. :D

Am I just doing something wrong/using the UDF incorrectly?

Thanks for any insight!

TestFolder.zip

 

Edit: @extended = 1 is expected on Enter key.

Edited by m00
Link to comment
Share on other sites

  • Moderators

m00,

Your zip file appears to be empty - can you check and re-upload if necessary?

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 comment
Share on other sites

  • Moderators

m00,

As the file had a .zip extension I did not think it was a 7Zip file as they are normally *.7z - I see inside now.

Edit: Forget the earlier post - I have not looked inside the code much lately and I had forgotten a lot of it, sorry. I see the freezing problem and I am looking into it. I am also looking into how you might get what you want - but do not hold your breath.

M23

Second edit:

I found the problem. I was not resetting the previous mode on leaving the _Embed function at one point - bad coding practice on my part not to have a single exit point, mea culpa. A new UDF release will be along shortly - thanks for finding the bug!

I have also managed to solve your other problem. Alas the UDF will never return folders with children on double click or {ENTER}. However, if you use checkboxes within your treeview you can easily get a folder with children returned. Please modify this amended script (which uses GUIGetMsg to get around the bug you found) with your path and filter - checking a folder and then pressing {ENTER} should return the name regardless of whether it has children:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <TreeViewConstants.au3>

#include "ChooseFileFolder.au3"

Global $GUILoop1 = 1

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

$GUI_Main = GUICreate("PDF Scan Move & Rename - ", 808, 550, -1, -1, BitOR($WS_SYSMENU, $WS_CAPTION, $WS_CLIPCHILDREN))
GUISetBkColor(0xECECEC)

GUICtrlCreateLabel(" Custom text description:", 8, 6, 534, 16)
$gui_treeview1 = GUICtrlCreateTreeView(3, 28, 400, 450, BitOr($GUI_SS_DEFAULT_TREEVIEW, $TVS_CHECKBOXES))
$gobutton = GUICtrlCreateButton("Go", 730, 500, 60, 30, $BS_CENTER)

GUISetState(@SW_SHOW)

While $GUILoop1 = 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $gobutton
            go_button()
    EndSwitch
WEnd

Func go_button()
    $superTest = _CFF_Embed($gui_treeview1, @ScriptDir & "\", "*|BMP", 3)
    ConsoleWrite(@error & " - " & @extended & " - " & $superTest & @CRLF)
EndFunc   ;==>go_button

M23

Edited by Melba23

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 comment
Share on other sites

  • Moderators

m00,

See my edited post above - I have found the bug and a workaround for you.

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 comment
Share on other sites

Hey cool!

I have been just butchering :whistle: a version of your UDF (for personal use only, because I probably broke all the other parts of it), and did get it to work for my specific use case. I really don't want checkboxes, so I forced it to accept the enter key on a folder with children/subfolders.

I think the bug may be that in the Case $cReturn section of the _CFF_Embed function, there isn't a line to put the mode back to where it was, as there is on doubleclick/etc. I added it, and it stopped the freezing for me.

Opt('GUIOnEventMode', $nOldOpt)

 

Link to comment
Share on other sites

  • Moderators

m00,

That was indeed the problem. Can you let me see your "butchered" version so that I can perhaps incorporate your solution into the UDF proper?

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 comment
Share on other sites

Of course, but novice that I am, I don't think you will actually be interested in it. I pretty much just commented out some of your likely useful checks ("is it a file, or a folder"), added some consolewrites so I could see where it was freezing, and added that one line.

ChooseFileFolder_m00Hack.au3

test4.au3

 

I definitely learned a lot today though, which is great. I have been using AutoIt for 10+ years, and still don't really know what I am doing. :)

Edited by m00
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...