设计器

添加高亮控件
This commit is contained in:
JianjunLiu 2022-09-15 17:59:12 +08:00
parent 1abe441ca6
commit 286af5904f
5 changed files with 121 additions and 4 deletions

View File

@ -2551,6 +2551,21 @@ type TMainMenuWindow = class(TDVirutalWindow)
end
type ThighlighterWindow = class(TDVirutalWindow)
{**
@explan(说明) 主菜单容器窗口 %%
**}
public
function Create(AOwner);override;
begin
inherited;
BindComp := new thighlighter(self);
end
function bitmapinfo();override;
begin
return gethighlighterbitmapinfo();
end
end
type TTrayWindow = class(TDVirutalWindow)
{**
@ -3054,10 +3069,36 @@ BFC6105000000097048597300000EC300000EC301C76FA864000000E549444154
inherited;
end
end
type tdhighlighter = class(TDRootComponent)
{**
@explan(说明) 语法高亮设计器控件 %%
**}
function dclassname();override;
begin
return "thighlighter";
end
function bitmapinfo();override;
begin
return gethighlighterbitmapinfo();
end
function ComponentClass();override;
begin
return class(thighlighter);
end
function WndClass();override;
begin
return Class(ThighlighterWindow);
end
function Create(AOwner);override;
begin
inherited;
end
end
type TDTray = class(TDRootComponent)
{**
@explan(说明) statusbar设计器控件 %%
@explan(说明) 托盘设计器控件 %%
**}
function HitTip();override;
begin
@ -5350,6 +5391,39 @@ type TGridCellVariabletimagelistEdit = class(TGridCellVariableTactionEdit)
inherited;
end
end
type TGridCellVariablehgtEdit = class(TGridCellVariableTactionEdit)
Function EditType();override;
begin
return "thighlighter";
end
function CellDrawLabel(dc,rect,d);override;
begin
v := d["value"];
if v is class(tcomponent) then
begin
dc.DrawText(v.name,rect,DT_VCENTER.|DT_LEFT .|DT_SINGLELINE);
end
end
function FormatTMF(d);override;
begin
if d is class(tcomponent) then
begin
r := d.name;
if r then return r;
end
return false;
end
function GetItemValue(V);override;
begin
if v is class(TDComponent) then r := v.GetTrueComponent();
return r;
end
function create(owner);override;
begin
inherited;
end
end
type TBtnCellDrawVTtype = class(TGridCellEditWithButton)
function Create(AOwner);override;
begin
@ -9494,6 +9568,7 @@ begin
class(TDEdit),
class(TDpassword),
class(TDmemo),
class(tdhighlighter),
class(TDradiobtn),
class(TDCheckBtn),
class(TDcomboBox),
@ -9526,6 +9601,7 @@ begin
class(TGridCellVariableTactionEdit),
class(TGridCellVariableTrayEdit),
class(TGridCellVariabletimagelistEdit),
class(TGridCellVariablehgtEdit),
class(TGridCellVariabletmainmenuEdit),
class(TGridCellVariabletpopupmenuEdit),
class(TGridCellImagesEdit),

View File

@ -15,6 +15,7 @@ function GetImageListBitmapInfo();
function GetTimerBitmapInfo();
function GetSaveFileBitmapInfo();
function GetMainMenuBitmapInfo();
function gethighlighterbitmapinfo();
function GetActionListBitmapInfo();
function GetPopUpMenuBitmapInfo();
function GetMessageBoxBitmapInfo();
@ -486,6 +487,26 @@ E1F20DA239CFDAA0C5B336686D713AB0EFFB90A70333CEF0BB0DF0E1CE7F30CAF
F06669CA1BEE48B797A00E00533D0A5754BB70F010000000049454E44AE426082
00";
end
function gethighlighterbitmapinfo();
begin
return "0502000000060400000074797065000203000000696D670006040000006461746
10002F801000089504E470D0A1A0A0000000D4948445200000010000000100806
0000001FF3FF61000000017352474200AECE1CE90000000467414D410000B18F0
BFC6105000000097048597300000EC300000EC301C76FA8640000018D49444154
384F8D933F6BC24018C6EF2BB47E04876677E852E8D2A143B150FC0C220E82207
4F40308EADA59032A552771113A290819741214FCAF20D188318822E6E9BD9738
D8C63F0F5C9E84E3F9DDFB5EEE181C5428E4ECB7EB62BAFE8CC582613E6750558
6D98C2112F9C074CA301E338C460C830143BFCFD0ED326C363F76D412D3348662
514232F9C4579604201C7E1723979304209B95C477262341D3A276D492005005F
9FC0342A1370120A70AC86B3597F063058E8058EC118A728F60F05500C809405E
ADBA841F01AA1AC56E37B1E3F61EF8FD2FBC4CB7700290D39065B768219DB6E65
2293786C34FD4EB1E349B7E0B209E374AD3CA224C2DB75A77E874BE6E07FC0D97
4A1EFEE794DB00E7C2A4AB804B61D245C0B530E92C4051140402818B619223A0D
D6E8B70229180CFE73B1B2639028E61AFD78B783CCE0F8E61CFFCD70940D77534
1A56CF14966519CBE512ABD50A8661F08BB4E1B01DF6FB3D0E87034CD33C054C2
613542A1E7E693C2897BF452BBD5E8FDFCA313FA133BEA91AD6EB35B6DBAD8098
A6895F8B8462F83DBBD4180000000049454E44AE42608200";
end
function GetActionListBitmapInfo();
begin
return "0502000000060400000074797065000203000000696D670006040000006461746

View File

@ -1741,6 +1741,7 @@ type tmemo = class(TSynMemoNorm)
function DoTextChanged(p);override;//Îı¾¸Ä±ä
begin
inherited;
calldatafunction(Fonchange,self(true),new tuieventbase(0,0,0,0));
end
function MouseUp(o,e);override;
begin
@ -1788,7 +1789,7 @@ type tmemo = class(TSynMemoNorm)
"popupmenu","visible","anchors","align",
"height","width","left","top",
"text","readonly","selectbkcolor","guttercolor","currentlinecolor","guttercharcnt",
"tabspace","onmousewheel","onmousemove","onpopupmenu",
"tabspace","highlighter","onmousewheel","onmousemove","onpopupmenu",
"onmousedown","onmouseup","onsetfocus","onkillfocus",
"onkeyup","onkeydown","onkeypress",
"onchange");
@ -1800,6 +1801,17 @@ type tmemo = class(TSynMemoNorm)
FonSetFocus;
fonKillFocus;
end
type thighlighter= class(tcustomsynhighlighter)
uses UTslMemo;
function create(AOwner);
begin
inherited;
end
function publishs();override;
begin
return array("name","keywordcolor","symcolor","stringcolor","annotationcolor");
end
end
//goupbox
type tgroupbox = class(tcustomgroupbox)

