调整编辑器工具栏图标大小
This commit is contained in:
parent
e8d2e5851e
commit
0ff9cbf615
|
|
@ -419,8 +419,8 @@ type teditorform = class(TVCform) //
|
||||||
if (importfile(ftstream(),"",feditorglobalpath,ginfo)=1) and ifarray(ginfo) then
|
if (importfile(ftstream(),"",feditorglobalpath,ginfo)=1) and ifarray(ginfo) then
|
||||||
begin
|
begin
|
||||||
global g_editer_font_size := ginfo["font"];
|
global g_editer_font_size := ginfo["font"];
|
||||||
FEdter.getpage().font := ginfo["font"];
|
//FEdter.getpage().font := ginfo["font"];
|
||||||
FEdter.getcodemap().font := ginfo["font"];
|
//FEdter.getcodemap().font := ginfo["font"];
|
||||||
|
|
||||||
//Fdirview.addrootdirs(dirs);
|
//Fdirview.addrootdirs(dirs);
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1097,12 +1097,12 @@ type TFTSLScriptMemo = class(TFTSLScriptcustomMemo)
|
||||||
function create(AOwner);
|
function create(AOwner);
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
global g_editer_font_size;
|
{global g_editer_font_size;
|
||||||
if g_editer_font_size and ifarray(g_editer_font_size) then
|
if g_editer_font_size and ifarray(g_editer_font_size) then
|
||||||
begin
|
begin
|
||||||
ft := array("width":g_editer_font_size["width"]+1,"height":g_editer_font_size["height"]+2);
|
ft := array("width":g_editer_font_size["width"]+1,"height":g_editer_font_size["height"]+2);
|
||||||
font := ft;
|
font := ft;
|
||||||
end
|
end }
|
||||||
end
|
end
|
||||||
function SetFocus();override;
|
function SetFocus();override;
|
||||||
begin
|
begin
|
||||||
|
|
@ -1712,7 +1712,7 @@ type TPageEditer=class(TPage) //
|
||||||
finfo := array("width":fw+1,"height":hw+2);
|
finfo := array("width":fw+1,"height":hw+2);
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if finfo then
|
if finfo then
|
||||||
begin
|
begin
|
||||||
font := finfo;
|
font := finfo;
|
||||||
callMessgeFunction(onscrollfont,o,finfo);
|
callMessgeFunction(onscrollfont,o,finfo);
|
||||||
|
|
@ -1787,18 +1787,43 @@ type TEditer=class(TCustomcontrol) //
|
||||||
ftoolbarb := new TToolBar(self); //¹¤¾ßÀ¸
|
ftoolbarb := new TToolBar(self); //¹¤¾ßÀ¸
|
||||||
FStatus := new TStatusBar(self); //״̬À¸
|
FStatus := new TStatusBar(self); //״̬À¸
|
||||||
fcoolbar := new tcoolbar(self);
|
fcoolbar := new tcoolbar(self);
|
||||||
ftoolbara.Align := alNone;
|
fcoolbar.ParentFont := false;
|
||||||
ftoolbarb.Align := alNone;
|
//ftoolbara.Align := alNone;
|
||||||
ftoolbara.Width := 430;
|
//ftoolbarb.Align := alNone;
|
||||||
ftoolbarb.Width := 250;
|
//ftoolbara.Width := 430;
|
||||||
|
//ftoolbarb.Width := 250;
|
||||||
fcoolbar.autosize := true;
|
fcoolbar.autosize := true;
|
||||||
FInfoShowWnd := new TEditerAuxiliary(self);
|
FInfoShowWnd := new TEditerAuxiliary(self);
|
||||||
FPageEditer := new TPageEditer(self);
|
FPageEditer := new TPageEditer(self);
|
||||||
FPageEditer.onscrollfont := function(o,ft)begin
|
FPageEditer.onscrollfont := function(o,ft)begin
|
||||||
|
fh := ft["height"];
|
||||||
|
if fh>34 then return ;
|
||||||
global g_editer_font_size := ft;
|
global g_editer_font_size := ft;
|
||||||
self.Notification(self,array("font",ft));
|
self.Notification(self,array("font",ft));
|
||||||
FinCodemap.FTree.font := ft;
|
FinCodemap.FTree.font := ft;
|
||||||
FinCodemap.FTree.ItemHeight := ft["height"]+6;
|
|
||||||
|
FinCodemap.FTree.ItemHeight := fh+6;
|
||||||
|
if fh<20 then
|
||||||
|
begin
|
||||||
|
isz := array(24,24);
|
||||||
|
end else
|
||||||
|
if fh>=20 and fh<24 then
|
||||||
|
begin
|
||||||
|
isz := array(28,28);
|
||||||
|
end else
|
||||||
|
if fh>=24 and fh<28 then
|
||||||
|
begin
|
||||||
|
isz := array(32,32);
|
||||||
|
end else
|
||||||
|
if fh>=28 and fh<31 then
|
||||||
|
begin
|
||||||
|
isz := array(36,36);
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
isz := array(40,40);
|
||||||
|
end
|
||||||
|
FImages.imgsize := isz;
|
||||||
|
fcoolbar.font := ft;
|
||||||
end
|
end
|
||||||
//FPageEditer.CloseBtn := true;
|
//FPageEditer.CloseBtn := true;
|
||||||
FPageEditer.Onbmpbclick := function(o,e)
|
FPageEditer.Onbmpbclick := function(o,e)
|
||||||
|
|
@ -1897,8 +1922,9 @@ type TEditer=class(TCustomcontrol) //
|
||||||
////////////
|
////////////
|
||||||
FPageEditer.PageItemOnRClick := thisfunction(PageItemOnRClick);
|
FPageEditer.PageItemOnRClick := thisfunction(PageItemOnRClick);
|
||||||
FImages := new TControlImageList(self);
|
FImages := new TControlImageList(self);
|
||||||
FImages.Width := 24;
|
//FImages.Width := 24;
|
||||||
FImages.Height := 24;
|
//FImages.Height := 24;
|
||||||
|
FImages.imgsize := array(24,24);
|
||||||
imgs := GetEditIcons();
|
imgs := GetEditIcons();
|
||||||
id := 0;
|
id := 0;
|
||||||
FToolbtns := array();
|
FToolbtns := array();
|
||||||
|
|
@ -1936,6 +1962,10 @@ type TEditer=class(TCustomcontrol) //
|
||||||
Fdbgbtns := dbgbtns;
|
Fdbgbtns := dbgbtns;
|
||||||
FTslDebug.addbtns(dbgbtns);
|
FTslDebug.addbtns(dbgbtns);
|
||||||
//FToolbar.ImageList := FImages;
|
//FToolbar.ImageList := FImages;
|
||||||
|
ftoolbara.autosize := true;
|
||||||
|
ftoolbara.ParentFont := true;
|
||||||
|
ftoolbarb.autosize := true;
|
||||||
|
ftoolbarb.ParentFont := true;
|
||||||
ftoolbara.ImageList := FImages;
|
ftoolbara.ImageList := FImages;
|
||||||
ftoolbarb.ImageList := FImages;
|
ftoolbarb.ImageList := FImages;
|
||||||
ftoolbara.Parent := fcoolbar;
|
ftoolbara.Parent := fcoolbar;
|
||||||
|
|
@ -4244,6 +4274,7 @@ type TEditer=class(TCustomcontrol) //
|
||||||
FFileopen;
|
FFileopen;
|
||||||
FFileSave;
|
FFileSave;
|
||||||
FPageMenu;
|
FPageMenu;
|
||||||
|
FImages;
|
||||||
//ͼ±ê
|
//ͼ±ê
|
||||||
FNeedSaveBmp;
|
FNeedSaveBmp;
|
||||||
FNotNeedSaveBmp;
|
FNotNeedSaveBmp;
|
||||||
|
|
|
||||||
Binary file not shown.
|
|
@ -1749,6 +1749,15 @@ type TCustomImageList=class(tcomponent)
|
||||||
begin
|
begin
|
||||||
return csDesigning in ComponentState;
|
return csDesigning in ComponentState;
|
||||||
end
|
end
|
||||||
|
function recreatehandle();
|
||||||
|
begin
|
||||||
|
tmp := FBmpItems;
|
||||||
|
DestroyHandle();
|
||||||
|
for i:= 0 to tmp.length()-1 do
|
||||||
|
begin
|
||||||
|
addbmp(tmp[i]);
|
||||||
|
end
|
||||||
|
end
|
||||||
function addbmps();
|
function addbmps();
|
||||||
begin
|
begin
|
||||||
if ifarray(FImages)and FImages["type"]="bmps" then
|
if ifarray(FImages)and FImages["type"]="bmps" then
|
||||||
|
|
@ -1880,8 +1889,9 @@ type TCustomImageList=class(tcomponent)
|
||||||
if flg then
|
if flg then
|
||||||
begin
|
begin
|
||||||
FChanged := true;
|
FChanged := true;
|
||||||
DestroyHandle();
|
//DestroyHandle();
|
||||||
addbmps();
|
//addbmps();
|
||||||
|
recreatehandle();
|
||||||
change();
|
change();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1891,8 +1901,8 @@ type TCustomImageList=class(tcomponent)
|
||||||
begin
|
begin
|
||||||
FWidth := w;
|
FWidth := w;
|
||||||
FChanged := true;
|
FChanged := true;
|
||||||
DestroyHandle();
|
//DestroyHandle();
|
||||||
addbmps();
|
recreatehandle();//addbmps();
|
||||||
change();
|
change();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1902,8 +1912,8 @@ type TCustomImageList=class(tcomponent)
|
||||||
begin
|
begin
|
||||||
FHeight := h;
|
FHeight := h;
|
||||||
FChanged := true;
|
FChanged := true;
|
||||||
DestroyHandle();
|
//DestroyHandle();
|
||||||
addbmps();
|
recreatehandle();//addbmps();
|
||||||
change();
|
change();
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -1943,12 +1953,8 @@ type TCustomImageList=class(tcomponent)
|
||||||
FimageCount := 0;
|
FimageCount := 0;
|
||||||
FBmpItems := new tnumindexarray();
|
FBmpItems := new tnumindexarray();
|
||||||
end
|
end
|
||||||
function add(Image,Mask);
|
{function add(Image,Mask);
|
||||||
begin
|
begin
|
||||||
{**
|
|
||||||
@ignore ºöÂÔ%%
|
|
||||||
@explan(˵Ã÷) Ìí¼Óλͼ %%
|
|
||||||
**}
|
|
||||||
if not FAutoDestroy then exit;
|
if not FAutoDestroy then exit;
|
||||||
if not(Image is class(tcustombitmap))then exit;
|
if not(Image is class(tcustombitmap))then exit;
|
||||||
HandleNeeded();
|
HandleNeeded();
|
||||||
|
|
@ -1967,7 +1973,7 @@ type TCustomImageList=class(tcomponent)
|
||||||
FimageCount := _wapi.ImageList_GetImageCount(FHandle);
|
FimageCount := _wapi.ImageList_GetImageCount(FHandle);
|
||||||
end
|
end
|
||||||
return r;
|
return r;
|
||||||
end
|
end}
|
||||||
function addbmp(bmp);
|
function addbmp(bmp);
|
||||||
begin
|
begin
|
||||||
{**
|
{**
|
||||||
|
|
|
||||||
|
|
@ -5699,6 +5699,7 @@ type TcustomToolBar=class(TCustomControl)
|
||||||
begin
|
begin
|
||||||
if fmainmenu then return ;
|
if fmainmenu then return ;
|
||||||
if not HandleAllocated() then return ;
|
if not HandleAllocated() then return ;
|
||||||
|
if autosize then return AdjustSize();
|
||||||
CalcButtonsRect();
|
CalcButtonsRect();
|
||||||
InvalidateRect(nil,false);
|
InvalidateRect(nil,false);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
BIN
tsleditor.exe
BIN
tsleditor.exe
Binary file not shown.
BIN
tslvcltool.exe
BIN
tslvcltool.exe
Binary file not shown.
Loading…
Reference in New Issue