From e084664fffd99ec4ee69f33fab3752dbfb67d465 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Tue, 7 Nov 2023 10:51:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=BE=91=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 浼樺寲缂栬瘧 --- .../resource.tfm/t_bconfig_cmd_shower.tfm | 51 +++++++++++++++++++ designer/ctl_mgr/t_bconfig_cmd_shower.tsf | 49 ++++++++++++++++++ designer/ctl_mgr/t_compile_config.tsf | 17 +++++-- funcext/tvclib/tslvcl.tsf | 15 +++++- funcext/tvclib/utslvclconstant.tsf | 2 +- 5 files changed, 128 insertions(+), 6 deletions(-) create mode 100644 designer/ctl_mgr/resource.tfm/t_bconfig_cmd_shower.tfm create mode 100644 designer/ctl_mgr/t_bconfig_cmd_shower.tsf diff --git a/designer/ctl_mgr/resource.tfm/t_bconfig_cmd_shower.tfm b/designer/ctl_mgr/resource.tfm/t_bconfig_cmd_shower.tfm new file mode 100644 index 0000000..711f3f9 --- /dev/null +++ b/designer/ctl_mgr/resource.tfm/t_bconfig_cmd_shower.tfm @@ -0,0 +1,51 @@ +object bconfig_cmd_shower:t_bconfig_cmd_shower + caption="命令行" + height=250 + left=610 + minmaxbox=false + onclose=bconfig_cmd_shower_close + top=406 + width=508 + object panel1:tpanel + align=albottom + caption="panel1" + height=45 + left=0 + parentcolor=true + top=166 + width=492 + wsdlgmodalframe=false + object bt_ok:tbtn + caption="完成" + height=26 + left=406 + onclick=btn1_clk + top=8 + width=78 + end + object bt_copy:tbtn + caption="复制" + height=26 + left=291 + onclick=bt_copy_clk + top=8 + width=94 + end + end + object memo1:tmemo + align=alclient + autogutterwidth=true + caption="memo1" + height=166 + left=0 + readonly=true + top=0 + width=492 + end + object cpbord:tclipboard + left=211 + top=240 + height=30 + width=30 + end +end \ No newline at end of file diff --git a/designer/ctl_mgr/t_bconfig_cmd_shower.tsf b/designer/ctl_mgr/t_bconfig_cmd_shower.tsf new file mode 100644 index 0000000..0442a89 --- /dev/null +++ b/designer/ctl_mgr/t_bconfig_cmd_shower.tsf @@ -0,0 +1,49 @@ +type t_bconfig_cmd_shower=class(tdcreateform) + uses tslvcl; + panel1:tpanel; + bt_ok:tbtn; + memo1:tmemo; + bt_copy:tbtn; + cpbord:tclipboard; + function Create(AOwner);override; //构造 + begin + inherited; + end + function bt_copy_clk(o;e);virtual; + begin + s := memo1.text; + cpbord.text := replacetext(s,"\r\n"," ");; + end + + function bconfig_cmd_shower_close(o;e); + begin + EndModal(1); + e.skip := true; + end + function btn1_clk(o;e); + begin + EndModal(1); + end + function set_config_text(s); + begin + memo1.text := s; + 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 diff --git a/designer/ctl_mgr/t_compile_config.tsf b/designer/ctl_mgr/t_compile_config.tsf index 908c3cf..3baec78 100644 --- a/designer/ctl_mgr/t_compile_config.tsf +++ b/designer/ctl_mgr/t_compile_config.tsf @@ -62,7 +62,16 @@ type t_compile_config=class(tdcreateform) function bt_cmd_clk(o;e); begin s := format_build_params(get_config()); - MessageBoxA(s,"编译命令行",0,o); + if not fcmd_shower then + begin + fcmd_shower := new t_bconfig_cmd_shower(self); + fcmd_shower.Visible := false; + fcmd_shower.parent := self; + end + fcmd_shower.Left := Left; + fcmd_shower.top := top+200; + fcmd_shower.set_config_text(s); + fcmd_shower.ShowModal(); end function bt_tsgadd_clk(o;e);virtual; begin @@ -402,10 +411,11 @@ type t_compile_config=class(tdcreateform) r := d["build"]+="="+format('"%s" ',d["buildfile"]); if d["libpath"] and ifstring(d["libpath"]) then begin - r+="-libpath "+d["libpath"]+" "; + r+="\r\n-libpath "+d["libpath"]+" "; end else - r+="-libpath ."+ioFileseparator()+" "; + r+="\r\n-libpath ."+ioFileseparator()+" "; + r+="\r\n"; r += f_b_a_param(d,"exports"); r += f_b_a_param(d,"dependsdir"); r += f_b_a_param(d,"depends"); @@ -435,4 +445,5 @@ type t_compile_config=class(tdcreateform) end return r; end + fcmd_shower; end diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index fbd3f1e..3c33fc3 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -166,7 +166,12 @@ type tapplication=class(tcomponent) FApplicationWindow.bindmessage(WM_ACTIVATEAPP,thisfunction(WMACTIVATEAPP)); end function Notification(a,op);override; - begin + begin + if op=opclosemainwnd and a= Fmainform then + begin + FApplicationWindow._send_(WM_CLOSE,0,0); + return ; + end if op=opRecycling then begin if a=Fmainform then @@ -210,7 +215,7 @@ type tapplication=class(tcomponent) **} CallMessgeFunction(Foldforminfo["close"],o,e); if e.skip then exit; - FApplicationWindow._send_(WM_CLOSE,0,0); + //FApplicationWindow._send_(WM_CLOSE,0,0); end function mainformminmize(o,e); begin @@ -1029,6 +1034,12 @@ type TVCForm = class(TScrollingWinControl) end end end + function DoWMCLOSE(o,e);override; + begin + inherited; + if e.skip then exit; + else NotifyComponent(self(true),opclosemainwnd,nil); + end function Notification(AComponent:TComponent;Operation:TOperation);override; begin {** diff --git a/funcext/tvclib/utslvclconstant.tsf b/funcext/tvclib/utslvclconstant.tsf index 009f637..061aacb 100644 --- a/funcext/tvclib/utslvclconstant.tsf +++ b/funcext/tvclib/utslvclconstant.tsf @@ -420,7 +420,7 @@ type tconstant=class(talign,TAnchorKind,TFormStyle,TComponentState,TComponentSty end type TSLUICONST=class(tmacroconst,tconstant) static const WM_TRAY=0x464;static const opInsert="opInsert+"; - static const opRemove="opRemove-";static const opRecycling="opRecycling-"; + static const opRemove="opRemove-";static const opRecycling="opRecycling-";static const opclosemainwnd="~closemianwnd~"; end type ws2def_h=class() static const AF_UNSPEC=0x0;static const AF_UNIX=0x1;