fpbrowser: Changes from TPageControl to TCDPageControl

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2083 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
sekelsenmat
2011-10-21 20:57:45 +00:00
parent 467647591c
commit 922d9f855a
5 changed files with 69 additions and 71 deletions

View File

@ -9,7 +9,7 @@ uses
{$ENDIF} {$ENDIF}
Interfaces, Interfaces,
Forms, Forms,
printer4lazarus, turbopoweripro, laz_synapse, printer4lazarus, turbopoweripro, customdrawn, laz_synapse,
mainform {Form1}, mainform {Form1},
Submit in 'Submit.pas' {SubmitForm}, Submit in 'Submit.pas' {SubmitForm},
Htmlabt in 'Htmlabt.pas' {AboutBox}, Htmlabt in 'Htmlabt.pas' {AboutBox},

View File

@ -30,19 +30,22 @@
<LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/> <LaunchingApplication PathPlusParams="/usr/X11R6/bin/xterm -T 'Lazarus Run Output' -e $(LazarusDir)/tools/runwait.sh $(TargetCmdLine)"/>
</local> </local>
</RunParams> </RunParams>
<RequiredPackages Count="4"> <RequiredPackages Count="5">
<Item1> <Item1>
<PackageName Value="TurboPowerIPro"/> <PackageName Value="customdrawn"/>
</Item1> </Item1>
<Item2> <Item2>
<PackageName Value="Printer4Lazarus"/> <PackageName Value="TurboPowerIPro"/>
</Item2> </Item2>
<Item3> <Item3>
<PackageName Value="laz_synapse"/> <PackageName Value="Printer4Lazarus"/>
</Item3> </Item3>
<Item4> <Item4>
<PackageName Value="LCL"/> <PackageName Value="laz_synapse"/>
</Item4> </Item4>
<Item5>
<PackageName Value="LCL"/>
</Item5>
</RequiredPackages> </RequiredPackages>
<Units Count="11"> <Units Count="11">
<Unit0> <Unit0>

View File

@ -3,7 +3,7 @@ object formBrowser: TformBrowser
Height = 439 Height = 439
Top = 186 Top = 186
Width = 621 Width = 621
ClientHeight = 419 ClientHeight = 439
ClientWidth = 621 ClientWidth = 621
Color = clBtnFace Color = clBtnFace
Font.Color = clWindowText Font.Color = clWindowText
@ -18,7 +18,7 @@ object formBrowser: TformBrowser
object panelBottom: TPanel object panelBottom: TPanel
Left = 0 Left = 0
Height = 18 Height = 18
Top = 401 Top = 421
Width = 621 Width = 621
Align = alBottom Align = alBottom
Alignment = taLeftJustify Alignment = taLeftJustify
@ -37,21 +37,13 @@ object formBrowser: TformBrowser
end end
object labelProgress: TLabel object labelProgress: TLabel
Left = 319 Left = 319
Height = 17 Height = 16
Top = 3 Top = 3
Width = 21 Width = 22
Caption = 'Idle' Caption = 'Idle'
ParentColor = False ParentColor = False
end end
end end
object pageBrowser: TPageControl
Left = 0
Height = 401
Top = 0
Width = 621
Align = alClient
TabOrder = 1
end
object OpenDialog: TOpenDialog object OpenDialog: TOpenDialog
DefaultExt = '.htm' DefaultExt = '.htm'
Filter = 'html files|*.htm;*.html|all files|*.*' Filter = 'html files|*.htm;*.html|all files|*.*'

View File

