Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- type
- TFontHelper = class helper for TFont
- private
- function GetBold: Boolean;
- procedure SetBold(Value: Boolean);
- function GetItalic: Boolean;
- procedure SetItalic(Value: Boolean);
- function GetUnderline: Boolean;
- procedure SetUnderline(Value: Boolean);
- function GetStrikeOut: Boolean;
- procedure SetStrikeOut(Value: Boolean);
- public
- property Bold: Boolean read GetBold write SetBold;
- property Italic: Boolean read GetItalic write SetItalic;
- property Underline: Boolean read GetUnderline write SetUnderline;
- property StrikeOut: Boolean read GetStrikeOut write SetStrikeOut;
- end;
- implementation
- { TFontHelper }
- function TFontHelper.GetBold: Boolean;
- begin
- Result := fsBold in Style;
- end;
- procedure TFontHelper.SetBold(Value: Boolean);
- begin
- if Value then
- Style := Style + [fsBold]
- else
- Style := Style - [fsBold];
- end;
- function TFontHelper.GetItalic: Boolean;
- begin
- Result := fsItalic in Style;
- end;
- procedure TFontHelper.SetItalic(Value: Boolean);
- begin
- if Value then
- Style := Style + [fsItalic]
- else
- Style := Style - [fsItalic];
- end;
- function TFontHelper.GetUnderline: Boolean;
- begin
- Result := fsUnderline in Style;
- end;
- procedure TFontHelper.SetUnderline(Value: Boolean);
- begin
- if Value then
- Style := Style + [fsUnderline]
- else
- Style := Style - [fsUnderline];
- end;
- function TFontHelper.GetStrikeOut: Boolean;
- begin
- Result := fsStrikeOut in Style;
- end;
- procedure TFontHelper.SetStrikeOut(Value: Boolean);
- begin
- if Value then
- Style := Style + [fsStrikeOut]
- else
- Style := Style - [fsStrikeOut];
- end;
Advertisement
Add Comment
Please, Sign In to add comment