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:
Robin Dunn
2003-01-06 22:39:57 +00:00
parent f6eae83ac3
commit 564d204d9f
7 changed files with 43 additions and 34 deletions

View File

@@ -18,7 +18,6 @@
from wxPython.wx import * from wxPython.wx import *
from wxPython.lib.colourselect import * from wxPython.lib.colourselect import *
import string
#---------------------------------------------------------------------------- #----------------------------------------------------------------------------
@@ -86,7 +85,7 @@ class TestColourSelect(wxPanel):
colour = button.GetColour() # get the colour selection button result colour = button.GetColour() # get the colour selection button result
result.append(name + ": " + str(colour)) # create string list for easy viewing of results result.append(name + ": " + str(colour)) # create string list for easy viewing of results
out_result = string.joinfields(result, ', ') out_result = ', '.join(result)
self.log.WriteText("Colour Results: " + out_result + "\n") self.log.WriteText("Colour Results: " + out_result + "\n")
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------

View File

@@ -36,6 +36,5 @@ def runTest(frame, nb, log):
import string overview = fancytext.__doc__.replace("<", "&lt;")
overview = string.replace(fancytext.__doc__, "<", "&lt;")

View File

@@ -1,8 +1,6 @@
from wxPython.wx import * from wxPython.wx import *
from wxPython.grid import * from wxPython.grid import *
import string
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
class CustomDataTable(wxPyGridTableBase): class CustomDataTable(wxPyGridTableBase):
@@ -93,7 +91,7 @@ class CustomDataTable(wxPyGridTableBase):
# editor and renderer. This allows you to enforce some type-safety # editor and renderer. This allows you to enforce some type-safety
# in the grid. # in the grid.
def CanGetValueAs(self, row, col, typeName): def CanGetValueAs(self, row, col, typeName):
colType = string.split(self.dataTypes[col], ':')[0] colType = self.dataTypes[col].split(':')[0]
if typeName == colType: if typeName == colType:
return true return true
else: else:

View File

@@ -20,6 +20,7 @@ cvsroot=:pserver:anoncvs@cvs.wxwindows.org:/pack/cvsroots/wxwindows
pythonbin=/usr/bin/python pythonbin=/usr/bin/python
port=GTK port=GTK
lcport=gtk lcport=gtk
unicode=0
tarname=wxPythonSrc tarname=wxPythonSrc
@@ -38,6 +39,7 @@ function useage {
echo " skiptar Don't build the tarball" echo " skiptar Don't build the tarball"
echo " skiprpm Don't build the RPM (but why?)" echo " skiprpm Don't build the RPM (but why?)"
echo " skipclean Don't do the cleanup at the end" echo " skipclean Don't do the cleanup at the end"
echo " gtk2 Build using wxGTK2 and Unicode"
echo " speconly Do nothing but write the RPM spec file" echo " speconly Do nothing but write the RPM spec file"
echo " smp Add SMP=2 to the envivonment to speed wxGTK build" echo " smp Add SMP=2 to the envivonment to speed wxGTK build"
} }
@@ -73,6 +75,7 @@ function makespec {
| sed s:@TARNAME@:${tarname}:g \ | sed s:@TARNAME@:${tarname}:g \
| sed s:@VERSION@:${version}:g \ | sed s:@VERSION@:${version}:g \
| sed s:@VER2@:${ver2}:g \ | sed s:@VER2@:${ver2}:g \
| sed s:@UNICODE@:${unicode}:g \
> ${distdir}/wxPython${port}.spec > ${distdir}/wxPython${port}.spec
} }
@@ -80,12 +83,13 @@ function makespec {
for flag in $*; do for flag in $*; do
case ${flag} in case ${flag} in
skipcvs) skipcvs=1 ;; skipcvs) skipcvs=1 ;;
skipclean) skipclean=1 ;; skipclean) skipclean=1 ;;
skiptar) skiptar=1 ;; skiptar) skiptar=1 ;;
skiprpm) skiprpm=1 ;; skiprpm) skiprpm=1 ;;
smp) export SMP=2 ;; gtk2) unicode=1; port=GTK2; lcport=gtk2 ;;
speconly) makespec; exit 0 ;; smp) export SMP=2 ;;
speconly) makespec; exit 0 ;;
*) echo "Unknown flag \"${flag}\"" *) echo "Unknown flag \"${flag}\""
useage useage

View File

