Added GetCount, GetCountRGB, and GetCountColour methods to
wx.ImageHistogram.
-wxMSW: wx.Window.Refresh changed to explicitly refresh all children
-as well. Previously it was implicitly done because parents did not
-clip thier children by default. Now that they always clip then
-Refresh needed to do a recursive refresh. This also fixes the
-Freeze/Thaw problems that some people had with 2.5.4.1.
+wxMSW: wx.Window.Refresh changed to explicitly refresh all children as
+well as the parent. Previously it was implicitly done because parents
+did not clip their children by default. Now that they always clip
+children then Refresh needed to be fixed to do a recursive refresh.
+This also fixes the Freeze/Thaw problems that some people had with
+2.5.4.1.
+
+wx.SplitterWindow: Send EVT_SPLITTER_SASH_POS_CHANGED only once after
+end of dragging and not after each CHANGING event (modified patch
+#1076226)
+
+wx.glcanvas.GLCanvas: applied patch fixing problems with X server
+crash when using nVidia cards (patch 1155132)
+
def __init__(self):
""" Standard initialiser.
"""
- self._lastColMinWidth = None
-
+ self._resizeColMinWidth = None
+ self._resizeColStyle = "LAST"
+ self._resizeCol = 0
self.Bind(wx.EVT_SIZE, self._onResize)
self.Bind(wx.EVT_LIST_COL_END_DRAG, self._onResize, self)
+ def setResizeColumn(self, col):
+ """
+ Specify which column that should be autosized. Pass either
+ 'LAST' or the column number. Default is 'LAST'.
+ """
+ if col == "LAST":
+ self._resizeColStyle = "LAST"
+ else:
+ self._resizeColStyle = "COL"
+ self._resizeCol = col
+
+
def resizeLastColumn(self, minWidth):
""" Resize the last column appropriately.
'minWidth' is the preferred minimum width for the last column.
"""
- self._lastColMinWidth = minWidth
+ self.resizeCloumn(self, minWidth)
+
+
+ def resizeColumn(self, minWidth):
+ self._resizeColMinWidth = minWidth
self._doResize()
+
# =====================
# == Private Methods ==
numCols = self.GetColumnCount()
if numCols == 0: return # Nothing to resize.
- if self._lastColMinWidth == None:
- self._lastColMinWidth = self.GetColumnWidth(numCols - 1)
+ if(self._resizeColStyle == "LAST"):
+ resizeCol = self.GetColumnCount()
+ else:
+ resizeCol = self._resizeCol
+
+ if self._resizeColMinWidth == None:
+ self._resizeColMinWidth = self.GetColumnWidth(resizeCol - 1)
# We're showing the vertical scrollbar -> allow for scrollbar width
# NOTE: on GTK, the scrollbar is included in the client size, but on
listWidth = listWidth - scrollWidth
totColWidth = 0 # Width of all columns except last one.
- for col in range(numCols-1):
- totColWidth = totColWidth + self.GetColumnWidth(col)
+ for col in range(numCols):
+ if col != (resizeCol-1):
+ totColWidth = totColWidth + self.GetColumnWidth(col)
- lastColWidth = self.GetColumnWidth(numCols - 1)
+ resizeColWidth = self.GetColumnWidth(resizeCol - 1)
- if totColWidth + self._lastColMinWidth > listWidth:
+ if totColWidth + self._resizeColMinWidth > listWidth:
# We haven't got the width to show the last column at its minimum
# width -> set it to its minimum width and allow the horizontal
# scrollbar to show.
- self.SetColumnWidth(numCols-1, self._lastColMinWidth)
+ self.SetColumnWidth(resizeCol-1, self._resizeColMinWidth)
return
# Resize the last column to take up the remaining available space.
- self.SetColumnWidth(numCols-1, listWidth - totColWidth)
+ self.SetColumnWidth(resizeCol-1, listWidth - totColWidth)
+
editor = wx.PreTextCtrl()
style =wx.TE_PROCESS_ENTER|wx.TE_PROCESS_TAB|wx.TE_RICH2
- style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT, wx.LIST_FORMAT_RIGHT: wx.TE_RIGHT, wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE}[col_style]
+ style |= {wx.LIST_FORMAT_LEFT: wx.TE_LEFT,
+ wx.LIST_FORMAT_RIGHT: wx.TE_RIGHT,
+ wx.LIST_FORMAT_CENTRE : wx.TE_CENTRE
+ }[col_style]
editor.Create(self, -1, style=style)
editor.SetBackgroundColour(wx.Colour(red=255,green=255,blue=175)) #Yellow
scrolloffset = self.GetScrollPos(wx.HORIZONTAL)
- # scroll foreward
+ # scroll forward
if x0+x1-scrolloffset > self.GetSize()[0]:
if wx.Platform == "__WXMSW__":
# don't start scrolling unless we really need to
# Since we can not programmatically scroll the ListCtrl
# close the editor so the user can scroll and open the editor
# again
+ self.editor.SetValue(self.GetItem(row, col).GetText())
+ self.curRow = row
+ self.curCol = col
self.CloseEditor()
return