mirror of
https://github.com/Rayerd/dfl.git
synced 2025-04-26 21:30:25 +03:00
Clean up
This commit is contained in:
parent
f0abc281d8
commit
904e887790
1 changed files with 9 additions and 9 deletions
|
@ -504,7 +504,7 @@ class PrintDocument
|
||||||
PrinterSettings printerSettings;
|
PrinterSettings printerSettings;
|
||||||
PrintController printController;
|
PrintController printController;
|
||||||
wstring documentName;
|
wstring documentName;
|
||||||
bool originAtMargins = false; // TODO: Implement.
|
// bool originAtMargins = false; // TODO: Implement.
|
||||||
|
|
||||||
///
|
///
|
||||||
this()
|
this()
|
||||||
|
@ -832,13 +832,13 @@ private PaperSize[] _createPaperSizeArray(HGLOBAL hDevMode)
|
||||||
private int _tentativeDpi(int dmPrintQuality)
|
private int _tentativeDpi(int dmPrintQuality)
|
||||||
{
|
{
|
||||||
if (dmPrintQuality == PrinterResolutionKind.DRAFT)
|
if (dmPrintQuality == PrinterResolutionKind.DRAFT)
|
||||||
return 400; // NOTE
|
return 400;
|
||||||
else if (dmPrintQuality == PrinterResolutionKind.LOW)
|
else if (dmPrintQuality == PrinterResolutionKind.LOW)
|
||||||
return 600; // NOTE
|
return 600;
|
||||||
else if (dmPrintQuality == PrinterResolutionKind.MEDIUM)
|
else if (dmPrintQuality == PrinterResolutionKind.MEDIUM)
|
||||||
return 1200; // NOTE
|
return 1200;
|
||||||
else if (dmPrintQuality == PrinterResolutionKind.HIGH)
|
else if (dmPrintQuality == PrinterResolutionKind.HIGH)
|
||||||
return 2400; // NOTE
|
return 2400;
|
||||||
else if (dmPrintQuality > 0)
|
else if (dmPrintQuality > 0)
|
||||||
return dmPrintQuality; // dpi unit.
|
return dmPrintQuality; // dpi unit.
|
||||||
else
|
else
|
||||||
|
@ -1992,7 +1992,7 @@ final class PageSetupDialog : CommonDialog
|
||||||
{
|
{
|
||||||
// Get inital page settings.
|
// Get inital page settings.
|
||||||
PAGESETUPDLG pd;
|
PAGESETUPDLG pd;
|
||||||
bool isOK = _makePagesetupdlgFromPageSettings(pd, document.printerSettings);
|
bool isOK = _createPagesetupdlgFromPrinterSettings(pd, document.printerSettings);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
{
|
{
|
||||||
throw new DflException("DFL: runDialog failure.");
|
throw new DflException("DFL: runDialog failure.");
|
||||||
|
@ -2051,7 +2051,7 @@ final class PageSetupDialog : CommonDialog
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
private bool _makePagesetupdlgFromPageSettings(ref PAGESETUPDLG pd, PrinterSettings printerSettings)
|
private bool _createPagesetupdlgFromPrinterSettings(ref PAGESETUPDLG pd, PrinterSettings printerSettings)
|
||||||
{
|
{
|
||||||
pd.lStructSize = pd.sizeof;
|
pd.lStructSize = pd.sizeof;
|
||||||
pd.hwndOwner = null;
|
pd.hwndOwner = null;
|
||||||
|
@ -2190,7 +2190,7 @@ class PrintPreviewControl : Control
|
||||||
body
|
body
|
||||||
{
|
{
|
||||||
PAGESETUPDLG pd;
|
PAGESETUPDLG pd;
|
||||||
bool isOK = _makePagesetupdlgFromPageSettings(pd, document.printerSettings);
|
bool isOK = _createPagesetupdlgFromPrinterSettings(pd, document.printerSettings);
|
||||||
if (!isOK)
|
if (!isOK)
|
||||||
{
|
{
|
||||||
throw new DflException("DFL: invalidatePreview failure.");
|
throw new DflException("DFL: invalidatePreview failure.");
|
||||||
|
@ -2668,7 +2668,7 @@ class PreviewPrintController : PrintController
|
||||||
.map!(elem => elem.maxElement) // [h1,h4] if h1 > h2 and h3 < h4
|
.map!(elem => elem.maxElement) // [h1,h4] if h1 > h2 and h3 < h4
|
||||||
.sum; // h1+h4
|
.sum; // h1+h4
|
||||||
|
|
||||||
// NOTE: TOP_AND_BOTTOM_MARGIN and the others are scales on video screen world.
|
// TOP_AND_BOTTOM_MARGIN and the others are scales on video screen world.
|
||||||
double ratio = cast(double)(screenRect.height - TOP_AND_BOTTOM_MARGIN - VERTICAL_SPAN * (_previewControl.rows - 1)) / totalPageHeight;
|
double ratio = cast(double)(screenRect.height - TOP_AND_BOTTOM_MARGIN - VERTICAL_SPAN * (_previewControl.rows - 1)) / totalPageHeight;
|
||||||
if (screenRect.width < totalPageWidth * ratio)
|
if (screenRect.width < totalPageWidth * ratio)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue