优化编辑器的自动大小功能
This commit is contained in:
@@ -80,7 +80,7 @@ type TPage=class(TCustomControl) //
|
||||
FLines := 0;
|
||||
FItemIndex :=-1;
|
||||
FWill_Drag := true;
|
||||
font := array("height":16,"width":8,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0,
|
||||
font := array("height":24,"width":12,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0,
|
||||
"charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0);
|
||||
end
|
||||
function GetPageRect(); //获得标签区域
|
||||
@@ -1097,6 +1097,7 @@ type TFTSLScriptMemo = class(TFTSLScriptcustomMemo)
|
||||
function create(AOwner);
|
||||
begin
|
||||
inherited;
|
||||
font := array("width":12,"height":24);
|
||||
{global g_editer_font_size;
|
||||
if g_editer_font_size and ifarray(g_editer_font_size) then
|
||||
begin
|
||||
@@ -1788,8 +1789,8 @@ type TEditer=class(TCustomcontrol) //
|
||||
FStatus := new TStatusBar(self); //状态栏
|
||||
fcoolbar := new tcoolbar(self);
|
||||
fcoolbar.ParentFont := false;
|
||||
//ftoolbara.Align := alNone;
|
||||
//ftoolbarb.Align := alNone;
|
||||
ftoolbara.Align := alNone;
|
||||
ftoolbarb.Align := alNone;
|
||||
//ftoolbara.Width := 430;
|
||||
//ftoolbarb.Width := 250;
|
||||
fcoolbar.autosize := true;
|
||||
@@ -1883,7 +1884,7 @@ type TEditer=class(TCustomcontrol) //
|
||||
FGotoLineWnd := new TGoToLineWnd(self); //共同
|
||||
FListPages := new TListPages(self); //tab 跳转页面
|
||||
FEchoWnd := new TEditerEchoWnd(self);
|
||||
FEchoWnd.font := array("height":16,"width":8,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0,
|
||||
FEchoWnd.font := array("height":24,"width":12,"escapement":0,"orientation":0,"weight":400,"italic":0,"underline":0,"strikeout":0,
|
||||
"charset":0,"outprecision":0,"clipprecision":0,"quality":1,"pitchandfamily":1,"facename":"Courier New","color":0);
|
||||
FTslDebug := new TTslDebug(self);
|
||||
FFindListWnd := new TFindListWnd(self);
|
||||
@@ -2444,6 +2445,10 @@ type TEditer=class(TCustomcontrol) //
|
||||
begin
|
||||
return fcoolbar;//FToolbar;
|
||||
end
|
||||
function gettoolbarimglist();
|
||||
begin
|
||||
return ftoolbara.ImageList;
|
||||
end
|
||||
function gettoolbarbtn(idxs);
|
||||
begin
|
||||
if ifarray(idxs) then
|
||||
|
||||
@@ -1447,7 +1447,8 @@ type TVclDesigner = class(tvcform)
|
||||
rect := _wapi.GetScreenRect();
|
||||
twidth := (rect[2]-50);
|
||||
width := twidth;
|
||||
calcheight(twidth);
|
||||
height := 200;
|
||||
//calcheight(twidth);
|
||||
caption := "TVCL界面设计器";
|
||||
FProjectsManager := new TProjectManagerForm(self);
|
||||
ico := new tbitmap();
|
||||
@@ -1540,20 +1541,21 @@ type TVclDesigner = class(tvcform)
|
||||
end
|
||||
end
|
||||
tlbar.Align := alLeft;
|
||||
tlbar.width :=450;
|
||||
tlbar.width :=650;
|
||||
tlbar.parent := self;
|
||||
tlbar.arrange :="0;1";
|
||||
sp1 := new tsplitter(self);
|
||||
sp1.Align := alLeft;
|
||||
sp1.parent := self;
|
||||
FToolBars := new TDesignertoolbars(self);
|
||||
FToolBars.parent := self;
|
||||
FToolBars.Imagelist := fdimagelist;
|
||||
FToolBars.Font.width := 9;
|
||||
FToolBars.Font.height := 18;
|
||||
|
||||
FToolBars.Imagelist := fdimagelist;
|
||||
FToolBars.Font.width := 10;
|
||||
FToolBars.Font.height := 20;
|
||||
FToolBars.linkimagelist := FProjectManager.FTslEditer.gettoolbarimglist();
|
||||
addtoolbuttons();
|
||||
FToolBars.Align := alClient;
|
||||
FToolBars.parent := self;
|
||||
//************菜单******************************
|
||||
createmainmenubyarray(mainmenus(),FMenu0,self);
|
||||
Mainmenu := FMenu0;
|
||||
@@ -1568,6 +1570,7 @@ type TVclDesigner = class(tvcform)
|
||||
FProjectManager.FTslEditer.setdbugruncall(thisfunction(debugproject)); //设置调试回调
|
||||
FProjectManager.newmenu.parent := ffilemenu;//
|
||||
FProjectManager.goformmenu.parent := fviewmenu;//
|
||||
//OnChange
|
||||
//fnewmenu
|
||||
end
|
||||
property VariableSelecter read FVariableSelecter; //当前控件树的变量对象
|
||||
@@ -2025,56 +2028,38 @@ type TDesigImageList = class(TControlImageList)
|
||||
end
|
||||
type TDesignertoolbars = class(TPageControl) //设计器控件按钮
|
||||
private
|
||||
[weakref]FToolbars;
|
||||
[weakref]FToolsheets;
|
||||
[weakref]ftoolbars;
|
||||
FLabels ;
|
||||
fimg;
|
||||
|
||||
[weakref]fimg;
|
||||
[weakref]flinkimagelist;
|
||||
function SetImageList(im);
|
||||
begin
|
||||
fimg := im;
|
||||
end
|
||||
function SetlinkeImageList(img);
|
||||
begin
|
||||
flinkimagelist := img;
|
||||
if flinkimagelist then
|
||||
begin
|
||||
flinkimagelist.onchange := thisfunction(changedimg);
|
||||
end
|
||||
end
|
||||
public
|
||||
Flabelcharlen;
|
||||
function changedimg(o,e);
|
||||
begin
|
||||
if fimg then fimg.imgsize := o.imgsize;
|
||||
end
|
||||
function Create(AOwner);override;
|
||||
begin
|
||||
inherited;
|
||||
ftbs := array();
|
||||
align := alClient;
|
||||
FToolbars := array();
|
||||
Flabelcharlen := 0;
|
||||
end
|
||||
Procedure Notification(AComponent,Operation);virtual;
|
||||
begin
|
||||
if Operation=opRemove then
|
||||
begin
|
||||
if AComponent=fimg then
|
||||
begin
|
||||
fimg := nil;
|
||||
end else
|
||||
begin
|
||||
for i,v in FToolbars do
|
||||
begin
|
||||
if v=AComponent then
|
||||
begin
|
||||
idx := i;
|
||||
end
|
||||
end
|
||||
if idx then
|
||||
begin
|
||||
reindex(FToolbars,array(idx:nil));
|
||||
end
|
||||
end
|
||||
end
|
||||
FToolsheets := array();
|
||||
ftoolbars := array();
|
||||
inherited;
|
||||
end
|
||||
function CrossCursor(f);
|
||||
begin
|
||||
for i,v in FToolbars do
|
||||
begin
|
||||
if f then
|
||||
v.Cursor := OCR_CROSS;
|
||||
else v.Cursor := OCR_NORMAL;
|
||||
end
|
||||
ParentFont := false;
|
||||
|
||||
align := alClient;
|
||||
|
||||
end
|
||||
function addbtn(btn,t); //加入按钮
|
||||
begin
|
||||
@@ -2082,31 +2067,52 @@ type TDesignertoolbars = class(TPageControl) //
|
||||
begin
|
||||
t := "常用";
|
||||
end
|
||||
tb := FToolbars[t];
|
||||
if not tb then
|
||||
st := FToolsheets[t];
|
||||
if not st then
|
||||
begin
|
||||
st := new TTabSheet(self);
|
||||
st.caption := t;
|
||||
tb := new ttoolbar(self);
|
||||
tb.align := alClient;
|
||||
st.caption := t;
|
||||
if t<>"隐藏" then
|
||||
begin
|
||||
st.parent := self;
|
||||
tb.parent := st;
|
||||
Flabelcharlen+= length(t)+2;
|
||||
end
|
||||
tb.imagelist := fimg;
|
||||
FToolbars[t] := tb;
|
||||
end
|
||||
FToolsheets[t] := st;
|
||||
end
|
||||
ftbs[btn._tag.dclassname()] := btn;
|
||||
btn.parent := tb;
|
||||
sb := ftoolbars[t];
|
||||
if not sb then sb := array();
|
||||
flg := true;
|
||||
for i,sbi in sb do
|
||||
begin
|
||||
if sbi.ExecuteCommand("getbtncount")<20 then
|
||||
begin
|
||||
flg := false;
|
||||
break;
|
||||
end
|
||||
end
|
||||
if flg then
|
||||
begin
|
||||
sbi := new ttoolbar(self);
|
||||
sbi.align := alTop;//alClient;
|
||||
sbi.autosize := true;
|
||||
sbi.parent := st;
|
||||
sbi.imagelist := fimg;
|
||||
sb[length(sb)] := sbi;
|
||||
ftoolbars[t] := sb;
|
||||
end
|
||||
btn.parent := sbi;
|
||||
ftbs[btn._tag.dclassname()] := btn;
|
||||
end
|
||||
function delbtn(n);
|
||||
begin
|
||||
btn := ftbs[n];
|
||||
if btn then btn.Recycling();
|
||||
if btn then
|
||||
begin
|
||||
btn.Recycling();
|
||||
deleteindex(ftbs,n);
|
||||
end
|
||||
end
|
||||
property ImageList write SetImageList;
|
||||
property linkimagelist write SetlinkeImageList;
|
||||
private
|
||||
[weakref]ftbs;
|
||||
|
||||
@@ -2138,7 +2144,7 @@ type TViewBitmap = class(TvcForm)
|
||||
else
|
||||
FBmp.StretchDraw(self.canvas,array(650,100,650+200,100+300));
|
||||
end
|
||||
end
|
||||
end
|
||||
function GetBimpOpenBmp();
|
||||
begin
|
||||
return getbitmapviewerbitmapinfo();
|
||||
|
||||
Reference in New Issue
Block a user