优化编辑器,快捷键提示

This commit is contained in:
liujianjun 2025-01-23 11:19:24 +08:00
parent 5732a251bf
commit 2442aa265e
12 changed files with 170 additions and 19 deletions

View File

@ -46,20 +46,20 @@ object functionfinder:t_function_finder
object btfind:tbtn object btfind:tbtn
autosize=true autosize=true
caption="ɸѡ" caption="ɸѡ"
height=21 height=22
left=281 left=281
onclick=btfind_clk onclick=btfind_clk
top=7 top=7
width=38 width=54
end end
object ck_prev:tcheckbtn object ck_prev:tcheckbtn
autosize=true autosize=true
caption="´ÓÍ·Æ¥Åä" caption="´ÓÍ·Æ¥Åä"
height=21 height=22
left=370 left=370
top=7 top=7
visible=true visible=true
width=95 width=111
end end
end end
object sbfind:tstatusbar object sbfind:tstatusbar

View File

@ -0,0 +1,65 @@
object shortcut_keys_view:t_shortcut_keys_view
caption="우쌥숩啞응"
font=<
height=19
width=9
escapement=0
orientation=0
weight=400
italic=0
underline=0
strikeout=0
charset=134
outprecision=3
clipprecision=2
quality=1
pitchandfamily=49
facename="劤芥竟"
color=0
>
height=684
left=711
minmaxbox=false
onclose=shortcut_keys_view_close
parentfont=false
top=459
visible=false
width=590
object panel1:tpanel
align=albottom
autosize=true
caption="panel1"
height=34
left=0
top=611
width=574
object fokbtn:tbtn
autosize=true
caption="횅땍"
height=22
left=242
onclick=fokbtn_clk
top=6
width=54
end
end
object shortcutview:tlistview
align=alclient
caption="listview1"
columns= [<
width=200
text="우쌥숩"
>
<
width=500
text="綱츠"
>
]
height=611
left=0
parentfont=true
top=0
width=574
end
end

View File

@ -0,0 +1,68 @@
type t_shortcut_keys_view=class(tdcreateform)
uses tslvcl;
panel1:tpanel;
fokbtn:tbtn;
shortcutview:tlistview;
function Create(AOwner);override; //构造
begin
inherited;
shortcutview.AppendItems(init_shortcut_keys());
end
function shortcut_keys_view_close(o;e);
begin
e.skip := true;
Visible := false;
end
function fokbtn_clk(o;e);
begin
Visible := false;
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
function init_shortcut_keys();
begin
return array(("ctrl+o","打开"),
("ctrl+N","新建"),
("ctrl+s","保存"),
("ctrl+F","查找窗口"),
("ctrl+R","替换窗口"),
("ctrl+a","全选"),
("ctrl+c","拷贝选择"),
("ctrl+D","复制被插入当前行"),
("ctrl+v","粘贴"),
("ctrl+x","剪切选择"),
("ctrl+G","定位到行"),
("ctrl+L|Y", "删除当前行"),
("tab | shift+tab","多行选中时缩进"),
("ctrl+/","注释当前选择"),
("ctrl+\\","取消当前注释"),
("ctrl+U","反撤销"),
("ctrl+z","撤销"),
("ctrl+tab","切换标签"),
("ctrl+J","打开tsl函数查找面板"),
("F2","跳转到下一个断点行"),
("F5","添加删除断点"),
("Alt+F5","将选中字符串转换为大写"),
("ctl+F5","将选中字符串转换为小写"),
("F3","正向搜索先前搜索的字符"),
("ctrl+F3","反向搜索先前搜索的字符"),
("ctrl+tab","切换标签页"),
("F9","执行当前页的代码"),
("ctrl+F9","打开执行代码编辑器"),
("F7","显示隐藏日志窗口"),
("F1","对于tsl语言查找当前光标所在位置的帮助"),
("alt+m","弹出tsl代码地图"));;
end
end

View File

@ -43,9 +43,14 @@ array(
"name":"t_function_finder", "name":"t_function_finder",
"type":"form", "type":"form",
"dir":"" "dir":""
),
"t_shortcut_keys_view":(
"name":"t_shortcut_keys_view",
"type":"form",
"dir":""
) )
), ),
"mainform":"textcompclassmgr", "mainform":"t_shortcut_keys_view",
"entryscript":"vcldesginer", "entryscript":"vcldesginer",
"commandline":"\"$(TSL_EXE)\" \"$(FULL_CURRENT_PATH)\" -libpath \"$(SEARCH_PATH)\"" "commandline":"\"$(TSL_EXE)\" \"$(FULL_CURRENT_PATH)\" -libpath \"$(SEARCH_PATH)\""
) )

View File

