-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.ahk
267 lines (220 loc) · 8.31 KB
/
settings.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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
; updated for v0.8.7 HeartyHampster
; ===================================================================================
; = Startup Code =
; ===================================================================================
#SingleInstance Force
#Persistent
#NoEnv
SetWorkingDir %A_ScriptDir%
SetBatchLines -1
#NoTrayIcon
; ===================================================================================
; Initial Variables
; ===================================================================================
save = 1
; ===================================================================================
; GUI Assets Variables
; ===================================================================================
googlegrey = media\gui assets\Google Grey.png
googlecolour = media\gui assets\Google Colour.png
firefoxgrey = media\gui assets\Firefox Grey.png
firefoxcolour = media\gui assets\Firefox Colour.png
edgegrey = media\gui assets\Edge GRey.png
edgecolour = media\gui assets\Edge Colour.png
chromegrey = media\gui assets\Chrome Grey.png
chromecolour = media\gui assets\Chome Colour.png
binggrey = media\gui assets\Bing Grey.png
bingcolour = media\gui assets\Bing Colour.png
quickbasegrey = media\gui assets\Quickbase Grey.png
quickbasecolour = media\gui assets\QuickBase Colour.png
closebutton = media\gui assets\Close Button.png
savehover = media\gui assets\Save hover.png
savenohover = media\gui assets\Save no hover.png
; ===================================================================================
; Settings GUI
; ===================================================================================
Gui -MinimizeBox -MaximizeBox -SysMenu +AlwaysOnTop -Caption ; removes system buttons, adds always-on-top
Gui Add, Picture, x0 y0 w1000 h700, media\gui assets\BG.png ; This is the main background image
Gui Add, Picture, gGoogle x654 y159 w94 h96 +BackgroundTrans, %googlegrey% ; this is the grey Google button
Gui Add, Picture, vGoogle x654 y159 w94 h96 +BackgroundTrans, %googlecolour% ; this is the colour Google button
Gui Add, Picture, gFireFox x266 y272 w95 h100 +BackgroundTrans, %firefoxgrey% ; this is the grey FireFox button
Gui Add, Picture, vFireFox x266 y272 w95 h100 +BackgroundTrans, %firefoxcolour% ; this is the colour FireFox button
Gui Add, Picture, gEdge x266 y388 w96 h96 +BackgroundTrans, %edgegrey% ; this is the grey Edge button
Gui Add, Picture, vEdge x266 y388 w96 h96 +BackgroundTrans, %edgecolour% ; this is the colour Edge button
Gui Add, Picture, gChrome x266 y159 w96 h96 +BackgroundTrans, %chromegrey% ; this is the grey Chrome button
Gui Add, Picture, vChrome x266 y159 w96 h96 +BackgroundTrans, %chromecolour% ; this is the colour Chrome button
Gui Add, Picture, gBing x654 y272 w64 h96 +BackgroundTrans, %binggrey% ; this is the grey Bing button
Gui Add, Picture, vBing x654 y272 w64 h96 +BackgroundTrans, %bingcolour% ; this is the colour Bing button
Gui Add, Picture, gQuickbase x654 y388 w72 h97 +BackgroundTrans, %quickbasegrey% ; this is the grey QuickBase button
Gui Add, Picture, vQuickBase x654 y388 w72 h97 +BackgroundTrans, %quickbasecolour% ; this is the colour QuickBase button
Gui Add, Picture, gClose hWndMyclose vMyclose x960 y23 w17 h17 +BackgroundTrans, %closebutton% ; this is the normal close button
Gui Add, Picture, gSave hWndMysave vMysave x456 y649 w86 h33, %savenohover% ; this is the grey save button
Gui Add, Picture, hWndMynosave vMynosave x456 y649 w86 h33, %savehover% ; this is the colour save button
Gui Add, Picture, x29 y654 w33 h23 +BackgroundTrans, media\gui assets\hotkey logo.png ; this is the logo
Gui +LastFound
WinSet, Region, 0-0 w1000 h700 R30-30,
OnMessage(0x201, "WM_LBUTTONDOWN")
; ===================================================================================
; this sets up the buttons when the GUI first loads
; ===================================================================================
IniRead, BrowserType, data\settings.ini, userdata, userpreferredbrowser
IniRead, SearchEngine, data\settings.ini, userdata, userpreferredsearchengine
if ( BrowserType = "Chrome" )
{
GuiControl, show, Chrome,
} else {
GuiControl, hide, Chrome,
}
if ( BrowserType = "FireFox" )
{
GuiControl, show, FireFox,
} else {
GuiControl, hide, FireFox,
}
if ( BrowserType = "Edge" )
{
GuiControl, show, Edge,
} else {
GuiControl, hide, Edge,
}
if ( SearchEngine = "Google" )
{
GuiControl, show, Google,
} else {
GuiControl, hide, Google,
}
if ( SearchEngine = "Bing" )
{
GuiControl, show, Bing,
} else {
GuiControl, hide, Bing,
}
if ( SearchEngine = "Quickbase" )
{
GuiControl, show, QuickBase,
} else {
GuiControl, hide, QuickBase,
}
Gui Show, w1000 h700,
SetTimer, MouseOverPicture, 1
SetTimer, GuiController, 1
return
; ===================================================================================
; gLabel commands from the gui
; ===================================================================================
Chrome:
IniWrite, Chrome, data\settings.ini, userdata, userpreferredbrowser
return
FireFox:
IniWrite, FireFox, data\settings.ini, userdata, userpreferredbrowser
return
Edge:
IniWrite, Edge, data\settings.ini, userdata, userpreferredbrowser
return
Google:
IniWrite, Google, data\settings.ini, userdata, userpreferredsearchengine
return
Bing:
IniWrite, Bing, data\settings.ini, userdata, userpreferredsearchengine
return
Quickbase:
IniWrite, Quickbase, data\settings.ini, userdata, userpreferredsearchengine
return
; ===================================================================================
;reads if the mouse is hovering over the save button and changes a variable to 1 or 0
; ===================================================================================
MouseOverPicture:
Gui, Submit, NoHide
MouseGetPos,,,,id,
if ( id = "Static15")
{
save = 1
}
if ( id = "Static1")
{
save = 0
}
return
; ===================================================================================
; This updates the GUI Buttons based on the selected settings
; ===================================================================================
GuiController:
IniRead, BrowserType, data\settings.ini, userdata, userpreferredbrowser
IniRead, SearchEngine, data\settings.ini, userdata, userpreferredsearchengine
if ( save = "1" )
{
GuiControl, show, Mynosave,
} else {
GuiControl, hide, Mynosave,
}
if ( BrowserType = "Chrome" )
{
GuiControl, show, Chrome,
} else {
GuiControl, hide, Chrome,
}
if ( BrowserType = "FireFox" )
{
GuiControl, show, FireFox,
} else {
GuiControl, hide, FireFox,
}
if ( BrowserType = "Edge" )
{
GuiControl, show, Edge,
} else {
GuiControl, hide, Edge,
}
if ( SearchEngine = "Google" )
{
GuiControl, show, Google,
} else {
GuiControl, hide, Google,
}
if ( SearchEngine = "Bing" )
{
GuiControl, show, Bing,
} else {
GuiControl, hide, Bing,
}
if ( SearchEngine = "Quickbase" )
{
GuiControl, show, QuickBase,
} else {
GuiControl, hide, QuickBase,
}
return
; ===================================================================================
; Hold left click to move window
; ===================================================================================
WM_LBUTTONDOWN(wParam, lParam, msg, hwnd)
{
PostMessage 0xA1, 2
}
; ===================================================================================
; Functions
; ===================================================================================
Close(CtrlHwnd, GuiEvent, EventInfo, ErrLevel := "") {
ExitApp
}
Save(CtrlHwnd, GuiEvent, EventInfo, ErrLevel := "") {
ExitApp
}
GuiSize(GuiHwnd, EventInfo, Width, Height) {
If (A_EventInfo == 1) {
Return
}
}
GuiEscape(GuiHwnd) {
ExitApp
}
GuiClose(GuiHwnd) {
ExitApp
}
OnWM_MOUSEMOVE(wParam, lParam, msg, hWnd) {
}
OnWM_LBUTTONDOWN(wParam, lParam, msg, hWnd) {
}
; ===================================================================================
; End
; ===================================================================================