From: Robin Dunn Date: Wed, 15 May 2002 19:46:31 +0000 (+0000) Subject: Updates from contributor X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/077f7c57a0d34ee0a491bc0730b46c0149749757 Updates from contributor git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15576 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/wxPython/wxPython/lib/printout.py b/wxPython/wxPython/lib/printout.py index 5f9e78eba9..33f3a24432 100644 --- a/wxPython/wxPython/lib/printout.py +++ b/wxPython/wxPython/lib/printout.py @@ -6,9 +6,14 @@ # # Created: # Version 0.75 -# Date: Sept 18, 2001 +# Date: May 15, 2002 # Licence: wxWindows license #---------------------------------------------------------------------------- +# Release Notes + +# fixed bug for string wider than print region +# add index to data list after parsing total pages for paging +#---------------------------------------------------------------------------- import os, sys, string, copy @@ -87,6 +92,13 @@ class PrintBase: if len(split) == 1: return ln_text, "" + try: + w, h = self.DC.GetTextExtent(split[0]) + if w >= width: + return ln_text, "" + except: + pass + cnt = 0 for word in split: bword = " " + word # blank + word @@ -341,31 +353,22 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): if self.total_pages == None: self.GetTotalPages() # total pages for display/printing - self.data_cnt = 0 - - cnt = 1 # get selected page - if cnt == self.page: - self.draw = TRUE - else: - self.draw = FALSE - - while cnt < self.page: - self.OutPage() - cnt = cnt + 1 + self.data_cnt = self.page_index[self.page-1] self.draw = TRUE self.PrintHeader() self.PrintFooter() self.OutPage() - def GetTotalPages(self): self.data_cnt = 0 self.draw = FALSE + self.page_index = [0] cnt = 0 while 1: test = self.OutPage() + self.page_index.append(self.data_cnt) if test == FALSE: break cnt = cnt + 1 @@ -376,7 +379,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase): self.y = self.y_start self.end_x = self.column[-1] - if self.data_cnt < len(self.data)-1: # if there data for display on the page + if self.data_cnt < len(self.data): # if there data for display on the page if self.label != []: # check if header defined self.PrintLabel() else: