Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 21 in printed book and digital formats -- plus a one-year subscription (beginning with 22.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 12.3 ('lJLaL')
Instant purchase and download via GumRoad!

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 the Insert menu on the menu bar. Name this class pictureViewer, and set its Super to be Canvas.

Add the Paint, OpenandDropObject 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.