fpbrowser: Fixes the about dialog

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2123 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-11-10 20:57:07 +00:00
parent c644346fb0
commit 2822429864
13 changed files with 143 additions and 240 deletions

View File

@ -0,0 +1,13 @@
unit browserconstants;
{$mode delphi}
interface
const
BrowserVersion = '0.5';
implementation
end.

View File

@ -19,6 +19,7 @@ type
MyPageLoaderThread: TPageLoaderThread;
MyPageLoader: TPageLoader;
CurrentTab: Integer;
ViewerName: string;
constructor Create; virtual;
destructor Destroy; override;
procedure CreateViewer(AParent, AOwner: TWinControl); virtual; abstract;

View File

@ -0,0 +1,68 @@
object AboutBox: TAboutBox
Left = 286
Height = 185
Top = 214
Width = 312
BorderIcons = [biSystemMenu]
Caption = 'About'
ClientHeight = 185
ClientWidth = 312
Color = clBtnFace
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Position = poScreenCenter
LCLVersion = '0.9.31'
object BitBtn1: TBitBtn
Left = 114
Height = 30
Top = 144
Width = 77
Caption = 'Close'
Kind = bkOK
ModalResult = 1
TabOrder = 0
end
object labelTitle: TLabel
AnchorSideTop.Control = Owner
Left = 0
Height = 30
Top = 10
Width = 312
Align = alTop
Alignment = taCenter
BorderSpacing.Top = 10
Caption = 'FPBrowser'
Font.Color = clWindowText
Font.Height = -25
Font.Name = 'Arial'
ParentColor = False
ParentFont = False
end
object Label2: TLabel
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 40
Top = 48
Width = 312
Anchors = [akTop, akLeft, akRight]
AutoSize = False
Caption = ' A browser complely written in Free Pascal and Lazarus.'
ParentColor = False
WordWrap = True
end
object labelEngine: TLabel
AnchorSideRight.Control = Owner
AnchorSideRight.Side = asrBottom
Left = 0
Height = 32
Top = 88
Width = 312
Anchors = [akTop, akLeft, akRight]
AutoSize = False
Caption = ' Rendering Engine:'
ParentColor = False
WordWrap = True
end
end

View File

@ -0,0 +1,43 @@
unit dlgabout;
interface
uses
LclIntf, LMessages, LclType, LResources, LCLVersion,
SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, ExtCtrls,
//
browserviewer, browserconstants;
type
{ TAboutBox }
TAboutBox = class(TForm)
BitBtn1: TBitBtn;
labelTitle: TLabel;
Label2: TLabel;
labelEngine: TLabel;
private
{ Private declarations }
public
{ Public declarations }
constructor CreateIt(Owner: TComponent; const ProgName, CompName: string);
end;
var
AboutBox: TAboutBox;
implementation
{$R *.lfm}
constructor TAboutBox.CreateIt(Owner: TComponent; const ProgName, CompName: string);
begin
inherited Create(Owner);
labelTitle.Caption := 'FPBrowser ' + BrowserVersion;
labelEngine.Caption := ' Rendering Engine: ' + GetCurrentBrowserViewer().ViewerName;
end;
end.

View File

