Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Dropdown Gui issue


  • Please log in to reply
1 reply to this topic
571
  • Members
  • 8 posts
  • Last active: Oct 30 2015 08:44 AM
  • Joined: 14 Apr 2015

dear all,

I kinda stuck with a small program.
I need to use some drop down menu's, using folders from the harddisk.

but this should go according tree format.

So first i should be able to select first group of folders, when i selected one there, i should go in his subfolders and select one there. And then also third step a subfolder from previous one. the tricky part should be if i select again from first group one, it should start all over again and step 2 & 3 should be empty again.

according this:
wukqdu.jpg

but i am not getting there, someone can help me out please?
Here is the part i already found and only first step is working for the moment.


Gosub, FirstFolder

Gui, Add, Text,, FirstTree
Gui, Add, DropDownList, vFirstChoice, %listfirst%

Gui, Add, Text,, SecondTree
Gui, Add, DropDownList, vSecondChoice, %listsecond%

Gui, Add, Text,, ThirdTree
Gui, Add, DropDownList, vThirdChoice, %listthird%

Gui, Show
return

GuiClose:
ExitApp

FirstFolder:
IfExist, C:\Tree\
Listfirst =
loop, C:\Tree\*.*, 2,0
    Listfirst = %Listfirst%%A_LoopFileName%|

; GuiControlGet, check1, ,FirstChoice
; if Check1=1
; {
;     goto, ModelFolder
; }
; else
; {    
;
; }
return    

ModelFolder:
GUI, submit, nohide
Listsecond =
loop, C:\Tree\%FirstChoice%\*.*, 2,0
    Listsecond = %Listsecond%%A_LoopFileName%|
Gosub, TypeFolder
return

TypeFolder:

Listthird =
loop, C:\Tree\%FirstChoice%\%SecondChoice%\*.*, 2,0
    Listthird = %Listthird%%A_LoopFileName%|
return
 

Exaskryz
  • Members
  • 3249 posts
  • Last active: Nov 20 2015 05:30 AM
  • Joined: 23 Aug 2012

Oi, I did the code at the bottom, but it's not what you were looking for, I see. I'll tweak it up and it should hopefully work.

 

Edit: This top code (not in the spoiler) is closer to what you wanted. Of course, it's not a final product.

 

root:="C:\Tree"
Loop, Files, %root%\*, D
    listfirst.="|" A_LoopFileName

Gui, New
Gui, Add, Text,, FirstTree
Gui, Add, DropDownList, gUpdate1 vFirstChoice, %listfirst%
Gui, Add, Text,, SecondTree
Gui, Add, DropDownList, gUpdate2 vSecondChoice, %listsecond%
Gui, Add, Text,, ThirdTree
Gui, Add, DropDownList, gUpdate3 vThirdChoice, %listthird%
Gui, Show
return



Update1:
Gui, Submit, NoHide
listsecond:=""
Loop, Files, %root%\%FirstChoice%\*, D
    listsecond.="|" A_LoopFileName
GuiControl,, SecondChoice, %listsecond% ; update the dropdown
return

Update2:
Gui, Submit, NoHide
listthird:=""
Loop, Files, %root%\%FirstChoice%\%SecondChoice%\*, D
    listthird.="|" A_LoopFileName
GuiControl,, ThirdChoice, %listthird%
return

Update3:
Gui, Submit, NoHide
MsgBox You have selected`n%root%\%FirstChoice%\%SecondChoice%\%ThirdChoice%
return

 

Spoiler