函数查找 打开的时候关闭窗口
This commit is contained in:
parent
3614e645b4
commit
5e04ec2088
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -190,11 +190,13 @@ type teditorform = class(TVCform) //
|
|||
FTslFormatMenu := new tmenu(self);
|
||||
FTslFormatMenu.Caption := c_m_tsl_style_config;
|
||||
FTslFormatMenu.OnClick := function(o,e)begin
|
||||
move_popwnd_to_center2(FFormatInfoWnd);
|
||||
FFormatInfoWnd.show();
|
||||
end
|
||||
FCodeBlockMenu := new TMenu(self);
|
||||
FCodeBlockMenu.caption := c_m_tsl_block;
|
||||
FCodeBlockMenu.OnClick := function(o,e)begin
|
||||
move_popwnd_to_center2(fBlockManager);
|
||||
fBlockManager.ShowModal();
|
||||
|
||||
end
|
||||
|
|
@ -1064,6 +1066,7 @@ end
|
|||
height=240
|
||||
left=497
|
||||
minmaxbox=false
|
||||
autosize=true
|
||||
onclose=tformatinfownd1_close
|
||||
top=295
|
||||
width=280
|
||||
|
|
@ -1290,6 +1293,7 @@ type TBlockManager=class(TVCForm)
|
|||
FEditer.caption := "添加代码块..."
|
||||
end
|
||||
FEditer.SetData(FList.SelectedValue);
|
||||
move_popwnd_to_center2(FEditer);
|
||||
FEditer.showmodal();
|
||||
end
|
||||
|
||||
|
|
@ -1394,6 +1398,8 @@ type tsearchdir = class(TCustomControl)
|
|||
function Create(AOwner);override;
|
||||
begin
|
||||
inherited;
|
||||
ParentFont := false;
|
||||
font := array("width":10,"height":20);
|
||||
fcopyer := new TClipBoard(self);
|
||||
caption := "函数搜索目录:左侧为别名,右侧为-libpath目录....";
|
||||
fcpmenu := new TPopupmenu(self);
|
||||
|
|
@ -1402,7 +1408,7 @@ type tsearchdir = class(TCustomControl)
|
|||
mui.Parent := fcpmenu;
|
||||
mui.OnClick := thisfunction(copy_current_dirs);
|
||||
WsDlgModalFrame := true;
|
||||
WSSizebox := true;
|
||||
//WSSizebox := true;
|
||||
visible := false;
|
||||
wsPopUp := true;
|
||||
WsSysMenu := true;
|
||||
|
|
@ -1448,6 +1454,7 @@ type tsearchdir = class(TCustomControl)
|
|||
bt.Color := ci;
|
||||
FBtns[i] := bt;
|
||||
end
|
||||
FBtns[4].autosize := true;
|
||||
/////////////////////////////////
|
||||
FEdit := new tedit(self);
|
||||
FEdit.SetBoundsRect(array(2,2,120,26));
|
||||
|
|
@ -1459,6 +1466,13 @@ type tsearchdir = class(TCustomControl)
|
|||
e.skip := true;
|
||||
o.endmodal(0);
|
||||
end ;
|
||||
autosize := true;
|
||||
end
|
||||
function GetPreferredSize(w,h);override;
|
||||
begin
|
||||
inherited;
|
||||
w+=5;
|
||||
h+=5;
|
||||
end
|
||||
function copy_current_dirs(o,e);
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ TPagees; TPageItem
|
|||
|
||||
}
|
||||
function gettslexe();
|
||||
function move_popwnd_to_center2(wnd);
|
||||
function to_ansi_str(s);
|
||||
type TPageItem=class() //±êÇ©Ïî
|
||||
function Create(AOwner);
|
||||
|
|
@ -3704,30 +3705,7 @@ type TEditer=class(TCustomcontrol) //
|
|||
wnd.top := xy[1];
|
||||
end
|
||||
end
|
||||
function move_popwnd_to_center2(wnd);
|
||||
begin
|
||||
////////////////////窗口居中处理/////////////////////////////////
|
||||
////////////////////wnd待居中的窗口/////////////////////////////////
|
||||
////////////////////pwnd父窗口/////////////////////////////////
|
||||
pd := pwnd;
|
||||
if pd then
|
||||
begin
|
||||
while not(pd.wspopup) do
|
||||
begin
|
||||
npd := pd.parent;
|
||||
if npd then pd := npd;
|
||||
else break;
|
||||
end
|
||||
r := pd.ClientRect;
|
||||
xy := pd.clienttoscreen(r[0],r[1]);
|
||||
end else
|
||||
begin
|
||||
xy := array(0,0);
|
||||
r := wnd._wapi.GetScreenRect();
|
||||
end
|
||||
wnd.Left := max(0,xy[0]+(r[2]-r[0]-wnd.width)/2) ;
|
||||
wnd.top := max(0,xy[1]+(r[3]-r[1]-wnd.Height)/2);
|
||||
end
|
||||
|
||||
function SetPageItemSyn(it,n);
|
||||
begin
|
||||
if not it then return;
|
||||
|
|
@ -4513,6 +4491,30 @@ AE40CC0000000049454E44AE42608200";//GetSaveFileBitmapInfo();
|
|||
end
|
||||
end
|
||||
implementation
|
||||
function move_popwnd_to_center2(wnd);
|
||||
begin
|
||||
////////////////////窗口居中处理/////////////////////////////////
|
||||
////////////////////wnd待居中的窗口/////////////////////////////////
|
||||
////////////////////pwnd父窗口/////////////////////////////////
|
||||
pd := wnd.Parent;
|
||||
if pd then
|
||||
begin
|
||||
while not(pd.wspopup) do
|
||||
begin
|
||||
npd := pd.parent;
|
||||
if npd then pd := npd;
|
||||
else break;
|
||||
end
|
||||
r := pd.ClientRect;
|
||||
xy := pd.clienttoscreen(r[0],r[1]);
|
||||
end else
|
||||
begin
|
||||
xy := array(0,0);
|
||||
r := wnd._wapi.GetScreenRect();
|
||||
end
|
||||
wnd.Left := max(0,xy[0]+(r[2]-r[0]-wnd.width)/2) ;
|
||||
wnd.top := max(0,xy[1]+(r[3]-r[1]-wnd.Height)/2);
|
||||
end
|
||||
type thighlightercoloredter=class(tvcform)
|
||||
uses tslvcl;
|
||||
colorcombobox1:tcolorcombobox;
|
||||
|
|
@ -5927,6 +5929,8 @@ type TGoToLineWnd=class(TVCForm) //
|
|||
function Create(AOwner);override;
|
||||
begin
|
||||
inherited;
|
||||
ParentFont := false;
|
||||
font := array("width":10,"height":20);
|
||||
wssizebox := false;
|
||||
minmaxbox := false;
|
||||
WsDlgModalFrame := true;
|
||||
|
|
@ -5934,13 +5938,14 @@ type TGoToLineWnd=class(TVCForm) //
|
|||
height := 110;
|
||||
caption := "תµ½..";
|
||||
FLabel := new TLabel(self);
|
||||
FLabel.TextAlign := AL9_CENTER;//tAlignStyle9
|
||||
FLabel.SetBoundsRect(array(3,10,70,35));
|
||||
FEdit := new TEdit(self);
|
||||
FEdit.SetBoundsRect(array(75,10,200,35));
|
||||
FBtn := new TBtn(self);
|
||||
FBtn.SetBoundsRect(array(210,10,280,35));
|
||||
FLabel.Caption := "目标位置:";
|
||||
FBtn.Caption := "定位";
|
||||
FLabel.Caption := "跳到行:";
|
||||
FBtn.Caption := " 确定 ";
|
||||
FLabel.parent := self;
|
||||
FEdit.parent := self;
|
||||
FEdit.OnKeyPress := function(o,e)
|
||||
|
|
@ -5961,6 +5966,8 @@ type TGoToLineWnd=class(TVCForm) //
|
|||
begin
|
||||
GotoTextInteger();
|
||||
end
|
||||
childsizing := array("layout":1,"leftrightspacing":5,"topbottomspacing":10,"verticalspacing":5,"controlsperline":3);
|
||||
autosize := true;
|
||||
end
|
||||
function DoControlAlign();override;
|
||||
begin
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -892,7 +892,10 @@ type tcontrol = class(tcomponent)
|
|||
bds:= array(0,0,w,h);
|
||||
end
|
||||
else
|
||||
bds := UnAlignBounds;
|
||||
begin
|
||||
//bds := UnAlignBounds;
|
||||
bds := BoundsRect;
|
||||
end
|
||||
case Align of
|
||||
alTop:
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -247,9 +247,9 @@ BFC6105000000097048597300000EC300000EC301C76FA8640000010D49444154
|
|||
vL := v.Left;
|
||||
sw := fcursplitter.Width;
|
||||
nvl := max(x-vl-sw,sw);
|
||||
v.Align := alNone;
|
||||
//v.Align := alNone;
|
||||
v.Width := nvl;
|
||||
v.Align := fcurspltype;
|
||||
//v.Align := fcurspltype;
|
||||
return ;
|
||||
end
|
||||
end
|
||||
|
|
@ -265,9 +265,9 @@ BFC6105000000097048597300000EC300000EC301C76FA8640000010D49444154
|
|||
vL := v.top;
|
||||
sw := fcursplitter.Height;
|
||||
nvl := max(y-vl-sw,sw);
|
||||
v.Align := alNone;
|
||||
//v.Align := alNone;
|
||||
v.Height := nvl;
|
||||
v.Align := fcurspltype;
|
||||
//v.Align := fcurspltype;
|
||||
return ;
|
||||
end
|
||||
end
|
||||
|
|
@ -282,9 +282,9 @@ BFC6105000000097048597300000EC300000EC301C76FA8640000010D49444154
|
|||
vl := (v.BoundsRect)[2];
|
||||
sw := fcursplitter.Width;
|
||||
nvl := max(vl-x-sw*1.5,sw);
|
||||
v.Align := alNone;
|
||||
//v.Align := alNone;
|
||||
v.Width := nvl;
|
||||
v.Align := fcurspltype;
|
||||
//v.Align := fcurspltype;
|
||||
return ;
|
||||
end
|
||||
end
|
||||
|
|
@ -299,9 +299,9 @@ BFC6105000000097048597300000EC300000EC301C76FA8640000010D49444154
|
|||
vL := (v.BoundsRect)[3];
|
||||
sw := fcursplitter.Height;
|
||||
nvl := max(vl-y-sw*1.5,sw);
|
||||
v.Align := alNone;
|
||||
//v.Align := alNone;
|
||||
v.Height := nvl;
|
||||
v.Align := fcurspltype;
|
||||
//v.Align := fcurspltype;
|
||||
return ;
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ type tcustomsplitter = class(tgraphiccontrol)
|
|||
end
|
||||
function paint();override;
|
||||
begin
|
||||
inherited;
|
||||
//inherited;
|
||||
r := ClientRect;
|
||||
dc := Canvas;
|
||||
if Border then
|
||||
|
|
|
|||
|
|
@ -80,6 +80,16 @@ type tgraphiccontrol = class(TControl)
|
|||
InvalidateRectForce();
|
||||
end
|
||||
end
|
||||
function GetPreferredSize(w,h);override;
|
||||
begin
|
||||
ft := Font;
|
||||
if ft then
|
||||
begin
|
||||
c := caption;
|
||||
w := ft.Width*(max(length(c),1))+2;
|
||||
h := ft.Height+3;
|
||||
end
|
||||
end
|
||||
function InvalidateRect(rec,f);
|
||||
begin
|
||||
{**
|
||||
|
|
|
|||
|
|
@ -2511,10 +2511,10 @@ type TWinControl = class(tcontrol)
|
|||
begin
|
||||
e.Result := hit;
|
||||
e.skip := true;
|
||||
if (csDesigning in ComponentState) then
|
||||
{if (csDesigning in ComponentState) then
|
||||
begin
|
||||
if al <> alNone then _send_(WM_USER,1644,1644,1);
|
||||
end
|
||||
end}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -2567,7 +2567,7 @@ type TWinControl = class(tcontrol)
|
|||
if e.wparam=1644 and e.lparam=1644 then
|
||||
begin
|
||||
//Align=alNone;
|
||||
al := Align;
|
||||
{al := Align;
|
||||
|
||||
if al in array(alLeft,alRight,alTop,alBottom) then
|
||||
begin
|
||||
|
|
@ -2579,7 +2579,7 @@ type TWinControl = class(tcontrol)
|
|||
Align := al;
|
||||
end
|
||||
end
|
||||
|
||||
}
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
BIN
tsleditor.exe
BIN
tsleditor.exe
Binary file not shown.
BIN
tslvcltool.exe
BIN
tslvcltool.exe
Binary file not shown.
Loading…
Reference in New Issue