Menu

#1173 wxSmith cannot load xrc files with wxToolBarAddOn in them

Undefined
wont-fix
nobody
None
Bug_Report
2022-01-12
2022-01-10
No

When loading a toolbar XRC file with a wxToolBarAddOn you get the following error in the log:
Could not open file '\src\plugins\clangd_client\src\resources\clcodecompletion_toolbar.xrc'.
The registered handler (wxSmith - MIME plugin) could not open it

I have tried all of the toolbar.xrc files in the CodeBlocks_wx31_64.cbp and they also fail to load.

Discussion

  • Miguel Gimenez

    Miguel Gimenez - 2022-01-10

    Looks like wxToolBarAddOn is an ancient (wxWidgets 2.5) component, and it does not exist anymore.

    Also, the names inside the file are not used in the code, so I think the file is a residue of a previous plugin that can be ditched.

    It was a custom handler

     

    Last edit: Miguel Gimenez 2022-01-10
    • Andrew Cottrell

      Andrew Cottrell - 2022-01-11

      Either I have done something wrong or I also need to make some code changes or something is missing because:
      1) I have renamed the following files by appending .old to them:
      src\plugins\contrib\BrowseTracker\BrowseTrackerToolbar.xrc.old
      src\plugins\compilergcc\resources\compiler_toolbar.xrc.old
      plugins\contrib\IncrementalSearch\IncrementalSearchToolbar.xrc.old
      src\plugins\contrib\NassiShneiderman\nassi_shneiderman_toolbar.xrc.old
      I did not rename the following:
      src\plugins\codecompletion\resources\codecompletion_toolbar.xrc
      src\src\resources\debugger_toolbar.xrc
      src\src\resources\main_toolbar.xrc
      2) Updated the BrowseTracker*.cbp to remove the zip line where it is just adding the BrowseTrackerToolbar.xrc file so it will build

      BUT after this C::B will not start due to code referencing wxToolBar's. I also get a wxwidget assert and then this assert is shown:
      [Window Title] wxWidgets Debug Alert
      [Main Instruction] A debugging check in this application has failed.
      [Content] ../../src/common/tbarbase.cpp(198): assert ""pos <= GetToolsCount()"" failed in InsertTool(): invalid position in wxToolBar::InsertTool()

      Did I miss something or did I just go to far and stuffed if up? Can you please point me in a the correct direction?

       
  • Andrew Cottrell

    Andrew Cottrell - 2022-01-11

    Do not try and hijack a bug report with your university work request as you should know better. Do NOT post support queries or questions in areas until you have found the correct place to post them as you have done this before and I am not the first to ask you to post in the correct area.

    [ollydbg: I remove the spam post]

     

    Last edit: ollydbg 2022-01-11
  • Miguel Gimenez

    Miguel Gimenez - 2022-01-11

    It is a C::B extension, used like this:

    bool CompilerGCC::BuildToolBar(wxToolBar* toolBar)
    {
        if (!IsAttached() || !toolBar)
            return false;
    
        m_pTbar = toolBar;
        Manager::Get()->AddonToolBar(toolBar, _T("compiler_toolbar"));
        m_pToolTarget = XRCCTRL(*toolBar, "idToolTarget", wxChoice);
        toolBar->Realize();
        toolBar->SetInitialSize();
        DoRecreateTargetMenu(); // make sure the tool target combo is up-to-date
        return true;
    }
    
    void Manager::AddonToolBar(wxToolBar* toolBar,wxString resid)
    {
        if (!toolBar)
            return;
        if (m_ToolbarHandler)
            m_ToolbarHandler->SetCurrentResourceID(resid);
        wxXmlResource::Get()->LoadObject(toolBar,nullptr,resid,_T("wxToolBarAddOn"));
        if (m_ToolbarHandler)
            m_ToolbarHandler->SetCurrentResourceID(wxString());
    }
    

    wxSmith does not recognize this custom object class.

     
  • Miguel Gimenez

    Miguel Gimenez - 2022-01-12
    • status: open --> wont-fix
     
  • Miguel Gimenez

    Miguel Gimenez - 2022-01-12

    Closing, too much work for something easily attainable with a text editor.

     

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.