@@ -3,6 +3,7 @@
%define pyver @PYVER@ %define pyver @PYVER@
%define port @PORT@ %define port @PORT@
%define lcport @LCPORT@ %define lcport @LCPORT@
%define unicode @UNICODE@
%define tarname @TARNAME@ %define tarname @TARNAME@
%define version @VERSION@ %define version @VERSION@
%define ver2 @VER2@ %define ver2 @VER2@
@@ -10,13 +11,16 @@
%define wxpref %{pref}/lib/wxPython %define wxpref %{pref}/lib/wxPython
%define name wxPython%{port}-py%{pyver} %define name wxPython%{port}-py%{pyver}
# Should the builtin image and etc. libs be used, or system libs?
# Distro specific RPMs should probably set this to 0, generic ones
# should use 1
%define builtin_libs 1
# Should --enable-debug_flag be used in release builds? # Should --enable-debug_flag be used in release builds?
# Using it defines __WXDEBUG__ and gives us runtime diagnostics # Using it defines __WXDEBUG__ and gives us runtime diagnostics
# that are turned into Python exceptions starting with 2.3.4. # that are turned into Python exceptions starting with 2.3.4.
%define debug_flag 1 %define debug_flag 1
%if %{debug_flag} %if %{debug_flag}
%define wxconfigname %{wxpref}/bin/wx%{lcport}d-%{ver2}-config %define wxconfigname %{wxpref}/bin/wx%{lcport}d-%{ver2}-config
%else %else
@@ -91,16 +95,21 @@ $WXDIR/configure --with-%{lcport} \
--disable-soname \ --disable-soname \
--enable-rpath=%{wxpref}/lib \ --enable-rpath=%{wxpref}/lib \
--with-opengl \ --with-opengl \
%if %{unicode}
--enable-gtk2 \
--enable-unicode \
%endif
--enable-geometry \ --enable-geometry \
--enable-optimise \ --enable-optimise \
%if %{debug_flag} %if %{debug_flag}
--enable-debug_flag \ --enable-debug_flag \
%endif %endif
%if %{builtin_libs}
--with-libjpeg=builtin \ --with-libjpeg=builtin \
--with-libpng=builtin \ --with-libpng=builtin \
--with-libtiff=builtin \ --with-libtiff=builtin \
--with-zlib=builtin \ --with-zlib=builtin \
%endif
# Build wxWindows # Build wxWindows

View File

@@ -449,7 +449,7 @@ class MessageAdapter:
def notify(self, message): def notify(self, message):
event = message.data # Extract the wxEvent event = message.data # Extract the wxEvent
self.eventHandler(event) # Perform the call as wxWindows would 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): def Destroy(self):

View File

@@ -350,7 +350,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
x, y = self.DC.GetTextExtent("W") x, y = self.DC.GetTextExtent("W")
self.space = y self.space = y
if self.total_pages == None: if self.total_pages is None:
self.GetTotalPages() # total pages for display/printing self.GetTotalPages() # total pages for display/printing
self.data_cnt = self.page_index[self.page-1] self.data_cnt = self.page_index[self.page-1]
@@ -500,7 +500,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
col = 0 col = 0
for colour in self.column_bgcolour: for colour in self.column_bgcolour:
cellcolour = self.GetCellColour(self.data_cnt, col) cellcolour = self.GetCellColour(self.data_cnt, col)
if cellcolour != None: if cellcolour is not None:
colour = cellcolour colour = cellcolour
brush = wxBrush(colour, wxSOLID) brush = wxBrush(colour, wxSOLID)
@@ -527,7 +527,7 @@ class PrintTableDraw(wxScrolledWindow, PrintBase):
fcolour = self.column_txtcolour[self.col] # set font colour fcolour = self.column_txtcolour[self.col] # set font colour
celltext = self.GetCellText(self.data_cnt, self.col) celltext = self.GetCellText(self.data_cnt, self.col)
if celltext != None: if celltext is not None:
fcolour = celltext # override the column colour fcolour = celltext # override the column colour
self.DC.SetTextForeground(fcolour) 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): def SetHeader(self, text = "", type = "Text", font=None, align = None, indent = None, colour = None, size = None):
set = { "Text": text } set = { "Text": text }
if font == None: if font is None:
set["Font"] = copy.copy(self.default_font) set["Font"] = copy.copy(self.default_font)
else: else:
set["Font"] = font set["Font"] = font
if colour != None: if colour is not None:
setfont = set["Font"] setfont = set["Font"]
setfont["Colour"] = self.GetColour(colour) setfont["Colour"] = self.GetColour(colour)
if size != None: if size is not None:
setfont = set["Font"] setfont = set["Font"]
setfont["Size"] = size setfont["Size"] = size
if align == None: if align is None:
set["Align"] = self.header_align set["Align"] = self.header_align
else: else:
set["Align"] = align set["Align"] = align
if indent == None: if indent is None:
set["Indent"] = self.header_indent set["Indent"] = self.header_indent
else: else:
set["Indent"] = indent set["Indent"] = indent
if type == None: if type is None:
set["Type"] = self.header_type set["Type"] = self.header_type
else: else:
set["Type"] = type 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): def SetFooter(self, text = "", type = None, font=None, align = None, indent = None, colour = None, size = None):
set = { "Text": text } set = { "Text": text }
if font == None: if font is None:
set["Font"] = copy.copy(self.default_font) set["Font"] = copy.copy(self.default_font)
else: else:
set["Font"] = font set["Font"] = font
if colour != None: if colour is not None:
setfont = set["Font"] setfont = set["Font"]
setfont["Colour"] = self.GetColour(colour) setfont["Colour"] = self.GetColour(colour)
if size != None: if size is not None:
setfont = set["Font"] setfont = set["Font"]
setfont["Size"] = size setfont["Size"] = size
if align == None: if align is None:
set["Align"] = self.footer_align set["Align"] = self.footer_align
else: else:
set["Align"] = align set["Align"] = align
if indent == None: if indent is None:
set["Indent"] = self.footer_indent set["Indent"] = self.footer_indent
else: else:
set["Indent"] = indent set["Indent"] = indent
if type == None: if type is None:
set["Type"] = self.footer_type set["Type"] = self.footer_type
else: else:
set["Type"] = type set["Type"] = type
@@ -956,9 +956,9 @@ class PrintTable:
class PrintGrid: class PrintGrid:
def __init__(self, parent, grid, format = [], total_col = None, total_row = None): 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() total_row = grid.GetNumberRows()
if total_col == None: if total_col is None:
total_col = grid.GetNumberCols() total_col = grid.GetNumberCols()
self.total_row = total_row self.total_row = total_row