修正 imagelist中bmp可能销毁导致的异常
This commit is contained in:
parent
d412eb1cfc
commit
ebed3be229
|
|
@ -1392,7 +1392,7 @@ type tsearchdir = class(TCustomControl)
|
|||
inherited;
|
||||
caption := "函数搜索目录:左侧为别名,右侧为-libpath目录....";
|
||||
WsDlgModalFrame := true;
|
||||
//WSSizebox := true;
|
||||
WSSizebox := true;
|
||||
visible := false;
|
||||
wsPopUp := true;
|
||||
WsSysMenu := true;
|
||||
|
|
@ -1609,7 +1609,7 @@ type tsearchdir = class(TCustomControl)
|
|||
FLists;
|
||||
FBtns;
|
||||
end
|
||||
private
|
||||
private
|
||||
function GetIcon();
|
||||
begin
|
||||
r := "0502000000060400000074797065000203000000696D670006040000006461746
|
||||
|
|
@ -1804,8 +1804,10 @@ type tdirviewer = class(tcustomcontrol)
|
|||
bmp := new TBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(folderbmp()));
|
||||
fimgs.addbmp(bmp);
|
||||
bmp := new TBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(filebmp()));
|
||||
fimgs.addbmp(bmp);
|
||||
bmp := new TBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(dllbmp()));
|
||||
fimgs.addbmp(bmp);
|
||||
ftbns := array();
|
||||
|
|
@ -1813,7 +1815,8 @@ type tdirviewer = class(tcustomcontrol)
|
|||
for i,v in gettbicons() do
|
||||
begin
|
||||
bt := new TToolButton(ftb);
|
||||
bt.caption := i;
|
||||
bt.caption := i;
|
||||
bmp := new TBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(v));
|
||||
fimgs.addbmp(bmp);
|
||||
bt.ImageId := fimgs.ImageCount-1;
|
||||
|
|
|
|||
|
|
@ -1079,7 +1079,7 @@ type TProjectView = class(TVCForm) //
|
|||
end
|
||||
////////////////////从新构造search目录///////////////////////////////
|
||||
global g_orig_lib_path;
|
||||
sdir := array(p);
|
||||
sdir := array(p+fio);
|
||||
idx := 1;
|
||||
hdirs := array(p:true);
|
||||
if ifstring(g_orig_lib_path) then
|
||||
|
|
@ -1749,7 +1749,7 @@ end
|
|||
end
|
||||
private
|
||||
FMoveMnus;
|
||||
FMoveMenu;
|
||||
FMoveMenu;
|
||||
function getnodebyfilename(f,nd);//获得编辑器对应节点
|
||||
begin
|
||||
if not nd then return 0;
|
||||
|
|
@ -2657,10 +2657,10 @@ type TFileTree = class(TTreeCtl)
|
|||
function CreateaImageList(AOwner,imgns);
|
||||
begin
|
||||
imgs := New TControlImageList(AOwner);
|
||||
imgns := array();
|
||||
bmp := new TBitmap();
|
||||
imgns := array();
|
||||
for i,v in GetIcons() do
|
||||
begin
|
||||
bmp := new TBitmap();
|
||||
bmp.ReadVCon(HexFormatStrToTsl(v));
|
||||
imgs.AddBmp(bmp);
|
||||
imgns[i]:= k;
|
||||
|
|
|
|||
|
|
@ -1880,7 +1880,6 @@ type TEditer=class(TCustomcontrol) //
|
|||
FImages := new TControlImageList(self);
|
||||
FImages.Width := 24;
|
||||
FImages.Height := 24;
|
||||
bmp := new TBitmap();
|
||||
imgs := GetEditIcons();
|
||||
id := 0;
|
||||
FToolbtns := array();
|
||||
|
|
@ -1895,6 +1894,7 @@ type TEditer=class(TCustomcontrol) //
|
|||
continue;
|
||||
end else
|
||||
begin
|
||||
bmp := new TBitmap();
|
||||
bmp.Readvcon(HexFormatStrToTsl(v));
|
||||
FImages.addbmp(bmp);
|
||||
bt.OnClick := thisfunction(ToolClick);
|
||||
|
|
|
|||
|
|
@ -2298,9 +2298,10 @@ type TTsfFileParser = class() //
|
|||
ClearCache(FFindDirs?true:false);
|
||||
end
|
||||
end
|
||||
function DirSet(d); //ÉèÖÃ
|
||||
function DirSet(d_); //ÉèÖÃ
|
||||
begin
|
||||
if not ifarray(d) then return FFindDirs;
|
||||
if not ifarray(d_) then return FFindDirs;
|
||||
d := format_dirs(d_);
|
||||
if d=FFindDirs then return d;
|
||||
r := FFindDirs;
|
||||
FFinddirsseted := true;
|
||||
|
|
@ -2312,6 +2313,22 @@ type TTsfFileParser = class() //
|
|||
end
|
||||
return r;
|
||||
end
|
||||
function format_dirs(d);
|
||||
begin
|
||||
r := array();
|
||||
idx := 0;
|
||||
for i,v in d do
|
||||
begin
|
||||
if ifstring(v) and v then
|
||||
begin
|
||||
vlen := length(v);
|
||||
if v[vlen]=fiofs then r[idx] := v[1:(vlen-1)];
|
||||
else r[idx] := v;
|
||||
idx++;
|
||||
end
|
||||
end
|
||||
return r;
|
||||
end
|
||||
function ClearCache(cl); //헌왕뻠닸
|
||||
begin
|
||||
if cl then
|
||||
|
|
|
|||
|
|
@ -666,7 +666,8 @@ public //
|
|||
if ifobj(otype)then
|
||||
begin
|
||||
iv := otype.UnformatEdit(v); //·´×ª»»
|
||||
if FChangedProperties[n]=vi then continue; //没有改变
|
||||
//if FChangedProperties[n]=vi then continue; //没有改变
|
||||
if FChangedProperties[n]=iv then continue; //没有改变
|
||||
SetChangedPublish(n,iv,pp); //±£´æ
|
||||
if n="visible" or n="wspopup" or n="enabled" then
|
||||
begin
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ BFC6105000000097048597300000EC300000EC301C76FA8640000010D49444154
|
|||
bmp := new TcustomBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(getsxbmp()));
|
||||
fsplitterdragimglist.addbmp(bmp);
|
||||
bmp := new TcustomBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(getzybmp()));
|
||||
fsplitterdragimglist.addbmp(bmp);
|
||||
end
|
||||
|
|
|
|||
|
|
@ -2094,7 +2094,9 @@ type TWinControl = class(tcontrol)
|
|||
FTRACKMOUSEEVENT.dwflags := TME_CANCEL .| TME_HOVER .| TME_LEAVE;
|
||||
_wapi.TrackMouseEvent(FTRACKMOUSEEVENT._getptr_);
|
||||
end }
|
||||
bv := FVisible;
|
||||
_wapi.DestroyWindow(self.Handle);
|
||||
FVisible := bv;
|
||||
end
|
||||
FHandle := 0;
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1975,8 +1975,8 @@ type tsgtkapi = class(tgtkapis)
|
|||
cairo_fill(dc);
|
||||
|
||||
cairo_move_to(dc,LPRECT[0]+x+2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/3);
|
||||
cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/3,LPRECT[3]-2);
|
||||
cairo_line_to(dc,LPRECT[2]-2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/4);
|
||||
cairo_line_to(dc,LPRECT[0]+x+(LPRECT[2]-LPRECT[0])/3,y+LPRECT[3]-2);
|
||||
cairo_line_to(dc,LPRECT[2]+x-2,LPRECT[1]+y+(LPRECT[3]-LPRECT[1])/4);
|
||||
cairo_set_source_rgb(dc,100/255,100/255,100/255);
|
||||
cairo_set_line_width(dc,4);
|
||||
cairo_stroke(dc);
|
||||
|
|
|
|||
|
|
@ -412,6 +412,7 @@ type tcustomcoolbar=class(tcustomcontrol)
|
|||
bmp := new TcustomBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(getmovebmp()));
|
||||
FDRageimglist.addbmp(bmp);
|
||||
bmp := new TcustomBitmap();
|
||||
bmp.readvcon(HexFormatStrToTsl(getsizebmp()));
|
||||
FDRageimglist.addbmp(bmp);
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1928,13 +1928,16 @@ type TCustomImageList=class(tcomponent)
|
|||
addIcon(bmp.ToIcon());
|
||||
if FimageCount>ct then
|
||||
begin
|
||||
FBmpItems.push(bmp);
|
||||
//////////////¿½±´bitamp²»Ïú»Ù///////////////////
|
||||
{
|
||||
nbmp := new tcustombitmap();
|
||||
bmp.AutoDestroy := false;
|
||||
nbmp.Handle := bmp.Handle;
|
||||
nbmp.AutoDestroy := true;
|
||||
//////////////////////////////
|
||||
FBmpItems.push(nbmp);
|
||||
//////////////////////////////
|
||||
}
|
||||
end
|
||||
finally
|
||||
FBmpAdding := false;
|
||||
|
|
|
|||
|
|
@ -527,6 +527,8 @@ type tfm = class(tvcform)
|
|||
end
|
||||
}
|
||||
function point_in_rgn(p,rgn_); //判断点是否在区域中
|
||||
function graph_paint_lines(cvs,linestyle,xys,closed,ifo); //根据给定点绘制线
|
||||
function graph_paint_points(mk,cvs,xys); //根据点信息绘制点
|
||||
type tg_WinControl = class(tcustomcontrol,tg_const) //绘图窗口
|
||||
function create(AOwner);
|
||||
begin
|
||||
|
|
@ -3748,12 +3750,13 @@ type tg_Polyline = class(tg_graph) //
|
|||
end
|
||||
end
|
||||
type tg_line_info = class(tg_const) //线型信息
|
||||
function create();
|
||||
function create(awer);
|
||||
begin
|
||||
fcolor := 0;
|
||||
FWidth := 1;
|
||||
FStyle := tgc_PS_SOLID;
|
||||
fbkcolor := nil;
|
||||
fonwer := awer;
|
||||
end
|
||||
function clone();
|
||||
begin
|
||||
|
|
@ -3765,24 +3768,64 @@ type tg_line_info = class(tg_const) //
|
|||
r.bkcolor := fbkcolor;
|
||||
return r;
|
||||
end
|
||||
property Style read FStyle write FStyle;
|
||||
property width read FWidth write fwidth;
|
||||
property size read FWidth write fwidth;
|
||||
property color read fcolor write fcolor;
|
||||
property bkcolor read fbkcolor write fbkcolor;
|
||||
property style index "style" read FStyle write setpropid;
|
||||
property width index "width" read FWidth write setpropid;
|
||||
property size index "size" read FWidth write setpropid;
|
||||
property color index "color" read fcolor write setpropid;
|
||||
property bkcolor index "bkcolor" read fbkcolor write setpropid;
|
||||
private
|
||||
fwidth;
|
||||
fcolor;
|
||||
FStyle;
|
||||
fbkcolor;
|
||||
function setpropid(id,v);
|
||||
begin
|
||||
case id of
|
||||
"style":
|
||||
begin
|
||||
if FStyle<>v and ifnumber(v) then
|
||||
begin
|
||||
FStyle := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"width","size":
|
||||
begin
|
||||
if FWidth<>v and ifnumber(v) then
|
||||
begin
|
||||
FWidth := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"color":
|
||||
begin
|
||||
if fcolor<>v and ifnumber(v) then
|
||||
begin
|
||||
fcolor := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"bkcolor":
|
||||
begin
|
||||
if fbkcolor<>v and ifnumber(v) then
|
||||
begin
|
||||
fbkcolor := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
|
||||
end;
|
||||
end
|
||||
[weakref]fonwer;
|
||||
end
|
||||
type tg_font_info = class(tg_const) //字体信息
|
||||
function create();
|
||||
function create(awner);
|
||||
begin
|
||||
fstyle := nil;
|
||||
fsize := 7;
|
||||
fforeground := 0;
|
||||
fbackground := nil;
|
||||
fonwer := awner;
|
||||
end
|
||||
function clone();
|
||||
begin
|
||||
|
|
@ -3793,25 +3836,65 @@ type tg_font_info = class(tg_const) //
|
|||
r.bkcolor := fbackground;
|
||||
return r;
|
||||
end
|
||||
property style read fstyle write fstyle;
|
||||
property size read fsize write fsize;
|
||||
property color read fforeground write fforeground;
|
||||
property bkcolor read fbackground write fbackground;
|
||||
property style index "style" read fstyle write setpropid;
|
||||
property size index "size" read fsize write setpropid;
|
||||
property color index "color" read fforeground write setpropid;
|
||||
property bkcolor index "bkcolor" read fbackground write setpropid;
|
||||
private
|
||||
fstyle;
|
||||
fsize;
|
||||
fsize_unit;
|
||||
fforeground;
|
||||
fbackground;
|
||||
fbackground;
|
||||
[weakref]fonwer;
|
||||
function setpropid(id,v);
|
||||
begin
|
||||
case id of
|
||||
"style":
|
||||
begin
|
||||
if FStyle<>v and ifnumber(v) then
|
||||
begin
|
||||
FStyle := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"size":
|
||||
begin
|
||||
if fsize<>v and ifnumber(v) then
|
||||
begin
|
||||
fsize := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"color":
|
||||
begin
|
||||
if fforeground<>v and ifnumber(v) then
|
||||
begin
|
||||
fforeground := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"bkcolor":
|
||||
begin
|
||||
if fbackground<>v and ifnumber(v) then
|
||||
begin
|
||||
fbackground := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
|
||||
end;
|
||||
end
|
||||
end
|
||||
type tg_mark_info = class(tg_const) //标记信息
|
||||
function create();
|
||||
function create(awner);
|
||||
begin
|
||||
fstyle := tgc_mks_dot;
|
||||
fsize := 0;
|
||||
fsize_unit := tgc_mk_point;
|
||||
fforeground := 0;
|
||||
fbackground := 0xffffff;
|
||||
fonwer := awner;
|
||||
end
|
||||
function clone();
|
||||
begin
|
||||
|
|
@ -3823,17 +3906,55 @@ type tg_mark_info = class(tg_const) //
|
|||
r.bkcolor := fbackground;
|
||||
return r;
|
||||
end
|
||||
property style read fstyle write fstyle;
|
||||
property size read fsize write fsize;
|
||||
property style index "style" read fstyle write setpropid;
|
||||
property size index "size" read fsize write setpropid;
|
||||
property size_unit read fsize_unit write fsize_unit;
|
||||
property color read fforeground write fforeground;
|
||||
property bkcolor read fbackground write fbackground;
|
||||
property color index "color" read fforeground write setpropid;
|
||||
property bkcolor index "bkcolor" read fbackground write setpropid;
|
||||
private
|
||||
fstyle;
|
||||
fsize;
|
||||
fsize_unit;
|
||||
fforeground;
|
||||
fbackground;
|
||||
fbackground;
|
||||
[weakref]fonwer;
|
||||
function setpropid(id,v);
|
||||
begin
|
||||
case id of
|
||||
"style":
|
||||
begin
|
||||
if FStyle<>v and ifnumber(v) then
|
||||
begin
|
||||
FStyle := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"size":
|
||||
begin
|
||||
if fsize<>v and ifnumber(v) then
|
||||
begin
|
||||
fsize := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"color":
|
||||
begin
|
||||
if fforeground<>v and ifnumber(v) then
|
||||
begin
|
||||
fforeground := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
"bkcolor":
|
||||
begin
|
||||
if fbackground<>v and ifnumber(v) then
|
||||
begin
|
||||
fbackground := v;
|
||||
if fonwer then fonwer.invalidate();
|
||||
end
|
||||
end
|
||||
end;
|
||||
end
|
||||
end
|
||||
type tg_evet_conainter = class(tg_const) //带消息的绘图基类
|
||||
function create();
|
||||
|
|
@ -3872,9 +3993,9 @@ type tg_base = class(TNode,tg_evet_conainter) //
|
|||
fenabled := tgc_on;
|
||||
fline_mode := tgc_off;
|
||||
fmark_mode := tgc_off;
|
||||
flineinfo := new tg_line_info();
|
||||
fmarkinfo := new tg_mark_info();
|
||||
ffontinfo := new tg_font_info();
|
||||
flineinfo := new tg_line_info(self(true));
|
||||
fmarkinfo := new tg_mark_info(self(true));
|
||||
ffontinfo := new tg_font_info(self(true));
|
||||
end
|
||||
function axes_mapping(x,y,z,_x,_y);virtual; //
|
||||
begin
|
||||
|
|
@ -3973,6 +4094,7 @@ type tg_base = class(TNode,tg_evet_conainter) //
|
|||
end
|
||||
function invalidate(); //刷新
|
||||
begin
|
||||
if tgc_off=fvisibe then return ;
|
||||
if fchange_locked then return ;
|
||||
axs := get_axes();
|
||||
if axs then
|
||||
|
|
@ -4388,6 +4510,14 @@ begin
|
|||
_x := x*cos(ag)+y*sin(ag);
|
||||
_y := -x*sin(ag)+y*cos(ag);
|
||||
end
|
||||
function graph_paint_lines(cvs,pls,xys,cls,ifo);
|
||||
begin
|
||||
return paint_lines(cvs,pls,xys,cls,ifo);
|
||||
end
|
||||
function graph_paint_points(mk,dc,xys);
|
||||
begin
|
||||
return paint_marks(mk,dc,xys);
|
||||
end
|
||||
function paint_lines(cvs,pls,xys,cls,ifo);//划线
|
||||
begin
|
||||
o := static new tg_const();
|
||||
|
|
@ -4493,7 +4623,7 @@ begin
|
|||
end
|
||||
end
|
||||
end
|
||||
function paint_marks(mk,dc,xys); //ťćÖĆľă
|
||||
function paint_marks(mk,dc,xys); //绘制marks;
|
||||
begin
|
||||
o := static new tg_const();
|
||||
tp := mk.Style;
|
||||
|
|
|
|||
|
|
@ -937,6 +937,7 @@ type TTmfParser = class(TTmfParserbase)
|
|||
public
|
||||
property Script write SetScript;
|
||||
property ScriptPath write SetScriptPath;
|
||||
property tokens read FTokens; //获得token数据
|
||||
{**
|
||||
@param(Script)(string) 设置脚本文件 %%
|
||||
@param(ScriptPath)(string) 脚本路径 %%
|
||||
|
|
|
|||
Loading…
Reference in New Issue