Menu

#789 [wxSmith] Sizer and wxAUI bugs

Undefined
open
Bug_Report
2023-01-13
2019-01-19
bluehazzard
No

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

Discussion

  • bluehazzard

    bluehazzard - 2019-01-19

    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.

     
  • bluehazzard

    bluehazzard - 2019-01-20
    • labels: --> wxSmith, wxAUI
    • Type: Undefined --> Bug_Report
     
  • ollydbg

    ollydbg - 2019-01-24

    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

     
  • ollydbg

    ollydbg - 2019-01-24

    I basically read the patch, and I think it is good! Thanks.

     
  • Teodor Petrov

    Teodor Petrov - 2019-01-24

    Would it be possible to separate this in one patch per problem?

     
  • Teodor Petrov

    Teodor Petrov - 2019-01-24

    Codefd is not a good name...

     
  • bluehazzard

    bluehazzard - 2019-02-18

    Would it be possible to separate this in one patch per problem?

    of course, patch for 1) is attached

    Codefd is not a good name...
    CodeGeneratorForDestructor better, or CodefDestructor or CodeForDestructor?

     
  • bluehazzard

    bluehazzard - 2019-02-18
    • assigned_to: bluehazzard
     
  • Teodor Petrov

    Teodor Petrov - 2019-02-19

    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?

     
    • ollydbg

      ollydbg - 2019-02-20

      I think "Codef" means "Code format", like OBF said.

       
      • bluehazzard

        bluehazzard - 2019-02-20

        So CodeFormatDestructor, or CodeFDestructor ? I do not know...

         
  • Teodor Petrov

    Teodor Petrov - 2019-05-08

    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
  • bluehazzard

    bluehazzard - 2019-05-08

    About the name, I'd choose DestructorCodeF, IMO

    i agree...

    Why are there 3 versions of CodeDestructorFormat? It looks too much to me. You call it in a single place...

    The target function is CodeDestructorF(wxsCoderContext* Context,const wxChar* Fmt,...) for convenience there are the two functions

    CodeDestructorF(const wxChar* Fmt,...)
    CodeDestructorF(const wxString &Fmt,...)
    

    so 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...

    If you have no intention to fix the TODOs then remove them

    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...

    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.

    its an inline function so the cost is zero. But anyway i changed it, because i agree with this

     
  • Miguel Gimenez

    Miguel Gimenez - 2023-01-13

    For the record, part 1 was fixed by [r11707]. Part 2 seems pending.

     

    Related

    Commit: [r11707]


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.