Re: Centring hyphertextctrl widgets
"Brendan Simon (eTRIX)" <[email protected]> Mon, 2 Sep 2019 22:20:24 +1000
| Newsgroups | gmane.comp.python.wxglade |
|---|---|
| Organization | eTRIX pty ltd |
| Message-ID | <[email protected]> |
On 2/9/19 10:08 pm, Brendan Simon (eTRIX) wrote:
> I'm having trouble centering some hypertextctrl widgets on Windows
> (Win 10), whereas MacOS works ok.
>
> I thought it was just a problem with the hypertextctrl itself as the
> docs state it doesn't support align centre or align right on Windows
> (why I don't know),
> but I thought I should be able to have the sizer expand
> proportionally, and the widget be centered within the sizer (with the
> widget set to the minimum size to hold the text.
>
> Is that right?
>
> The setup is a horizontal sizer (say 3 columns), with the
> hypertextctrl in one (or more) slots, the layout set with a proportion
> of 1 and alignment of centre. When I click on the widget in the
> design window I see that the blue handles take the entire size of slot
> (much larger than the text). With Windows not honouring the align
> centre flag of the widget, it means it will be left justifed (on Mac
> the align centre of widget works ok).
>
> How can I have proportion = 1 to expand the sizer slot, AND, have the
> widget at the minimum size and centred within the slot. I think this
> should be platform neutral (i.e. not be platform specific as it's just
> sizer machinery), right?
I tried with StaticText (instead of hypherlinkctrl) and it does the same
thing. i.e. the widget expands to the entire sizer slot, but it does
honour the align centre style of the widget.
Anyhow, I didn't notice it before but there is a wxSHAPED style in the
layout tab, and that does what I want. It reduces the size of the
widget to the minimum and the widget can be centred within the slot :)
And the same happens for hypherlinkctrl (as one would expect).
I think this is the answer, although the tooltip for wxSHAPED seems to
suggest the opposite.
"The item will be expanded as much as possible while also
maintaining it's aspect ratio."
"Proportion must be 0 in this case."
I notice that selecting wxSHAPED also changes the proportion back to 0,
which is NOT what I want. Changing proportion back to 1 seems ok.
Brendan.
_______________________________________________
wxGlade-general mailing list
wxGlade-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/wxglade-general