Gtk2: Allow font change for TListView. Fixed issue #16964

git-svn-id: trunk@28444 -
This commit is contained in:
zeljko 2010-11-24 08:13:15 +00:00
parent 6ded956938
commit da7a65635c
2 changed files with 17 additions and 0 deletions

View File

@ -147,6 +147,7 @@ type
class procedure SetAllocBy(const ALV: TCustomListView; const AValue: Integer); override;
class procedure SetColor(const AWinControl: TWinControl); override;
class procedure SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); override;
class procedure SetFont(const AWinControl: TWinControl; const AFont: TFont); override;
class procedure SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles); override;
class procedure SetHoverTime(const ALV: TCustomListView; const AValue: Integer); override;
// class procedure SetIconOptions(const ALV: TCustomListView; const AValue: TIconOptions); override;

View File

@ -1815,6 +1815,22 @@ begin
then Exit;
end;
class procedure TGtk2WSCustomListView.SetFont(const AWinControl: TWinControl;
const AFont: TFont);
var
Widget: PGtkWidget;
begin
if not WSCheckHandleAllocated(AWinControl, 'SetFont') then
Exit;
Widget := PGtkWidget(AWinControl.Handle);
Widget := GetWidgetInfo(Widget, True)^.CoreWidget;
Gtk2WidgetSet.SetWidgetFont(Widget, AFont);
Gtk2WidgetSet.SetWidgetColor(Widget, AFont.Color, clNone,
[GTK_STATE_NORMAL,GTK_STATE_ACTIVE,
GTK_STATE_PRELIGHT,GTK_STATE_SELECTED,
GTK_STYLE_TEXT]);
end;
class procedure TGtk2WSCustomListView.SetHotTrackStyles(const ALV: TCustomListView;
const AValue: TListHotTrackStyles);
begin