@ -2,58 +2,57 @@
LazarusResources.Add('TformBrowser','FORMDATA',[ LazarusResources.Add('TformBrowser','FORMDATA',[
'TPF0'#12'TformBrowser'#11'formBrowser'#4'Left'#3'G'#1#6'Height'#3#183#1#3'To' 'TPF0'#12'TformBrowser'#11'formBrowser'#4'Left'#3'G'#1#6'Height'#3#183#1#3'To'
+'p'#3#186#0#5'Width'#3'm'#2#12'ClientHeight'#3#163#1#11'ClientWidth'#3'm'#2#5 +'p'#3#186#0#5'Width'#3'm'#2#12'ClientHeight'#3#183#1#11'ClientWidth'#3'm'#2#5
+'Color'#7#9'clBtnFace'#10'Font.Color'#7#12'clWindowText'#11'Font.Height'#2 +'Color'#7#9'clBtnFace'#10'Font.Color'#7#12'clWindowText'#11'Font.Height'#2
+#243#9'Font.Name'#6#5'Arial'#4'Menu'#7#8'MainMenu'#8'OnCreate'#7#10'FormCrea' +#243#9'Font.Name'#6#5'Arial'#4'Menu'#7#8'MainMenu'#8'OnCreate'#7#10'FormCrea'
+'te'#9'OnDestroy'#7#11'FormDestroy'#6'OnShow'#7#8'FormShow'#8'Position'#7#14 +'te'#9'OnDestroy'#7#11'FormDestroy'#6'OnShow'#7#8'FormShow'#8'Position'#7#14
+'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TPanel'#11'panelBottom'#4'Le' +'poScreenCenter'#10'LCLVersion'#6#6'0.9.31'#0#6'TPanel'#11'panelBottom'#4'Le'
+'ft'#2#0#6'Height'#2#18#3'Top'#3#145#1#5'Width'#3'm'#2#5'Align'#7#8'alBottom' +'ft'#2#0#6'Height'#2#18#3'Top'#3#165#1#5'Width'#3'm'#2#5'Align'#7#8'alBottom'
+#9'Alignment'#7#13'taLeftJustify'#10'BevelInner'#7#9'bvLowered'#10'BevelOute' +#9'Alignment'#7#13'taLeftJustify'#10'BevelInner'#7#9'bvLowered'#10'BevelOute'
+'r'#7#6'bvNone'#12'ClientHeight'#2#18#11'ClientWidth'#3'm'#2#8'TabOrder'#2#0 +'r'#7#6'bvNone'#12'ClientHeight'#2#18#11'ClientWidth'#3'm'#2#8'TabOrder'#2#0
+#0#12'TProgressBar'#11'ProgressBar'#4'Left'#3#214#1#6'Height'#2#16#3'Top'#2#1 +#0#12'TProgressBar'#11'ProgressBar'#4'Left'#3#214#1#6'Height'#2#16#3'Top'#2#1
+#5'Width'#3#150#0#5'Align'#7#7'alRight'#8'TabOrder'#2#0#0#0#6'TLabel'#13'lab' +#5'Width'#3#150#0#5'Align'#7#7'alRight'#8'TabOrder'#2#0#0#0#6'TLabel'#13'lab'
+'elProgress'#4'Left'#3'?'#1#6'Height'#2#17#3'Top'#2#3#5'Width'#2#21#7'Captio' +'elProgress'#4'Left'#3'?'#1#6'Height'#2#16#3'Top'#2#3#5'Width'#2#22#7'Captio'
+'n'#6#4'Idle'#11'ParentColor'#8#0#0#0#12'TPageControl'#11'pageBrowser'#4'Lef' +'n'#6#4'Idle'#11'ParentColor'#8#0#0#0#11'TOpenDialog'#10'OpenDialog'#10'Defa'
+'t'#2#0#6'Height'#3#145#1#3'Top'#2#0#5'Width'#3'm'#2#5'Align'#7#8'alClient'#8 +'ultExt'#6#4'.htm'#6'Filter'#6'%html files|*.htm;*.html|all files|*.*'#7'Opt'
+'TabOrder'#2#1#0#0#11'TOpenDialog'#10'OpenDialog'#10'DefaultExt'#6#4'.htm'#6 +'ions'#11#14'ofHideReadOnly'#15'ofPathMustExist'#15'ofFileMustExist'#0#4'lef'
+'Filter'#6'%html files|*.htm;*.html|all files|*.*'#7'Options'#11#14'ofHideRe' +'t'#3'I'#1#3'top'#2#2#0#0#9'TMainMenu'#8'MainMenu'#4'left'#3'#'#1#3'top'#2#4
+'adOnly'#15'ofPathMustExist'#15'ofFileMustExist'#0#4'left'#3'I'#1#3'top'#2#2 +#0#9'TMenuItem'#5'File1'#7'Caption'#6#5'&File'#0#9'TMenuItem'#4'Open'#7'Capt'
+#0#0#9'TMainMenu'#8'MainMenu'#4'left'#3'#'#1#3'top'#2#4#0#9'TMenuItem'#5'Fil' +'ion'#6#5'&Open'#8'ShortCut'#2'r'#7'OnClick'#7#13'OpenFileClick'#0#0#9'TMenu'
+'e1'#7'Caption'#6#5'&File'#0#9'TMenuItem'#4'Open'#7'Caption'#6#5'&Open'#8'Sh' +'Item'#12'OpenTextFile'#7'Caption'#6#15'Open &Text File'#7'OnClick'#7#17'Ope'
+'ortCut'#2'r'#7'OnClick'#7#13'OpenFileClick'#0#0#9'TMenuItem'#12'OpenTextFil' +'nTextFileClick'#0#0#9'TMenuItem'#13'OpenImageFile'#7'Caption'#6#16'Open &Im'
+'e'#7'Caption'#6#15'Open &Text File'#7'OnClick'#7#17'OpenTextFileClick'#0#0#9 +'age File'#7'OnClick'#7#18'OpenImageFileClick'#0#0#9'TMenuItem'#13'PrinterSe'
+'TMenuItem'#13'OpenImageFile'#7'Caption'#6#16'Open &Image File'#7'OnClick'#7 +'tup1'#7'Caption'#6#16'Printer Setup...'#7'OnClick'#7#18'PrinterSetup1Click'
+#18'OpenImageFileClick'#0#0#9'TMenuItem'#13'PrinterSetup1'#7'Caption'#6#16'P' +#0#0#9'TMenuItem'#12'Printpreview'#7'Caption'#6#14'Print pre&view'#7'Enabled'
+'rinter Setup...'#7'OnClick'#7#18'PrinterSetup1Click'#0#0#9'TMenuItem'#12'Pr' +#8#7'OnClick'#7#17'PrintpreviewClick'#0#0#9'TMenuItem'#6'Print1'#7'Caption'#6
+'intpreview'#7'Caption'#6#14'Print pre&view'#7'Enabled'#8#7'OnClick'#7#17'Pr' +#9'&Print...'#7'Enabled'#8#7'OnClick'#7#11'Print1Click'#0#0#9'TMenuItem'#2'N'
+'intpreviewClick'#0#0#9'TMenuItem'#6'Print1'#7'Caption'#6#9'&Print...'#7'Ena' +'1'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#5'Exit1'#7'Caption'#6#5'E&xit'#7'OnCl'
+'bled'#8#7'OnClick'#7#11'Print1Click'#0#0#9'TMenuItem'#2'N1'#7'Caption'#6#1 +'ick'#7#10'Exit1Click'#0#0#0#9'TMenuItem'#5'Edit2'#7'Caption'#6#5'&Edit'#7'O'
+'-'#0#0#9'TMenuItem'#5'Exit1'#7'Caption'#6#5'E&xit'#7'OnClick'#7#10'Exit1Cli' +'nClick'#7#10'Edit2Click'#0#9'TMenuItem'#5'Find1'#7'Caption'#6#5'&Find'#7'En'
+'ck'#0#0#0#9'TMenuItem'#5'Edit2'#7'Caption'#6#5'&Edit'#7'OnClick'#7#10'Edit2' +'abled'#8#7'OnClick'#7#10'Find1Click'#0#0#9'TMenuItem'#8'CopyItem'#7'Caption'
+'Click'#0#9'TMenuItem'#5'Find1'#7'Caption'#6#5'&Find'#7'Enabled'#8#7'OnClick' +#6#5'&Copy'#8'ShortCut'#3'C@'#7'OnClick'#7#13'CopyItemClick'#0#0#9'TMenuItem'
+#7#10'Find1Click'#0#0#9'TMenuItem'#8'CopyItem'#7'Caption'#6#5'&Copy'#8'Short' +#2'N2'#7'Caption'#6#1'-'#0#0#9'TMenuItem'#13'SelectAllItem'#7'Caption'#6#11
+'Cut'#3'C@'#7'OnClick'#7#13'CopyItemClick'#0#0#9'TMenuItem'#2'N2'#7'Caption' +'Select &All'#7'Enabled'#8#7'OnClick'#7#18'SelectAllItemClick'#0#0#0#9'TMenu'
+#6#1'-'#0#0#9'TMenuItem'#13'SelectAllItem'#7'Caption'#6#11'Select &All'#7'En' +'Item'#11'menuOptions'#7'Caption'#6#6'&Tools'#0#9'TMenuItem'#10'ShowImages'#7
+'abled'#8#7'OnClick'#7#18'SelectAllItemClick'#0#0#0#9'TMenuItem'#11'menuOpti' +'Caption'#6#12'&Show images'#7'OnClick'#7#15'ShowImagesClick'#0#0#9'TMenuIte'
+'ons'#7'Caption'#6#6'&Tools'#0#9'TMenuItem'#10'ShowImages'#7'Caption'#6#12'&' +'m'#5'Fonts'#7'Caption'#6#23'Default &Font/Colors...'#7'OnClick'#7#15'FontCo'
+'Show images'#7'OnClick'#7#15'ShowImagesClick'#0#0#9'TMenuItem'#5'Fonts'#7'C' +'lorsClick'#0#0#9'TMenuItem'#13'menuViewDebug'#7'Caption'#6#26'View Source a'
+'aption'#6#23'Default &Font/Colors...'#7'OnClick'#7#15'FontColorsClick'#0#0#9 +'nd Debug info'#7'OnClick'#7#18'menuViewDebugClick'#0#0#9'TMenuItem'#16'menu'
+'TMenuItem'#13'menuViewDebug'#7'Caption'#6#26'View Source and Debug info'#7 +'ToolsModules'#7'Caption'#6#7'Modules'#0#0#0#9'TMenuItem'#15'HistoryMenuItem'
+'OnClick'#7#18'menuViewDebugClick'#0#0#9'TMenuItem'#16'menuToolsModules'#7'C' +#7'Caption'#6#8'&History'#7'Visible'#8#0#0#9'TMenuItem'#6'About1'#7'Caption'
+'aption'#6#7'Modules'#0#0#0#9'TMenuItem'#15'HistoryMenuItem'#7'Caption'#6#8 +#6#6'&About'#7'OnClick'#7#11'About1Click'#0#0#0#12'TPrintDialog'#11'PrintDia'
+'&History'#7'Visible'#8#0#0#9'TMenuItem'#6'About1'#7'Caption'#6#6'&About'#7 +'log'#8'FromPage'#2#1#7'MinPage'#2#1#7'MaxPage'#3#15''''#7'Options'#11#10'po'
+'OnClick'#7#11'About1Click'#0#0#0#12'TPrintDialog'#11'PrintDialog'#8'FromPag' +'PageNums'#0#6'ToPage'#2#1#4'left'#3'j'#1#3'top'#2#1#0#0#11'TFindDialog'#10
+'e'#2#1#7'MinPage'#2#1#7'MaxPage'#3#15''''#7'Options'#11#10'poPageNums'#0#6 +'FindDialog'#7'Options'#11#6'frDown'#15'frHideWholeWord'#18'frDisableWholeWo'
+'ToPage'#2#1#4'left'#3'j'#1#3'top'#2#1#0#0#11'TFindDialog'#10'FindDialog'#7 +'rd'#0#6'OnFind'#7#14'FindDialogFind'#4'left'#3#248#0#3'top'#2#4#0#0#10'TPop'
+'Options'#11#6'frDown'#15'frHideWholeWord'#18'frDisableWholeWord'#0#6'OnFind' +'upMenu'#9'PopupMenu'#4'left'#3#144#1#3'top'#2#1#0#9'TMenuItem'#9'Viewimage'
+#7#14'FindDialogFind'#4'left'#3#248#0#3'top'#2#4#0#0#10'TPopupMenu'#9'PopupM' +#7'Caption'#6#11'&View image'#7'OnClick'#7#14'ViewimageClick'#0#0#9'TMenuIte'
+'enu'#4'left'#3#144#1#3'top'#2#1#0#9'TMenuItem'#9'Viewimage'#7'Caption'#6#11 +'m'#20'CopyImageToClipboard'#7'Caption'#6#24'&Copy image to clipboard'#7'OnC'
+'&View image'#7'OnClick'#7#14'ViewimageClick'#0#0#9'TMenuItem'#20'CopyImageT' +'lick'#7#25'CopyImageToClipboardClick'#0#0#9'TMenuItem'#2'N3'#7'Caption'#6#1
+'oClipboard'#7'Caption'#6#24'&Copy image to clipboard'#7'OnClick'#7#25'CopyI' +'-'#0#0#9'TMenuItem'#15'OpenInNewWindow'#7'Caption'#6#19'&Open in new window'
+'mageToClipboardClick'#0#0#9'TMenuItem'#2'N3'#7'Caption'#6#1'-'#0#0#9'TMenuI' +#7'OnClick'#7#20'OpenInNewWindowClick'#0#0#0#6'TTimer'#9'MetaTimer'#7'Enable'
+'tem'#15'OpenInNewWindow'#7'Caption'#6#19'&Open in new window'#7'OnClick'#7 +'d'#8#7'OnTimer'#7#14'MetaTimerTimer'#4'left'#3#242#0#3'top'#2'K'#0#0#6'TTim'
+#20'OpenInNewWindowClick'#0#0#0#6'TTimer'#9'MetaTimer'#7'Enabled'#8#7'OnTime' +'er'#6'Timer1'#8'Interval'#3#200#0#7'OnTimer'#7#11'Timer1Timer'#4'left'#3'0'
+'r'#7#14'MetaTimerTimer'#4'left'#3#242#0#3'top'#2'K'#0#0#6'TTimer'#6'Timer1' +#1#3'top'#2'G'#0#0#19'TPrinterSetupDialog'#18'PrinterSetupDialog'#4'left'#3
+#8'Interval'#3#200#0#7'OnTimer'#7#11'Timer1Timer'#4'left'#3'0'#1#3'top'#2'G' +#192#1#0#0#0
+#0#0#19'TPrinterSetupDialog'#18'PrinterSetupDialog'#4'left'#3#192#1#0#0#0
]); ]);

