OK, well I see I really misunderstood the printing framework. In the end, I
only began to understand it because I stepped through the Wx::Demo version
in debug mode.

It seems I need to provide a number of subroutines for Wx::Printout.  This
wasn't clear to me before.  I guess I didn't really understand the
vocabulary used in the Print Framework Overview.  Although what I didn't
understand, I'm not sure, as it seems crystal clear now.

The main item I need to re-write is the wxRichTextPrintout. Has anyone made
any progress with this?  It's a bit of a mammoth.

Given that I have no experience with 'wrapping', do people feel that
wrapping the C-code would be easier or re-writing it in Perl.  I suspect the
re-write is easier unless I can wrap tens or hundreds of lines at a time
(there are 706 lines in the C).  What's the opinion out there?

Regards

Steve



-----Original Message-----
From: Steve Cookson [mailto:steve.cook...@sca-uk.com] 
Sent: 30 March 2010 16:45
To: wxperl-users@perl.org
Subject: Getting data into wxPrintPreview

Hi Guys,

Its not at all clear to me how to get data into Wx::PrintPreview (and I
expect Print too, when I get to that),  I have pulled what I can out of the
Wx::Demo and I have constructed an event-handler as follows:

        sub on_click_richtext_preview {
         my( $this, $event ) = @_;

         my $print = Wx::Printout->new( "Print" );
         my $prev = Wx::Printout->new( "Print" );
         my $preview = Wx::PrintPreview->new( $prev, $print );
         print $preview -> IsOk(), "\n";
         my $frame = Wx::PreviewFrame->new( $preview,
$this->{Ctl_Report_Text_Txt}, "Print Preview", [-1, -1], [600, -1] );
         $frame->Initialize();
          
         $frame->Show( 1 );
        }

Where the data is in $this->{Ctl_Report_Text_Txt} (which is a
Wx::RichTextCtrl).  This gives me a blank preview window with 32767 pages,
admittedly I haven't checked them all, but it appears to be blank.

Thanks and regards,

Steve


Reply via email to