El 24/11/13 16:36, Ed Leafe escribió:
On Nov 24, 2013, at 12:56 PM, Ricardo Aráoz <[email protected]> wrote:
Hi, having some trouble setting up a grid sizer. Just can't find what I'm doing
wrong.
I've simplified the thing down to a form with 3 rows. First and second row are
text boxes while the third row has an edit box. I want the first two rows to
keep their original sizes whilst the third should grow in both dimensions.
That doesn't sound possible. The expansion properties apply to the entire
column or row, not to individual cells.
Sorry my confusion was due that both the GridBagSizer and the
RowColSizer (in wx) allow a specific cell in a gridSizer to grow in one
or two dimensions.
On the other hand there is something funny going on here.
Check the following code, this will work exactly as I want it to work
(the edit box will expand to fill the free space in both dimensions),
but it will only work for col1 row1, if you add another dLabel-dTextBox
row and want to put the edit box in col2 row2 it won't work (all col and
row numbers are zero based) :
# -*- coding: utf-8 -*-
import dabo
dabo.ui.loadUI('wx')
class PnlEditor(dabo.ui.dPanel):
def afterInit(self):
gSzr = dabo.ui.dGridSizer(HGap=10, VGap=5)
lbl = dabo.ui.dLabel(self,
Caption='TextBox 1',
FontSize=12,
FontBold=False)
ctrl = dabo.ui.dTextBox(self)
gSzr.append(lbl, alignment=("top", "right"))
gSzr.append(ctrl)
lbl = dabo.ui.dLabel(self,
Caption='EditBox',
FontSize=12,
FontBold=False)
ctrl = dabo.ui.dEditBox(self)
gSzr.append(lbl, 'expand', alignment=("top", "right"))
gSzr.append(ctrl, 'expand')
gSzr.setColExpand(True, 1)
gSzr.setRowExpand(True, 1)
self.Sizer = dabo.ui.dSizer('v')
self.Sizer.append1x(gSzr, border=15)
class GSzrTest(dabo.ui.dForm):
def afterInit(self):
editPnl = PnlEditor(self)
self.Sizer = dabo.ui.dSizer('v')
self.Sizer.append1x(editPnl)
app = dabo.dApp()
app.MainFormClass = GSzrTest
app.start()
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[email protected]