View File

@ -3031,7 +3031,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
fignorecase := false;//ºöÂÔ´óСд
FChangeDeal := true;
FTokens := array();
setkeyword(array("null","true","false"));
setkeyword(array("null","true","false","goto","break","for","to","while","do"));
setblockannote(array(
("/*","*/"),
));
@ -3043,6 +3043,7 @@ type tcustomsynhighlighter = class(TSynHighLighter)
));
setpairs(array(
("(",")"),
("[","]"),
("{","}"),
));
clean();
@ -3741,7 +3742,7 @@ type TSynCustomMemo = class(TCustomMemo)
y := (CaretY-GetYpos())*GetYScrollDelta();
x := (CaretX-GetXpos())*GetXScrollDelta();
end
property Highlighter read FHighlighter write SetHighlighter; //语法高亮
property Highlighter:thighlighter read FHighlighter write SetHighlighter; //语法高亮
property Completion read FCompletion write SetCompletion; //×Ô¶¯Íê³É
property TabChar read FTabChar write SetTabChar;
private

View File

@ -1222,6 +1222,12 @@ type TPropertyImagelist=class(TPropertyaction) //imagelist
return "tcontrolimagelist";
end
end
type TPropertyhgt=class(TPropertyaction) //imagelist
Function EditType();override;
begin
return "thighlighter";
end
end
type TPropertyImagesData=class(TPropertyType) //imagedata,×÷ΪimagelistµÄÊý¾Ý
Function EditType();override;
begin
@ -2043,6 +2049,7 @@ begin
"tpropertypopupmenu",
"tpropertymainmenu",
"tpropertyimagelist",
"tpropertyhgt",
"tpropertyimagesdata",
"tpropertybitmap",
"tpropertyicon",