mirror of
https://github.com/Rayerd/dfl.git
synced 2025-04-26 04:59:55 +03:00
Add scrollbar to PrintPreviewDialog
This commit is contained in:
parent
19a27ed5a1
commit
919e992d4c
1 changed files with 28 additions and 1 deletions
|
@ -2287,6 +2287,7 @@ class PrintPreviewDialog : Form
|
||||||
private ToolBarButton _button5;
|
private ToolBarButton _button5;
|
||||||
private ImageList _imageList;
|
private ImageList _imageList;
|
||||||
private Panel _pageSelectPanel;
|
private Panel _pageSelectPanel;
|
||||||
|
private Panel _previewPanel;
|
||||||
private Label _fromPageLabel;
|
private Label _fromPageLabel;
|
||||||
private TextBox _fromPage;
|
private TextBox _fromPage;
|
||||||
private Button _forwardButton;
|
private Button _forwardButton;
|
||||||
|
@ -2379,6 +2380,7 @@ class PrintPreviewDialog : Form
|
||||||
_previewControl.autoZoom = !_previewControl.autoZoom;
|
_previewControl.autoZoom = !_previewControl.autoZoom;
|
||||||
_previewControl.invalidatePreview();
|
_previewControl.invalidatePreview();
|
||||||
_previewControl.invalidate();
|
_previewControl.invalidate();
|
||||||
|
_enableScroll = !_previewControl.autoZoom;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
assert(0);
|
assert(0);
|
||||||
|
@ -2479,6 +2481,10 @@ class PrintPreviewDialog : Form
|
||||||
};
|
};
|
||||||
_forwardButton.parent = _pageSelectPanel;
|
_forwardButton.parent = _pageSelectPanel;
|
||||||
|
|
||||||
|
_previewPanel = new Panel();
|
||||||
|
_previewPanel.dock = DockStyle.FILL;
|
||||||
|
_previewPanel.parent = this;
|
||||||
|
|
||||||
_previewControl = new PrintPreviewControl(doc);
|
_previewControl = new PrintPreviewControl(doc);
|
||||||
_previewControl.resizeRedraw = true;
|
_previewControl.resizeRedraw = true;
|
||||||
_previewControl.backColor = Color.gray;
|
_previewControl.backColor = Color.gray;
|
||||||
|
@ -2487,7 +2493,9 @@ class PrintPreviewDialog : Form
|
||||||
_previewControl.columns = 1; // ditto
|
_previewControl.columns = 1; // ditto
|
||||||
_previewControl.autoZoom = true; // Initial mode is "Fit".
|
_previewControl.autoZoom = true; // Initial mode is "Fit".
|
||||||
_previewControl.startPage = 0;
|
_previewControl.startPage = 0;
|
||||||
_previewControl.parent = this;
|
_previewControl.parent = _previewPanel;
|
||||||
|
|
||||||
|
_enableScroll = !_previewControl.autoZoom;
|
||||||
|
|
||||||
_fromPage.text = to!string(_previewControl.startPage + 1);
|
_fromPage.text = to!string(_previewControl.startPage + 1);
|
||||||
}
|
}
|
||||||
|
@ -2519,6 +2527,25 @@ class PrintPreviewDialog : Form
|
||||||
{
|
{
|
||||||
super.wndProc(msg);
|
super.wndProc(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
///
|
||||||
|
private void _enableScroll(bool byes) @property // setter
|
||||||
|
{
|
||||||
|
if (byes)
|
||||||
|
{
|
||||||
|
_previewPanel.hScroll = true;
|
||||||
|
_previewPanel.vScroll = true;
|
||||||
|
_previewPanel.scrollSize = Size(GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN));
|
||||||
|
_previewPanel.performLayout();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_previewPanel.hScroll = false;
|
||||||
|
_previewPanel.vScroll = false;
|
||||||
|
_previewPanel.scrollSize = Size(0, 0);
|
||||||
|
_previewPanel.performLayout();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///
|
///
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue