Boa dialog not flexible as needed

Hi !

I have a problem.
I have a dialog with many options (editboxes, etc.) - see the attachment.

But I have been lost some resizing functionality... :slight_smile:

I use FlexGridSizer in code. But the big panel's area (in the rigth place) is unused by FlexGridSizer !
1. Why ?
2. How to force the sizer to use it ?
3. Why the subcomponents (TextCtrls, Spin) have to big height ? How to I "fit them" after I set them (with SetValue) ?

Thanx for fast help !
聽聽ft

Uhhhh....
The attachments are lost... I forget them.

#Boa:Dialog:dlg_EditInterval

import wx
import wx.lib.buttons

def create(parent):
    return dlg_EditInterval(parent)

[wxID_DLG_EDITINTERVAL, wxID_DLG_EDITINTERVALBTN_SHOWMOD,
wxID_DLG_EDITINTERVALBUTTON2, wxID_DLG_EDITINTERVALBUTTON3,
wxID_DLG_EDITINTERVALBUTTON4, wxID_DLG_EDITINTERVALBUTTON5,
wxID_DLG_EDITINTERVALCB_INTERVAL, wxID_DLG_EDITINTERVALCB_INTINFO,
wxID_DLG_EDITINTERVALCB_OUTPLACE, wxID_DLG_EDITINTERVALCH_GROUP,
wxID_DLG_EDITINTERVALCH_INTTYPE, wxID_DLG_EDITINTERVALCH_TYPE,
wxID_DLG_EDITINTERVALPANEL1, wxID_DLG_EDITINTERVALPANEL2,
wxID_DLG_EDITINTERVALPANEL3, wxID_DLG_EDITINTERVALPANEL4,
wxID_DLG_EDITINTERVALSPC_STUDENTS, wxID_DLG_EDITINTERVALSTATICLINE1,
wxID_DLG_EDITINTERVALSTATICTEXT1, wxID_DLG_EDITINTERVALSTATICTEXT10,
wxID_DLG_EDITINTERVALSTATICTEXT11, wxID_DLG_EDITINTERVALSTATICTEXT12,
wxID_DLG_EDITINTERVALSTATICTEXT14, wxID_DLG_EDITINTERVALSTATICTEXT15,
wxID_DLG_EDITINTERVALSTATICTEXT16, wxID_DLG_EDITINTERVALSTATICTEXT17,
wxID_DLG_EDITINTERVALSTATICTEXT18, wxID_DLG_EDITINTERVALSTATICTEXT2,
wxID_DLG_EDITINTERVALSTATICTEXT3, wxID_DLG_EDITINTERVALSTATICTEXT5,
wxID_DLG_EDITINTERVALSTATICTEXT6, wxID_DLG_EDITINTERVALSTATICTEXT7,
wxID_DLG_EDITINTERVALSTATICTEXT8, wxID_DLG_EDITINTERVALSTATICTEXT9,
wxID_DLG_EDITINTERVALSTT_DATE, wxID_DLG_EDITINTERVALST_INFO2,
wxID_DLG_EDITINTERVALTC_INFO1, wxID_DLG_EDITINTERVALTC_INTERVALSTR,
wxID_DLG_EDITINTERVALTC_MEMO, wxID_DLG_EDITINTERVALTC_MOD,
] = [wx.NewId() for _init_ctrls in range(40)]

