This is a bug report from this forum thread:
http://forums.codeblocks.org/index.php/topic,23011.msg156400.html#msg156400
1) Panel names must be unique
2) AuiManager::UnInit() has to be added to the destructor of the window code
3) Adding sizer and sub elements will cause wrong code to be generated
This is a big patch is a fix for problem 1) and 2)
1) is only one line.
2) Adds the code generation for the destructor code. I think this was intended from the begining, but never implemented.
related: https://sourceforge.net/p/codeblocks/tickets/665/
Aha, about the problem 2), I also mention this bug in the wx's discussion, see the last post here: Re: assert GetEventHandler()== this failed
I basically read the patch, and I think it is good! Thanks.
Would it be possible to separate this in one patch per problem?
Codefd is not a good name...
of course, patch for 1) is attached
The original Codef I think means code format or something similar.
About the last patch:
1. please remove the useless spaces
2. can you add a comment what this new code does?
I think "Codef" means "Code format", like OBF said.
So CodeFormatDestructor, or CodeFDestructor ? I do not know...
Ok, here are the two patches reworked
Patch _1 Looks fine. I'd use operator+=, but it doesn't matter.
Patch _2:
1. About the name, I'd choose DestructorCodeF, IMO
2. Why are there 3 versions of CodeDestructorFormat? It looks too much to me. You call it in a single place...
3. If you have no intention to fix the TODOs then remove them
4. Don't call GetCoderContext more than once in a function, I don't know if it is really expencive, but this is sloppy and hard to read.
p.s. I have very very vague idea how wxSmith works...
Last edit: Teodor Petrov 2019-05-08
i agree...
The target function is
CodeDestructorF(wxsCoderContext* Context,const wxChar* Fmt,...)
for convenience there are the two functionsso you can omit one parameter and use "" or wxString(). I do not think they are too mutch. Beside the existing Codef function has the same signatures and i think they should be symmetrical...
I am not sure what to do... The whole code is without any call to a codeblocks specific function. I think logging an error is good for finding the error fast, but i do not like to introduce codeblock specific code in a so clean environment. I think 1. is more important than 2...
its an inline function so the cost is zero. But anyway i changed it, because i agree with this
For the record, part 1 was fixed by [r11707]. Part 2 seems pending.
Related
Commit: [r11707]