X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b881fc787d2823bdd8a415080b82feee90804a17..f78e4942ec0f3f6abd2992502e2d6c5c2e8e55f6:/wxPython/wx/lib/rcsizer.py?ds=sidebyside diff --git a/wxPython/wx/lib/rcsizer.py b/wxPython/wx/lib/rcsizer.py index a95485b51f..30a06ca0ef 100644 --- a/wxPython/wx/lib/rcsizer.py +++ b/wxPython/wx/lib/rcsizer.py @@ -14,10 +14,14 @@ # o 2.5 compatability update. # o There appears to be a prob with the wx.PySizer.GetSize() method. # +# 12/23/2003 - Jeff Grimmett (grimmtooth@softhome.net) +# +# o wx.PySizer.GetSize() method working right now. +# """ -A pure-Python wxSizer that lays out items in a grid similar to -wxFlexGridSizer but item position is not implicit but explicitly +A pure-Python Sizer that lays out items in a grid similar to +wx.FlexGridSizer but item position is not implicit but explicitly specified by row and col, and row/col spanning is supported. Adapted from code by Niki Spahiev. @@ -71,9 +75,11 @@ class RowColSizer(wx.PySizer): #-------------------------------------------------- def Add(self, item, option=0, flag=0, border=0, - row=-1, col=-1, # row, col and spanning can be specified individually... + # row, col and spanning can be specified individually... + row=-1, col=-1, rowspan=1, colspan=1, - pos=None, size=None, # or as tuples (row,col) and (rowspan,colspan) + # or as tuples (row,col) and (rowspan,colspan) + pos=None, size=None, ): if pos is not None: @@ -89,7 +95,7 @@ class RowColSizer(wx.PySizer): # flag = flag | wx.EXPAND wx.PySizer.Add(self, item, option, flag, border, - userData=(row, col, row+rowspan, col+colspan)) + userData=(row, col, row+rowspan, col+colspan)) #AddWindow = Add #AddSizer = Add @@ -107,8 +113,8 @@ class RowColSizer(wx.PySizer): assert row != -1, "Row must be specified" assert col != -1, "Column must be specified" - wx.PySizer.AddSpacer(self, (width, height), option, flag, border, - userData=(row, col, row+rowspan, col+colspan)) + wx.PySizer.Add(self, (width, height), option, flag, border, + userData=(row, col, row+rowspan, col+colspan)) #-------------------------------------------------- def _add( self, size, dim ):