Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • xrc unknown control sizer problem

    3 answers - 665 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi,
    I'm having problems with a grid control which I attach to an xrc 'unknown
    control' node. I'd like the grid to appear in its minsize and not be expanded by
    the sizer. The attached examples demonstrates the problem. The grid control
    appears to be larger than the space the sizer thinks it needs. Therefor it is
    partly hidden by the buttons. Why isn't the sizer respecting the grid's minsize?
    Any ideas?
    Regards, Christian
    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.1 | | 1038 bytes | |

    Christian Kristukat wrote:
    Hi,
    I'm having problems with a grid control which I attach to an xrc 'unknown
    control' node. I'd like the grid to appear in its minsize and not be expanded by
    the sizer. The attached examples demonstrates the problem. The grid control
    appears to be larger than the space the sizer thinks it needs. Therefor it is
    partly hidden by the buttons. Why isn't the sizer respecting the grid's minsize?
    Any ideas?

    When a "unknown control" is used in XRC it actually creates a panel to
    put into that spot, and then when you use the AttachUnknownControl
    method it reparents your control to that panel. So basically there is
    an extra window between your grid and the panel that you thought was its
    parent.

    There is a sizer on that panel, but it looks like it is not behaving as
    expected. There is an easy workaround though. After you do the
    AttachUnknownControl do something like this:

    grid.GetParent().SetMinSize(grid.GetMinSize())
  • No.2 | | 1798 bytes | |

    Robin Dunn wrote:
    Christian Kristukat wrote:
    >Hi,
    >I'm having problems with a grid control which I attach to an xrc 'unknown
    >control' node. I'd like the grid to appear in its minsize and not be
    >expanded by
    >the sizer. The attached examples demonstrates the problem. The grid
    >control
    >appears to be larger than the space the sizer thinks it needs.
    >Therefor it is
    >partly hidden by the buttons. Why isn't the sizer respecting the
    >grid's minsize?
    >Any ideas?


    When a "unknown control" is used in XRC it actually creates a panel to
    put into that spot, and then when you use the AttachUnknownControl
    method it reparents your control to that panel. So basically there is
    an extra window between your grid and the panel that you thought was its
    parent.

    There is a sizer on that panel, but it looks like it is not behaving as
    expected. There is an easy workaround though. After you do the
    AttachUnknownControl do something like this:

    grid.GetParent().SetMinSize(grid.GetMinSize())

    I see. Thanks a lot. I noticed that in addition a grid.Layout() is needed
    thereafter.
    Btw. can I supress the display of one of the scrollbars in the grid? As this
    grid is quite small I always want to display it in its full representation.

    Regards, Christian

    ps: I just recieved your book in Japan. I'm pleased that I already knew much of
    its content by reading that list and the demo and I really enjoyed the part
    concerning MVC.

    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.3 | | 832 bytes | |

    Christian Kristukat wrote:

    Btw. can I supress the display of one of the scrollbars in the grid? As this
    grid is quite small I always want to display it in its full representation.

    This is a tricky side-effect of how the scrolled window handles its
    virtual size and scrolling. The scrollbars are set to scroll a certain
    amount when clicking on the arrow buttons, a.k.a. the scroll rate. The
    virtual size set for a scrolled window is then rounded up to the next
    multiple of this scroll rate in order for the whole virtual area of the
    window to be displayed when scrolling. Most of the time this results in
    the virtual size being just a little bigger than expected, and if you
    size the window to be same size as the expected virtual size then
    scrollbars appear in order to show the extra space.

Re: xrc unknown control sizer problem


max 4000 letters.
Your nickname that display:
In order to stop the spam: 3 + 2 =
QUESTION ON "Python"

EMSDN.COM