Printing

0 views
Skip to first unread message

Rob McMullen

unread,
Sep 23, 2009, 12:04:24 PM9/23/09
to pepp...@googlegroups.com
On Tue, Sep 22, 2009 at 9:56 AM, Christopher Barker
<Chris....@noaa.gov> wrote:
> How hard is it to add printing?

Hmmm, no idea... I've never used any printing functions in wx at all.
Do you use any in FloatCanvas?

At some point, I'll have to read the printing chapter in wxPython In
Action. One of the few chapters I haven't looked at.

> While full syntax-highlighter printing would be nice, I think just
> dumping the buffer to wxHTMEasyPrinting would be a OK.

I've added a ticket: http://trac.flipturn.org/ticket/769

It will have to be more complicated than, say, Editra's printing
because it would need to contain interfaces such that non-wxSTC modes
could also make printouts.

Rob

Christopher Barker

unread,
Sep 23, 2009, 2:33:00 PM9/23/09
to pepp...@googlegroups.com
Rob McMullen wrote:
> Hmmm, no idea... I've never used any printing functions in wx at all.
> Do you use any in FloatCanvas?

No, I've had requests, but I've never gotten around to it. I do know
printing can be a pain!

> It will have to be more complicated than, say, Editra's printing
> because it would need to contain interfaces such that non-wxSTC modes
> could also make printouts.

Yes, though if you had some modes just raise an error, saying "I can't
print this mode", for now, that would be a start.

By the way, speaking of other modes, I find I often get a crash when I
try to load binary files. In particular, I've got some files that have
text headers, followed by binary data -- I don't' want to read the
binary data (though I may some day), but it would be nice if it could at
least load so I can see the header.

Let me know if you need a sample.

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris....@noaa.gov

Rob McMullen

unread,
Sep 23, 2009, 2:56:51 PM9/23/09
to pepp...@googlegroups.com
On Wed, Sep 23, 2009 at 11:33 AM, Christopher Barker
<Chris....@noaa.gov> wrote:
> Yes, though if you had some modes just raise an error, saying "I can't
> print this mode", for now, that would be a start.

Yes, something like this. I'm thinking that I'll add some methods in
MajorMode that can be overridden by those modes that can provide print
capability. Otherwise the default action would be to disallow
printing for that mode (and probably not even include the Print option
in the File menu).

Actually, maybe it makes more sense to make it a mixin class that
major modes can implement.

Rob

Rob McMullen

unread,
Sep 27, 2009, 6:38:52 PM9/27/09
to pepp...@googlegroups.com
Latest svn has the first cut at printing support. Still problems to
work out, like the page count being messed up by word wrapping, but
the basics are there.

Rob

Christopher Barker

unread,
Sep 28, 2009, 12:48:48 PM9/28/09
to pepp...@googlegroups.com

Cool! My first print looks great!

Rob McMullen

unread,
Sep 28, 2009, 1:07:55 PM9/28/09
to pepp...@googlegroups.com
On Mon, Sep 28, 2009 at 9:48 AM, Christopher Barker
<Chris....@noaa.gov> wrote:
> Cool! My first print looks great!

Excellent. As long as there are no wrapped lines, it seems to do a
good job. Line wrapping throws a huge monkey wrench in the works and
it doesn't look easily solvable. I'll be posting to the wxPython list
when I get my example code in a better state...

Rob

Reply all
Reply to author
Forward
0 new messages