编辑器

优化细节
This commit is contained in:
JianjunLiu
2023-03-30 11:05:56 +08:00
parent 9c506629ec
commit 2a0149d06f
3 changed files with 257 additions and 29 deletions
+93 -6
View File
@@ -168,7 +168,7 @@ type TPage=class(TCustomControl) //
dc.Brush.Color := 0xFa901E;
end else
begin
dc.Brush.Color := 0xe4eeee;
dc.Brush.Color := 0xe4eeee;//rgb(228,228,228);//
end
dc.draw("roundrect",array(rc[0:1],rc[2:3],array(5,5)));
ny := integer(rc[1]+(rc[3]-rc[1]-16)/2);
@@ -1615,6 +1615,34 @@ type TPageEditer=class(TPage) //
FMenu := nil;
FPageItemOnRClick := nil;
end
function DoMouseWheel(o,e);override;
begin
IF ssCtrl in e.shiftstate then
begin
fw := font.Width;
if e.delta<0 then
begin
if fw>8 then
begin
finfo := array("width":fw-1,"height":font.height-2);
end
end else
begin
if fw<15 then
begin
finfo := array("width":fw+1,"height":font.height+2);
end
end
if finfo then
begin
font := finfo;
callMessgeFunction(onscrollfont,o,finfo);
InValidateRect(nil,false);
end
return;
end
end
[weakref] onscrollfont;
function DoControlAlign();override;
begin
inherited;
@@ -1696,6 +1724,10 @@ type TEditer=class(TCustomcontrol) //
fcoolbar.autosize := true;
FInfoShowWnd := new TEditerAuxiliary(self);
FPageEditer := new TPageEditer(self);
FPageEditer.onscrollfont := function(o,ft)begin
FinCodemap.FTree.font := ft;
end
//FPageEditer.CloseBtn := true;
FPageEditer.Onbmpbclick := function(o,e)
begin
@@ -4078,6 +4110,7 @@ type TEditer=class(TCustomcontrol) //
end
end
public
static Fhightercolor;
FExecuteEditer;
private
function sethclor(cs);
@@ -4107,7 +4140,6 @@ type TEditer=class(TCustomcontrol) //
end
end
Fdbgbtns;
static Fhightercolor;
fhltediterdata;
static FSynClasses;
fhltediter;
@@ -4392,6 +4424,9 @@ type thighlightercoloredter=class(tvcform)
btn2:tbtn;
colorcombobox2:tcolorcombobox;
btn3:tbtn;
btn4:tbtn;
btn5:tbtn;
openfileadlg1:topenfileadlg;
function Create(AOwner);override; //构造
begin
fcolorindexname := array("字体","关键字","符号","注释","字符串","数字","系统函数","选中背景","当前行背景");
@@ -4410,6 +4445,26 @@ type thighlightercoloredter=class(tvcform)
begin
EndModal(0);
end
function import_clk(o;e);virtual;
begin
if openfileadlg1.OpenDlg() then
begin
importfile(ftstream(),"",openfileadlg1.filename,d);
if d and ifarray(d) then
begin
colorinfo := d;
listbox1.InvalidateRect(nil,false);
end
end
end
function export_clk(o;e);virtual;
begin
d := colorinfo;
if openfileadlg1.OpenDlg() then
begin
exportfile(ftstream(),"",openfileadlg1.filename,d);
end
end
function btn3_clk(o;e);virtual;
begin
ffrontcolors := ffrontcolordefault;
@@ -4656,7 +4711,7 @@ begin
end
object btn1:tbtn
caption="取消"
height=31
height=25
left=187
onclick=btn1_clk
top=311
@@ -4664,7 +4719,7 @@ begin
end
object btn2:tbtn
caption="确定"
height=31
height=25
left=269
onclick=btn2_clk
top=312
@@ -4680,12 +4735,39 @@ begin
end
object btn3:tbtn
caption="还原默认"
height=31
height=25
left=103
onclick=btn3_clk
top=310
width=72
end
object btn4:tbtn
caption="导入"
height=25
left=3
onclick=import_clk;
top=310
width=30
end
object btn5:tbtn
caption="导出"
height=25
left=35
onclick=export_clk;
top=310
width=30
end
object openfileadlg1:topenfileadlg
left=314
top=36
height=30
width=30
caption="openfileadlg1"
filter=<
stm="*.stm"
"所有"="*"
>
end
end%%;
end
@@ -4946,6 +5028,9 @@ type tfincodemap = class(tcustomcontrol)
begin
ontimerdo();
FTree.SetFocus();
hg := owner.Fhightercolor;
FTree.Color := hg.bkcolor().Color;
FTree.font.Color := hg.fontcolor().Color;
end else
begin
et := geteditor();
@@ -5164,7 +5249,7 @@ EA5E0BB7C5850E4063EDA83420076B5E10000000049454E44AE42608200";
fisloading;
ffbtn;
FTempNodes; //节点
FTree;
fcbtn;
FList;
flistv;
@@ -5173,6 +5258,8 @@ EA5E0BB7C5850E4063EDA83420076B5E10000000049454E44AE42608200";
FString;
fcaretya; //开始位置记录
fcaretyb; //截止位置记录
public
FTree;
end
(*
type TTslCodeMap=class(TTreeView) //tsl代码地图