git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15576
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
#
# Created:
# Version 0.75
#
# Created:
# Version 0.75
# Licence: wxWindows license
#----------------------------------------------------------------------------
# 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
import os, sys, string, copy
if len(split) == 1:
return ln_text, ""
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
cnt = 0
for word in split:
bword = " " + word # blank + word
if self.total_pages == None:
self.GetTotalPages() # total pages for display/printing
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()
self.draw = TRUE
self.PrintHeader()
self.PrintFooter()
self.OutPage()
def GetTotalPages(self):
self.data_cnt = 0
self.draw = FALSE
def GetTotalPages(self):
self.data_cnt = 0
self.draw = FALSE
cnt = 0
while 1:
test = self.OutPage()
cnt = 0
while 1:
test = self.OutPage()
+ self.page_index.append(self.data_cnt)
if test == FALSE:
break
cnt = cnt + 1
if test == FALSE:
break
cnt = cnt + 1
self.y = self.y_start
self.end_x = self.column[-1]
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:
if self.label != []: # check if header defined
self.PrintLabel()
else: