134 lines
3.3 KiB
Plaintext
134 lines
3.3 KiB
Plaintext
type tfm_inheritedwnd=class(tdcreateform)
|
||
uses tslvcl;
|
||
statusbar1:tstatusbar;
|
||
panel1:tpanel;
|
||
panel2:tpanel;
|
||
ed_ok:tbtn;
|
||
label1:tlabel;
|
||
label2:tlabel;
|
||
bt_cancel:tbtn;
|
||
label3:tlabel;
|
||
ed_search:tedit;
|
||
panel3:tpanel;
|
||
label4:tlabel;
|
||
ed_name:tedit;
|
||
lbx_pal:tlistbox;
|
||
function Create(AOwner);override; //¹¹Ôì
|
||
begin
|
||
fnds := array();
|
||
fnds2 := array();
|
||
fns := array();
|
||
inherited;
|
||
rc := _wapi.GetScreenRect();
|
||
left :=(rc[2]-rc[0])/2-280;
|
||
top :=(rc[3]-rc[1])/2-230;
|
||
end
|
||
function ed_search_keyup(o;e);
|
||
begin
|
||
case e.charcode of
|
||
VK_UP:
|
||
begin
|
||
idx := lbx_pal.ItemIndex;
|
||
if idx>0 then lbx_pal.ItemIndex := idx-1;
|
||
else lbx_pal.ItemIndex := length(fnds2)-1;
|
||
end
|
||
VK_DOWN:
|
||
begin
|
||
len := length(fnds2);
|
||
idx := lbx_pal.ItemIndex;
|
||
if idx<(len-1) then lbx_pal.ItemIndex := idx+1;
|
||
else lbx_pal.ItemIndex := 0;
|
||
end
|
||
|
||
end ;
|
||
end
|
||
function ed_ok_clk(o;e);
|
||
begin
|
||
EndModal(1);
|
||
end
|
||
function bt_cancel_clk(o;e);
|
||
begin
|
||
EndModal(0);
|
||
end
|
||
function lbx_pal_sel(o;e);
|
||
begin
|
||
idx := o.getCurrentSelection();
|
||
if idx>=0 then
|
||
begin
|
||
s := o.getItemText(idx);
|
||
n := 1;
|
||
while true do
|
||
begin
|
||
ns := s+inttostr(n);
|
||
if not(fns[ns]) then break;
|
||
n++;
|
||
end
|
||
ed_name.text := ns;
|
||
end else ed_name.text := "";
|
||
ed_ok.Enabled := (idx>=0);
|
||
end
|
||
|
||
function fm_inheritedwnd_close(o;e);
|
||
begin
|
||
e.skip := true;
|
||
o.EndModal(0);
|
||
end
|
||
function ed_search_onchanged(o;e); //ËÑË÷¸Ä±ä
|
||
begin
|
||
//if not fsearchok then return ;
|
||
set_to_list();
|
||
end
|
||
function getinfo();
|
||
begin
|
||
return array(fnds2[lbx_pal.getCurrentSelection()],ed_name.text);
|
||
end
|
||
function setinfo();
|
||
begin
|
||
ActiveControl := ed_search;
|
||
if parent then
|
||
begin
|
||
tr := parent.tree;
|
||
fnds := array();
|
||
tr.GetNodesBytype(fnds,array("form","panel"));
|
||
end
|
||
set_to_list();
|
||
|
||
end
|
||
function set_to_list();
|
||
begin
|
||
s := lowercase(trim( ed_search.text));
|
||
ss := array();
|
||
ssl := 0;
|
||
fnds2 := array();
|
||
fns := array();
|
||
for i,v in fnds do
|
||
begin
|
||
ssi := v.Fname;
|
||
fns[ssi] := true;
|
||
if not( s) or (s and pos(s,ssi)) then
|
||
begin
|
||
fnds2[ssl] := v;
|
||
ss[ssl++] := ssi;
|
||
end
|
||
end
|
||
lbx_pal.Items := ss;
|
||
ed_name.ExecuteCommand("ecselall");
|
||
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
|
||
private
|
||
fsearchok;
|
||
fnds;
|
||
fnds2;
|
||
fns;
|
||
end
|