修改资源文件tfm位置

This commit is contained in:
2025-05-19 15:28:51 +08:00
parent 60749c0d93
commit e4d6b23680
52 changed files with 2169 additions and 1311 deletions
+1 -1
View File
@@ -1524,7 +1524,7 @@ type tcontrol = class(tcomponent)
info := fonGetPreferredSize.functioninfo();
fn := info["functionname"];
if ifstring(info["classname"]) then fn := info["classname"] $ "." $ fn;
fn := "onGetPreferredSize call: "$fn $" err!";
fn := "onGetPreferredSize call: "$fn $" err!" $ exceptobject.errinfo;
except
fn := "onGetPreferredSize is not function";
end ;
+2
View File
@@ -74,6 +74,7 @@ type tgraphiccontrol = class(TControl)
p := Parent;
if(p is class(TWinControl))and p.HandleAllocated()then
begin
if p.autosize and (p.childsizing.layout<>0) then return p.AdjustSize();
if Align <> alNone then return p.DoControlAlign();
end
//////////////////
@@ -182,6 +183,7 @@ type tgraphiccontrol = class(TControl)
inherited;
if NewParent is class(TWinControl)then
begin
if NewParent.autosize or (NewParent.childsizing.layout<>0) then NewParent.AdjustSize();
InvalidateRect();
end
end
+23 -5
View File
@@ -1492,6 +1492,12 @@ type tmemo = class(TSynMemoNorm) //
if Fonchange then
calldatafunction(Fonchange,self(true),new tuieventbase(0,0,0,0));
end
function GetPreferredSize(w,h);override;
begin
if onGetPreferredSize then return inherited;
w := Width;
h := Height;
end
function MouseUp(o,e);override;
begin
if csDesigning in ComponentState then return ;
@@ -1594,11 +1600,17 @@ type twrapmemo = class(TScrollingWinControl)
end
end
end
function GetPreferredSize(w,h);override;
begin
if onGetPreferredSize then return inherited;
w := Width;
h := Height;
end
function FontChanged(o);override;
begin
if HandleAllocated() then doControlALign();
end
protected
protected
function GetXScrollDelta();override; //x间隔
begin
return FCharwidth;
@@ -5784,7 +5796,11 @@ type Ttfm2Component = class(TTmfParser)
end
function hastfmresource(o,cn);
begin
data := get_resource_by_name(cn+".tfm");
////////////根据新特性处理/////////
ci := o.classinfo();
data := ci["tfm"];
///////////////////////////////////////
if not data then data := get_resource_by_name(cn+".tfm");
if data then
begin
LoadFromTfmScript(o,data);
@@ -5844,20 +5860,22 @@ type Ttfm2Component = class(TTmfParser)
function GetReSourcetfmdir(p,rp);
begin
if not ifarray(rp) then rp := array();
rp[length(rp)] := p;
iofp := ioFileseparator();
for ii,vv in filelist("",p+"*") do
begin
fn := vv["FileName"];
if fn="." or fn=".." then continue;
if Pos("D",vv["Attr"]) then
begin
if lowercase(fn)="resource.tfm" then
begin
GetReSourcetfmdir(p+fn+iofp,rp);
{if lowercase(fn)="resource.tfm" then
begin
rp[length(rp)] := p+"resource.tfm"+iofp;
end else
begin
GetReSourcetfmdir(p+fn+iofp,rp);
end
end }
end
end
end
+8 -2
View File
@@ -590,9 +590,14 @@ type TWinControl = class(tcontrol)
if v=SW_SHOWNOACTIVATE then return ;
}
_wapi.ShowWindow(FHandle,v?SW_SHOW:SW_HIDE);
if(Parent is class(TWinControl))and parent.HandleAllocated()then
p := parent;
if(p is class(TWinControl))and p.HandleAllocated()then
begin
if Align <> alNone then Parent.DoControlAlign();
if (p.autosize or (p.childsizing.layout<>0) ) then
begin
p.AdjustSize();
end else
if Align <> alNone then p.DoControlAlign();
end
{if V then
begin
@@ -1787,6 +1792,7 @@ type TWinControl = class(tcontrol)
hParentWnd := hParentWndt;
end
end
Visible := false; //20250508 添加处理关闭按钮
return EndModalCode;
end
function UpdateWindow();
+11 -11
View File
@@ -729,8 +729,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
begin
if bytetype(dtx,i)<> 0 then
begin
bn := ft.charset;
ft.charset := 134;
//bn := ft.charset;
//ft.charset := 134;
break;
end
end
@@ -747,8 +747,8 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
begin
if bytetype(dtx,i)<> 0 then
begin
bn := ft.charset;
ft.charset := 134;
//bn := ft.charset;
//ft.charset := 134;
break;
end
end
@@ -757,10 +757,10 @@ type TCustomMemo = class(TCustomScrollControl,TCustomMemoCmd) //
r[2]:= r[0]+ct * FCharWidth;
cvs.DrawText(dtx2,r,DT_NOPREFIX);
end
if bn <> 100000 then
{if bn <> 100000 then
begin
ft.charset := bn;
end
end}
end
function paintlinestext(RC,FirstLine,LastLine,FirstCol,LastCol);virtual;
@@ -4216,23 +4216,23 @@ type TSynMemoNorm = class(TsynCustomMemo) //
begin
if fw>7 then
begin
if fw=18 then
{if fw=18 then
begin
fw := 17;
hw := 34;
end
end }
flg := true;
font := array("width":fw-1,"height":hw-2);
end
end else
begin
if fw<18 then
if fw<44 then
begin
if fw=16 then
{if fw=16 then
begin
fw := 17;
hw := 34;
end
end }
flg := true;
font := array("width":fw+1,"height":hw+2);
end
+5 -6
View File
@@ -256,11 +256,11 @@ type Tcustomfont = class(tgdi)
end
function Setcharset(v)
begin
if ifnumber(v)and v <> Fcharset then
{if ifnumber(v) and v <> Fcharset then
begin
Fcharset := v;
onchange();
end
end}
end
function Setoutprecision(v)
begin
@@ -329,7 +329,7 @@ type Tcustomfont = class(tgdi)
begin
s += invoke(self,"f"+v0);
end else
vvi := invoke(self,"f"+v0);
vvi := invoke(self,"f"+v0);
if ifnumber(vvi)then s += inttostr(vvi);
else s += "0";
s += ";";
@@ -427,12 +427,10 @@ type Tcustomfont = class(tgdi)
continue;
end
{$endif}
if v0="charset" then continue;
if not ifnil(vsv)then
begin
ovi := invoke(self,"f"+v0);
{$ifdef linux}{$else}
if (vsv=17 and v0="width") or (vsv=34 and v0="height") then continue;
{$endif}
if (ovi <> vsv) then
begin
invoke(self,"f"+v0,1,vsv);
@@ -456,6 +454,7 @@ type Tcustomfont = class(tgdi)
if FWidth>0 then return FWidth;
return abs(FHeight)/2;
end
//property constmembers read fconstmembers write setconstmembers
property height read Fheight write Setheight;
property width read Fwidth write Setwidth;
property escapement read Fescapement write Setescapement;
+6
View File
@@ -67,6 +67,12 @@ type TcustomGridCtl = class(tcustomscrollcontrol) //
// begin
// DoControlAlign();
// end
function GetPreferredSize(w,h);override;
begin
if ongetpreferredsize then return inherited;
w := Width;
h := Height;
end
function DoControlAlign();override;
begin
if(IsUpDating())then
+12 -3
View File
@@ -3590,7 +3590,11 @@ type TcustomListBox=class(TCustomListBoxbase)
end
2:
begin
selchange := 1;
if FMultisel3Data[-1] then //修正选中改变的问题20250430
begin
Reindex(FMultisel3Data,array(-1:nil));
end else
selchange := 1;
end
end;
if selchange then calllistselchengd();
@@ -3768,7 +3772,12 @@ type TcustomListBox=class(TCustomListBoxbase)
FSelEnd := n2;
flg := true;
end
end
end else
if (FSelBegin>=0) and (n=-1) then
begin
FSelBegin := FSelEnd := -1;
flg := true;
end
if flg then
begin
InvalidateRect(nil,false);
@@ -3801,7 +3810,7 @@ type TcustomListBox=class(TCustomListBoxbase)
end
return;
end
if not(isValidIndex2(n)) or n=FSelBegin then return;
if not(isValidIndex2(n) or n=-1) or n=FSelBegin then return;
SelRange(false);
FSelBegin := FSelEnd := n;
SelRange(true);
+39 -12
View File
@@ -1066,7 +1066,7 @@ type tg_axes = class(tg_base) //
f_changed .|= c_g_data_zoombox;
end
end
cmd_node_add_in:
cmd_node_add_in,cmd_node_del_from:
begin
if pm is class(tg_graph_base) then
begin
@@ -1217,7 +1217,7 @@ type tg_axes = class(tg_base) //
if (f_changed .& c_g_data_changed)=c_g_data_changed then
begin
tbds := fdata_bounds;
for i,v in get_node_data_bounds(self(true)) do
for i,v in get_node_data_bounds_format(self(true)) do
begin
if not fdata_bounds_locked[i] then
begin
@@ -4395,11 +4395,17 @@ type tg_base = class(TNode,tg_evet_conainter) //
function paint_pre(cvs);virtual;
begin
paint(cvs);
lgns := array();
for i := 0 to NodeCount-1 do
begin
vi := GetNodeByIndex(i);
vi.paint_pre(cvs);
end
if vi is class(tg_legend) then //处理次序问题
begin
lgns[length(lgns)] := vi;
end else
vi.paint_pre(cvs);
end
for i,vi in lgns do vi.paint_pre(cvs);
end
function hit_at(info):bool; //命中处理,鼠标信息
begin
@@ -4522,14 +4528,20 @@ type tg_base = class(TNode,tg_evet_conainter) //
function SetParent(V);virtual;
begin
if not check_parent(v) then return ;
if v then ct := v.NodeCount;
r := inherited;
if v then ct2 := v.NodeCount;
if ct2>ct then
p := parent;
r := inherited;
p2 := parent;
if p=p2 then return ;
if p2 then //添加
begin
ax := p2.axes;
if ax then ax.executecommand(cmd_node_add_in,self(true));
end
if p then //移除
begin
ax := axes;
if ax then ax.executecommand(cmd_node_add_in,self(true));
end
ax := p.axes;
if ax then ax.executecommand(cmd_node_del_from,self(true));
end
return r;
end
protected
@@ -4699,6 +4711,7 @@ type tg_const = class()
static const cmd_figure_changed = "figure_changed";
static const cmd_data_changed = "data_changed";
static const cmd_node_add_in = "node_add_in";
static const cmd_node_del_from = "node_del_from";
/////////////////////////////////////////////////////////
static const tgc_complementary_color = "complementary_color"; //采用补色
////////////////////////////////
@@ -5239,7 +5252,7 @@ begin
n++;
return new_bound_factor(a/10,n);
end else
if a<=1 then
if a<1 then
begin
n--;
return new_bound_factor(a*10,n);
@@ -5250,6 +5263,7 @@ begin
a_ := a;
b_ := b;
if not(par>=1) then par:=20;//20;
if a=b then return ;
r := new_bound_factor((b-a)/par,n);
if r<>0 then
begin
@@ -5272,10 +5286,23 @@ begin
d := bds;
end else
mg_bds(bds,d);
end else
if v is class(tg_axis) then
begin
echo "\r\n axis";
end
end
return d;
end
function get_node_data_bounds_format(nd);
begin
d := get_node_data_bounds(nd);
for i:= 0 to 2 do
begin
if d[i,0]>=d[i,1] then d[i,1] := d[i,0]+1;
end
return d;
end
function modify_text_pos(x_,y_,txtw,txth,al);//修正对齐位置
begin
case al of
+10 -3
View File
@@ -2299,12 +2299,19 @@ type ttfmnode = class()
s := finheritedname;
if s and ifstring(s) then
begin
data := get_resource_by_name( s+".tfm");
//////////根据新特性添加//////////////////////////////////////
o :=findclass(s);
if o then
begin
ci := o.classinfo();
data := ci["tfm"];
end
//////////////////////////////////////////////
if not data then data := get_resource_by_name( s+".tfm");
if data then
begin
return get_inherited(data);
end
end
for i,v in finheritedpaths do
begin
fv := v+s+".tfm";