Thread editor in perl 0.3.n: hurra
(630 answers)
Opened by zipster at 2005-10-21 17:46 Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 package TextCtrlPrintout; use strict; use vars qw(@ISA); @ISA = qw(Wx::Printout); =head1 METHODS =head2 new( $wx_textctrl ) =cut sub new { my $class = shift; my $textctrl = shift; my $this = $class->SUPER::new( @_ ); $this->{DOCUMENT} = $textctrl; # Seitenanzahl ausrechnen. $this->{PAGE_COUNT} = 1; return $this; } # /new =head2 GetPageInfo() wxPrintout::GetPageInfo void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo) Called by the framework to obtain information from the application about minimum and maximum page values that the user can select, and the required page range to be printed. By default this returns 1, 32000 for the page minimum and maximum values, and 1, 1 for the required page range. If minPage is zero, the page number controls in the print dialog will be disabled. wxPerl note: When this method is overridden in a derived class, it must not take any parameters, and returns a 4-element list. =cut sub GetPageInfo { my $this = shift; Wx::LogMessage( "GetPageInfo" ); # Entweder hier ausrechnen wieviele Seiten es werden, oder wo anders # ausrechnen und hier zurück geben. return ( 1, $this->{PAGE_COUNT}, 1, $this->{PAGE_COUNT} ); # dast stimmt so natürlich nicht } # /GetPageInfo =head2 HasPage() wxPrintout::HasPage bool HasPage(int pageNum) Should be overridden to return true if the document has this page, or false if not. Returning false signifies the end of the document. By default, HasPage behaves as if the document has only one page. =cut sub HasPage { my $self = shift; my $page = shift; Wx::LogMessage( "HasPage: %d", $_[0] ); return 1 if $page <= $self->{PAGE_COUNT}; return 0; } # /HasPage http://www.intergastro-service.de (mein erstes CMS :) )
|