diff --git a/designer/teditorform.tsf b/designer/teditorform.tsf index c193629..129c983 100644 --- a/designer/teditorform.tsf +++ b/designer/teditorform.tsf @@ -419,11 +419,11 @@ type teditorform = class(TVCform) // if (importfile(ftstream(),"",feditorglobalpath,ginfo)=1) and ifarray(ginfo) then begin global g_editer_font_size := ginfo["font"]; - FEdter.getpage().font := ginfo["font"]; - FEdter.getcodemap().font := ginfo["font"]; + //FEdter.getpage().font := ginfo["font"]; + //FEdter.getcodemap().font := ginfo["font"]; //Fdirview.addrootdirs(dirs); - end + end if importfile(ftstream(),"",fdirspath,dirs)=1 then begin Fdirview.addrootdirs(dirs); diff --git a/designer/utslcodeeditor.tsf b/designer/utslcodeeditor.tsf index d04c772..6eff271 100644 --- a/designer/utslcodeeditor.tsf +++ b/designer/utslcodeeditor.tsf @@ -1097,12 +1097,12 @@ type TFTSLScriptMemo = class(TFTSLScriptcustomMemo) function create(AOwner); begin inherited; - global g_editer_font_size; + {global g_editer_font_size; if g_editer_font_size and ifarray(g_editer_font_size) then begin ft := array("width":g_editer_font_size["width"]+1,"height":g_editer_font_size["height"]+2); font := ft; - end + end } end function SetFocus();override; begin @@ -1712,7 +1712,7 @@ type TPageEditer=class(TPage) // finfo := array("width":fw+1,"height":hw+2); end end - if finfo then + if finfo then begin font := finfo; callMessgeFunction(onscrollfont,o,finfo); @@ -1787,18 +1787,43 @@ type TEditer=class(TCustomcontrol) // ftoolbarb := new TToolBar(self); //工具栏 FStatus := new TStatusBar(self); //状态栏 fcoolbar := new tcoolbar(self); - ftoolbara.Align := alNone; - ftoolbarb.Align := alNone; - ftoolbara.Width := 430; - ftoolbarb.Width := 250; + fcoolbar.ParentFont := false; + //ftoolbara.Align := alNone; + //ftoolbarb.Align := alNone; + //ftoolbara.Width := 430; + //ftoolbarb.Width := 250; fcoolbar.autosize := true; FInfoShowWnd := new TEditerAuxiliary(self); FPageEditer := new TPageEditer(self); FPageEditer.onscrollfont := function(o,ft)begin + fh := ft["height"]; + if fh>34 then return ; global g_editer_font_size := ft; self.Notification(self,array("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 //FPageEditer.CloseBtn := true; FPageEditer.Onbmpbclick := function(o,e) @@ -1897,8 +1922,9 @@ type TEditer=class(TCustomcontrol) // //////////// FPageEditer.PageItemOnRClick := thisfunction(PageItemOnRClick); FImages := new TControlImageList(self); - FImages.Width := 24; - FImages.Height := 24; + //FImages.Width := 24; + //FImages.Height := 24; + FImages.imgsize := array(24,24); imgs := GetEditIcons(); id := 0; FToolbtns := array(); @@ -1936,6 +1962,10 @@ type TEditer=class(TCustomcontrol) // Fdbgbtns := dbgbtns; FTslDebug.addbtns(dbgbtns); //FToolbar.ImageList := FImages; + ftoolbara.autosize := true; + ftoolbara.ParentFont := true; + ftoolbarb.autosize := true; + ftoolbarb.ParentFont := true; ftoolbara.ImageList := FImages; ftoolbarb.ImageList := FImages; ftoolbara.Parent := fcoolbar; @@ -4244,6 +4274,7 @@ type TEditer=class(TCustomcontrol) // FFileopen; FFileSave; FPageMenu; + FImages; //图标 FNeedSaveBmp; FNotNeedSaveBmp; diff --git a/editor-install.exe b/editor-install.exe index 7699240..efc879e 100644 Binary files a/editor-install.exe and b/editor-install.exe differ diff --git a/funcext/tvclib/utslvclgdi.tsf b/funcext/tvclib/utslvclgdi.tsf index 08669a5..5caf37d 100644 --- a/funcext/tvclib/utslvclgdi.tsf +++ b/funcext/tvclib/utslvclgdi.tsf @@ -1749,6 +1749,15 @@ type TCustomImageList=class(tcomponent) begin return csDesigning in ComponentState; end + function recreatehandle(); + begin + tmp := FBmpItems; + DestroyHandle(); + for i:= 0 to tmp.length()-1 do + begin + addbmp(tmp[i]); + end + end function addbmps(); begin if ifarray(FImages)and FImages["type"]="bmps" then @@ -1880,8 +1889,9 @@ type TCustomImageList=class(tcomponent) if flg then begin FChanged := true; - DestroyHandle(); - addbmps(); + //DestroyHandle(); + //addbmps(); + recreatehandle(); change(); end end @@ -1891,8 +1901,8 @@ type TCustomImageList=class(tcomponent) begin FWidth := w; FChanged := true; - DestroyHandle(); - addbmps(); + //DestroyHandle(); + recreatehandle();//addbmps(); change(); end end @@ -1902,8 +1912,8 @@ type TCustomImageList=class(tcomponent) begin FHeight := h; FChanged := true; - DestroyHandle(); - addbmps(); + //DestroyHandle(); + recreatehandle();//addbmps(); change(); end end @@ -1943,12 +1953,8 @@ type TCustomImageList=class(tcomponent) FimageCount := 0; FBmpItems := new tnumindexarray(); end - function add(Image,Mask); + {function add(Image,Mask); begin - {** - @ignore 忽略%% - @explan(说明) 添加位图 %% - **} if not FAutoDestroy then exit; if not(Image is class(tcustombitmap))then exit; HandleNeeded(); @@ -1967,7 +1973,7 @@ type TCustomImageList=class(tcomponent) FimageCount := _wapi.ImageList_GetImageCount(FHandle); end return r; - end + end} function addbmp(bmp); begin {** diff --git a/funcext/tvclib/utslvclstdctl.tsf b/funcext/tvclib/utslvclstdctl.tsf index 2545fe6..7562af1 100644 --- a/funcext/tvclib/utslvclstdctl.tsf +++ b/funcext/tvclib/utslvclstdctl.tsf @@ -5699,6 +5699,7 @@ type TcustomToolBar=class(TCustomControl) begin if fmainmenu then return ; if not HandleAllocated() then return ; + if autosize then return AdjustSize(); CalcButtonsRect(); InvalidateRect(nil,false); return 0; diff --git a/tsleditor.exe b/tsleditor.exe index d3b29ea..3d90c17 100644 Binary files a/tsleditor.exe and b/tsleditor.exe differ diff --git a/tslvcltool.exe b/tslvcltool.exe index 26413eb..eb4e65e 100644 Binary files a/tslvcltool.exe and b/tslvcltool.exe differ