@ -12,7 +12,7 @@ uses
printer4lazarus, turbopoweripro, customdrawn, laz_synapse,
mainform {Form1},
Submit in 'Submit.pas' {SubmitForm},
Htmlabt in 'Htmlabt.pas' {AboutBox},
dlgabout in 'Htmlabt.pas' {AboutBox},
(* Fontdlg in 'Fontdlg.pas' {FontForm},
PreviewForm in 'PreviewForm.pas' {PreviewForm},
Gopage in 'Gopage.pas' {GoPageForm},
@ -25,7 +25,7 @@ uses
{$ifdef FPBROWSER_TURBOPOWERIPRO}
viewer_ipro,
{$endif}
browserviewer, mod_braille;
browserviewer, mod_braille, browserconstants;
begin
Application.Initialize;

View File

@ -47,7 +47,7 @@
<PackageName Value="LCL"/>
</Item5>
</RequiredPackages>
<Units Count="11">
<Units Count="12">
<Unit0>
<Filename Value="fpbrowser.dpr"/>
<IsPartOfProject Value="True"/>
@ -74,10 +74,12 @@
<UnitName Value="Fontdlg"/>
</Unit3>
<Unit4>
<Filename Value="htmlabt.pas"/>
<Filename Value="dlgabout.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="AboutBox"/>
<HasResources Value="True"/>
<UnitName Value="HTMLAbt"/>
<ResourceBaseClass Value="Form"/>
<UnitName Value="dlgabout"/>
</Unit4>
<Unit5>
<Filename Value="pageloader.pas"/>
@ -109,6 +111,11 @@
<IsPartOfProject Value="True"/>
<UnitName Value="mod_braille"/>
</Unit10>
<Unit11>
<Filename Value="browserconstants.pas"/>
<IsPartOfProject Value="True"/>
<UnitName Value="browserconstants"/>
</Unit11>
</Units>
</ProjectOptions>
<CompilerOptions>

View File

@ -1,61 +0,0 @@
object AboutBox: TAboutBox
Left = 286
Top = 214
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'About'
ClientHeight = 184
ClientWidth = 306
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'System'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
PixelsPerInch = 96
TextHeight = 16
object BitBtn1: TBitBtn
Left = 114
Top = 146
Width = 77
Height = 30
TabOrder = 0
Kind = bkOK
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 306
Height = 137
Align = alTop
BevelInner = bvLowered
BevelOuter = bvNone
Caption = 'Panel1'
TabOrder = 1
object Viewer: THTMLViewer
Left = 1
Top = 1
Width = 304
Height = 135
ViewImages = False
Enabled = False
TabOrder = 0
Align = alClient
BorderStyle = htSingle
HistoryMaxCount = 0
DefFontName = 'Times New Roman'
DefPreFontName = 'Courier New'
NoSelect = True
ScrollBars = ssNone
CharSet = DEFAULT_CHARSET
PrintMarginLeft = 2.000000000000000000
PrintMarginRight = 2.000000000000000000
PrintMarginTop = 2.000000000000000000
PrintMarginBottom = 2.000000000000000000
PrintScale = 1.000000000000000000
htOptions = []
end
end
end

View File

@ -1,61 +0,0 @@
object AboutBox: TAboutBox
Left = 286
Top = 214
BorderIcons = [biSystemMenu]
BorderStyle = bsDialog
Caption = 'About'
ClientHeight = 184
Height = 184
ClientWidth = 306
Width = 306
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -13
Font.Name = 'Arial'
Font.Style = []
Position = poScreenCenter
PixelsPerInch = 96
object BitBtn1: TBitBtn
Left = 114
Top = 146
Width = 77
Height = 30
TabOrder = 0
Kind = bkOK
end
object Panel1: TPanel
Left = 0
Top = 0
Width = 306
Height = 137
Align = alTop
BevelInner = bvLowered
BevelOuter = bvNone
Caption = 'Panel1'
TabOrder = 1
object Viewer: THTMLViewer
Left = 1
Top = 1
Width = 304
Height = 135
ViewImages = False
Enabled = False
TabOrder = 0
Align = alClient
BorderStyle = htSingle
HistoryMaxCount = 0
DefFontName = 'Times New Roman'
DefPreFontName = 'Courier New'
NoSelect = True
ScrollBars = ssNone
CharSet = DEFAULT_CHARSET
PrintMarginLeft = 2.000000000000000000
PrintMarginRight = 2.000000000000000000
PrintMarginTop = 2.000000000000000000
PrintMarginBottom = 2.000000000000000000
PrintScale = 1.000000000000000000
htOptions = []
end
end
end

View File

@ -1,20 +0,0 @@
LazarusResources.Add('TAboutBox','FORMDATA',[
'TPF0'#9'TAboutBox'#8'AboutBox'#4'Left'#3#30#1#3'Top'#3#214#0#11'BorderIcons'
+#11#12'biSystemMenu'#0#11'BorderStyle'#7#8'bsDialog'#7'Caption'#6#5'About'#12
+'ClientHeight'#3#184#0#6'Height'#3#184#0#11'ClientWidth'#3'2'#1#5'Width'#3'2'
+#1#5'Color'#7#9'clBtnFace'#12'Font.Charset'#7#15'DEFAULT_CHARSET'#10'Font.Co'
+'lor'#7#12'clWindowText'#11'Font.Height'#2#243#9'Font.Name'#6#5'Arial'#10'Fo'
+'nt.Style'#11#0#8'Position'#7#14'poScreenCenter'#13'PixelsPerInch'#2'`'#0#7
+'TBitBtn'#7'BitBtn1'#4'Left'#2'r'#3'Top'#3#146#0#5'Width'#2'M'#6'Height'#2#30
+#8'TabOrder'#2#0#4'Kind'#7#4'bkOK'#0#0#6'TPanel'#6'Panel1'#4'Left'#2#0#3'Top'
+#2#0#5'Width'#3'2'#1#6'Height'#3#137#0#5'Align'#7#5'alTop'#10'BevelInner'#7#9
+'bvLowered'#10'BevelOuter'#7#6'bvNone'#7'Caption'#6#6'Panel1'#8'TabOrder'#2#1
+#0#11'THTMLViewer'#6'Viewer'#4'Left'#2#1#3'Top'#2#1#5'Width'#3'0'#1#6'Height'
+#3#135#0#10'ViewImages'#8#7'Enabled'#8#8'TabOrder'#2#0#5'Align'#7#8'alClient'
+#11'BorderStyle'#7#8'htSingle'#15'HistoryMaxCount'#2#0#11'DefFontName'#6#15
+'Times New Roman'#14'DefPreFontName'#6#11'Courier New'#8'NoSelect'#9#10'Scro'
+'llBars'#7#6'ssNone'#7'CharSet'#7#15'DEFAULT_CHARSET'#15'PrintMarginLeft'#5#0
+#0#0#0#0#0#0#128#0'@'#16'PrintMarginRight'#5#0#0#0#0#0#0#0#128#0'@'#14'Print'
+'MarginTop'#5#0#0#0#0#0#0#0#128#0'@'#17'PrintMarginBottom'#5#0#0#0#0#0#0#0
+#128#0'@'#10'PrintScale'#5#0#0#0#0#0#0#0#128#255'?'#9'htOptions'#11#0#0#0#0#0
]);

View File

@ -1,91 +0,0 @@
unit HTMLAbt;
interface
uses
LclIntf, LMessages, LclType, LResources, LCLVersion,
SysUtils, Classes, Graphics, Controls,
Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
const
Version = '9.45';
type
TAboutBox = class(TForm)
BitBtn1: TBitBtn;
Panel1: TPanel;
private
{ Private declarations }
public
{ Public declarations }
constructor CreateIt(Owner: TComponent; const ProgName, CompName: string);
end;
var
AboutBox: TAboutBox;
implementation
{$IFNDEF LCL}
{$R *.DFM}
{$ENDIF}
constructor TAboutBox.CreateIt(Owner: TComponent; const ProgName, CompName: string);
var
S: string[210];
begin
inherited Create(Owner);
(*//Viewer.DefFontName := 'MS Sans Serif'; //Windows-only font
Viewer.DefFontName := 'Arial';
Viewer.DefFontSize := 9;
Viewer.DefFontColor := clNavy;
S :='<body bgcolor="ffffeb" text="000080">'+
'<center>'+
'<h1>'+ProgName+'</h1>'+
'<font color="Maroon">A demo program for the '+CompName+' component</font>'+
{$IFNDEF LCL}
'<h3>Version '+Version+' compiled with Delphi '+
{$ifdef Windows}
'1</h3>'+
{$endif}
{$ifdef Ver90}
'2</h3>'+
{$endif}
{$ifdef Ver100}
'3</h3>'+
{$endif}
{$ifdef Ver120}
'4</h3>'+
{$endif}
{$ifdef Ver130}
'5</h3>'+
{$endif}
{$ifdef Ver140}
'6</h3>'+
{$endif}
{$ifdef Ver150}
'7</h3>'+
{$endif}
{$ifdef Ver170}
'2005</h3>'+
{$endif}
{$ifdef Ver180}
'2006</h3>'+
{$endif}
{$ELSE}
'<h3>Version ' + Version + ' compiled with Lazarus ' + lcl_version + '</h3>' +
{$ENDIF}
'</center>'+
'</body>';
Viewer.LoadFromBuffer(@S[1], Length(S), '');*)
end;
initialization
{$IFDEF LCL}
{$I Htmlabt.lrs} {Include form's resource file}
{$ENDIF}
end.

View File

@ -15,7 +15,7 @@ uses
// Custom Drawn
customdrawnextras, customdrawncontrols, customdrawndrawers, customdrawn_kde,
//
HTMLabt,
dlgabout, browserconstants,
pageloader, browserviewer, browsermodules;
type
@ -262,7 +262,7 @@ begin
OpenDialog.InitialDir := ExtractFilePath(ParamStr(0));
{$ENDIF}
Caption := 'fpBrowser, Version '+HTMLAbt.Version;
Caption := 'fpBrowser '+BrowserVersion;
(*for I := 0 to MaxHistories-1 do
begin {create the MenuItems for the history list}

View File

@ -192,6 +192,8 @@ end;
procedure TiProViewer.CreateViewer(AParent, AOwner: TWinControl);
begin
ViewerName := 'Turbo Power iPro HTML viewer written in Pascal';
DataProvider1:=TMyIpHtmlDataProvider.Create(AOwner);
DataProvider1.Name:='DataProvider1';
DataProvider1.OnCanHandle:=DataProvider1CanHandle;

View File

@ -312,6 +312,8 @@ end;
procedure THtmlCompViewer.CreateViewer(AParent, AOwner: TWinControl);
begin
ViewerName := 'THTMLComp written in Pascal';
Viewer := THTMLViewer.Create(AOwner);
Viewer.Left := 1;
Viewer.Height := 358;