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

Feature Request: Full pathname in editors list

<< < (3/4) > >>

tiwag:
_HEAD\src\src\main.cpp(936):

--- Code: ---void MainFrame::DoUpdateStatusBar()
{
#if wxUSE_STATUSBAR
    if (!GetStatusBar())
        return;
    cbEditor* ed = m_pEdMan->GetBuiltinActiveEditor();
    if (ed)
    {
        int pos = ed->GetControl()->GetCurrentPos();
        wxString msg;
        msg.Printf(_("Line %d, Column %d"), ed->GetControl()->GetCurrentLine() + 1, ed->GetControl()->GetColumn(pos) + 1);
        SetStatusText(msg, 1);
        SetStatusText(ed->GetControl()->GetOvertype() ? _("Overwrite") : _("Insert"), 2);
        SetStatusText(ed->GetModified() ? _("Modified") : wxEmptyString, 3);
        SetStatusText(ed->GetControl()->GetReadOnly() ? _("Read only") : _("Read/Write"), 4);
        SetStatusText(ed->GetFilename(), 0); //tiwag 050818
    }
    else
    {
        SetStatusText(_("Welcome to "APP_NAME"!"));  //tiwag 050818
        SetStatusText(wxEmptyString, 1);
        SetStatusText(wxEmptyString, 2);
        SetStatusText(wxEmptyString, 3);
        SetStatusText(wxEmptyString, 4);
    }
#endif // wxUSE_STATUSBAR
}
--- End code ---

please don't dream about timers and other complex stuff ...
i just edited two lines, and it works as i proposed...

kiss  (keep it simple stupid)



[update]
here's the patch, if someone wants to try it  ...


--- Code: ---Index: src/src/main.cpp
===================================================================
RCS file: /cvsroot/codeblocks/codeblocks/src/src/main.cpp,v
retrieving revision 1.84
diff -u -r1.84 main.cpp
--- src/src/main.cpp    1 Aug 2005 11:28:31 -0000   1.84
+++ src/src/main.cpp    18 Aug 2005 12:54:00 -0000
@@ -948,9 +948,11 @@
         SetStatusText(ed->GetControl()->GetOvertype() ? _("Overwrite") : _("Insert"), 2);
         SetStatusText(ed->GetModified() ? _("Modified") : wxEmptyString, 3);
         SetStatusText(ed->GetControl()->GetReadOnly() ? _("Read only") : _("Read/Write"), 4);
+        SetStatusText(ed->GetFilename(), 0); //tiwag 050818
     }
     else
     {
+        SetStatusText(_("Welcome to "APP_NAME"!"));  //tiwag 050818
         SetStatusText(wxEmptyString, 1);
         SetStatusText(wxEmptyString, 2);
         SetStatusText(wxEmptyString, 3);

--- End code ---

tiwag:
btw - i found a small flaw in CodeBlocks CVS-HEAD,
the statusbar (Line, Column) doesn't get updated
when you are only changing between notebooks but don't start edit them

it can be fixed by adding a wxNotebookEvent Handler for PageChanged

here's the code to patch main.cpp

--- Code: ---//event table entry
EVT_NOTEBOOK_PAGE_CHANGED(-1, MainFrame::OnEditorUpdateUI_NB)

//handle notebook event
void MainFrame::OnEditorUpdateUI_NB(wxNotebookEvent& event)
{
    if (m_pEdMan ) DoUpdateStatusBar();  //tiwag 050818
    event.Skip();
}
--- End code ---

[update] patchfile appended


[attachment deleted by admin]

rickg22:
ARGH!   :x What have we said about SUBMITTING PATCHES IN SOURCEFORGE!?

*Sigh* :cry: why me???

tiwag:
hi rick

stay cool please, i don't want call this a patch for committing in cvs, it is more a preview and i would like to know the opinion of the other here in the forum, if they would like such a solution, what i've proposed.
please try it and give me your thoughts about, thanks

rickg22:
Oh, ok then. It's just that I got tired of having to submit patches that people post in the forums :(

In any case I've made up my mind: Not the status bar, but the main title bar. It's been already requested and it's expected behavior.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version