Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ouch on June 10, 2015, 09:07:36 pm

Title: wxSmith, unable to center anything horizontally
Post by: ouch 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.
Title: Re: wxSmith, unable to center anything horizontally
Post by: oBFusCATed on June 10, 2015, 11:25:34 pm
Patches welcome:)
Title: Re: wxSmith, unable to center anything horizontally
Post by: Jenna 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.
Title: Re: wxSmith, unable to center anything horizontally
Post by: Jenna on June 12, 2015, 12:51:42 am
Should be fixed in trunk.
Really nasty beginners error.
Sorry and thanks for reporting !
Title: Re: wxSmith, unable to center anything horizontally
Post by: Commaster 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.
Title: Re: wxSmith, unable to center anything horizontally
Post by: Jenna 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 ,
Title: Re: wxSmith, unable to center anything horizontally
Post by: Commaster 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.