【娱乐至上】一个简单的记事工具

【娱乐至上】一个简单的记事工具

  1. ; 一个用来简单记事的工具
  2. ; 运行后默认显示/隐藏窗口热键 Ctrl F12, 可以在set.ini里修改
  3. ; 可以调整每条内容的顺序
  4. ; 目前已知的,在连续频繁调顺序的过程中有几率内容错乱【我暂时无解】
  5. ; 运行的时候自动创建一个Set.ini文件
  6. ; 新建内容的时候会新建js.ini文件
  7. loadjsb:
  8. Menu, Tray, NoStandard
  9. Menu, Tray, DeleteAll
  10. Menu, Tray, Add, 记事本, ShowOrHide
  11. Menu, Tray, Add, 重启, 重启
  12. Menu, Tray, Add, 退出, 退出
  13. Menu, Tray, Default, 记事本
  14. Menu, Tray, Tip, 默认显示快捷键Ctrl F12 `n Set.ini里可以修改 `n 右键双击条目可以对下面扩展的Edit框编辑
  15. Menu, Tray, Click, 2
  16. Gui, +HwndNoteBQ +AlwaysOnTop +LastFound
  17. Gui, Font, s16
  18. Gui, Add, Edit, h30 w480 Section vNewjs
  19. Gui, Add, Button, h30 xs ys+35 g新建, 添加
  20. Gui, Add, Button, h30 x+5 g插入, 插入
  21. Gui, Add, Button, h30 x+5 g删除, 删除
  22. Gui, Add, Text, h30 x+5 yp+4, |
  23. Gui, Add, Button, h30 x+5 yp-4 g向上, 向上
  24. Gui, Add, Button, h30 x+5 g向下, 向下
  25. Gui, Add, Edit, h30 w64 x+5
  26. Gui, Add, UpDown, h30 x+5 v目标行号 Range1-300
  27. Gui, Add, Button, h30 x+5 g移动, 移动
  28. Gui, Add, ListView, R10 -Multi Grid Count10 -Hdr xs y+5 gLv_Mouse AltSubmit, 内容|扩展
  29. Gui, Add, Edit, xs y+5 w480 h150 Disabled1 vShowNR
  30. LV_ModifyCol(1,420)
  31. LV_ModifyCol(2,50)
  32. Loadind()
  33. 初始化热键()
  34. Return
  35. 重启:
  36. Reload
  37. Return
  38. 退出:
  39. ExitApp
  40. Return
  41. GuiClose:
  42. ShowOrHide:
  43. If (WinExist("ahk_id" NoteBQ)){
  44. WinGetpos, Gui_x, Gui_y, Gui_w, Gui_h, ahk_id %NoteBQ%
  45. IniWrite, % Gui_x, % A_WorkingDir "\Set.ini", GuiHotkey, Gui_x
  46. IniWrite, % Gui_y, % A_WorkingDir "\Set.ini", GuiHotkey, Gui_y
  47. Gui, Hide
  48. }
  49. Else {
  50. IniRead, Gui_x, % A_WorkingDir "\Set.ini", GuiHotkey, Gui_x
  51. IniRead, Gui_y, % A_WorkingDir "\Set.ini", GuiHotkey, Gui_y
  52. Gui, show, x%Gui_x% y%Gui_y%, 一个简单的记事工具
  53. }
  54. Return
  55. 移动:
  56. Gui, Submit, NoHide
  57. HNumber := LV_GetNext()
  58. If (HNumber != 0) {
  59. LV_GetText(danhang, HNumber,1)
  60. LV_GetText(danhang2, HNumber,2)
  61. LV_Delete(HNumber)
  62. LV_Insert(目标行号, "Focus Select",danhang, danhang2)
  63. }
  64. Settimer, 更新记录, -300
  65. Return
  66. 向上:
  67. HNumber := LV_GetNext()
  68. If (HNumber > 1) {
  69. LV_GetText(danhang, HNumber,1)
  70. LV_GetText(danhang2, HNumber,2)
  71. LV_Insert(HNumber-1, "Focus Select",danhang, danhang2)
  72. LV_Delete(HNumber+1)
  73. }
  74. Settimer, 更新记录, -300
  75. Return
  76. 向下:
  77. HNumber := LV_GetNext()
  78. If (HNumber < LV_GetCount() && HNumber > 0) {
  79. LV_GetText(danhang, HNumber,1)
  80. LV_GetText(danhang2, HNumber,2)
  81. LV_Insert(HNumber+2, "Focus Select",danhang, danhang2)
  82. LV_Delete(HNumber)
  83. }
  84. Settimer, 更新记录, -300
  85. Return
  86. 插入:
  87. Gui, Submit, NoHide
  88. If(Newjs) {
  89. HNumber := LV_GetNext()
  90. LV_Insert(HNumber := (HNumber = 0) ? 1 : HNumber, ,Newjs)
  91. GuiControl, Text, Newjs
  92. IniWrite, thi=, % A_WorkingDir "\js.ini", % Newjs
  93. }
  94. Settimer, 更新记录, -300
  95. Return
  96. 新建:
  97. Gui, Submit, NoHide
  98. If(Newjs) {
  99. LV_Add(, Newjs)
  100. GuiControl, Text, Newjs
  101. IniWrite, thi=, % A_WorkingDir "\js.ini", % Newjs
  102. }
  103. Settimer, 更新记录, -300
  104. Return
  105. 删除:
  106. HNumber := LV_GetNext()
  107. LV_GetText(HText, HNumber)
  108. If (HNumber != 0) {
  109. IniDelete, % A_WorkingDir "\js.ini", % HText
  110. LV_Delete(HNumber)
  111. }
  112. Settimer, 更新记录, -300
  113. Return
  114. Lv_Mouse:
  115. HNumber := LV_GetNext()
  116. Switch A_GuiEvent
  117. {
  118. Case "R":
  119. If (HNumber = 0)
  120. Return
  121. GuiControl, Enable, ShowNR
  122. LV_GetText(HText, HNumber)
  123. IniRead, ShowYl, % A_WorkingDir "\js.ini", % HText, thi
  124. If (ShowYl) {
  125. ShowYl := RegExReplace(ShowYl,"\\n","`n")
  126. GuiControl, Text, ShowNR, % ShowYl
  127. }
  128. Else {
  129. GuiControl, Text, ShowNR
  130. }
  131. OldHh := LV_GetNext()
  132. LV_GetText(OldText, OldHh)
  133. Case "RightClick":
  134. GuiControl, Text, ShowNR
  135. Case "Normal":
  136. If (OldHh) {
  137. Gui, Submit, NoHide
  138. ShowNR := RegExReplace(ShowNR,"[\n\r]+","\n")
  139. IniWrite, % ShowNR, % A_WorkingDir "\js.ini", % OldText, thi
  140. LV_Modify(OldHh, ,OldText, kv := (ShowNR) ? ">>>" : "")
  141. }
  142. GuiControl, Disabled, ShowNR
  143. Switch HNumber
  144. {
  145. Case 0:
  146. GuiControl, Text, ShowNR
  147. Default:
  148. LV_GetText(HText, HNumber)
  149. IniRead, ShowYl, % A_WorkingDir "\js.ini", % HText, thi
  150. If (ShowYl) {
  151. ShowYl := RegExReplace(ShowYl,"\\n","`n")
  152. GuiControl, Text, ShowNR, % ShowYl
  153. }
  154. Else
  155. GuiControl, Text, ShowNR
  156. }
  157. OldHh := "", OldText := ""
  158. }
  159. Return
  160. 初始化热键(){
  161. If (FileExist(A_WorkingDir "\Set.ini")){
  162. IniRead, GuiHotkey, % A_WorkingDir "\Set.ini", GuiHotkey, SHkey
  163. If (GuiHotkey)
  164. Hotkey, % GuiHotkey, ShowOrHide
  165. } Else {
  166. IniWrite, ^F12, % A_WorkingDir "\Set.ini", GuiHotkey, SHkey
  167. IniWrite, 100, % A_WorkingDir "\Set.ini", GuiHotkey, Gui_x
  168. IniWrite, 100, % A_WorkingDir "\Set.ini", GuiHotkey, Gui_y
  169. Hotkey, ^F12, ShowOrHide
  170. }
  171. }
  172. Return
  173. Loadind(){
  174. cl := []
  175. IniRead, paixu, % A_WorkingDir "\Set.ini", paixu
  176. cl := StrSplit(paixu,"`n")
  177. For k,v in cl
  178. TxtCl .= v ","
  179. If (paixu) {
  180. Loop, Parse, paixu, `n, `r
  181. {
  182. IniRead, jishi, % A_WorkingDir "\js.ini", % A_LoopField, thi
  183. If (jishi="ERROR") {
  184. IniWrite, thi=, % A_WorkingDir "\js.ini", % A_LoopField
  185. LV_Add(, A_LoopField)
  186. }
  187. Else
  188. LV_Add(, A_LoopField, kv := (jishi) ? ">>>" : "")
  189. }
  190. }
  191. IniRead, paixu, % A_WorkingDir "\js.ini"
  192. If (paixu) {
  193. ; IniWrite, % paixu, % A_WorkingDir "\Set.ini", paixu
  194. Loop, Parse, paixu, `n, `r
  195. {
  196. If A_LoopField in %TxtCl%
  197. continue
  198. IniRead, jishi, % A_WorkingDir "\js.ini", % A_LoopField, thi
  199. If (jishi="ERROR") {
  200. IniWrite, thi=, % A_WorkingDir "\js.ini", % A_LoopField
  201. LV_Add(, A_LoopField)
  202. }
  203. Else
  204. LV_Add(, A_LoopField, kv := (jishi) ? ">>>" : "")
  205. }
  206. }
  207. Settimer, 更新记录, -300
  208. }
  209. Return
  210. 更新记录:
  211. Loop % LV_GetCount()
  212. {
  213. LV_GetText(danhang, A_Index)
  214. If (A_Index = 1)
  215. paixu := danhang
  216. Else
  217. paixu .= "`n" danhang
  218. }
  219. IniDelete, % A_WorkingDir "\Set.ini", paixu
  220. IniWrite, % paixu, % A_WorkingDir "\Set.ini", paixu
  221. Return
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。
其他

简单的翻译工具

2022-1-26 11:39:06

其他

多个脚本间的简单通讯 v1.0 By FeiYue

2022-1-27 9:27:58

7 条回复 A文章作者 M管理员
欢迎您,新朋友,感谢参与互动!
  1. user13732

    入坑,瞌睡送枕头,谢谢谢谢~~

  2. 月下马

    帅呆了帅呆了,牛逼得要死!好实用!!!

  3. §勇往直前

    666,非常实用

  4. 僵尸2

    ?

  5. 变节000

    厉害,实用。

  6. user16960

    真的不错,好厉害

  7. user22316

    非常实用呀,谢谢

个人中心
购物车
优惠劵
私信列表
搜索