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

Papercuts :)

<< < (3/5) > >>

Kazade:

--- Quote from: oBFusCATed on June 30, 2009, 01:42:12 pm ---Delete key does not work in the project tree and in the watch window (I should fix them, but the laziness wins every time I think of doing it :( )

--- End quote ---

Cool, added that to the list.

ollydbg:

--- Quote from: Kazade on June 30, 2009, 10:59:30 am ---OK, I ran the example, and double clicking the separator does nothing. The log output just says:

09:55:15: OnColBeginDrag: column 1 (width = 0 or 37).
09:55:15: OnColDragging: column 1 (width = 0 or 37).
09:55:15: OnColEndDrag: column 1 (width = 0 or 37).

So I guess it's a wxWidgets thing. I think that after compilation completes (and anywhere else that outputs to the log in a batch), setColumnWidth(2, wxLIST_AUTOSIZE) should be called once to resize everything.

--- End quote ---

Agree!
Searching the keyword "Build finished" directs me to these code below:


--- Code: ---void CompilerGCC::OnJobEnd(size_t procIndex, int exitCode)
{
//    Manager::Get()->GetMessageManager()->Log(m_PageIndex, _T("JobDone: index=%u, exitCode=%d"), procIndex, exitCode));
    m_timerIdleWakeUp.Stop();
    m_Pid[procIndex] = 0;
    m_Processes[procIndex] = 0;
    m_LastExitCode = exitCode;

    if (exitCode == 0 && !m_ProcessOutputFiles[procIndex].IsEmpty())
    {
        #if wxCHECK_VERSION(2, 9, 0)
        wxFFile f(m_ProcessOutputFiles[procIndex].wx_str(), _T("r"));
        #else
        wxFFile f(m_ProcessOutputFiles[procIndex].c_str(), _T("r"));
        #endif
        if (f.IsOpened())
        {
            size_t size = f.Length();
            f.Close();

            float displaySize;
            wxString units;
            if (size < 1024)
            {
                displaySize = (float)size;
                units = _("bytes");
            }
            else if (size < 1048576)
            {
                displaySize = (float)size / 1024.0f;
                units = _("KB");
            }
            else
            {
                displaySize = (float)size / 1048576.0f;
                units = _("MB");
            }
            wxString msg;
            #if wxCHECK_VERSION(2, 9, 0)
            msg.Printf(_("Output size is %.2f %s"), displaySize, units.wx_str());
            #else
            msg.Printf(_("Output size is %.2f %s"), displaySize, units.c_str());
            #endif
            LogMessage(msg, cltNormal);
        }
    }

    if (m_CommandQueue.GetCount() != 0 && exitCode == 0)
    {
        // continue running commands while last exit code was 0.
        DoRunQueue();
    }
    else
    {
        if (exitCode == 0)
        {
            if (IsProcessRunning())
            {
                DoRunQueue();
                return;
            }

            while (1)
            {
                BuildStateManagement();
                if (m_CommandQueue.GetCount())
                {
                    DoRunQueue();
                    return;
                }
                if (m_BuildState == bsNone && m_NextBuildState == bsNone)
                    break;
            }
        }
        m_CommandQueue.Clear();
        ResetBuildState();
        // clear any remaining jobs (e.g. in case of build errors)
        while (!m_BuildJobTargetsList.empty())
            m_BuildJobTargetsList.pop();


        // long int elapsed = wxGetElapsedTime() / 1000;
        wxLongLong localTime = wxGetLocalTimeMillis();
        wxLongLong duration = localTime - m_StartTimer;
        long int elapsed = duration.ToLong();
        elapsed /= 1000;
        int mins = elapsed / 60;
        int secs = (elapsed % 60);
        wxString msg = wxString::Format(_("Process terminated with status %d (%d minutes, %d seconds)"), exitCode, mins, secs);
        LogMessage(msg, exitCode == 0 ? cltWarning : cltError, ltAll, exitCode != 0);
        if (!m_CommandQueue.LastCommandWasRun())
        {
            wxString msg = wxString::Format(_("%d errors, %d warnings"), m_Errors.GetCount(cltError), m_Errors.GetCount(cltWarning));
            LogMessage(msg, exitCode == 0 ? cltWarning : cltError, ltAll, exitCode != 0);
            #if wxCHECK_VERSION(2, 9, 0)
            LogWarningOrError(cltNormal, 0, wxEmptyString, wxEmptyString, wxString::Format(_("=== Build finished: %s ==="), msg.wx_str()));
            #else
            LogWarningOrError(cltNormal, 0, wxEmptyString, wxEmptyString, wxString::Format(_("=== Build finished: %s ==="), msg.c_str()));
            #endif
            SaveBuildLog();
        }
        else
        {
            // last command was "Run"
            // force exit code to zero (0) or else debugger will think build failed if last run returned non-zero...
// TODO (mandrav##): Maybe create and use GetLastRunExitCode()? Is it needed?
            m_LastExitCode = 0;
        }
        Manager::Get()->GetLogManager()->Log(_T(" "), m_PageIndex); // blank line

        NotifyJobDone();

        if (!Manager::IsBatchBuild() && m_Errors.GetCount(cltError))
        {
            if (Manager::Get()->GetConfigManager(_T("message_manager"))->ReadBool(_T("/auto_show_build_errors"), true))
            {
                CodeBlocksLogEvent evtShow(cbEVT_SHOW_LOG_MANAGER);
                Manager::Get()->ProcessEvent(evtShow);
            }
            CodeBlocksLogEvent evtSwitch(cbEVT_SWITCH_TO_LOG_WINDOW, m_pListLog);
            Manager::Get()->ProcessEvent(evtSwitch);

            m_pListLog->FocusError(m_Errors.GetFirstError());
            // Build is not completed, so clear the progress bar
            if (m_Log->progress)
                m_Log->progress->SetValue(0);
        }
        else
        {
            if (m_RunAfterCompile)
            {
                m_RunAfterCompile = false;
                if (Run() == 0)
                    DoRunQueue();
            }
            else if (!Manager::IsBatchBuild())
            {
                // don't close the message manager (if auto-hiding), if warnings are required to keep it open
                if (m_Errors.GetCount(cltWarning) &&
                    Manager::Get()->GetConfigManager(_T("message_manager"))->ReadBool(_T("/auto_show_build_warnings"), true))
                {
                    CodeBlocksLogEvent evtShow(cbEVT_SHOW_LOG_MANAGER);
                    Manager::Get()->ProcessEvent(evtShow);

                    CodeBlocksLogEvent evtSwitch(cbEVT_SWITCH_TO_LOG_WINDOW, m_pListLog);
                    Manager::Get()->ProcessEvent(evtSwitch);
                }
                else // if message manager is auto-hiding, unlock it (i.e. close it)
                {
                    CodeBlocksLogEvent evtShow(cbEVT_HIDE_LOG_MANAGER);
                    Manager::Get()->ProcessEvent(evtShow);
                }
            }
        }

        m_RunAfterCompile = false;

        // no matter what happened with the build, return the focus to the active editor
        cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinEditor(Manager::Get()->GetEditorManager()->GetActiveEditor());
        if (ed)
            ed->GetControl()->SetFocus();
    }
}

--- End code ---

So, this is the best time to call auto_size column. :D



Here, another bug:
I can't use "thread search" in "compilergcc.cpp", a message box shows this file can't be opened. When I translate the encoding  from "UTF8 without BOM" to "ANSI" (using NotePad++), then thread search can work now. but this time, Gcc( mingw) will complain "legal character near line 3483


--- Code: ---        wxString Quoted = message;
        Quoted.Replace(_T("‘"), _T("\""), true);
        Quoted.Replace(_T("’"), _T("\""), true);
        m_BuildLogContents << Quoted;

--- End code ---


Can anyone reproduce this problem?  :D


By the way, is this a filed bug in wxWidgets?

http://trac.wxwidgets.org/ticket/9925

(at least, this bug is not happened in Windows )

Kazade:
Cool OK, we have 9 bugs/issues now. 1 more then I'll call it a day and begin working through them. If anyone else can fix them, or has the time to report them as bugs on Berlios then feel free.

ollydbg:
Hi, I have reported this bug on the wxWidgets maillist, and here is an answer from a developer.


--- Quote ---Yes, the generic wxListCtrl version simply doesn't implement this (see
wxListHeaderWindow::OnMouse()). It shouldn't be difficult to add but
personally I'd prefer to replace wxListHeaderWindow with wxHeaderCtrl if we
modify this code at all as it has other advantages.

 Regards,
VZ

--- End quote ---

ollydbg:
Hi, all:

I have fix this problem, see this patch. At least this patch works fin in Windows, Can someone explain under Linux? Thanks!
And any comments?


--- Code: ---Index: compilergcc.cpp
===================================================================
--- compilergcc.cpp (revision 5679)
+++ compilergcc.cpp (working copy)
@@ -3715,6 +3715,7 @@
             #else
             LogWarningOrError(cltNormal, 0, wxEmptyString, wxEmptyString, wxString::Format(_("=== Build finished: %s ==="), msg.c_str()));
             #endif
+            m_pListLog->GetListControl()->SetColumnWidth(2, wxLIST_AUTOSIZE);
             SaveBuildLog();
         }
         else
Index: compilermessages.h
===================================================================
--- compilermessages.h (revision 5679)
+++ compilermessages.h (working copy)
@@ -21,6 +21,7 @@
         virtual void FocusError(int nr);
 
         virtual wxWindow* CreateControl(wxWindow* parent);
+        wxListCtrl* GetListControl(){ return control ; }
     private:
         void OnClick(wxCommandEvent& event);
         void OnDoubleClick(wxCommandEvent& event);

--- End code ---

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version