Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-11

Version page of Lazarus 'About' dialog

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Howard Page-Clark

Under Windows (XP SP3) the Version page of Lazarus' About dialog does not display correctly, with 'Lazarus' text obscuring 'Free Pascal' (see attached screenshot).
By amending the OnPaint method of the PaintBox1 control in \lazarus\ide\aboutfrm.pas
as follows:

procedure TForm1.PaintBox1Paint(Sender: TObject);
begin
  with PaintBox1.Canvas do
  begin
    Font.Color:= RGBToColor(63,97,197);
    Font.Size:= 14;                           // Font.Size:= 16;
    TextOut(66,0, 'Free Pascal');  // TextOut(55,0, 'Free Pascal');
    Font.Size:= 24;                          // Font.Size:= 36;
    Font.Style:= [fsBold];
    TextOut(51,20, 'Lazarus');     // TextOut(5,10, 'Lazarus');
    Brush.Color:= clRed;
    Pen.Color:= clRed;
    Rectangle(60,63,170,81);
    Font.Color:= clWhite;
    Font.Size:= 10;
    TextOut(90,63, 'Project');
  end;
end;

the page displays correctly in Windows.
Presumably the developer of this bit of the ide tried it on his Mac or Linux system and it displayed OK as coded in the repository.

Is there a cross-platform way to code such fancily formatted strings which would ensure they are centred and non-overlapping and so avoid altogether the need to hard-code pixel positions and text lengths?

yours

Howard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: About.JPG
Type: image/jpeg
Size: 21649 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091102/94610994/attachment-0001.jpe>

Reply by email

wile64
to Howard Page-Clark

Changed now !

2009/11/2 Howard Page-Clark

Show quoted text 46 lines
Under Windows (XP SP3) the Version page of Lazarus' About dialog does not display correctly, with 'Lazarus' text obscuring 'Free Pascal' (see attached screenshot). By amending the OnPaint method of the PaintBox1 control in \lazarus\ide\aboutfrm.pas as follows: procedure TForm1.PaintBox1Paint(Sender: TObject); begin with PaintBox1.Canvas do begin Font.Color:= RGBToColor(63,97,197); Font.Size:= 14; // Font.Size:= 16; TextOut(66,0, 'Free Pascal'); // TextOut(55,0, 'Free Pascal'); Font.Size:= 24; // Font.Size:= 36; Font.Style:= [fsBold]; TextOut(51,20, 'Lazarus'); // TextOut(5,10, 'Lazarus'); Brush.Color:= clRed; Pen.Color:= clRed; Rectangle(60,63,170,81); Font.Color:= clWhite; Font.Size:= 10; TextOut(90,63, 'Project'); end; end; the page displays correctly in Windows. Presumably the developer of this bit of the ide tried it on his Mac or Linux system and it displayed OK as coded in the repository. Is there a cross-platform way to code such fancily formatted strings which would ensure they are centred and non-overlapping and so avoid altogether the need to hard-code pixel positions and text lengths? yours Howard -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Laurent. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20091102/867c7231/attachment.html>

Reply by email

Graeme Geldenhuys
to Howard Page-Clark: Under Windows (XP SP3) the Version page of Lazarus' About dialog does not display…

2009/11/2 Howard Page-Clark :

Is there a cross-platform way to code such fancily formatted strings which would ensure they are centred and non-overlapping and so avoid altogether the need to hard-code pixel positions and text lengths?

Yes, it's called "layout managers". Something most Linux & all Java widgetsets support, and something that will be well worth implementing in LCL. MiG Layout might be the best candidate of them all.

http://www.miglayout.com

Download the Swing demo and give it a try. It has awesome features and NO nested layout managers. All you need for any dialog is one instance of MiG Layout.

Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/

Reply by email