Some fixes and cleanups
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@18610 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -449,7 +449,7 @@ class MessageAdapter:
|
||||
def notify(self, message):
|
||||
event = message.data # Extract the wxEvent
|
||||
self.eventHandler(event) # Perform the call as wxWindows would
|
||||
event.Skip(1) # Make sure Skip(1) wasn't set. ##????
|
||||
##event.Skip(1) # Make sure Skip(1) wasn't set. ##????
|
||||
|
||||
|
||||
def Destroy(self):
|
||||
|
@@ -350,7 +350,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
|
||||
x, y = self.DC.GetTextExtent("W")
|
||||
self.space = y
|
||||
|
||||
if self.total_pages == None:
|
||||
if self.total_pages is None:
|
||||
self.GetTotalPages() # total pages for display/printing
|
||||
|
||||
self.data_cnt = self.page_index[self.page-1]
|
||||
@@ -500,7 +500,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
|
||||
col = 0
|
||||
for colour in self.column_bgcolour:
|
||||
cellcolour = self.GetCellColour(self.data_cnt, col)
|
||||
if cellcolour != None:
|
||||
if cellcolour is not None:
|
||||
colour = cellcolour
|
||||
|
||||
brush = wxBrush(colour, wxSOLID)
|
||||
@@ -527,7 +527,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
|
||||
|
||||
fcolour = self.column_txtcolour[self.col] # set font colour
|
||||
celltext = self.GetCellText(self.data_cnt, self.col)
|
||||
if celltext != None:
|
||||
if celltext is not None:
|
||||
fcolour = celltext # override the column colour
|
||||
|
||||
self.DC.SetTextForeground(fcolour)
|
||||
@@ -800,30 +800,30 @@ class PrintTable:
|
||||
def SetHeader(self, text = "", type = "Text", font=None, align = None, indent = None, colour = None, size = None):
|
||||
set = { "Text": text }
|
||||
|
||||
if font == None:
|
||||
if font is None:
|
||||
set["Font"] = copy.copy(self.default_font)
|
||||
else:
|
||||
set["Font"] = font
|
||||
|
||||
if colour != None:
|
||||
if colour is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Colour"] = self.GetColour(colour)
|
||||
|
||||
if size != None:
|
||||
if size is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Size"] = size
|
||||
|
||||
if align == None:
|
||||
if align is None:
|
||||
set["Align"] = self.header_align
|
||||
else:
|
||||
set["Align"] = align
|
||||
|
||||
if indent == None:
|
||||
if indent is None:
|
||||
set["Indent"] = self.header_indent
|
||||
else:
|
||||
set["Indent"] = indent
|
||||
|
||||
if type == None:
|
||||
if type is None:
|
||||
set["Type"] = self.header_type
|
||||
else:
|
||||
set["Type"] = type
|
||||
@@ -833,30 +833,30 @@ class PrintTable:
|
||||
def SetFooter(self, text = "", type = None, font=None, align = None, indent = None, colour = None, size = None):
|
||||
set = { "Text": text }
|
||||
|
||||
if font == None:
|
||||
if font is None:
|
||||
set["Font"] = copy.copy(self.default_font)
|
||||
else:
|
||||
set["Font"] = font
|
||||
|
||||
if colour != None:
|
||||
if colour is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Colour"] = self.GetColour(colour)
|
||||
|
||||
if size != None:
|
||||
if size is not None:
|
||||
setfont = set["Font"]
|
||||
setfont["Size"] = size
|
||||
|
||||
if align == None:
|
||||
if align is None:
|
||||
set["Align"] = self.footer_align
|
||||
else:
|
||||
set["Align"] = align
|
||||
|
||||
if indent == None:
|
||||
if indent is None:
|
||||
set["Indent"] = self.footer_indent
|
||||
else:
|
||||
set["Indent"] = indent
|
||||
|
||||
if type == None:
|
||||
if type is None:
|
||||
set["Type"] = self.footer_type
|
||||
else:
|
||||
set["Type"] = type
|
||||
@@ -956,9 +956,9 @@ class PrintTable:
|
||||
|
||||
class PrintGrid:
|
||||
def __init__(self, parent, grid, format = [], total_col = None, total_row = None):
|
||||
if total_row == None:
|
||||
if total_row is None:
|
||||
total_row = grid.GetNumberRows()
|
||||
if total_col == None:
|
||||
if total_col is None:
|
||||
total_col = grid.GetNumberCols()
|
||||
|
||||
self.total_row = total_row
|
||||
|
Reference in New Issue
Block a user