David Anderson wrote:
Hi, take a look at the attached screenshot
I've made like this:
On the top there's a BoxSizer(wx.HORIZONTAL),
then put there, the Static text on the left, with wx.ALIGN_LEFT, and the logo on the right, with wx.ALIGN_RIGHT,
Which I called InnerHBox
below it has a BoxSizer(wx.Vertical), named InnerVBox, where I've added, the Static Text's (Add order, Order item , etc), and ah wx.GridSizer,
then it has the OuterVBox, which I've added the InnerVBox with wx.ALIGN_TOP, then the innerVBOX, with wx.ALIGN_CENTER
The thing is, I want the logo to be in the extreme left top corner,
This should be doable with alignment flags when you add the item to the sizer. If that sizer is in a sizer itself, then make sure that it is expanded so the sizer will take the whole width of the window.
put the grid sizer exactly on the middle of the screen,
If you have the grid sizer in a horizontal box sizer with a spacer before and after it, and give each of the spacers a proportion value of 1, then that should do it. Again, you need to make sure that the horizontal sizer has the right flags when it is added to the parent sizer so that it will occupy the full width of the window.
and I have another doubt, the GridSizer items are StaticTexts with a size that is (200,20) how can I put the text exactly on the mid of the White Bg?
If the white portion is the StaticText widget itself (with a white background) then there isn't a way to do it because sizers can only do alignment for the whole widget and you've already maximized the widget and the sizer doesn't have any space left to align it within. The StaticText does have some alignment ability itself, but only horizontally, not vertically. One way to do what you want is to use another panel to make the white background portion, and then make the static text be a child of that panel and leave it at its default size. Give that panel a sizer to manage the position and alignment of the text within that space.
The other item you have on the image is the spacing between the text and the edge of the window. You can do that by putting the whole thing in another sizer that has the flags and border settings you need.
···
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!