Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

wxSmith Feature request: Option to disable calls to Fit() and SetSizeHints()

<< < (7/8) > >>

lesnewell:

--- Quote from: oBFusCATed on March 04, 2021, 12:43:14 am ---1. Descriptive commit message. I can gather one from the topic, but I'd be happier if you can provide one.
--- End quote ---
Changes to wxSmith code generation:
Stop SetSizeHints() being used for every window containing a sizer and make laying out the window optional.

--- Quote ---2. A real name or nickname. I like to give credit to people who provide patches and svn doesn't allow separation between author and committer name, so I write it down in the commit message.
--- End quote ---
Les Newell

--- Quote ---3. A description for the tooltip for the "Lay out the window" property.
--- End quote ---
Automatically lay out the window. If disabled you must call Layout(), Fit() or SetSizeHints() in your code.


--- Quote ---Just a note: You've messed up the load/save of the layout property, but I've fixed it. Re using parent_arg wasn't a good idea. ;)
--- End quote ---
Yeah, copy and paste isn't always your friend. The last patch fixes this. If you changed it yourself, please use the name 'layout_window' so it doesn't break a project I'm already using this on.

oBFusCATed:
Your explanations are too brief for my liking. :(

lesnewell:
Ok,  how about this for the commit message
Changes to wxSmith code generation:
Stop SetSizeHints() being used for every window containing a sizer. The wxWidgets documentation recommends SetSizeHints to only be used on top level windows https://docs.wxwidgets.org/3.0/classwx_sizer.html#abc460cd0e2bb3bde72142fdb434bc546
Added 'Lay out window' option for top level windows. If enabled (the default) the wxWidgets layout sytem is called and the window size is set using SetSizeHints(), Fit() or Layout() as appropriate. If disabled no calls are made to the layout system, allowing extra controls to be added/removed outside of wxSmith managed code. Note: after adding,removing or hiding controls you need to call SetSizeHints, Fit() or Layout().

I'm not sure if the tool tip should be much longer. IMHO tool tips should be fairly short. It's likely that this function is only of much use to people who have a reasonable understanding of how windows are laid out. In that case the tip is probably enough as it is.

By the way are you adding tips for all of the other options?

oBFusCATed:
Thanks this is a lot better.

The changes I plan to commit are in this branch: https://github.com/obfuscated/codeblocks_sf/tree/wxsmith/layout
Please test and verify I'm not missing something.

I have no time or knowledge to add tooltips for all properties, but this is a start to show how it is done.
Patches welcome. Ideally we should add for all of them.

lesnewell:
I just looked at the code, built and tested it. Everything looks as I would expect. Thanks.


--- Quote ---I have no time or knowledge to add tooltips for all properties, but this is a start to show how it is done.
Patches welcome. Ideally we should add for all of them.
--- End quote ---
Yes, that's quite a bit of work. That's why I wan't to keen on adding tool tips.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version