-
Notifications
You must be signed in to change notification settings - Fork 72
/
Copy pathFE.ahk
149 lines (115 loc) · 2.62 KB
/
FE.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
FE_load(autobuild=false)
{
Global FE_Autobuild
FE_Autobuild := autobuild
Run, regsvr32 "%A_ScriptDir%\FEShlExt.dll" /s
}
FE_unload()
{
Run, regsvr32 "%A_ScriptDir%\FEShlExt.dll" /u /s
}
FE_addItem(id,parent,submenu,application,parameters,caption,hint,iconfile,iconindex,checked,filetype)
{
Global
itemCnt++
item[%id%] := itemCnt
item[%itemCnt%]ID := id
if parent is not integer
{
parent := item[%parent%]
}
item[%itemCnt%]Parent := Parent
item[%itemCnt%]Application := Application
item[%itemCnt%]Parameters := Parameters
item[%itemCnt%]Caption := Caption
item[%itemCnt%]Hint := Hint
item[%itemCnt%]IconFile := IconFile
item[%itemCnt%]IconIndex := IconIndex
item[%itemCnt%]Checked := Checked
item[%itemCnt%]FileType := FileType
item[%itemCnt%]SubMenu := SubMenu
if FE_Autobuild
FE_buildMenu()
return % itemCnt
}
FE_deleteItem(id)
{
Global
no := item[%id%]
if no !=
{
Loop, % itemCnt - no
{
i := A_Index + no
j := i-1
FE_int_copyItem(i,j)
}
itemCnt--
}
if FE_Autobuild
FE_buildMenu()
}
FE_int_copyItem(from,to)
{
Global
local tList
tList = ID,Parent,Application,Parameters,Caption,Hint,IconFile,IconIndex,Checked,FileType,SubMenu
Loop, parse, tList, `,
{
it := item[%from%]%A_LoopField%
item[%to%]%A_LoopField% := it
}
}
FE_addCustomSetting(option,value)
{
Global
csCnt++
cs[%csCnt%]Option := option
cs[%csCnt%]Value := value
if FE_Autobuild
FE_buildMenu()
}
FE_addDebugSetting(option,value)
{
Global
dsCnt++
ds[%dsCnt%]Option := option
ds[%dsCnt%]Value := value
if FE_Autobuild
FE_buildMenu()
}
FE_buildMenu()
{
Global
local iniFile, i, section, tList, tOption, tValue
iniFile = %A_ScriptDir%\FastExplorer.ini
FileDelete, %iniFile%
section = Dynamic Items
Loop, %itemCnt%
{
i := A_Index
tList = Parent,Application,Parameters,Caption,Hint,IconFile,IconIndex,Checked,FileType,SubMenu
Loop, parse, tList, `,
{
it := item[%i%]%A_LoopField%
IniWrite, %it%, %iniFile%, %section%, %A_LoopField%%i%
}
}
IniWrite, %itemCnt%, %iniFile%, %section%, Count
section = Custom-drawn Menu Properties
Loop, %csCnt%
{
i := A_Index
tOption := cs[%i%]Option
tValue := cs[%i%]Value
IniWrite, %tValue%, %iniFile%, %section%, %tOption%
}
section = Debug Options
Loop, %dsCnt%
{
i := A_Index
tOption := ds[%i%]Option
tValue := ds[%i%]Value
IniWrite, %tValue%, %iniFile%, %section%, %tOption%
}
}