View File

@ -10,7 +10,7 @@ uses
LclIntf, LMessages, LclType, LResources, LclIntf, LMessages, LclType, LResources,
Graphics, Controls, Graphics, Controls,
Forms, Dialogs, ExtCtrls, Menus, StdCtrls, Clipbrd, Forms, Dialogs, ExtCtrls, Menus, StdCtrls, Clipbrd,
PrintersDlgs, buttons, PrintersDlgs, buttons, customdrawnextras,
ComCtrls, ComCtrls,
{$IFDEF MSWINDOWS} ShellAPI, {$ELSE} Unix, {$ENDIF} {$IFDEF MSWINDOWS} ShellAPI, {$ELSE} Unix, {$ENDIF}
HTMLabt, HTMLabt,
@ -27,7 +27,6 @@ type
N1: TMenuItem; N1: TMenuItem;
OpenDialog: TOpenDialog; OpenDialog: TOpenDialog;
MainMenu: TMainMenu; MainMenu: TMainMenu;
pageBrowser: TPageControl;
panelBottom: TPanel; panelBottom: TPanel;
File1: TMenuItem; File1: TMenuItem;
Open: TMenuItem; Open: TMenuItem;
@ -121,6 +120,7 @@ type
procedure HandlePageChanged(Sender: TObject); procedure HandlePageChanged(Sender: TObject);
public public
{ Public declarations } { Public declarations }
pageBrowser: TCDPageControl;
CurrentTab: Integer; CurrentTab: Integer;
procedure LoadURL(AURL: string); procedure LoadURL(AURL: string);
procedure AddBrowserTab(AURL: string; AGoToTab: Boolean); procedure AddBrowserTab(AURL: string; AGoToTab: Boolean);
@ -140,6 +140,10 @@ uses
procedure TformBrowser.FormCreate(Sender: TObject); procedure TformBrowser.FormCreate(Sender: TObject);
begin begin
pageBrowser := TCDPageControl.Create(Self);
pageBrowser.Parent := Self;
pageBrowser.Align := alClient;
InitializeForm(); InitializeForm();
end; end;
@ -340,7 +344,7 @@ procedure TformBrowser.HandlePageChanged(Sender: TObject);
var var
lIndex: Integer; lIndex: Integer;
begin begin
lIndex := pageBrowser.ActivePageIndex; lIndex := pageBrowser.TabIndex;
SetCurrentBrowserViewer(lIndex); SetCurrentBrowserViewer(lIndex);
end; end;
@ -768,12 +772,12 @@ end;
procedure TformBrowser.AddBrowserTab(AURL: string; AGoToTab: Boolean); procedure TformBrowser.AddBrowserTab(AURL: string; AGoToTab: Boolean);
var var
lViewer: TBrowserViewer; lViewer: TBrowserViewer;
lTabSheet: TTabSheet; lTabSheet: TCDTabSheet;
lTopPanel: TPanel; lTopPanel: TPanel;
lbuttonReload, lbuttonBack, lbuttonForward: TBitBtn; lbuttonReload, lbuttonBack, lbuttonForward: TBitBtn;
leditURL: TEdit; leditURL: TEdit;
begin begin
lTabSheet := pageBrowser.AddTabSheet(); // This call requires Lazarus 0.9.31+ lTabSheet := pageBrowser.AddPage(''); // This call requires Lazarus 0.9.31+
lTabSheet.Caption := 'WebPage'; lTabSheet.Caption := 'WebPage';
// Add the top panel of the tab with buttons and the edit box // Add the top panel of the tab with buttons and the edit box
@ -831,11 +835,11 @@ end;
procedure TformBrowser.AddMemoTab(AText: TStringList; ACaption: string; procedure TformBrowser.AddMemoTab(AText: TStringList; ACaption: string;
AGoToTab: Boolean); AGoToTab: Boolean);
var var
lTabSheet: TTabSheet; lTabSheet: TCDTabSheet;
lMemo: TMemo; lMemo: TMemo;
lViewer: TBrowserViewer; lViewer: TBrowserViewer;
begin begin
lTabSheet := pageBrowser.AddTabSheet(); // This call requires Lazarus 0.9.31+ lTabSheet := pageBrowser.AddPage(''); // This call requires Lazarus 0.9.31+
lTabSheet.Caption := ACaption; lTabSheet.Caption := ACaption;
// Add the top panel of the tab with buttons and the edit box // Add the top panel of the tab with buttons and the edit box