parent
1210422286
commit
cbeee269d4
|
|
@ -195,6 +195,7 @@ type tcontrol = class(tcomponent)
|
||||||
if FParentFont <> nv then
|
if FParentFont <> nv then
|
||||||
begin
|
begin
|
||||||
FParentFont := nv;
|
FParentFont := nv;
|
||||||
|
FontChanged();
|
||||||
return 1;
|
return 1;
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -352,16 +353,16 @@ type tcontrol = class(tcomponent)
|
||||||
protected //部分属性设置
|
protected //部分属性设置
|
||||||
function GetControlFont();virtual;
|
function GetControlFont();virtual;
|
||||||
begin
|
begin
|
||||||
if ParentFont and Parent then return Parent.FFont;
|
if ParentFont and Parent then return Parent.font;
|
||||||
return FFont;
|
return FFont;
|
||||||
end
|
end
|
||||||
function SetControlFont(v);virtual;
|
function SetControlFont(v);virtual;
|
||||||
begin
|
begin
|
||||||
|
if ParentFont then return ; //如果使用父节点的字体,那么字体无效
|
||||||
if ifarray(v)then
|
if ifarray(v)then
|
||||||
begin
|
begin
|
||||||
FFont.SetValues(v);
|
FFont.SetValues(v);
|
||||||
end else
|
end else
|
||||||
//if v is class(tfont)then
|
|
||||||
if v is class(Tcustomfont)then
|
if v is class(Tcustomfont)then
|
||||||
begin
|
begin
|
||||||
FFont.copyfont(v);
|
FFont.copyfont(v);
|
||||||
|
|
@ -497,6 +498,7 @@ type tcontrol = class(tcomponent)
|
||||||
{**
|
{**
|
||||||
@explan(说明) 子控件添加 %%
|
@explan(说明) 子控件添加 %%
|
||||||
**}
|
**}
|
||||||
|
if AControl and AControl.ParentFont then AControl.FontChanged();
|
||||||
end
|
end
|
||||||
function ControlDeleted(AControl);virtual;//子控件被删除
|
function ControlDeleted(AControl);virtual;//子控件被删除
|
||||||
begin
|
begin
|
||||||
|
|
@ -676,7 +678,7 @@ type tcontrol = class(tcomponent)
|
||||||
end;
|
end;
|
||||||
procedure FontChanged(Sender:TObject);virtual;
|
procedure FontChanged(Sender:TObject);virtual;
|
||||||
begin
|
begin
|
||||||
if parent then parent.FontChanged(Sender);
|
//if parent then parent.FontChanged(Sender);
|
||||||
end
|
end
|
||||||
function GetClientRect();virtual; // //type_tcontrol visual size of client area
|
function GetClientRect();virtual; // //type_tcontrol visual size of client area
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -988,6 +988,7 @@ type TVCForm = class(TScrollingWinControl)
|
||||||
end
|
end
|
||||||
procedure FontChanged(Sender:TObject);override;
|
procedure FontChanged(Sender:TObject);override;
|
||||||
begin
|
begin
|
||||||
|
return inherited;
|
||||||
if(HandleAllocated())then
|
if(HandleAllocated())then
|
||||||
begin
|
begin
|
||||||
_send_(WM_SETFONT,Font.Handle,1);
|
_send_(WM_SETFONT,Font.Handle,1);
|
||||||
|
|
|
||||||
|
|
@ -793,17 +793,23 @@ type TWinControl = class(tcontrol)
|
||||||
end
|
end
|
||||||
procedure FontChanged(Sender:TObject);override;
|
procedure FontChanged(Sender:TObject);override;
|
||||||
begin
|
begin
|
||||||
if(HandleAllocated()and not(ParentFont))then
|
for i := 0 to ControlCount-1 do
|
||||||
begin
|
begin
|
||||||
_send_(WM_SETFONT,Font.Handle,1);
|
it := Controls[i];
|
||||||
end
|
if it.ParentFont then
|
||||||
|
begin
|
||||||
|
it.FontChanged(sender);
|
||||||
|
end
|
||||||
|
//InvalidateRect(nil,false);
|
||||||
|
//it.Perform(new tuieventbase(CM_PARENTFONTCHANGED,hd,1,0));
|
||||||
|
end
|
||||||
end
|
end
|
||||||
function CMPARENTFONTCHANGED(o,e):CM_PARENTFONTCHANGED;virtual;
|
function CMPARENTFONTCHANGED(o,e):CM_PARENTFONTCHANGED;virtual;
|
||||||
begin
|
begin
|
||||||
if ParentFont then
|
//if ParentFont then
|
||||||
begin
|
//begin
|
||||||
_send_(WM_SETFONT,e.wparam,1);
|
// _send_(WM_SETFONT,e.wparam,1);
|
||||||
end
|
//end
|
||||||
end
|
end
|
||||||
function WMGETMINMAXINFO(o,e):WM_GETMINMAXINFO;virtual;
|
function WMGETMINMAXINFO(o,e):WM_GETMINMAXINFO;virtual;
|
||||||
begin
|
begin
|
||||||
|
|
@ -850,8 +856,8 @@ type TWinControl = class(tcontrol)
|
||||||
end
|
end
|
||||||
function WMSETFONT(o,e):WM_SETFONT;virtual;
|
function WMSETFONT(o,e):WM_SETFONT;virtual;
|
||||||
begin
|
begin
|
||||||
defaulthandler(e);
|
//defaulthandler(e);
|
||||||
Perform(new tuieventbase(CM_FONTCHANGED,e.wparam,e.lparam,0));
|
//Perform(new tuieventbase(CM_FONTCHANGED,e.wparam,e.lparam,0));
|
||||||
end
|
end
|
||||||
function WMACTIVATE(o,e):WM_ACTIVATE;virtual;
|
function WMACTIVATE(o,e):WM_ACTIVATE;virtual;
|
||||||
begin
|
begin
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ function GetGdipStatus(v);
|
||||||
type TGdi = class(TSLUIBASE)
|
type TGdi = class(TSLUIBASE)
|
||||||
private
|
private
|
||||||
static GDICache;
|
static GDICache;
|
||||||
FCanvas;
|
[weakref]FCanvas;
|
||||||
function SetCanvas(c);
|
function SetCanvas(c);
|
||||||
begin
|
begin
|
||||||
FCanvas := c;
|
FCanvas := c;
|
||||||
|
|
@ -428,10 +428,11 @@ type Tcustomfont = class(tgdi)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if ifnumber(vs["color"])then
|
vsc := vs["color"];
|
||||||
|
if ifnumber(vsc) and (FColor<>vsc) then
|
||||||
begin
|
begin
|
||||||
cg := true;
|
cg := true;
|
||||||
SetColor(vs["color"]);
|
SetColor(vsc);
|
||||||
end
|
end
|
||||||
if cg then Onchange();
|
if cg then Onchange();
|
||||||
return cg;
|
return cg;
|
||||||
|
|
@ -464,7 +465,7 @@ type TFontControl=class(Tcustomfont)
|
||||||
@explan(说明) 控件字体 %%
|
@explan(说明) 控件字体 %%
|
||||||
**}
|
**}
|
||||||
private
|
private
|
||||||
FControl;
|
[weakref]FControl;
|
||||||
Function SetControl(v);
|
Function SetControl(v);
|
||||||
begin
|
begin
|
||||||
if(v <> FControl)and(v is class(tcontrol))then
|
if(v <> FControl)and(v is class(tcontrol))then
|
||||||
|
|
|
||||||
|
|
@ -2959,8 +2959,9 @@ type tthreeEntry=class(TCustomControl)
|
||||||
function FontChanged(o);override;
|
function FontChanged(o);override;
|
||||||
begin
|
begin
|
||||||
//¸Ä±ä
|
//¸Ä±ä
|
||||||
FFontWidth := font.width;
|
ft := font;
|
||||||
for i,v in FEntrys do v.Font := font;
|
FFontWidth := ft.width;
|
||||||
|
for i,v in FEntrys do v.Font := ft;
|
||||||
calcCtls();
|
calcCtls();
|
||||||
end
|
end
|
||||||
protected
|
protected
|
||||||
|
|
@ -3237,14 +3238,16 @@ type TCustomListBoxbase=class(TCustomScrollControl)
|
||||||
end
|
end
|
||||||
function FontChanged(o);override;
|
function FontChanged(o);override;
|
||||||
begin
|
begin
|
||||||
wd := font.width;
|
ft := Font;
|
||||||
h := font.Height;
|
wd := ft.width;
|
||||||
|
h := ft.Height;
|
||||||
if h <> FFontHeight or wd <> FFontWidth then
|
if h <> FFontHeight or wd <> FFontWidth then
|
||||||
begin
|
begin
|
||||||
FFontHeight := h;
|
FFontHeight := h;
|
||||||
FFontWidth := wd;
|
FFontWidth := wd;
|
||||||
UpDateScrollBar();
|
UpDateScrollBar();
|
||||||
end
|
end
|
||||||
|
inherited;
|
||||||
end
|
end
|
||||||
function GetItemCount();virtual;
|
function GetItemCount();virtual;
|
||||||
begin
|
begin
|
||||||
|
|
@ -4102,7 +4105,7 @@ type TCustomComboBoxbase=class(TCustomControl)
|
||||||
end
|
end
|
||||||
published
|
published
|
||||||
property itemcount read GetItemCount ;
|
property itemcount read GetItemCount ;
|
||||||
property ItemIndex:tsl read GetItemIndex write SetItemIndex;
|
property ItemIndex:lazytsl read GetItemIndex write SetItemIndex;
|
||||||
property OnSelchanged:eventhandler read FOnSelchanged write FOnSelchanged;
|
property OnSelchanged:eventhandler read FOnSelchanged write FOnSelchanged;
|
||||||
property ondropdown:eventhandler read Fondropdown write Fondropdown;
|
property ondropdown:eventhandler read Fondropdown write Fondropdown;
|
||||||
property oncloseup:eventhandler read Foncloseup write Foncloseup;
|
property oncloseup:eventhandler read Foncloseup write Foncloseup;
|
||||||
|
|
@ -4294,10 +4297,12 @@ type TcustomComboBox=class(TCustomComboBoxbase)
|
||||||
FEdit.Readonly := Freadonly;
|
FEdit.Readonly := Freadonly;
|
||||||
FListBox.parent := self;
|
FListBox.parent := self;
|
||||||
FEdit.parent := self;
|
FEdit.parent := self;
|
||||||
|
FEdit.ParentFont := true;
|
||||||
end
|
end
|
||||||
function CreateAlist();override;
|
function CreateAlist();override;
|
||||||
begin
|
begin
|
||||||
r := new TComboListBox(self);
|
r := new TComboListBox(self);
|
||||||
|
r.ParentFont := true;
|
||||||
return r;
|
return r;
|
||||||
end
|
end
|
||||||
function SetDesigning(Value,SetChildren);override;
|
function SetDesigning(Value,SetChildren);override;
|
||||||
|
|
@ -6013,6 +6018,7 @@ type tcustomgroupbox=class(TCustomControl)
|
||||||
wf := ft.width;
|
wf := ft.width;
|
||||||
hf := ft.height+2;
|
hf := ft.height+2;
|
||||||
cvs := Canvas;
|
cvs := Canvas;
|
||||||
|
cvs.font := ft;
|
||||||
cvs.pen.color := 11184810;//rgb(170,170,170);
|
cvs.pen.color := 11184810;//rgb(170,170,170);
|
||||||
cvs.pen.width := 1;
|
cvs.pen.width := 1;
|
||||||
cwd := 0;
|
cwd := 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue