LazReport, fix selecting the right font after switching of printers, fix icons in font list to show what fonts came from printer

git-svn-id: trunk@43186 -
This commit is contained in:
jesus 2013-10-09 05:34:44 +00:00
parent 6099679fa6
commit 7ac8ef0af4
2 changed files with 27 additions and 15 deletions

View File

@ -1926,7 +1926,7 @@ inherited frDesignerForm: TfrDesignerForm
object C2: TComboBox
Tag = 7
Left = 1
Height = 21
Height = 19
Top = 2
Width = 155
ItemHeight = 13
@ -1935,6 +1935,7 @@ inherited frDesignerForm: TfrDesignerForm
OnGetItems = C2GetItems
ParentFont = False
Sorted = True
Style = csOwnerDrawFixed
TabOrder = 1
end
end

View File

@ -2892,6 +2892,7 @@ procedure TfrDesignerForm.GetFontList;
var
DC: HDC;
Lf: TLogFont;
S: String;
{$IFDEF USE_PRINTER_FONTS}
Lst: TStrings;
i: Integer;
@ -2929,18 +2930,28 @@ begin
end;
{$ENDIF}
if C2.Items.Count>0 then
LastFontName := C2.Items[0]
else
LastFontName := '';
if C2.Items.IndexOf('Arial') <> -1 then
LastFontName := 'Arial'
else if C2.Items.IndexOf('helvetica [urw]')<>-1 then
LastFontName := 'helvetica [urw]'
else if C2.Items.IndexOf('Arial Cyr') <> -1 then
LastFontName := 'Arial Cyr';
LastFontSize := 10;
if (SelNum>0) and (FirstSelected is TfrMemoView) then
begin
// font of selected memo has preference, select it
LastFontname := TfrMemoView(FirstSelected).Font.Name;
LastFontSize := TfrMemoView(FirstSelected).Font.Size;
end else
if C2.Items.IndexOf(LastFontName)>=0 then
// last font name remains valid, keep it together with lastFontSize
else begin
// setup an initial font name and size
if C2.Items.Count>0 then
LastFontName := C2.Items[0]
else
LastFontName := '';
if C2.Items.IndexOf('Arial') <> -1 then
LastFontName := 'Arial'
else if C2.Items.IndexOf('helvetica [urw]')<>-1 then
LastFontName := 'helvetica [urw]'
else if C2.Items.IndexOf('Arial Cyr') <> -1 then
LastFontName := 'Arial Cyr';
LastFontSize := 10;
end;
end;
procedure TfrDesignerForm.FormCreate(Sender: TObject);
@ -4841,9 +4852,9 @@ begin
if t is TfrMemoView then
with t as TfrMemoView do
case b of
7: if C2.ItemIndex <> 0 then
7: if C2.ItemIndex >= 0 then
begin
Font.Name := C2.Text;
Font.Name := C2.Items[C2.ItemIndex];
LastFontName := Font.Name;
end;
8: begin