[wxPython] wxFlexGridSizer at non-zero position

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] wxFlexGridSizer at non-zero position

alexander smishlajev-3
hello!

wxFlexGridSizer is incorrecly limiting the item sizes when placed at
non-zero position.  following patch was locally applied:

--- grids.py.orig Tue Nov 09 23:47:02 1999
+++ grids.py Fri Jan 07 19:20:20 2000
@@ -230,6 +230,8 @@
             for idx in self.growableCols:
                 self.colWidths[idx] = self.colWidths[idx] + delta
 
+        # bottom right corner
+        sz = wxSize(pt.x +sz.width, pt.y +sz.height)
         # Layout each cell
         x = pt.x
         for c in range(ncols):

best wishes,
alex.


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxFlexGridSizer at non-zero position

Robin Dunn
>
> wxFlexGridSizer is incorrecly limiting the item sizes when placed at
> non-zero position.  following patch was locally applied:
>

Thanks!  Do you have a simple test case that shows the problem before the
fix?

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!




_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] wxFlexGridSizer at non-zero position

alexander smishlajev-3
Robin Dunn wrote:
>
> Do you have a simple test case that shows the problem before the
> fix?

==== begin cut ====
from wxPython.wx import *
from wxPython.lib.grids import wxFlexGridSizer

class aFrame(wxFrame):
    def __init__(self, parent=NULL, id=-1, title="test"):
        wxFrame.__init__(self, parent, id, title)
        s =wxBoxSizer(wxVERTICAL)
        gs =wxFlexGridSizer(2, 2, 2, 2)
        for label in ('one', 'two', 'tree', 'four'):
            gs.Add(wxButton(self, -1, label, size=(100,100)), 1,
wxEXPAND)
        s.Add(gs, 1, wxEXPAND|wxALL, 50)
        self.SetSizer(s)
        self.SetAutoLayout(TRUE)
        s.Fit(self)

class MyApp(wxApp):
    def OnInit(self):
      frame =aFrame()
      self.SetTopWindow(frame)
      frame.Show(TRUE)
      return TRUE

app=MyApp(0)
app.MainLoop()
===== end cut =====

best wishes,
alex.


_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users