Platform: GTK
Python Version: 2.7.3 on linux2
Dabo Version: 0.9.13
UI Version: 2.8.12.1 on wxGTK (gtk2)

Hi,
I have this CRUD with two columns of objects, the label column and the txtbox column. Now I want the label column not to expand, and the txtbox column to expand as the form is resized. To the right of these two columns I will have a dImage picture of the employee. Now the natural way to do it seemed to use a horizontal sizer to which a grid sizer and an image are appended. Did this, but I am not able to make the txtbox column grow to take all the available space. Using append with layout='x' won't do it. If I give a big size (with width) to one of the txtboxes then the layout='x' will expand all other columns to this size, but I have not been able to tell the sizer to expand to take the available space.

Is this doable?
What I'd like, have the input fields take horizontal space available but give them a minimum width.
What I can live with, have the input fields take horizontal space available.
Why the grid sizer? Because I want the input fields to be aligned vertically and the label and field be aligned horizontally.

Here goes minimum code that will exhibit the behaviour.

GridSizerTest.py :
--------------------------------------------------------------------------------
# -*- coding: utf-8 -*-
"""
Created on Mon Sep 23 13:58:10 2013

@author:
"""
import dabo
dabo.ui.loadUI('wx')


class tbTextBox(dabo.ui.dTextBox):
    ''' Sets common properties for dTextBox'''
    def initProperties(self):
        self.BorderStyle = 'sunken'


class PnlData(dabo.ui.dPanel):
    def afterInit(self):
        gSzr = dabo.ui.dGridSizer(HGap=10, VGap=5)

        lbl = dabo.ui.dLabel(self,
                             Caption='Apellido',
                             FontSize=12,
                             FontBold=False)
        gSzr.append(lbl, row=1, col=0, halign='left')
        txtbox = tbTextBox(self,
                           RegID='Apellido',
                           TextLength=70)
        gSzr.append(txtbox, row=1, col=1,
                    layout='expand')

        lbl = dabo.ui.dLabel(self,
                             Caption='Primer Nombre',
                             FontSize=12,
                             FontBold=False)
        gSzr.append(lbl, row=2, col=0, halign='left')
        txtbox = tbTextBox(self,
                           RegID='Nombre',
                           TextLength=70)
        gSzr.append(txtbox, row=2, col=1,
                    layout='expand')

        self.Sizer = dabo.ui.dSizer('v')
        self.Sizer.append1x(gSzr, border=15)


class PnlEditor(dabo.ui.dPanel):
    def afterInit(self):
        self.Sizer = vs = dabo.ui.dSizer('v')

        pnlData = PnlData(self)
        vs.append1x(pnlData)


class GSzrTest(dabo.ui.dForm):
    def initProperties(self):
        self.Caption = 'Tarjetas'
        self.ShowStatusBar = False

    def afterInit(self):
        self.SetMinSize((700, 400))

        editPnl = PnlEditor(self)
        self.Sizer = dabo.ui.dSizer('v')
        self.Sizer.append1x(editPnl)
# Needed starting with wx 2.7, for the first control to have the focus:
        self.setFocus()

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]

Reply via email to