Menu

#109 Some buttons disabled but not greyed out while building or running

Next_Release
invalid
Compiler (40)
Bug_Report
2021-06-30
2014-12-07
Riot
No

When building running a program, the "build" and debug buttons are greyed out, but the "run", "build and run", and "rebuild" buttons are not - even though they cannot be clicked.

Discussion

  • ollydbg

    ollydbg - 2014-12-08
    • labels: --> Compiler
     
  • Teodor Petrov

    Teodor Petrov - 2014-12-08

    What version are you using?
    What kind of project?
    Does it happen with simple hello world project?
    I've tried it and it doesn't happen on my machine.

     
  • ollydbg

    ollydbg - 2014-12-08

    Hi, OBF, I'm using the nightly build rev10016, and I can reproduce this bug in a very simple hello world console project in my WinXP.

     
  • Riot

    Riot - 2014-12-08

    svn 10035, windows xp sp2 - it's probably been this way for a long time before that, though, I just never noticed.

     

    Last edit: Riot 2014-12-08
  • Teodor Petrov

    Teodor Petrov - 2014-12-08

    10050 here and it works as expected. Either it is something windows related or I don't know how to reproduce it here on Linux.

     
  • ollydbg

    ollydbg - 2014-12-10

    Maybe, it is a Windows related issue, I can see that even if the application is running, the "run" button in the toolbar is disabled partially, it is still shown in green color, but I can't click on it, so it looks like it is disabled, mean while, the build button is shown in gray color and get disabled totally. This is strange.

     
  • Riot

    Riot - 2014-12-10

    Indeed normally hovering the buttons has them "pop out" with an embossed effect:

    When they should be greyed out they no longer do this; only the abort button does:

    They just fail to change colour to match.

     
  • ollydbg

    ollydbg - 2014-12-11

    I guess this is a wx related bug under Windows, I just see the source code, and I don't see any thing wrong:

    We have:

    void CompilerGCC::OnUpdateUI(wxUpdateUIEvent& event)
    {
        cbProject* prj = Manager::Get()->GetProjectManager()->GetActiveProject();
        cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
        wxMenuBar* mbar = Manager::Get()->GetAppFrame()->GetMenuBar();
        bool running = IsRunning();
    
        cbPlugin *runningPlugin = Manager::Get()->GetProjectManager()->GetIsRunning();
        bool otherRunning = runningPlugin && runningPlugin != this;
        if (mbar)
        {
            mbar->Enable(idMenuCompile,          !running && (prj || ed) && !otherRunning);
            mbar->Enable(idMenuBuildWorkspace,   !running && prj &&         !otherRunning);
    //        mbar->Enable(idMenuCompileFromProjectManager, !running && prj);
            mbar->Enable(idMenuCompileFile,      !running && ed &&          !otherRunning);
    //        mbar->Enable(idMenuCompileFileFromProjectManager, !running && prj);
    //        mbar->Enable(idMenuCleanFileFromProjectManager,   !running && prj);
            mbar->Enable(idMenuRebuild,          !running && prj &&         !otherRunning);
            mbar->Enable(idMenuRebuildWorkspace, !running && prj &&         !otherRunning);
    //        mbar->Enable(idMenuRebuildFromProjectManager, !running && prj);
            mbar->Enable(idMenuClean,            !running && prj &&         !otherRunning);
            mbar->Enable(idMenuCleanWorkspace,   !running && prj &&         !otherRunning);
    //        mbar->Enable(idMenuCleanFromProjectManager, !running && prj);
            mbar->Enable(idMenuCompileAndRun,    !running && (prj || ed) && !otherRunning);
            mbar->Enable(idMenuRun, !running && (prj || ed) &&              !otherRunning);
            mbar->Enable(idMenuKillProcess,       running);
            mbar->Enable(idMenuSelectTarget,     !running && prj &&         !otherRunning);
    
            mbar->Enable(idMenuNextError,     !running && (prj || ed) && m_Errors.HasNextError()     && !otherRunning);
            mbar->Enable(idMenuPreviousError, !running && (prj || ed) && m_Errors.HasPreviousError() && !otherRunning);
            mbar->Enable(idMenuClearErrors,                                                             !otherRunning);
    
            // Project menu
            mbar->Enable(idMenuProjectCompilerOptions, !running && prj && !otherRunning);
            mbar->Enable(idMenuProjectProperties,      !running && prj && !otherRunning);
        }
    
        // enable/disable compiler toolbar buttons
        wxToolBar* tbar = m_pTbar;//Manager::Get()->GetAppWindow()->GetToolBar();
        if (tbar)
        {
            tbar->EnableTool(idMenuCompile,       !running && (prj || ed) && !otherRunning);
            tbar->EnableTool(idMenuRun,           !running && (prj || ed) && !otherRunning);
            tbar->EnableTool(idMenuCompileAndRun, !running && (prj || ed) && !otherRunning);
            tbar->EnableTool(idMenuRebuild,       !running && prj         && !otherRunning);
            tbar->EnableTool(idMenuKillProcess,    running && prj);
    
            m_pToolTarget = XRCCTRL(*tbar, "idToolTarget", wxChoice);
            if (m_pToolTarget)
                m_pToolTarget->Enable(!running && prj && !otherRunning);
        }
    
        // allow other UpdateUI handlers to process this event
        // *very* important! don't forget it...
        event.Skip();
    }
    

    and

    BEGIN_EVENT_TABLE(CompilerGCC, cbCompilerPlugin)
        EVT_UPDATE_UI(idMenuCompile,                       CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCompileTarget,                 CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCompileFromProjectManager,     CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuProjectCompilerOptions,        CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuTargetCompilerOptions,         CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuTargetCompilerOptionsSub,      CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCompileFile,                   CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCompileFileFromProjectManager, CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCleanFileFromProjectManager,   CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuRebuild,                       CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuRebuildTarget,                 CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuRebuildFromProjectManager,     CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuBuildWorkspace,                CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuRebuildWorkspace,              CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuClean,                         CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCleanWorkspace,                CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCleanTarget,                   CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCleanFromProjectManager,       CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuCompileAndRun,                 CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuRun,                           CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuKillProcess,                   CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuSelectTarget,                  CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuNextError,                     CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuPreviousError,                 CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuClearErrors,                   CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idMenuSettings,                      CompilerGCC::OnUpdateUI)
        EVT_UPDATE_UI(idToolTarget,                        CompilerGCC::OnUpdateUI)
    

    So, each ui (each menu item and toolbar item) will call the same OnUpdateUI function, thus this function will be called many times. I see that the menu status are correct disabled.

     
  • Teodor Petrov

    Teodor Petrov - 2014-12-11

    Can you find the first nightly where this is working?

     
    • Riot

      Riot - 2014-12-12

      Wish I had the time to do a manual binary search through the entire history of nightlies! I don't know if it's ever been different, though; it may always have been this way on win xp.

       
  • Morten MacFly

    Morten MacFly - 2015-02-07
    • Type: --> Undefined
     
  • Alpha

    Alpha - 2015-02-07
    • Type: Undefined --> Bug_Report
     
  • bluehazzard

    bluehazzard - 2017-12-13

    windows 7 wx3.0 all works as expected (buttons are greyed out on build)

     
  • bluehazzard

    bluehazzard - 2021-06-30
    • status: open --> invalid
    • assigned_to: bluehazzard
     
  • bluehazzard

    bluehazzard - 2021-06-30

    I close this bug, because i can not reproduce it with wx3.0 on windows...
    If someone can reproduce it we can reopen it

     

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.