layout problem

I’m still preparing the GUI for my App.

For now all by hand, so at the end i can’t figure out how to align 3 controls in one BoxSizer(wx.HORIZONTAL)

i want all controls inside to be in the centre.Some are a bit higher, some in the middle, some lower…

i know flag=wx.ALIGN_CENTRE_VERTICAL, but i don’t know where exactly to place it!

Here is the part of the code:

#PANEL3

bx3=wx.StaticBox(pnl3, -1, “”)

payment_label=wx.StaticText(pnl3, 8, ‘Начин на плащане:’)

paymentKind = [‘в брой’, ‘по банков път’, ‘с карта’]

ch_payment = wx.Choice( bx3,-1, choices = paymentKind)

btn_ok=wx.Button(pnl3, 23,‘запази’)

third=wx.BoxSizer(wx.HORIZONTAL)

third.Add(payment_label)

third.Add(ch_payment, wx.TOP)

third.AddSpacer(470)

third.AddSpacer(btn_ok)

sz3=wx.StaticBoxSizer(bx3,wx.HORIZONTAL)

sz3.Add(third)

szbx4=wx.BoxSizer(wx.HORIZONTAL)

szbx4.Add(sz3)

pnl3.Sizer=szbx4

I'm still preparing the GUI for my App.
For now all by hand, so at the end i can't figure out how to align 3
controls in one BoxSizer(wx.HORIZONTAL)
i want all controls inside to be in the centre.Some are a bit higher, some
in the middle, some lower....
i know flag=wx.ALIGN_CENTRE_VERTICAL, but i don't know where exactly to
place it!

All flags that "fine-adjust" the sizing of the widgets are put as
arguments to the sizer.Add(...) method...so, for example, from your
code snippet:

    third.Add(payment_label, flag=wx.ALIGN_CENTRE_VERTICAL)

If you want to put more than one flag, you separate them with the |
character (what is this called guys?), like:

    third.Add(payment_label, border=5, flag=wx.ALIGN_CENTRE_VERTICAL | wx.TOP)

Notice in this case I also added border=5, because putting wx.TOP is
meaningless if there is no border. TOP just means make the border
start from the top. So in your line here:

    third.Add(ch_payment, wx.TOP)

wx.TOP is meaningless.

Also,

        third.AddSpacer(btn_ok)

Why are you using AddSpacer to add a widget (a button)? You should
use third.Add(...)

Che

···

On Sun, Jun 9, 2013 at 2:44 PM, CPU IN THE BRAIN <cpuinthebrain@gmail.com> wrote:

The character | has many names, but Wikipedia lists it under the name vertical bar. See here for more names of it: https://en.wikipedia.org/wiki/Vertical_bar