Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: ironhead on August 17, 2005, 03:57:15 pm

Title: Feature Request: Full pathname in editors list
Post by: ironhead on August 17, 2005, 03:57:15 pm
I have a workspace that has several projects on it.  Each of the projects share a common filename among them.  The problem is the tab in the editor only contains the filename, and when I have multiple tabs with the same name, it can get confusing as to which project it belongs to.

As a proposed solution, I'm wondering if one (or more) of the following could be implemented:


Other than that I am very impressed!  :)
Title: Re: Feature Request
Post by: thomas on August 17, 2005, 04:03:38 pm
Are these only identical filenames, or are the pathnames inside the different projects all identical, too?

If it is just the filenames:

(http://img4.imageshack.us/img4/8346/ed9fc.png)
Title: Re: Feature Request
Post by: ironhead on August 17, 2005, 04:48:47 pm
I have that option selected.  The identical filenames all also happen to be in the same relative location, being the root directory of the projects.
Title: Re: Feature Request
Post by: rickg22 on August 17, 2005, 07:39:14 pm
Someone requested to put the edited file's name in the title bar. I think it can be done trivially, will that suffice?

I also got the request of organizing the editor files just as the project tree, but that might need more work, since it's abou changing the tree's structure. (Right now it's very simple, one branch, just files).
Title: Re: Feature Request
Post by: tiwag on August 18, 2005, 04:15:35 am
Someone requested to put the edited file's name in the title bar. I think it can be done trivially, will that suffice?...

i would suggest to show the full path/name of the file in the active editor in the status bar instead of the "Welcome to Code::Blocks"
and to show the active project's name in the title bar, as it is already implemented now.

the status bar already shows Line:, Colums: Info, so it's logically to display the filename there too.
Title: Re: Feature Request
Post by: thomas on August 18, 2005, 01:48:46 pm
i would suggest to show the full path/name of the file in the active editor in the status bar instead of the "Welcome to Code::Blocks"
That is where the help texts for the menus are shown, though.
Title: Re: Feature Request
Post by: tiwag on August 18, 2005, 02:00:59 pm
i would suggest to show the full path/name of the file in the active editor in the status bar instead of the "Welcome to Code::Blocks"
That is where the help texts for the menus are shown, though.

though what ?

i know that there the menu-help-texts are shown, and this should be not affected,
but most of the time we don't crawl around the menus and then we can show the full path&filename in the statusbar.
Title: Re: Feature Request
Post by: thomas on August 18, 2005, 02:09:49 pm
Though what? Well, the menu help resets the status bar to wxEmtpyString. Look what happens to "Welcome to Code::Blocks".
So your filename won't be visible for long really (unless you set up a Timer or something and repeatedly set it).
Also the status field might be used by other things to display a current status as well. For example, I use it when running version control transactions that involve several operations, so the user sees what is going on.
This does not mean that it is not possible to show the current editor's filename there, but it may cause conflicts.
Title: Re: Feature Request
Post by: tiwag on August 18, 2005, 02:25:08 pm
...This does not mean that it is not possible to show the current editor's filename there, but it may cause conflicts.

it's not a big issue
Title: Re: Feature Request
Post by: Vampyre_Dark on August 18, 2005, 02:37:13 pm
What about a hover popup thing?

You hold your mouse over the file in the list/tree thing and after a second, and little tolltip/popup thing shows the fullname.
Title: Re: Feature Request
Post by: tiwag on August 18, 2005, 02:59:16 pm
_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
}

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);
Title: Re: Feature Request
Post by: tiwag on August 18, 2005, 06:24:08 pm
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();
}

[update] patchfile appended


[attachment deleted by admin]
Title: Re: Feature Request
Post by: rickg22 on August 18, 2005, 06:45:51 pm
ARGH!   :x What have we said about SUBMITTING PATCHES IN SOURCEFORGE!?

*Sigh* :cry: why me???
Title: Re: Feature Request
Post by: tiwag on August 18, 2005, 06:50:59 pm
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
Title: Re: Feature Request
Post by: rickg22 on August 18, 2005, 06:54:21 pm
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.
Title: Re: Feature Request: Full pathname in editors list
Post by: ironhead on August 19, 2005, 06:14:00 pm
Sweet!  Thanx all!   :D