diff --git a/Demos/Main Demos/HtmlDemoLaz.lpi b/Demos/Main Demos/HtmlDemoLaz.lpi
new file mode 100644
index 00000000..31ad0533
--- /dev/null
+++ b/Demos/Main Demos/HtmlDemoLaz.lpi
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Demos/Main Demos/demounit.lfm b/Demos/Main Demos/demounit.lfm
index cabd1c84..7c21cef7 100644
--- a/Demos/Main Demos/demounit.lfm
+++ b/Demos/Main Demos/demounit.lfm
@@ -13,7 +13,7 @@ object Form1: TForm1
OnCreate = FormCreate
OnDestroy = FormDestroy
OnShow = FormShow
- LCLVersion = '0.9.30.2'
+ LCLVersion = '1.4.0.4'
object Panel1: TPanel
Left = 0
Height = 18
@@ -113,11 +113,7 @@ object Form1: TForm1
Height = 362
Top = 1
Width = 611
- TabStop = True
- TabOrder = 0
- Align = alClient
BorderStyle = htFocused
- CharSet = DEFAULT_CHARSET
DefBackground = clWindow
DefFontColor = clWindowText
DefFontName = 'Times New Roman'
@@ -131,7 +127,6 @@ object Form1: TForm1
PrintMarginRight = 2
PrintMarginTop = 2
PrintScale = 1
- OnMouseMove = ViewerMouseMove
OnFormSubmit = SubmitEvent
OnHistoryChange = HistoryChange
OnHotSpotClick = HotSpotClick
@@ -146,18 +141,21 @@ object Form1: TForm1
OnRightClick = RightClick
OnScript = ViewerScript
OnSoundRequest = SoundRequest
+ Align = alClient
+ TabOrder = 0
+ OnMouseMove = ViewerMouseMove
end
end
object OpenDialog: TOpenDialog
DefaultExt = '.htm'
Filter = 'html files|*.htm;*.html|all files|*.*'
Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist]
- left = 329
- top = 2
+ left = 224
+ top = 56
end
object MainMenu: TMainMenu
- left = 352
- top = 75
+ left = 48
+ top = 56
object File1: TMenuItem
Caption = '&File'
object Open: TMenuItem
@@ -240,12 +238,12 @@ object Form1: TForm1
object FindDialog: TFindDialog
Options = [frDown, frHideWholeWord, frDisableWholeWord]
OnFind = FindDialogFind
- left = 249
- top = 65535
+ left = 312
+ top = 56
end
object PopupMenu: TPopupMenu
- left = 400
- top = 1
+ left = 136
+ top = 56
object Viewimage: TMenuItem
Caption = '&View image'
OnClick = ViewimageClick
@@ -265,21 +263,21 @@ object Form1: TForm1
object MetaTimer: TTimer
Enabled = False
OnTimer = MetaTimerTimer
- left = 242
- top = 75
+ left = 224
+ top = 136
end
object Timer1: TTimer
Interval = 200
OnTimer = Timer1Timer
- left = 291
- top = 71
+ left = 312
+ top = 136
end
object PrintDialog: TPrintDialog
- left = 160
- top = 83
+ left = 136
+ top = 136
end
object PrinterSetupDialog: TPrinterSetupDialog
- left = 56
- top = 83
+ left = 48
+ top = 136
end
end
diff --git a/Demos/Main Demos/demounit.pas b/Demos/Main Demos/demounit.pas
index 9fa49f9f..043f3aa3 100644
--- a/Demos/Main Demos/demounit.pas
+++ b/Demos/Main Demos/demounit.pas
@@ -306,6 +306,10 @@ procedure TForm1.OpenFileClick(Sender: TObject);
begin
if Viewer.CurrentFile <> '' then
OpenDialog.InitialDir := ExtractFilePath(Viewer.CurrentFile);
+ OpenDialog.Filter := 'HTML Files (*.htm,*.html)|*.htm;*.html'+
+ '|Text Files (*.txt)|*.txt'+
+ '|All Files (*.*)|*.*';
+ OpenDialog.FilterIndex:=1;
if OpenDialog.Execute then
begin
Update;
@@ -597,6 +601,7 @@ procedure TForm1.OpenTextFileClick(Sender: TObject);
OpenDialog.Filter := 'HTML Files (*.htm,*.html)|*.htm;*.html'+
'|Text Files (*.txt)|*.txt'+
'|All Files (*.*)|*.*';
+ OpenDialog.FilterIndex:=2;
if OpenDialog.Execute then
begin
ReloadButton.Enabled := False;
@@ -617,6 +622,7 @@ procedure TForm1.OpenImageFileClick(Sender: TObject);
OpenDialog.Filter := 'Graphics Files (*.bmp,*.gif,*.jpg,*.jpeg,*.png)|'+
'*.bmp;*.jpg;*.jpeg;*.gif;*.png|'+
'All Files (*.*)|*.*';
+ OpenDialog.FilterIndex := 1;
if OpenDialog.Execute then
begin
ReloadButton.Enabled := False;
diff --git a/package/FrameViewer09.lpk b/package/FrameViewer09.lpk
index 0ec3f6ac..4a95a639 100644
--- a/package/FrameViewer09.lpk
+++ b/package/FrameViewer09.lpk
@@ -1,8 +1,9 @@
-
+
+
@@ -38,11 +39,10 @@
-
-
+
@@ -136,8 +136,67 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
diff --git a/package/FrameViewer09.pas b/package/FrameViewer09.pas
index fbdfb887..f44e4b05 100644
--- a/package/FrameViewer09.pas
+++ b/package/FrameViewer09.pas
@@ -10,7 +10,10 @@ interface
DitherUnit, FramBrwz, FrameViewerReg, FramView, HtmlBuffer, HtmlGif1,
HTMLGif2, HtmlGlobals, HtmlMisc, Htmlsbs1, HTMLSubs, HTMLUn2, HtmlView,
ReadHTML, StylePars, StyleUn, URLSubs, msimg32, AlphaBlendUn, HSLUtils,
- BuffConv, BuffConvArrays, HtmlSymb, LazarusPackageIntf;
+ BuffConv, BuffConvArrays, HtmlSymb, BegaHtmlPrintPreviewForm,
+ BegaMetaFilePrinter, BegaPreview, BegaPreviewForm, BegaPreviewPanel,
+ BegaScrollBox, BegaZoom, GDIPL2A, HtmlCaches, HtmlFonts, HtmlImages,
+ MetaFilePrinter, StyleTypes, vwPrint, WideStringsLcl, LazarusPackageIntf;
implementation
diff --git a/source/htmlview.pas b/source/htmlview.pas
index 2911c827..25587df4 100644
--- a/source/htmlview.pas
+++ b/source/htmlview.pas
@@ -1078,6 +1078,9 @@ procedure THtmlViewer.LoadFromFile(const FileName: ThtString; DocType: ThtmlFile
begin
if IsProcessing then
Exit;
+ // in lazarus 1.4.0 with fpc 2.6.4
+ // htmlviewer will not draw properly if focused
+ RemoveFocus(false);
if Filename <> '' then
begin
OldFile := FCurrentFile;
@@ -1173,7 +1176,9 @@ procedure THtmlViewer.LoadDocument(Document: TBuffer; const DocName: ThtString;
begin
if IsProcessing then
Exit;
-
+ // in lazarus 1.4.0 with fpc 2.6.4
+ // htmlviewer will not draw properly if focused
+ RemoveFocus(false);
SplitDest(DocName, Name, Dest);
case DocType of
ImgType: