Skip to content

Commit 8ba8ce5

Browse files
- Autoload local markdown files when clicked into Preview
- The editor can open all markdown extensions: .md, .mkd, .mdwn, .mdown, .mdtxt, .mdtext, .markdown, .txt, .text' - Stopped image rendering during editing to speed-up - Added useful close button on Tabs - Hint full filename on Tabs - Save/Discard messaged default response inverted - Removed Settings "Search In Folder"
1 parent bac5361 commit 8ba8ce5

File tree

77 files changed

+1829
-1269
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+1829
-1269
lines changed

Ext/HTMLViewer/Source/BegaHtmlPrintPreviewForm.pas

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,16 @@
2424
{$include htmlcons.inc}
2525

2626
interface
27+
{$ifndef NoFlatScrollbars}
28+
{$ifndef NoMetaFile}
2729

2830
uses
2931
{$ifdef LCL}
3032
LclIntf, LclType, PrintersDlgs,
3133
{$else}
3234
Windows,
3335
{$endif}
34-
Graphics, Controls, Forms, Types, Printers, //Math,
36+
Controls, Forms, Types, Printers, //Math,
3537
// shared units
3638
HtmlView,
3739
FramView,
@@ -58,7 +60,11 @@ TBegaHtmlPrintPreviewForm = class(TBegaCustomPrintPreviewForm)
5860
property HtmlViewer: THtmlViewer read FHtmlViewer write setHtmlViewer;
5961
end;
6062

63+
{$endif NoMetaFile}
64+
{$endif NoFlatScrollbars}
6165
implementation
66+
{$ifndef NoFlatScrollbars}
67+
{$ifndef NoMetaFile}
6268

6369
//- BG ----------------------------------------------------------- 26.03.2007 --
6470
function TBegaHtmlPrintPreviewForm.canPrint: Boolean;
@@ -79,8 +85,6 @@ function TBegaHtmlPrintPreviewForm.CurrentViewer: THtmlViewer;
7985

