1+ XIncludeFile "DocumentsSorter.pbi"
2+ XIncludeFile "VideosSorter.pbi"
3+ XIncludeFile "ImagesSorter.pbi"
4+
5+ Enumeration
6+ #WINDOW_1
7+ #LISTVIEW_1
8+ #LISTVIEW_2
9+ #LISTVIEW_3
10+ #TEXT_GADGET_1
11+ #TEXT_GADGET_2
12+ #TEXT_GADGET_3
13+ EndEnumeration
14+
15+ #WINDOWS_FLAGS = #PB_Window_SystemMenu | #PB_Window_ScreenCentered
16+
17+ If OpenWindow(#WINDOW_1, 0, 0, 720, 420, "Directory 101", #WINDOWS_FLAGS)
18+
19+ TextGadget(#TEXT_GADGET_1, 5, 5, 200, 30, "DOCUMENTS:")
20+ TextGadget(#TEXT_GADGET_2, 5, 145, 200, 30, "VIDEOS:")
21+ TextGadget(#TEXT_GADGET_3, 5, 285, 200, 30, "PICTURES:")
22+
23+ ListViewGadget(#LISTVIEW_1, 10, 30, 700, 100)
24+ ListViewGadget(#LISTVIEW_2, 10, 170, 700, 100)
25+ ListViewGadget(#LISTVIEW_3, 10, 310, 700, 100)
26+
27+ SetGadgetFont(#WINDOW_1, FontID(LoadFont(#PB_Any,"Century Gothic", 12)))
28+ SetGadgetFont(#LISTVIEW_1, FontID(LoadFont(#PB_Any,"Century Gothic", 12)))
29+ SetGadgetFont(#LISTVIEW_2, FontID(LoadFont(#PB_Any,"Century Gothic", 12)))
30+ SetGadgetFont(#LISTVIEW_3, FontID(LoadFont(#PB_Any,"Century Gothic", 12)))
31+ SetGadgetFont(#TEXT_GADGET_1, FontID(LoadFont(#PB_Any,"Comic Sans MS", 14)))
32+ SetGadgetFont(#TEXT_GADGET_2, FontID(LoadFont(#PB_Any,"Comic Sans MS", 14)))
33+ SetGadgetFont(#TEXT_GADGET_3, FontID(LoadFont(#PB_Any,"Comic Sans MS", 14)))
34+
35+ ForEach DirectoryContent3()
36+ AddGadgetItem(#LISTVIEW_3, -1, DirectoryContent3())
37+ Next
38+
39+ ForEach DirectoryContent2()
40+ AddGadgetItem(#LISTVIEW_2, -1, DirectoryContent2())
41+ Next
42+
43+ ForEach DirectoryContent1()
44+ AddGadgetItem(#LISTVIEW_1, -1, DirectoryContent1())
45+ Next
46+
47+ Repeat
48+ Event = WaitWindowEvent()
49+
50+ Select Event
51+
52+ Case #PB_Event_Gadget
53+ Select EventGadget()
54+
55+ Case #LISTVIEW_1
56+ Select EventType()
57+ Case #PB_EventType_LeftClick
58+ SetGadgetState(#LISTVIEW_2, -1)
59+ SetGadgetState(#LISTVIEW_3, -1)
60+ SetActiveGadget(#LISTVIEW_1)
61+
62+ Case #PB_EventType_LeftDoubleClick
63+ SetGadgetState(#LISTVIEW_2, -1)
64+ SetGadgetState(#LISTVIEW_3, -1)
65+ SetActiveGadget(#LISTVIEW_1)
66+
67+ path1.s = GetGadgetItemText(#LISTVIEW_1, (GetGadgetState(#LISTVIEW_1)))
68+
69+ pathComplete1.s = Directory$ + path1
70+ RunProgram(pathComplete1)
71+ EndSelect
72+
73+ Case #LISTVIEW_2
74+ Select EventType()
75+ Case #PB_EventType_LeftClick
76+ SetGadgetState(#LISTVIEW_1, -1)
77+ SetGadgetState(#LISTVIEW_3, -1)
78+ SetActiveGadget(#LISTVIEW_2)
79+
80+ Case #PB_EventType_LeftDoubleClick
81+ SetActiveGadget(#LISTVIEW_2)
82+ SetGadgetState(#LISTVIEW_1, -1)
83+ SetGadgetState(#LISTVIEW_3, -1)
84+ path2.s = GetGadgetItemText(#LISTVIEW_2, (GetGadgetState(#LISTVIEW_2)))
85+ pathComplete2.s = Directory$ + path2
86+ RunProgram(pathComplete2)
87+ EndSelect
88+
89+ Case #LISTVIEW_3
90+ Select EventType()
91+ Case #PB_EventType_LeftClick
92+ SetGadgetState(#LISTVIEW_2, -1)
93+ SetGadgetState(#LISTVIEW_1, -1)
94+ SetActiveGadget(#LISTVIEW_3)
95+
96+ Case #PB_EventType_LeftDoubleClick
97+ SetGadgetState(#LISTVIEW_1, -1)
98+ SetGadgetState(#LISTVIEW_2, -1)
99+ SetActiveGadget(#LISTVIEW_3)
100+
101+ path3.s = GetGadgetItemText(#LISTVIEW_3, (GetGadgetState(#LISTVIEW_3)))
102+ pathComplete3.s = Directory$ + path3
103+ RunProgram(pathComplete3)
104+ EndSelect
105+
106+ EndSelect
107+
108+ EndSelect
109+ Until Event = #PB_Event_CloseWindow
110+ EndIf
111+ ; IDE Options = PureBasic 5.00 (Windows - x64)
112+ ; EnableXP
0 commit comments