@ -1996,6 +1996,7 @@ type TEditer=class(TCustomcontrol) //
CreateAFile(); CreateAFile();
end end
ffuncfind := new t_function_finder(self); ffuncfind := new t_function_finder(self);
FShortCutshower := new t_shortcut_keys_view(self);
end end
function PopUpAuxiliary(); function PopUpAuxiliary();
begin begin
@ -3188,7 +3189,10 @@ type TEditer=class(TCustomcontrol) //
end end
"快捷键说明": "快捷键说明":
begin begin
s := ""; if not FShortCutshower.Parent then FShortCutshower.Parent := self;
InitShowWndPos(FShortCutshower,"surcut",500,150,true);
FShortCutshower.Show();
{s := "";
s += "ctrl+o 打开\r\n"; s += "ctrl+o 打开\r\n";
s += "ctrl+N 新建\r\n"; s += "ctrl+N 新建\r\n";
s += "ctrl+s 保存\r\n"; s += "ctrl+s 保存\r\n";
@ -3219,7 +3223,7 @@ type TEditer=class(TCustomcontrol) //
s += "F7 显示隐藏日志窗口\r\n"; s += "F7 显示隐藏日志窗口\r\n";
s += "F1 对于tsl语言查找当前光标所在位置的帮助\r\n"; s += "F1 对于tsl语言查找当前光标所在位置的帮助\r\n";
s += "alt+m 弹出tsl代码地图\r\n"; s += "alt+m 弹出tsl代码地图\r\n";
messageboxa(s,"우쌥숩綱츠",0,self); messageboxa(s,"우쌥숩綱츠",0,self);}
end end
"撤销": "撤销":
begin begin
@ -3721,9 +3725,9 @@ type TEditer=class(TCustomcontrol) //
begin begin
FTslChmHelp.ShowTslLangChm(); FTslChmHelp.ShowTslLangChm();
end end
function InitShowWndPos(wnd,n,ix,iy); //셕炬놓迦貫零 function InitShowWndPos(wnd,n,ix,iy,flg); //셕炬놓迦貫零
begin begin
if not FFistShows[n]then if flg or (not FFistShows[n])then
begin begin
FFistShows[n]:= true; FFistShows[n]:= true;
xy := Clienttoscreen(ix,iy); xy := Clienttoscreen(ix,iy);
@ -4262,6 +4266,7 @@ type TEditer=class(TCustomcontrol) //
FListPages; FListPages;
FFindWnd; FFindWnd;
ffuncfind; ffuncfind;
FShortCutshower;
FFindListWnd; FFindListWnd;
FEchoWnd; FEchoWnd;
FGotoLineWnd; FGotoLineWnd;

View File

@ -1004,11 +1004,10 @@ type TDVirutalWindow = class(TCustomControl) //
function Create(AOwner);override; function Create(AOwner);override;
begin begin
fminusfileds := array(); fminusfileds := array();
FWindowFileds := array("left","top","height","width");
inherited; inherited;
width := 30; width := 30;
height := 30; height := 30;
FWindowFileds := array("left","top","height","width");
//ParentFont := true;
end end
function paint();override; function paint();override;
begin begin
@ -1569,10 +1568,17 @@ type TGraphicbevelWindow = class(TDVirutalWindow)
**} **}
function paint();override; function paint();override;
begin begin
bd := BindComp; cv := canvas;
bd := BindComp;
if not bd.Parentcolor then
begin
c := ClientRect;
cv.brush.color := bd.color;
cv.fillrect(c);
end
bd.width := width; bd.width := width;
bd.height := height; bd.height := height;
bd.canvas.Handle := canvas.Handle; bd.canvas.Handle := cv.Handle;
bd.paint(); bd.paint();
end end
function FontChanged(o);override; function FontChanged(o);override;
@ -1596,7 +1602,7 @@ type TGraphicbevelWindow = class(TDVirutalWindow)
width := bd.width; width := bd.width;
height := bd.Height; height := bd.Height;
BindComp := bd; BindComp := bd;
WindowFileds := array("left","top","width","height","color","parentcolor","font","parentfont","visible","align"); WindowFileds := array("left","top","width","height","font","parentfont","visible","align");//,"parentcolor"
minusfileds := array("caption","popupMenu","action","border","anchors"); minusfileds := array("caption","popupMenu","action","border","anchors");
end end
function DesigningSizer();override; function DesigningSizer();override;

Binary file not shown.

View File

@ -1503,8 +1503,8 @@ type tcontrol = class(tcomponent)
if ft then if ft then
begin begin
c := caption; c := caption;
w := ft.Width*(max(2,length(c)))+2; w := ft.Width*(length(c)+2);
h := ft.Height+2; h := ft.Height+3;
end end
end end
protected protected

View File

@ -574,7 +574,7 @@ type TPanel=class(TScrollingWinControl) //
return frclient; return frclient;
end end
published published
property borderwidth read fborderwidth write setborderwidth; property borderwidth:natural read fborderwidth write setborderwidth;
property bevelinner:tbevelcut read fbevelinner write setbevelinner; property bevelinner:tbevelcut read fbevelinner write setbevelinner;
property bevelouter:tbevelcut read fbevelouter write setbevelouter; property bevelouter:tbevelcut read fbevelouter write setbevelouter;
property bevelwidth:integer read fbevelwidth write setbevelwidth; property bevelwidth:integer read fbevelwidth write setbevelwidth;

View File

@ -2426,10 +2426,12 @@ type tcustombevel = class(TGraphicControl)
function create(AOwner); function create(AOwner);
begin begin
inherited; inherited;
Color := clMenu;
transparent := false;
caption := ""; caption := "";
fshape := bsbox; fshape := bsbox;
fstyle := bsLowered; fstyle := bsLowered;
end end
function paint();override; function paint();override;
begin begin
if iffuncptr(OnPaint) then call(OnPaint,self(true)); if iffuncptr(OnPaint) then call(OnPaint,self(true));

Binary file not shown.

Binary file not shown.