8086
//- BG ----------------------------------------------------------- 26.03.2007 --
8187
procedure TBegaHtmlPrintPreviewForm.PreviewCreatePages(Sender: TObject; MFPrinter: TBegaMetaFilePrinter; var Done: Boolean);
82-
const
83-
PrintMarginFactor = 10.0;
8488
var
8589
OldCursor: TCursor;
8690
Viewer: THtmlViewer;
@@ -92,10 +96,10 @@ procedure TBegaHtmlPrintPreviewForm.PreviewCreatePages(Sender: TObject; MFPrinte
9296
Screen.Cursor := crHourGlass;
9397
try
9498
MFPrinter.PrintMargins := Rect(
95-
round(Viewer.PrintMarginLeft * PrintMarginFactor),
96-
round(Viewer.PrintMarginTop * PrintMarginFactor),
97-
round(Viewer.PrintMarginRight * PrintMarginFactor),
98-
round(Viewer.PrintMarginBottom * PrintMarginFactor));
99+
round(Viewer.PrintMarginLeft * 10.0),
100+
round(Viewer.PrintMarginTop * 10.0),
101+
round(Viewer.PrintMarginRight * 10.0),
102+
round(Viewer.PrintMarginBottom * 10.0));
99103
Viewer.PrintScale := 1.0 / MFPrinter.PrintScale;
100104
Viewer.PrintPreview(MFPrinter);
101105
Done := True;
@@ -107,8 +111,6 @@ procedure TBegaHtmlPrintPreviewForm.PreviewCreatePages(Sender: TObject; MFPrinte
107111

108112
//- BG ----------------------------------------------------------- 14.03.2006 --
109113
function TBegaHtmlPrintPreviewForm.PreviewGetSize(Sender: TObject; MFPrinter: TBegaMetaFilePrinter; out Width, Height: Integer): Boolean;
110-
const
111-
MarginFactor = 10.0;
112114
var
113115
OldCursor: TCursor;
114116
Viewer: THtmlViewer;
@@ -121,10 +123,10 @@ function TBegaHtmlPrintPreviewForm.PreviewGetSize(Sender: TObject; MFPrinter: TB
121123
Screen.Cursor := crHourGlass;
122124
try
123125
MFPrinter.PrintMargins := Rect(
124-
round(Viewer.PrintMarginLeft * MarginFactor),
125-
round(Viewer.PrintMarginTop * MarginFactor),
126-
round(Viewer.PrintMarginRight * MarginFactor),
127-
round(Viewer.PrintMarginBottom * MarginFactor));
126+
round(Viewer.PrintMarginLeft * 10.0),
127+
round(Viewer.PrintMarginTop * 10.0),
128+
round(Viewer.PrintMarginRight * 10.0),
129+
round(Viewer.PrintMarginBottom * 10.0));
128130
Viewer.PrintScale := 1.0 / MFPrinter.PrintScale;
129131
Viewer.NumPrinterPages(MFPrinter, Width, Height);
130132
finally
@@ -191,4 +193,6 @@ procedure TBegaHtmlPrintPreviewForm.updateEvents;
191193
end;
192194
end;
193195

196+
{$endif NoMetaFile}
197+
{$endif NoFlatScrollbars}
194198
end.

Ext/HTMLViewer/Source/BegaPreview.dfm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,7 @@ object BegaCustomPreviewFrame: TBegaCustomPreviewFrame
503503
Height = 403
504504
BevelOuter = bvNone
505505
BevelWidth = 0
506+
Color = clBtnShadow
506507
CommonColumnWidth = 0
507508
CommonRowHeight = 0
508509
TabOrder = 0

Ext/HTMLViewer/Source/BegaPreview.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ interface
4242
// own units
4343
BegaMetaFilePrinter,
4444
BegaPreviewPanel,
45-
BegaZoom, BegaScrollBox, System.ImageList;
45+
BegaZoom, BegaScrollBox;
4646

4747
const
4848
crZoom = 40;

Ext/HTMLViewer/Source/BegaPreviewForm.pas

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
unit BegaPreviewForm;
2525

2626
interface
27+
{$ifndef NoFlatScrollbars}
28+
{$ifndef NoMetaFile}
2729

2830
uses
2931
Classes, SysUtils,
@@ -68,8 +70,11 @@ TBegaMetaFilePrintPreviewForm = class(TBegaCustomPrintPreviewForm)
6870
property MetafilePrinter: TBegaMetaFilePrinter read FMetafilePrinter write setMetafilePrinter;
6971
end;
7072

71-
73+
{$endif NoMetaFile}
74+
{$endif NoFlatScrollbars}
7275
implementation
76+
{$ifndef NoFlatScrollbars}
77+
{$ifndef NoMetaFile}
7378

7479
{$ifdef LCL}
7580
{$R *.lfm}
@@ -164,4 +169,6 @@ procedure TBegaMetaFilePrintPreviewForm.setMetafilePrinter(
164169
Preview.createPages;
165170
end;
166171

172+
{$endif NoMetaFile}
173+
{$endif NoFlatScrollbars}
167174
end.

Ext/HTMLViewer/Source/BegaZoom.pas

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
unit BegaZoom;
2525

2626
interface
27+
{$ifndef NoFlatScrollbars}
2728

2829
uses
2930
Classes, Controls, ExtCtrls, Math, Types,
@@ -80,7 +81,9 @@ TBegaZoomBox = class(TBegaZoomingScrollBox)
8081
procedure begaZoomControlAroundPoint(ZoomedControl: TControl; Zoom: Double; Around: TPoint);
8182
function begaZoomFactorToMode(Factor: Double): TBegaZoomMode;
8283

84+
{$endif NoFlatScrollbars}
8385
implementation
86+
{$ifndef NoFlatScrollbars}
8487

8588
//- BG ----------------------------------------------------------- 12.11.2006 --
8689
procedure begaZoomControlAroundPoint(ZoomedControl: TControl; Zoom: Double; Around: TPoint);
@@ -235,4 +238,5 @@ function TBegaZoomBox.getZoomedControl: TControl;
235238
Result := nil;
236239
end;
237240

241+
{$endif NoFlatScrollbars}
238242
end.

Ext/HTMLViewer/Source/BuffConv.pas

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
HtmlViewer Version 11.7
3-
Copyright (c) 2010-2016 by Bernd Gabriel
2+
HtmlViewer Version 11.9
3+
Copyright (c) 2010-2018 by Bernd Gabriel
44
55
This source module is based on code of CodeChangerDecode.pas written by SchwarzKopf-M ([email protected])
66
and the source code library libiconv, which is published under the GNU Library General Public License.
@@ -1839,7 +1839,6 @@ procedure TBuffConvUTF7.Assign(Source: TBuffConverter);
18391839
end;
18401840
end;
18411841

1842-
{$HINTS OFF}
18431842
//-- BG ---------------------------------------------------------- 06.10.2012 --
18441843
function TBuffConvUTF7.NextChar: TBuffChar;
18451844
// Specification: RFC 2152 (and old RFC 1641, RFC 1642)
@@ -1931,7 +1930,7 @@ function TBuffConvUTF7.NextChar: TBuffChar;
19311930
kmax := 2;
19321931
k := 0;
19331932
base64count := 0;
1934-
i := 0; // valium for the compiler
1933+
{$IFNDEF Compiler32_Plus}i := 0;{$ENDIF} // valium for the compiler
19351934
while c1 <> 0 do
19361935
begin
19371936
case c1 of

Ext/HTMLViewer/Source/HTMLUn2.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,7 @@ procedure DrawBorder(Canvas: TCanvas; ORect, IRect: TRect; const C: ThtColorArra
29352935
//-- BG ---------------------------------------------------------- 24.11.2011 --
29362936
constructor TViewerBase.Create(AOwner: TComponent);
29372937
const
2938-
defaultPrintMargin = 0.8;//1.0;
2938+
defaultPrintMargin = 0.8;//2.0;
29392939
begin
29402940
inherited;
29412941
PrintMarginLeft := defaultPrintMargin;

0 commit comments

Comments
 (0)