Advertisement
dangerdogL2121

Fire Smartbar Version 5

May 17th, 2013
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. This program was designed to make a opening files and going to web addresses easier.
  3. Welcome to the script for the 'Fire Smartbar'.
  4. Made by dangerdogL2121(code name).
  5. I put a lot of time in this, so please don't take credit for it.
  6. This is my first public project!
  7. Definate bugs: None
  8. Possible bugs: The gui might not run whatever the user clicks on.
  9. Less important details:
  10. Programming language: AutoHotkey
  11. Total programming time in hours:approx. 10hrs(a really bad estamate)
  12. Time span from start to finish: 3 days
  13. Thank you for looking at this!
  14. Finished 5/3/2013
  15. */
  16. #WinActivateForce
  17. coordmode, pixel, screen
  18. coordmode,mouse,screen
  19. coordmode,tooltip,screen
  20. moveif=
  21. Varx=
  22. Vary=
  23. ColorChoice=
  24. thing1=(blank)
  25. thing2=(blank)
  26. thing3=(blank)
  27. thing4=(blank)
  28. thing5=(blank)
  29. thing6=(blank)
  30. thing7=(blank)
  31. thing8=(blank)
  32. thing9=(blank)
  33. thing10=(blank)
  34. inputnum=1
  35. numthing=1
  36. Hider=FALSE
  37. startscreenw=%A_ScreenWidth%
  38. startscreenw-=350
  39. IniRead, Hider, %A_ScriptDir%\ddlhelper.ini, Section100, Key1,FALSE
  40. IniRead, moveif, %A_ScriptDir%\ddlhelper.ini, Section103, Key1
  41. if moveif = ERROR
  42. {
  43. moveif=0
  44. }
  45. loop,10
  46. {
  47. IniRead, thing%inputnum%, %A_ScriptDir%\ddlhelper.ini, Section%inputnum%, Key1
  48. if thing%inputnum% = ERROR
  49. thing%inputnum% = (blank)
  50. inputnum+=1
  51. }
  52. OnMessage(0x201, "WM_LBUTTONDOWN")
  53. WM_LBUTTONDOWN()
  54. {
  55.     if A_Gui = 1
  56.         PostMessage, 0xA1, 2 ; WM_NCLBUTTONDOWN
  57. WinGetPos, Varx, Vary,,, %A_ScriptName%
  58. IniWrite, %Varx%, %A_ScriptDir%\ddlhelper.ini, Section101, Key1
  59. IniWrite, %Vary%, %A_ScriptDir%\ddlhelper.ini, Section102, Key1
  60. moveif := 1
  61. IniWrite, %moveif%, %A_ScriptDir%\ddlhelper.ini, Section103, Key1
  62. }
  63. IniRead, Varx, %A_ScriptDir%\ddlhelper.ini, Section101, Key1
  64. IniRead, Vary, %A_ScriptDir%\ddlhelper.ini, Section102, Key1
  65. Gosub, MainGui
  66. return
  67.  
  68. MainGui:
  69. Gui,Submit
  70. Gui,Destroy
  71. IniRead, Varx, %A_ScriptDir%\ddlhelper.ini, Section101, Key1
  72. IniRead, Vary, %A_ScriptDir%\ddlhelper.ini, Section102, Key1
  73. WinActivate,%A_ScriptName%
  74. startscreenw=%A_ScreenWidth%
  75. startscreenw-=400
  76. gui, font, s10, Verdana
  77. Gui,+AlwaysOnTop
  78. Gui, +ToolWindow -caption
  79. Gui, Color, EEAA99
  80. WinSet, TransColor, EEAA99
  81. Gui, Add, Text, , Thank you for using the Fire Smartbar.`nClick on a blank box to configure it.
  82. Gui, Add, DropDownList, w350 vColorChoice gcheck altsubmit, hide|Clear a drop down list box|%thing1%|%thing2%|%thing3%|%thing4%|%thing5%|%thing6%|%thing7%|%thing8%|%thing9%|%thing10%
  83. if Hider = TRUE
  84. {
  85. Gui, Show, Hide
  86. }
  87. if Hider = FALSE
  88. {
  89. if moveif = 1
  90. {
  91. Gui, Show, x%Varx% y%Vary%
  92. }
  93. else
  94. {
  95. Gui, Show, x%startscreenw% y200
  96. }
  97. }
  98. WinActivate,%A_ScriptName%
  99. return
  100.  
  101.  
  102.  
  103.  
  104. check:
  105. KeyWait,WheelDown
  106. KeyWait,WheelUp
  107. Gui,Submit
  108. ifWinNotActive,%A_ScriptName%
  109. WinActivate,%A_ScriptName%
  110. workon=%ColorChoice%
  111. workon-=2
  112. if ColorChoice = 1
  113. {
  114. MsgBox,To bring the drop down list back type 'unhide'.
  115. Hider=TRUE
  116. IniWrite, TRUE, %A_ScriptDir%\ddlhelper.ini, Section100, Key1
  117. FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
  118. Gosub, MainGui
  119. }
  120. if ColorChoice = 2
  121. {
  122. Gosub,Configure
  123. }
  124. if ColorChoice > 2
  125. {
  126. if thing%workon% != (blank)
  127. {
  128. StringLen,dcheck, thing%workon%
  129. if dcheck > 0
  130. {
  131. run,% thing%workon%,,UseErrorLevel
  132. If ErrorLevel = ERROR
  133. {
  134. MsgBox, % thing%workon% "could not be opened."
  135. ErrorLevel=0
  136. }
  137. Gosub, MainGui
  138. }
  139. }
  140. else
  141. {
  142. Gosub, choser
  143. }
  144. }
  145. return
  146.  
  147. choser:
  148. WinGetPos,Varx,Vary,,A
  149. Gui,Submit
  150. Gui, Destroy
  151. WinActivate, %A_ScriptName%
  152. KeyWait,WheelDown
  153. KeyWait,WheelUp
  154. ifWinNotActive,%A_ScriptName%
  155. WinActivate,%A_ScriptName%
  156. startscreenw=%A_ScreenWidth%
  157. startscreenw-=200
  158. okbutton=startscreenw
  159. okbutton+=100
  160. numthing=%ColorChoice%
  161. EnvSub, numthing, 1
  162. Gui,+AlwaysOnTop
  163. WinSet, TransColor, EEAA99
  164. Gui, +ToolWindow -caption
  165. gui, font, s10, Verdana
  166. Gui, Color, EEAA99
  167. Gui, Add, Text,, Select shortcut type.
  168. Gui, Add, Radio, vMyRadio altsubmit, File or folder
  169. Gui, Add, Radio,, Internet Address
  170. Gui, Add, Radio,, Make box blank
  171. Gui, Add, Button,x%okbutton% gbuttonok, OK
  172. Gui, Show, x%Varx% y%Vary%
  173. return
  174.  
  175. buttonok:
  176. Gui,Submit
  177. ifWinNotActive,%A_ScriptName%
  178. WinActivate,%A_ScriptName%\
  179. if MyRadio = 0
  180. {
  181. Gosub,MainGui
  182. }
  183. if MyRadio = 1
  184. {
  185. FileSelectFile, thing%numthing%
  186. if ErrorLevel = 1
  187. {
  188. thing%numthing%=(blank)
  189. ErrorLevel=0
  190. }
  191. IniWrite, % thing%numthing%, %A_ScriptDir%\ddlhelper.ini, Section%numthing%, Key1
  192. FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
  193. Gosub, MainGui
  194. }
  195. if MyRadio = 2
  196. {
  197. InputBox, thing%numthing%, Item%numthing%, Please insert what internet address`nyou want the Item%numthing%.
  198. if ErrorLevel = 1
  199. {
  200. thing%numthing%=(blank)
  201. ErrorLevel=0
  202. }
  203. if thing%numthing% =
  204. {
  205. thing%numthing%=(blank)
  206. }
  207. IniWrite, % thing%numthing%, %A_ScriptDir%\ddlhelper.ini, Section%numthing%, Key1
  208. FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
  209. Gosub, MainGui
  210. }
  211. if MyRadio = 3
  212. {
  213. thing%numthing% = (blank)
  214. IniWrite, % thing%numthing%, %A_ScriptDir%\ddlhelper.ini, Section%numthing%, Key1
  215. Gosub, MainGui
  216. }
  217. return
  218.  
  219.  
  220. :*B0:unhide::
  221. IniWrite, FALSE, %A_ScriptDir%\ddlhelper.ini, Section100, Key1
  222. FileSetAttrib, -H, %A_ScriptDir%\ddlhelper.ini
  223. Hider=FALSE
  224. Gosub, MainGui
  225. return
  226.  
  227.  
  228.  
  229.  
  230.  
  231. configure:
  232. Gui, Destroy
  233. WinActivate,%A_ScriptName%
  234. KeyWait,WheelDown
  235. KeyWait,WheelUp
  236. startscreenw=%A_ScreenWidth%
  237. startscreenw-=350
  238. Gui,+AlwaysOnTop
  239. WinSet, TransColor, EEAA99
  240. Gui, +ToolWindow -caption
  241. gui, font, s10, Verdana
  242. Gui, Color, EEAA99
  243. Gui, Add, Text, , Select the box you want to change.
  244.  
  245. Gui, Add, DropDownList, w300 vConfigure2 gchanger altsubmit, back|%thing1%|%thing2%|%thing3%|%thing4%|%thing5%|%thing6%|%thing7%|%thing8%|%thing9%|%thing10%
  246. Gui, Show, x%Varx% y%Vary%
  247. return
  248.  
  249. changer:
  250. Gui,Submit
  251. ifWinNotActive,%A_ScriptName%
  252. WinActivate,%A_ScriptName%
  253. numthing=%Configure2%
  254. numthing-=1
  255. if Configure2 = 1
  256. {
  257. Gui,Destroy
  258. Gosub, MainGui
  259. }
  260. if Configure2 > 1
  261. {
  262. thing%numthing%=(blank)
  263. Gosub,MainGui
  264. }
  265. return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement