Author Topic: wxSmith, unable to center anything horizontally  (Read 3523 times)

Offline ouch

  • Almost regular
  • **
  • Posts: 223
wxSmith, unable to center anything horizontally
« on: June 10, 2015, 09:07:36 pm »
I'm trying to center buttons and stuff in a wxflexgridsizer but wxSmith is not letting me do this.I know of the changes made to wxWidgets that limits what direction you can center sizers. However it seems odd that I can't even center a button horizontally within one.

using codeblocks 32bit rev 10269 compiled against wxwidgets 2.8 on win 7 64 bit using 32bit tdm mingw 4.7.2.

Can anyone else reproduce this?

edit: should probably mention that while codeblocks is running wx 2.8 my app uses the latest git repo of wx 3.x.

edit2: also, if I add the wxALIGN_CENTER_HORIZONTAL flags manually to the code it works. So it really does seem to be something amiss with wxSmith.
« Last Edit: June 10, 2015, 09:34:56 pm by ouch »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12027
    • Travis build status
Re: wxSmith, unable to center anything horizontally
« Reply #1 on: June 10, 2015, 11:25:34 pm »
Patches welcome:)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxSmith, unable to center anything horizontally
« Reply #2 on: June 11, 2015, 09:30:01 pm »
I'm trying to center buttons and stuff in a wxflexgridsizer but wxSmith is not letting me do this.I know of the changes made to wxWidgets that limits what direction you can center sizers. However it seems odd that I can't even center a button horizontally within one.

using codeblocks 32bit rev 10269 compiled against wxwidgets 2.8 on win 7 64 bit using 32bit tdm mingw 4.7.2.

Can anyone else reproduce this?

edit: should probably mention that while codeblocks is running wx 2.8 my app uses the latest git repo of wx 3.x.

edit2: also, if I add the wxALIGN_CENTER_HORIZONTAL flags manually to the code it works. So it really does seem to be something amiss with wxSmith.
I made the changes and will see why this happens.
The changes should not affect flexgridsizer (if I remember correctly). And if it does it would probably be a bug.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxSmith, unable to center anything horizontally
« Reply #3 on: June 12, 2015, 12:51:42 am »
Should be fixed in trunk.
Really nasty beginners error.
Sorry and thanks for reporting !

Online Commaster

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: wxSmith, unable to center anything horizontally
« Reply #4 on: July 23, 2015, 01:00:32 pm »
The same happens, in my case, with BoxSizers. And it does change the place controls end up in the program. (i.e. Writing wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL manually in the generated code makes it look better)
Example: I usually press the middle RadioButton on the side bar and the actual selection moves either to the top center or left center, depending on the BoxSizer Orientation.

Ubuntu, svn 10358, wx2.8.12, x64.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: wxSmith, unable to center anything horizontally
« Reply #5 on: July 26, 2015, 10:18:18 am »
The same happens, in my case, with BoxSizers. And it does change the place controls end up in the program. (i.e. Writing wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL manually in the generated code makes it look better)
Example: I usually press the middle RadioButton on the side bar and the actual selection moves either to the top center or left center, depending on the BoxSizer Orientation.

Ubuntu, svn 10358, wx2.8.12, x64.
Can you please attach a sample project where this makes a difference ?
Using horizontal align inside a horizontal aligned boxsizer should do nothing (but leads to an assert in wx3).
If an attachement is too large, please send it to me via mail: my_nickname at codeblocks dot org ,

Online Commaster

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: wxSmith, unable to center anything horizontally
« Reply #6 on: July 27, 2015, 04:31:39 pm »
Can you please attach a sample project where this makes a difference ?
This should be a small sample project with some sort of a usecase.
You might want to fix the build options, if you are going to use my .cbp file.