* * *

Author Topic: [solved] Projects in C:\lazarus\examples - fontenum  (Read 537 times)

PeterX

  • Full Member
  • ***
  • Posts: 208
[solved] Projects in C:\lazarus\examples - fontenum
« on: May 11, 2017, 12:46:42 pm »
I hope not to break code anywhere,
but adding
Quote
  lbCharsetClick(Sender);
fills up all listboxes (from line 227 in mainunit):

Quote
procedure TfrmMain.FormShow(Sender: TObject);
begin
  LoadFontlist;
  lbCharsetClick(Sender);
end;

procedure TfrmMain.lbFamilyClick(Sender: TObject);
begin
  LoadFamilyFonts(-1);
  lbCharsetClick(Sender);
end;

« Last Edit: May 15, 2017, 02:04:58 pm by PeterX »
usually using latest Lazarus release version
with Windows 10 at home
and Windows 7 on the job

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2960
  • I like bugs.
Re: Projects in C:\lazarus\examples - fontenum
« Reply #1 on: May 11, 2017, 12:57:04 pm »
PeterX, it is good you fix bugs but you should learn to create patches.
 http://wiki.freepascal.org/Creating_A_Patch
Here they get easily ignored, the bug tracker is a better place.

PeterX

  • Full Member
  • ***
  • Posts: 208
Re: Projects in C:\lazarus\examples - fontenum
« Reply #2 on: May 11, 2017, 01:02:27 pm »
PeterX, it is good you fix bugs but you should learn to create patches.
 http://wiki.freepascal.org/Creating_A_Patch
Here they get easily ignored, the bug tracker is a better place.
I have different experiences with BugTracker.

Some said that my changes are my opinion
and I should first discuss them in the forum.
And the BugTracker is not the right place for discussions.
So I stopped writing bug reports. Sorry.
« Last Edit: May 11, 2017, 01:28:58 pm by PeterX »
usually using latest Lazarus release version
with Windows 10 at home
and Windows 7 on the job

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2960
  • I like bugs.
Re: Projects in C:\lazarus\examples - fontenum
« Reply #3 on: May 11, 2017, 01:12:46 pm »
Ok, it depends on the issue. A clear bug fix should be ok but sometimes things are more complex.
Anyway the example projects deserve some attention, I will apply your change soon. Hold on...

PeterX

  • Full Member
  • ***
  • Posts: 208
Re: Projects in C:\lazarus\examples - fontenum
« Reply #4 on: May 11, 2017, 01:21:45 pm »
Adding OnChange for the CheckBoxes ..

Quote
procedure TfrmMain.chkStrikeChange(Sender: TObject);
begin
  SelectFont;
end;

procedure TfrmMain.chkUnderLineChange(Sender: TObject);
begin
  SelectFont;
end;

makes them work.

This requires some additional lines in procedure TfrmMain.SelectFont
below the line
Quote
             if i and 2 <> 0 then F.Style := F.Style + [fsBold];
:

Quote
            if chkUnderLine.Checked
              then F.Style := F.Style + [fsUnderline]
              else F.Style := F.Style - [fsUnderline];
            if chkStrike.Checked
              then F.Style := F.Style + [fsStrikeOut]
              else F.Style := F.Style - [fsStrikeOut];



usually using latest Lazarus release version
with Windows 10 at home
and Windows 7 on the job

PeterX

  • Full Member
  • ***
  • Posts: 208
Re: Projects in C:\lazarus\examples - fontenum
« Reply #5 on: May 11, 2017, 01:27:40 pm »
Sorry, there's more to be done (see post #1).
Now to also auto-update the Font View  in component "grid" :

=> SelectFont;  was also missing :

Quote
procedure TfrmMain.FormShow(Sender: TObject);
begin
  LoadFontlist;
  lbCharsetClick(Sender);
  SelectFont;
end;

procedure TfrmMain.lbFamilyClick(Sender: TObject);
begin
  LoadFamilyFonts(-1);
  lbCharsetClick(Sender);
  SelectFont;
end;

« Last Edit: May 11, 2017, 01:30:00 pm by PeterX »
usually using latest Lazarus release version
with Windows 10 at home
and Windows 7 on the job

wp

  • Hero Member
  • *****
  • Posts: 3599
Re: Projects in C:\lazarus\examples - fontenum
« Reply #6 on: May 11, 2017, 10:36:25 pm »
Fixed in r54876. Thanks.
Lazarus trunk / fpc 3.0.0 / Win32

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus