函数查找 打开的时候关闭窗口
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
object searchdir_mgr:t_searchdir_mgr
|
||||
caption="函数搜索目录:左侧为别名,右侧为-libpath目录...."
|
||||
height=454
|
||||
left=570
|
||||
top=447
|
||||
width=766
|
||||
object panel1:tpanel
|
||||
caption="panel1"
|
||||
height=300
|
||||
left=165
|
||||
top=85
|
||||
width=455
|
||||
object panel2:tpanel
|
||||
align=alleft
|
||||
autosize=true
|
||||
caption="panel2"
|
||||
height=294
|
||||
left=0
|
||||
top=0
|
||||
width=140
|
||||
object label1:tlabel
|
||||
left=90
|
||||
top=145
|
||||
width=44
|
||||
height=17
|
||||
autosize=true
|
||||
caption="label1"
|
||||
end
|
||||
end
|
||||
object splitter1:tsplitter
|
||||
left=140
|
||||
top=0
|
||||
width=10
|
||||
height=294
|
||||
align=alleft
|
||||
caption="splitter1"
|
||||
end
|
||||
object panel3:tpanel
|
||||
align=alclient
|
||||
caption="panel3"
|
||||
height=294
|
||||
left=150
|
||||
top=0
|
||||
width=299
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -38,6 +38,7 @@ type t_function_finder=class(tdcreateform)
|
||||
if not d then return ;
|
||||
f := ffcomp.GetFileFullPath(d[1]);
|
||||
Owner.OpenAndGotoFileByName(f,d[3]);
|
||||
Visible := false;
|
||||
end
|
||||
function show_finder();
|
||||
begin
|
||||
@@ -51,10 +52,33 @@ type t_function_finder=class(tdcreateform)
|
||||
end
|
||||
function edfind_keydown(o;e);
|
||||
begin
|
||||
if e.charcode=13 then
|
||||
ec := e.charcode;
|
||||
case ec of
|
||||
13:
|
||||
begin
|
||||
return dofind();
|
||||
end
|
||||
VK_UP:
|
||||
begin
|
||||
sid := listfunc.SelectedId;
|
||||
if sid>0 then listfunc.SelectedId := sid-1;
|
||||
else return ;
|
||||
end
|
||||
VK_DOWN:
|
||||
begin
|
||||
sid := listfunc.SelectedId;
|
||||
if sid<listfunc.ItemCount-1 then listfunc.SelectedId := sid+1;
|
||||
else return ;
|
||||
end
|
||||
end ;
|
||||
n := listfunc.Height/listfunc.ItemHeight;
|
||||
idx := listfunc.SelectedId ;
|
||||
tidx := listfunc.topline;
|
||||
if idx<tidx or idx>=(n+tidx-3) then
|
||||
begin
|
||||
dofind();
|
||||
listfunc.topline := integer(idx-(n/2)-3);
|
||||
end
|
||||
|
||||
end
|
||||
function dofind();
|
||||
begin
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
type t_searchdir_mgr=class(tdcreateform)
|
||||
uses tslvcl;
|
||||
panel1:tpanel;
|
||||
panel2:tpanel;
|
||||
splitter1:tsplitter;
|
||||
panel3:tpanel;
|
||||
label1:tlabel;
|
||||
function Create(AOwner);override; //构造
|
||||
begin
|
||||
inherited;
|
||||
end
|
||||
function DoControlAlign();override;//对齐子控件
|
||||
begin
|
||||
//当窗口大小改变时,该函数会被调用,
|
||||
//可以通过 clientrect 获取客户区大小,设置子控件的位置以及大小
|
||||
//如果自己处理了子控件的对齐,就可以去掉 inherited
|
||||
inherited;
|
||||
end
|
||||
function Recycling();override; //回收变量
|
||||
begin
|
||||
inherited;
|
||||
ci := self.classinfo(); //将成员变量赋值为nil避免循环引用
|
||||
for i,v in ci["members"] do
|
||||
begin
|
||||
if v["const"] then continue;
|
||||
if v["static"] then continue;
|
||||
invoke(self,v["name"],nil);
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1 @@
|
||||
//tsl script :tsl1
|
||||
@@ -48,6 +48,16 @@ array(
|
||||
"name":"t_shortcut_keys_view",
|
||||
"type":"form",
|
||||
"dir":""
|
||||
),
|
||||
"t_searchdir_mgr":(
|
||||
"name":"t_searchdir_mgr",
|
||||
"type":"form",
|
||||
"dir":""
|
||||
),
|
||||
"tsl1":(
|
||||
"name":"tsl1",
|
||||
"type":"tsl",
|
||||
"dir":""
|
||||
)
|
||||
),
|
||||
"mainform":"t_shortcut_keys_view",
|
||||
|
||||
Reference in New Issue
Block a user