把之前的库提示文件插件化了,现在可直接使用光庆大佬开发的【插件管理】添加使用
以前修改init文件的记得还原了,没必要存在两份了
1 新增了 ctrl+f9的热键,可以根基自己习惯直接修改源码就行,注释里有修改位置
2 新增了自动刷新,之前是因为 ide.refreshUserLib(); 会篡改当前目录导致下一次使用相对路径,读取不到文件了,重置一下当前路径就好了
2023年8月25日
优化
1 为类的构造函数生成,完整代码行提示,类似idea的 .var功能,避免移动光标书写var 变量名的过程,
提示格式为 类名_var ,生成代码为
Code AardioLine:1复制
Code AardioLine:205复制
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.namespace
UserDeclareBuild{-
import
fsys; -
import
string
; -
import
io
; -
import
win
; -
import
ide
; -
import
console; -
function
build(){ -
if
(ide
.getProjectDir()==null
||ide
.getProjectDir()==""
){ -
win
.msgbox("请打开项目在使用此功能"
) -
return
; - }
-
- fsys.setCurDir(
ide
.getProjectDir()) -
- declare =
io
.open (".\lib\declare.aardio"
,"w+"
) - declare.write(
- "
- "+
'\n'
- +
"annf = @/**\n@@_desc_func __ \n**/"
+'\n'
- +
"mm = @/**\n@@desc __ \n**/"
+'\n'
- +
"end intellisense*/"
+'\n'
- );
- declare.close();
- declare =
io
.open (".\lib\declare.aardio"
,"a+"
) - fsys.enum(
".\lib"
, -
"*.aardio"
, -
function
(dir,file,fullpath,findData){ -
if
(file){ -
-
if
(file!="declare.aardio"
&&file!="UserDeclareBuild.aardio"
){ - printDeclare(declare,fullpath);
- }
- }
- }
- );
- declare.close();
-
-
ide
.refreshUserLib(); -
win
.msgbox("用户库提示文件刷新成功,.\lib\declare.aardio"
,,,,1000
); -
- }
-
-
function
printDeclare(declare,fullpath){ -
var
$str = string
.load(fullpath) -
var
method=""
; -
var
isClazz=false
; -
var
clazz=""
; -
var
clazzDesc=""
; -
for
$line in
string
.lines($str) { -
if
(string
.indexOf($line,"class"
)){ - isClazz=
true
; - clazz=
string
.replace(string
.replace($line,"@class"
,""
),"{"
,""
) - declare.write("
- "+
'\n'
); -
- }
- }
import
win
.ui;import
ide
;import
gdi;import
winex;import
fonts.fontAwesome;import
console;-
var
hwndStatusBar = winex.findEx(ide
.getMainHwnd(), , "Afx\:RibbonStatusBar"
, ""
);win
.modifyStyle(hwndStatusBar, , 0x2000000 );var
winform = win
.form(text="编译用户库提示文件"
;right=19
;bottom=20
;border="none"
;exmode="none"
;max=false
;min=false
;mode="child"
;parent=hwndStatusBar)- winform.add(
- plus={cls=
"plus"
;left=0
;top=0
;right=20
;bottom=23
;bgcolor=-28642
;color=16777215
;font=LOGFONT(h=-16
);iconStyle={font=LOGFONT(h=-20
;name='FontAwesome'
)};iconText='\uF0E3'
;notify=1
;z=1
} - )
- winform.reghotkey(
-
function
(id,mod,vk){ - UserDeclareBuild.build();
- }
-
- ,2,0x78
- );
- winform.plus.skin({
- background = {
- active = 0xFF0081FF;
- default = 0xFF1E90FF;
- hover = 0xFF339AFF
- };
- color = {
- default = 0xFFFFFFFF
- }
- })
-
-
- winform.plus.oncommand =
function
(id, event) { -
- UserDeclareBuild.build();
- }
-
var
intervalId = winform.setInterval( -
300
, -
function
(hwnd, msg, id, tick) { -
- chwnd = winex.findEx(
ide
.getMainHwnd(), , "Afx\:RibbonStatusBar"
, ""
); -
if
(chwnd) { -
var
x, y ,weight ,height = win
.getPos(chwnd) -
var
x1, y1 ,weight1 ,height1 = win
.getPos(winform.hwnd); -
var
targetX=weight-255
+x; -
if
(targetX!=x1){ - winform.setPos(targetX,
2
,winform.width,winform.height); - winform.redraw();
- }
- }
- })
- winform.onClose =
function
(hwnd, message, wParam, lParam) { - winform.clearInterval(intervalId);
- }
-
import
win
.ui.menu; - winform.plus.wndproc =
function
(hwnd, message, wParam, lParam) { -
-
select
(message) { -
case
0x205 { -
-
var
x, y = win
.getMessagePos(lParam); -
var
menu = win
.ui.popmenu(winform); - menu.add(
"退出"
, function
() { - winform.close()
- })
-
- menu.popup(x, y);
-
return
true
; - }
- }
-
- }
import
win
.ui.tooltip;var
tooltipCtrl = win
.ui.tooltip(winform);var
toolInfoPlus = tooltipCtrl.addTool(winform.plus, "编译用户库提示文件(Ctrl+F9)"
)- winform.show();
return
win
.loopMessage();