From e45feaf84e6cc3c97cc57e62dd7cc9428773f369 Mon Sep 17 00:00:00 2001 From: JianjunLiu Date: Tue, 15 Nov 2022 16:29:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新设计器 --- designer/udesignerproject.tsf | 1 + designer/utslvcldcomponents.tsf | 200 ++++++++++++++++++++++++++++++-- funcext/tvclib/utslmemo.tsf | 17 +-- 3 files changed, 203 insertions(+), 15 deletions(-) diff --git a/designer/udesignerproject.tsf b/designer/udesignerproject.tsf index 8f8e47d..ffc0f22 100644 --- a/designer/udesignerproject.tsf +++ b/designer/udesignerproject.tsf @@ -1060,6 +1060,7 @@ type TProjectView = class(TVCForm) // begin r := format(%% type %s=class(%s) + uses tslvcl; function create(AOwner); begin inherited; diff --git a/designer/utslvcldcomponents.tsf b/designer/utslvcldcomponents.tsf index 2ce7154..643bb70 100644 --- a/designer/utslvcldcomponents.tsf +++ b/designer/utslvcldcomponents.tsf @@ -448,6 +448,195 @@ type TDComponent = class() **} fiscontainerdcmp := true; feventnametable := array(); + + ev := array( + "event":"onmouseup", + "name":"ms_up", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) Êó±ê°´Ï %% + @param(o)(control)¿Ø¼þ %% + @param(e)(TMMouse) Êó±êÏûÏ¢¶ÔÏó %% + **} + if e.button()=mbLeft then + begin + echo '\\r\\n:×ó¼ü'; + end else + if e.button()=mbRight then + begin + echo '\\r\\n:ÓÒ¼ü'; + end else + if e.button()=mbMiddle then + begin + echo '\\r\\n:¹öÂÖ'; + end + echo '\\r\\npos:',e.xpos,'===',e.ypos; + inherited; +" + ); + SetDefalutEvent(ev,true); + + ev := array( + "event":"onmousedown", + "name":"ms_down", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) Êó±ê°´Ï %% + @param(o)(control)¿Ø¼þ %% + @param(e)(TMMouse) Êó±êÏûÏ¢¶ÔÏó %% + **} + if e.button()=mbLeft then + begin + echo '\\r\\n:×ó¼ü'; + end else + if e.button()=mbRight then + begin + echo '\\r\\n:ÓÒ¼ü'; + end else + if e.button()=mbMiddle then + begin + echo '\\r\\n:¹öÂÖ'; + end + if e.shiftdouble() then + begin + echo '\\r\\n:Ë«»÷'; + end + echo '\\r\\npos:',e.xpos,'===',e.ypos; + inherited; +" + ); + SetDefalutEvent(ev,true); + ev := array( + "event":"onmousemove", + "name":"ms_move", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) Êó±êÒÆ¶¯ %% + @param(o)(control)¿Ø¼þ %% + @param(e)(TMMouse) Êó±êÏûÏ¢¶ÔÏó %% + **} + echo '\\r\\npos:',e.xpos,'===',e.ypos; + inherited; +" + ); + SetDefalutEvent(ev,true); + ev := array( + "event":"onkeyup", + "name":"keyup", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) °´¼üµ¯Æð %% + @param(o)(control)¿Ø¼þ %% + @param(e)(TMKEY) °´¼üÏûÏ¢¶ÔÏó %% + **} + echo '\\r\\nchar:',e.char; + echo '\\r\\nascii:',e.charcode; + if ssShift in e.shiftstate then + begin + echo '\\r\\nshift °´¼ü'; + end + if ssAlt in e.shiftstate then + begin + echo '\\r\\nalt °´¼ü'; + end + if ssCtrl in e.shiftstate then + begin + echo '\\r\\nctrl °´¼ü'; + end + inherited;" + ); + SetDefalutEvent(ev,true); + ev := array( + "event":"onkeydown", + "name":"keydown", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) °´¼ü°´Ï %% + @param(o)(control)¿Ø¼þ %% + @param(e)(TMKEY) °´¼üÏûÏ¢¶ÔÏó %% + **} + echo '\\r\\nchar:',e.char; + echo '\\r\\nascii:',e.charcode; + if ssShift in e.shiftstate then + begin + echo '\\r\\nshift °´¼ü'; + end + if ssAlt in e.shiftstate then + begin + echo '\\r\\nalt °´¼ü'; + end + if ssCtrl in e.shiftstate then + begin + echo '\\r\\nctrl °´¼ü'; + end + inherited;" + ); + SetDefalutEvent(ev,true); + ev := array( + "event":"onkeypress", + "name":"keypress", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) ×Ö·ûÏûÏ¢ %% + @param(o)(control)¿Ø¼þ %% + @param(e)(TMKEY) °´¼üÏûÏ¢¶ÔÏó %% + **} + echo '\\r\\nchar:',e.char; + echo '\\r\\nascii:',e.charcode; + if ssShift in e.shiftstate then + begin + echo '\\r\\nshift °´¼ü'; + end + if ssCtrl in e.shiftstate then + begin + echo '\\r\\nctrl °´¼ü'; + end + inherited;" + ); + SetDefalutEvent(ev,true); + ev := array( + "event":"onnotification", + "name":"note", + "virtual":true, + "param":array("o","e"), + "body": +" {** + @explan(˵Ã÷) ֪ͨÏûÏ¢ %% + @param(o)(control)¿Ø¼þ %% + @param(e)(tuieventbase) ÏûÏ¢¶ÔÏó,msg³ÉԱΪ֪ͨÄÚÈÝ, + ¸ÃÏûÏ¢¿ÉÒÔͨ¹ý×é¼þ relnotification(ÏûÏ¢ÄÚÈÝ) + ·¢Ë͵½ËùÓÐ×é¼þ,ÐèÒª´¦Àí¸ÃÏûÏ¢µÄ×é¼þ¿ÉÒÔ´¦Àí %% + **} + + inherited;" + ); + SetDefalutEvent(ev,true); + ev :=array( + "event":"onclick", + "name":"clk", + "param":array("o","e"), + "virtual":true, + "body": +" {** + @explan(˵Ã÷) µã»÷»Øµ÷ %% + @param(o)(tcontrol)Ñ¡Ôñ°´Å¥ %% + @param(e)(tuievent) ÏûÏ¢¶ÔÏó %% + **} + inherited;" + ); + SetDefalutEvent(ev,true); if not(AOwner is class(TComponent)) then exit; c := WndClass(); if c is class(TComponent) then @@ -455,8 +644,7 @@ type TDComponent = class() FCwnd := createobject(c,AOwner); FCwnd.SetDesigning(true); end - else raise "ÀàÐÍ´íÎó!"; - + else raise "ÀàÐÍ´íÎó!"; end function GetChangedPropertiesn(n); begin @@ -629,8 +817,8 @@ type TDComponent = class() format(" {** @explan(˵Ã÷) %sÏûÏ¢»Øµ÷ %% - @param(e)(tuievent) ÏûÏ¢¶ÔÏó %% @param(o)(tcomponent) ×é¼þ %% + @param(e)(tuievent) ÏûÏ¢¶ÔÏó %% **} inherited; ",n); @@ -3054,16 +3242,14 @@ type TDCheckBtn=class(TDComponent) "param":array("o","e"), "virtual":true, "body": -" - {** +" {** @explan(˵Ã÷) µã»÷»Øµ÷ %% @param(e)(tuievent) ÏûÏ¢¶ÔÏó %% @param(o)(tcheckbtn)Ñ¡Ôñ°´Å¥ %% **} MessageBoxA(((o.checked)?'Ñ¡ÖÐ':'ûѡÖÐ'),'Ìáʾ',0,o); inherited; -" - ); +"); end function bitmapinfo();override;begin return "0502000000060400000074797065000203000000696D670006040000006461746 diff --git a/funcext/tvclib/utslmemo.tsf b/funcext/tvclib/utslmemo.tsf index a864e6f..0476254 100644 --- a/funcext/tvclib/utslmemo.tsf +++ b/funcext/tvclib/utslmemo.tsf @@ -1685,6 +1685,13 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // return array(cy,cx+(ci?(0):1)); end private //ÊôÐÔÉèÖú¯Êý + function getclipboard();//»ñµÃclipbord + begin + if not FCopyer then + begin + FCopyer := new TcustomClipBoard(self); + end + end function memtextchanged(p); begin if not(fundoing or fredoing) then @@ -1819,10 +1826,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // r := GetSelText(); if r then begin - if not FCopyer then - begin - FCopyer := new TcustomClipBoard(self); - end + getclipboard(); FCopyer.text := r; return true; end @@ -1830,10 +1834,7 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) // function PasteFromClipboard(); begin //if ReadOnly then return ; - if not FCopyer then - begin - FCopyer := new TcustomClipBoard(self); - end + getclipboard(); //s := FCopyer.Text; //echo length(s),"\r\n"; if SelAvail then SelText := FCopyer.Text;