class dlg_EditInterval(wx.Dialog):
    def _init_coll_gs_main_Items(self, parent):
        # generated method, don't edit

        parent.AddWindow(self.staticText1, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.staticText2, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText3, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.stt_Date, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText5, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.ch_Type, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText6, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.cb_interval, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText7, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.tc_intervalstr, 0, border=2,
              flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText8, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.panel4, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText9, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.ch_group, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText10, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.ch_inttype, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText11, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.tc_info1, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText12, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.st_info2, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText14, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.cb_intinfo, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText18, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.cb_outplace, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText15, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.spc_students, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText16, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.tc_memo, 0, border=2, flag=wx.EXPAND|wx.ALL)
        parent.AddWindow(self.staticText17, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.panel1, 0, border=2, flag=wx.EXPAND|wx.ALL)

    def _init_coll_bs_main_Items(self, parent):
        # generated method, don't edit

        parent.AddWindow(self.panel2, 1, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.staticLine1, 0, border=0, flag=wx.EXPAND)
        parent.AddWindow(self.panel3, 0, border=0, flag=wx.EXPAND)

    def _init_coll_bs_bottom_Items(self, parent):
        # generated method, don't edit

        parent.AddWindow(self.button2, 0, border=0, flag=0)
        parent.AddWindow(self.button3, 0, border=4, flag=wx.LEFT)
        parent.AddWindow(self.button4, 0, border=4, flag=wx.LEFT)
        parent.AddWindow(self.button5, 0, border=4, flag=wx.LEFT)

    def _init_coll_bs_pan1_Items(self, parent):
        # generated method, don't edit

        parent.AddWindow(self.tc_mod, 0, border=2, flag=wx.EXPAND | wx.RIGHT)
        parent.AddWindow(self.btn_showmod, 0, border=0, flag=0)

    def _init_sizers(self):
        # generated method, don't edit
        self.gs_main = wx.FlexGridSizer(cols=2, hgap=4, rows=10, vgap=4)

        self.bs_main = wx.BoxSizer(orient=wx.VERTICAL)

        self.bs_pan1 = wx.BoxSizer(orient=wx.HORIZONTAL)

        self.bs_bottom = wx.BoxSizer(orient=wx.HORIZONTAL)

        self._init_coll_gs_main_Items(self.gs_main)
        self._init_coll_bs_main_Items(self.bs_main)
        self._init_coll_bs_pan1_Items(self.bs_pan1)
        self._init_coll_bs_bottom_Items(self.bs_bottom)

        self.SetSizer(self.bs_main)
        self.panel1.SetSizer(self.bs_pan1)
        self.panel2.SetSizer(self.gs_main)
        self.panel3.SetSizer(self.bs_bottom)

    def _init_ctrls(self, prnt):
        # generated method, don't edit
        wx.Dialog.__init__(self, id=wxID_DLG_EDITINTERVAL,
              name=u'dlg_EditInterval', parent=prnt, pos=wx.Point(443, 140),
              size=wx.Size(417, 547), style=wx.DEFAULT_DIALOG_STYLE,
              title=u'Jelenl\xe9t szerkeszt\xe9se')
        self.SetClientSize(wx.Size(409, 513))
        self.Center(wx.BOTH)

        self.panel2 = wx.Panel(id=wxID_DLG_EDITINTERVALPANEL2, name='panel2',
              parent=self, pos=wx.Point(0, 0), size=wx.Size(409, 488),
              style=wx.TAB_TRAVERSAL)
        self.panel2.SetBackgroundColour(wx.Colour(238, 224, 183))

        self.staticText1 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT1,
              label=u'N\xe9v:', name='staticText1', parent=self.panel2,
              pos=wx.Point(0, 0), size=wx.Size(120, 32), style=0)

        self.staticText2 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT2,
              label=u'stt_Name', name='staticText2', parent=self.panel2,
              pos=wx.Point(126, 2), size=wx.Size(200, 28), style=0)

        self.staticText3 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT3,
              label=u'D\xe1tum:', name='staticText3', parent=self.panel2,
              pos=wx.Point(0, 36), size=wx.Size(120, 32), style=0)

        self.stt_Date = wx.StaticText(id=wxID_DLG_EDITINTERVALSTT_DATE,
              label='staticText4', name=u'stt_Date', parent=self.panel2,
              pos=wx.Point(126, 38), size=wx.Size(200, 28), style=0)

        self.staticText5 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT5,
              label=u'T\xedpus', name='staticText5', parent=self.panel2,
              pos=wx.Point(0, 72), size=wx.Size(120, 25), style=0)

        self.staticText6 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT6,
              label=u'Id\u0151tartam:', name='staticText6', parent=self.panel2,
              pos=wx.Point(0, 101), size=wx.Size(120, 25), style=0)

        self.staticText7 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT7,
              label=u'Id\u0151tartam r\xe9szletesen:', name='staticText7',
              parent=self.panel2, pos=wx.Point(0, 130), size=wx.Size(120, 32),
              style=0)

        self.cb_interval = wx.ComboBox(choices=,
              id=wxID_DLG_EDITINTERVALCB_INTERVAL, name=u'cb_interval',
              parent=self.panel2, pos=wx.Point(126, 103), size=wx.Size(200, 21),
              style=0, value='comboBox1')

        self.tc_intervalstr = wx.TextCtrl(id=wxID_DLG_EDITINTERVALTC_INTERVALSTR,
              name=u'tc_intervalstr', parent=self.panel2, pos=wx.Point(126,
              132), size=wx.Size(200, 28), style=0, value='textCtrl1')

        self.staticText8 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT8,
              label=u'Id\u0151szalag:', name='staticText8', parent=self.panel2,
              pos=wx.Point(0, 166), size=wx.Size(120, 13), style=0)

        self.staticText9 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT9,
              label=u'Csoport:', name='staticText9', parent=self.panel2,
              pos=wx.Point(0, 183), size=wx.Size(120, 25), style=0)

        self.staticText10 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT10,
              label=u'Jogc\xedm:', name='staticText10', parent=self.panel2,
              pos=wx.Point(0, 212), size=wx.Size(120, 25), style=0)

        self.ch_Type = wx.Choice(choices=, id=wxID_DLG_EDITINTERVALCH_TYPE,
              name=u'ch_Type', parent=self.panel2, pos=wx.Point(126, 74),
              size=wx.Size(200, 21), style=0)

        self.ch_group = wx.Choice(choices=, id=wxID_DLG_EDITINTERVALCH_GROUP,
              name=u'ch_group', parent=self.panel2, pos=wx.Point(126, 185),
              size=wx.Size(200, 21), style=0)

        self.ch_inttype = wx.Choice(choices=,
              id=wxID_DLG_EDITINTERVALCH_INTTYPE, name=u'ch_inttype',
              parent=self.panel2, pos=wx.Point(126, 214), size=wx.Size(200, 21),
              style=0)

        self.staticText11 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT11,
              label=u'Jogc\xedm r\xf6vid info:', name='staticText11',
              parent=self.panel2, pos=wx.Point(0, 241), size=wx.Size(120, 32),
              style=0)

        self.tc_info1 = wx.TextCtrl(id=wxID_DLG_EDITINTERVALTC_INFO1,
              name=u'tc_info1', parent=self.panel2, pos=wx.Point(126, 243),
              size=wx.Size(200, 28), style=0, value='textCtrl2')

        self.staticText12 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT12,
              label=u'Jogc\xedm teljes le\xedr\xe1sa:', name='staticText12',
              parent=self.panel2, pos=wx.Point(0, 277), size=wx.Size(120, 32),
              style=0)

        self.st_info2 = wx.StaticText(id=wxID_DLG_EDITINTERVALST_INFO2,
              label='staticText13', name=u'st_info2', parent=self.panel2,
              pos=wx.Point(126, 279), size=wx.Size(200, 28), style=0)

        self.staticText14 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT14,
              label=u'Jogc\xedm egy\xe9b info:', name='staticText14',
              parent=self.panel2, pos=wx.Point(0, 313), size=wx.Size(120, 25),
              style=0)

        self.staticText15 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT15,
              label=u'Oktatott hallgat\xf3k', name='staticText15',
              parent=self.panel2, pos=wx.Point(0, 371), size=wx.Size(120, 32),
              style=0)

        self.cb_intinfo = wx.ComboBox(choices=,
              id=wxID_DLG_EDITINTERVALCB_INTINFO, name=u'cb_intinfo',
              parent=self.panel2, pos=wx.Point(126, 315), size=wx.Size(200, 21),
              style=0, value='comboBox2')

        self.cb_outplace = wx.ComboBox(choices=,
              id=wxID_DLG_EDITINTERVALCB_OUTPLACE, name=u'cb_outplace',
              parent=self.panel2, pos=wx.Point(126, 344), size=wx.Size(200, 21),
              style=0, value='comboBox3')

        self.staticText16 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT16,
              label=u'Egy\xe9b inform\xe1ci\xf3k:', name='staticText16',
              parent=self.panel2, pos=wx.Point(0, 407), size=wx.Size(120, 32),
              style=0)

        self.spc_students = wx.SpinCtrl(id=wxID_DLG_EDITINTERVALSPC_STUDENTS,
              initial=0, max=100, min=0, name=u'spc_students',
              parent=self.panel2, pos=wx.Point(126, 373), size=wx.Size(200, 28),
              style=wx.SP_ARROW_KEYS)

        self.staticText17 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT17,
              label=u'M\xf3dos\xedt\xe1si info:', name='staticText17',
              parent=self.panel2, pos=wx.Point(0, 443), size=wx.Size(120, 32),
              style=0)

        self.tc_memo = wx.TextCtrl(id=wxID_DLG_EDITINTERVALTC_MEMO,
              name=u'tc_memo', parent=self.panel2, pos=wx.Point(126, 409),
              size=wx.Size(200, 28), style=0, value='textCtrl3')

        self.staticText18 = wx.StaticText(id=wxID_DLG_EDITINTERVALSTATICTEXT18,
              label=u'K\xfcls\u0151 helysz\xedn:', name='staticText18',
              parent=self.panel2, pos=wx.Point(0, 342), size=wx.Size(120, 25),
              style=0)

        self.panel1 = wx.Panel(id=wxID_DLG_EDITINTERVALPANEL1, name='panel1',
              parent=self.panel2, pos=wx.Point(126, 445), size=wx.Size(200, 28),
              style=wx.TAB_TRAVERSAL)

        self.tc_mod = wx.TextCtrl(id=wxID_DLG_EDITINTERVALTC_MOD,
              name=u'tc_mod', parent=self.panel1, pos=wx.Point(0, 0),
              size=wx.Size(100, 28), style=0, value='textCtrl4')

        self.btn_showmod = wx.Button(id=wxID_DLG_EDITINTERVALBTN_SHOWMOD,
              label=u'?', name=u'btn_showmod', parent=self.panel1,
              pos=wx.Point(102, 0), size=wx.Size(24, 23), style=0)

        self.staticLine1 = wx.StaticLine(id=wxID_DLG_EDITINTERVALSTATICLINE1,
              name='staticLine1', parent=self, pos=wx.Point(0, 488),
              size=wx.Size(409, 2), style=0)

        self.panel3 = wx.Panel(id=wxID_DLG_EDITINTERVALPANEL3, name='panel3',
              parent=self, pos=wx.Point(0, 490), size=wx.Size(409, 23),
              style=wx.TAB_TRAVERSAL)

        self.panel4 = wx.Panel(id=wxID_DLG_EDITINTERVALPANEL4, name='panel4',
              parent=self.panel2, pos=wx.Point(126, 168), size=wx.Size(200, 9),
              style=wx.TAB_TRAVERSAL)

        self.button2 = wx.Button(id=wxID_DLG_EDITINTERVALBUTTON2, label=u'Ok',
              name='button2', parent=self.panel3, pos=wx.Point(0, 0),
              size=wx.Size(75, 23), style=0)

        self.button3 = wx.Button(id=wxID_DLG_EDITINTERVALBUTTON3,
              label=u'Ok + \xdaj t\xe9tel', name='button3', parent=self.panel3,
              pos=wx.Point(79, 0), size=wx.Size(75, 23), style=0)

        self.button4 = wx.Button(id=wxID_DLG_EDITINTERVALBUTTON4,
              label=u'Ok + \xdaj nap', name='button4', parent=self.panel3,
              pos=wx.Point(158, 0), size=wx.Size(75, 23), style=0)

        self.button5 = wx.Button(id=wxID_DLG_EDITINTERVALBUTTON5,
              label=u'M\xe9gsem', name='button5', parent=self.panel3,
              pos=wx.Point(237, 0), size=wx.Size(75, 23), style=0)

        self._init_sizers()

    def __init__(self, parent):
        self._init_ctrls(parent)
        self.Fit()

if __name__ == '__main__':
    app = wx.PySimpleApp()
    wx.InitAllImageHandlers()
    dlg = create(None)
    try:
        dlg.ShowModal()
    finally:
        dlg.Destroy()
    app.MainLoop()

fowlertrainer@anonym.hu 铆rta:

路路路

Hi !

I have a problem.
I have a dialog with many options (editboxes, etc.) - see the attachment.

Hi,

I think you just want to make the second column of your flexgrid sizer growable (in Boa Forms Designer, select the sizer and in the Property editor props tab define the appropriate column to be growable.

I think Riaan just yesterday checked in a correction with regards to this, so you need to get the latest CVS version.

Attached is the edited version, note that I had to replace unicode 0151 with Unicode0151 as it was not reconized as a valid character. I also added an encoding line to your script, you should set it to the appropriate encoding.

See you
Werner

P.S. Please attach files in the future as inline files cause indentation problems when one tries to do copy/paste.
fowlertrainer@anonym.hu wrote:

dialog.py (15.2 KB)

路路路

Uhhhh....
The attachments are lost... I forget them.