Steve,
I'm just stepping into this myself. Only as far as displaying some rudimentry psuedo-rtf in the wxrichtextctrl widget.
I tracked down what I believe is the C code you are referring to :

http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/src/richtext/richtextprint.cpp?revision=61724&view=co

and was wondering if you could get me up to speed with where you are at now - 
some code snippets perhaps.
Then perhaps we could divide up some of the work snd share notes.  Feel free to 
discuss offline if you prefer and then post finished lessons later.

Jeff



Steve Cookson wrote:
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