You've already forked lazarus-ccr
* Change LM_SETFONT handler to CM_FONTCHANGED so the tree can properly react to font changes
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1082 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -3310,7 +3310,7 @@ type
|
|||||||
procedure SetDefaultText(const Value: String);
|
procedure SetDefaultText(const Value: String);
|
||||||
procedure SetOptions(const Value: TCustomStringTreeOptions);
|
procedure SetOptions(const Value: TCustomStringTreeOptions);
|
||||||
procedure SetText(Node: PVirtualNode; Column: TColumnIndex; const Value: String);
|
procedure SetText(Node: PVirtualNode; Column: TColumnIndex; const Value: String);
|
||||||
procedure WMSetFont(var Msg: TLMNoParams{TWMSetFont}); message LM_SETFONT;
|
procedure CMFontChanged(var Msg: TLMessage); message CM_FONTCHANGED;
|
||||||
protected
|
protected
|
||||||
procedure AdjustPaintCellRect(var PaintInfo: TVTPaintInfo; out NextNonEmpty: TColumnIndex); override;
|
procedure AdjustPaintCellRect(var PaintInfo: TVTPaintInfo; out NextNonEmpty: TColumnIndex); override;
|
||||||
function CanExportNode(Node: PVirtualNode): Boolean;
|
function CanExportNode(Node: PVirtualNode): Boolean;
|
||||||
@ -15228,7 +15228,7 @@ begin
|
|||||||
if HandleAllocated then
|
if HandleAllocated then
|
||||||
Invalidate;
|
Invalidate;
|
||||||
end;
|
end;
|
||||||
//todo_lcl Replace this message with a THeader method
|
|
||||||
HeaderMessage.Msg := CM_PARENTFONTCHANGED;
|
HeaderMessage.Msg := CM_PARENTFONTCHANGED;
|
||||||
HeaderMessage.WParam := 0;
|
HeaderMessage.WParam := 0;
|
||||||
HeaderMessage.LParam := 0;
|
HeaderMessage.LParam := 0;
|
||||||
@ -31565,27 +31565,23 @@ end;
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure TCustomVirtualStringTree.WMSetFont(var Msg: TLMNoParams);
|
procedure TCustomVirtualStringTree.CMFontChanged(var Msg: TLMessage);
|
||||||
|
|
||||||
// Whenever a new font is applied to the tree some default values are determined to avoid frequent
|
// Whenever a new font is applied to the tree some default values are determined to avoid frequent
|
||||||
// determination of the same value.
|
// determination of the same value.
|
||||||
|
|
||||||
{
|
|
||||||
var
|
var
|
||||||
MemDC: HDC;
|
MemDC: HDC;
|
||||||
Run: PVirtualNode;
|
Run: PVirtualNode;
|
||||||
TM: TTextMetric;
|
TM: TTextMetric;
|
||||||
Size: TSize;
|
Size: TSize;
|
||||||
Data: PInteger;
|
Data: PInteger;
|
||||||
}
|
|
||||||
|
|
||||||
begin
|
begin
|
||||||
inherited;
|
inherited;
|
||||||
//todo_lcl
|
|
||||||
{
|
|
||||||
MemDC := CreateCompatibleDC(0);
|
MemDC := CreateCompatibleDC(0);
|
||||||
try
|
try
|
||||||
SelectObject(MemDC, Msg.Font);
|
SelectObject(MemDC, Font.Reference.Handle);
|
||||||
GetTextMetrics(MemDC, TM);
|
GetTextMetrics(MemDC, TM);
|
||||||
FTextHeight := TM.tmHeight;
|
FTextHeight := TM.tmHeight;
|
||||||
|
|
||||||
@ -31604,7 +31600,6 @@ begin
|
|||||||
Data^ := 0;
|
Data^ := 0;
|
||||||
Run := GetNextNoInit(Run);
|
Run := GetNextNoInit(Run);
|
||||||
end;
|
end;
|
||||||
}
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user