-
-
Notifications
You must be signed in to change notification settings - Fork 335
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support to print controls and print preview dialog
Fixes #969
- Loading branch information
Showing
37 changed files
with
1,202 additions
and
211 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Eto.Forms; | ||
|
||
namespace Eto.GtkSharp.Forms.Printing | ||
{ | ||
public class PrintPreviewDialogHandler : WidgetHandler<object, PrintPreviewDialog>, PrintPreviewDialog.IHandler | ||
{ | ||
PrintSettings settings; | ||
|
||
public PrintDocument Document { get; set; } | ||
|
||
public DialogResult ShowDialog(Window parent) | ||
{ | ||
var parentWindow = parent?.ControlObject as Gtk.Window; | ||
|
||
var printSettingsHandler = (PrintSettingsHandler)PrintSettings.Handler; | ||
|
||
Document.PrintSettings = PrintSettings; | ||
|
||
printSettingsHandler.ShowPreview = true; | ||
((PrintDocumentHandler)Document.Handler).Print(parentWindow); | ||
return DialogResult.Ok; | ||
} | ||
|
||
public PrintSettings PrintSettings | ||
{ | ||
get => settings ?? (settings = new PrintSettings()); | ||
set => settings = value; | ||
} | ||
|
||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.