Article Preview
Buy Now
FEATURE
Pretty Print Dialog
Adding the Combined Page Setup/Print Dialog to Your Mac Application
Issue: 12.3 (May/June 2014)
Author: Sam Rowlands
Author Bio: Sam is the code monkey behind Ohanaware Software.
Article Description: No description available.
Article Length (in bytes): 17,413
Starting Page Number: 18
Article Number: 12305
Related Link(s): None
Excerpt of article text...
You've probably used an application where Page Setup is combined within the Print dialog. Xojo separates these two functions (for a print heavy based application, you might want to stick with this). However to quickly add a printing function to part of your app, the combined Page SetupandPrint dialog, not only looks slick, it provides a live preview and makes it a one stop shop for the user to customize the print (see Figure 1).
Note: This is only a quick tutorial and doesn't cover some advanced functionality such as pagination or more control over printing. This requires a heck of a lot more work, to be able to 'overwrite' some Cocoa functions within Xojo. For more advanced functionality you may wish to stick with the default Xojo Page Setup, and separate print function. Create a new Xojo project. Select
Class
from theInsert
menu on the menu bar. Name this classpictureViewer
, and set itsSuper
to beCanvas
.Add the
Paint
,Open
andDropObject
events to the new class. We'll primarily interact with it via DragandDrop, so we'll need to configure it, handle it and, of course, display the contents.
...End of Excerpt. Please purchase the magazine to read the full article.