Author Topic: nicer tree-view for "projects" and "open files list"  (Read 19442 times)

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
nicer tree-view for "projects" and "open files list"
« on: June 11, 2007, 09:16:08 pm »
Hi,

i was just working a little bit on my own code and trying to find the right file in the projects-treeview. since i have a few files which names start identical i either have to have this window quite wide or have to scroll left and right in it.

i then realised that there is a bit of wasted space in the treeview!
the root-node "Workspace" shouldn't be really needed since right now its possible to only have one workspace open at the same time.

in the open files list the "problem" is a little bit different. since the title of the window is "Open files list" i think there is no need to have a node called "Opened Files".

i searched the forum for a reason why these nodes have to be there (maybe a future update will allow more than one workspace) but couldn't find any.

attached you can find a patch (when you want to call something a patch that just changes 3 lines...) which will hide the root nodes in the projects and open files list window. it does not remove the "title" of the nodes nor does it remove the icons (yeah both are invisible, but i guess wxWidgets still allocates memory for it). if this patch is welcomed i would be more than happy to remove these too.

of course i made two screenshots so you can compare for yourself.

i just tried this on WinXP SP2 with wxWidgets 2.8.4. if you are concerned that this might break on linux i can test this on Ubuntu 7.04 too.

regards
Markus

[attachment deleted by admin]
« Last Edit: June 13, 2007, 12:34:24 am by Charon »
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

mariocup

  • Guest
Re: nicer tree-view for "projects" and "open files list"
« Reply #1 on: June 11, 2007, 10:07:30 pm »
Hi Charon,

to show the workspace name is necessary. If you collect different projects in a workspace you can save the workspace with a name e.g. ContriPlugins and this name is shown, so it contains additional information. If the name is not shown you can not distinguish between opened projects and a workspace.

To the changes of the open files list I agree, because the root item does not contain additional information.

Bye,

Mario

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
Re: nicer tree-view for "projects" and "open files list"
« Reply #2 on: June 12, 2007, 12:21:06 am »
Hi mariocup,

yeah, i guess i didn't think enough about this.
something like the attached picture should be the the right thing then i guess? (it's just a mockup)

actually the same would work for the symbol-browser. the flag wxTR_HIDE_ROOT is already set in the *.xrc but it gets ignored (but it seems like this is a wxWidgets bug). setting it after the wxTreeCtrl is created doesn't work though (SetWindowStyle doesn't work on MWS, it's even documented *yay* :-( )

regards
Markus

[attachment deleted by admin]
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
Re: nicer tree-view for "projects" and "open files list"
« Reply #3 on: June 12, 2007, 10:36:10 pm »
hi again,

i just reworked my patch and added the name of the workspace.

man its hard to get into wxWidgets again. the last time i worked with it is a few years ago :)

could anyone be so nice and help me with the following two things?
1. the background of the wxStaticText that is used to show the name of the workspace is dark-grey and i can't get it to appear like the background behind the items on the top of the symbols-browser (light-grey)
2. of course the context-menu for the workspace (rename and so on...) doesn't work right now. any hint for an easy way to add this to the wxStaticText?

i don't know if this kind of patch is welcomed, if not just say so. atleast its an easy way for me to get a little bit familiar with the codeblocks code-base :)

regards
Markus

[attachment deleted by admin]
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5495
Re: nicer tree-view for "projects" and "open files list"
« Reply #4 on: June 12, 2007, 10:43:11 pm »
note : when right clicking on the workspace there's a menu (save, save as, rename, close). I think you will loose that with the static text.
And on the other hand you don't gain that many space by it.

Now something else, since you are experimenting in that area, what about you can right click on the workspace, or maybe even the project and have as an option 'find file', which will expand the tree and set the selection to the filename you typed in, providing that file is in the project.

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
Re: nicer tree-view for "projects" and "open files list"
« Reply #5 on: June 13, 2007, 12:05:37 am »
hi killerbot,

yeah i know its not that much space, but its at least a little bit more and in my opinion it looks more right with the hidden root item.

apart from the uselfullness of this : any idea why the background of it is dark-grey?

concerning the "find file" :
öhm, finished!  :D
you can right-click on a node and select "Find file...". a window will appear that asks for the filename.
if the file is found it will get selected (but not opened), else a message is shown that it couldn't be found.

right now its my complete patch. if you think the part concerning the "find file" is ok i will gladly clean it up so my experiment for the hidden root folder isn't included.

regards
Markus

[attachment deleted by admin]
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5495
Re: nicer tree-view for "projects" and "open files list"
« Reply #6 on: June 13, 2007, 07:35:04 am »
very well done.
Ok, I would start with integrating the find file. I see you made it for now on the project level.

I am not so sure about removing the workspace node, because you loose the menu attached to it (the menu where we could add also the find file ...)

So could you attach a cleaned up patch with just the find file. I will merge that in our code base then. Once again, very well done :-)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: nicer tree-view for "projects" and "open files list"
« Reply #7 on: June 13, 2007, 08:23:39 am »
Hi !

That's nice  :)

It may be more complex but what I'd prefer is something like in Eclipse (don't misunderstand !! I prefer C::B  :D), a text control just below the tree that filters it automatically to show just tree items matching the entered text.

Dje

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
Re: nicer tree-view for "projects" and "open files list"
« Reply #8 on: June 13, 2007, 05:24:41 pm »
@killerbot:
thanks for your kind words!
i cleaned up the patch so that it only contains the "find files" and of course it already supports workspaces, projects, folder and virtual folders  :)
the only type of folder that i couldn't get to work is the one automatically created when using "Categorize by file types" (i.e. "Sources" and "Headers").


i didn't plan to submit my other patch (for removing the workspace node) for review until it works like it should (with the right-click menu).
it was just meant to find out if there is interest in something like this and if somebody can help me with my 2 problems with it. of course it makes only sense if the right-click menu works!


@dje:
nice idea, but i am not good enough yet with wxWidgets and Code::Blocks itself to start on something like this :)



PS.: while creating this patch i almost pulled out all my hair. when i was doing my final test i found out i couldn't select "Categorize by file types" and "Display folders as on disk" anymore. i searched all my added code for mistakes but found none. then i compared my working version with the version in svn in the case i accidently deleted something. nothing.
then it dawned on me. i was still using wxWidgets 2.8.3. upgraded to 2.8.4 and voila, the bug was gone!

[attachment deleted by admin]
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: nicer tree-view for "projects" and "open files list"
« Reply #9 on: June 13, 2007, 09:09:53 pm »
nice idea, but i am not good enough yet with wxWidgets and Code::Blocks itself to start on something like this :)
Unless you don't know you are  :wink:

Dje

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2780
Re: nicer tree-view for "projects" and "open files list"
« Reply #10 on: June 13, 2007, 10:32:21 pm »
then it dawned on me. i was still using wxWidgets 2.8.3. upgraded to 2.8.4 and voila, the bug was gone!

There is still something wrong though. I'm running 2.8.4 and I still have this problem.

The check marks on the menu items will not UNCHECK, nor will the tree display change.


Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5495
Re: nicer tree-view for "projects" and "open files list"
« Reply #11 on: June 13, 2007, 10:41:32 pm »
I already applied the patch [modified it a bit for const correctness] before your cleaned up version ;-)


About the tree with the workspace being removed, I think there's less interest though.

mariocup

  • Guest
Re: nicer tree-view for "projects" and "open files list"
« Reply #12 on: June 14, 2007, 09:39:06 am »
Hi,

as in the symbol view and the codesnippets view there is a search field, I would prefer the same implementation/mechanism for selecting files in the project view.

Furthermore I think that a browser view of the filesystem with a search field perhaps with a file extension filter *.cpp would be very nice for developers.

Bye,

Mario

Offline Charon

  • Multiple posting newcomer
  • *
  • Posts: 49
  • fnord
    • charon - where mental illness meets chronic nonsense
Re: nicer tree-view for "projects" and "open files list"
« Reply #13 on: June 14, 2007, 10:57:14 am »
it's a pity, if i had known this i wouldn't have to clean it up :-(
at least i learned a little bit of the svn command line client this way!

thanks anyway! i guess i am little bit proud now for my first included patch ^^

but please enlighten me, what did you change for const-correctness? apart from coding-style changes the only real change i can see is the removal of a variable i forgot to delete.


regards
Markus


PS.: deep inside i stll hope for the workspace-node to vanish ;-)
« Last Edit: June 14, 2007, 11:45:41 am by Charon »
hi, i am a signature virus. please copy me into your sig!
Wish list : no root-node for workspaces, open files and symbols; world domination

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5495
Re: nicer tree-view for "projects" and "open files list"
« Reply #14 on: June 14, 2007, 12:46:34 pm »
example : FindItem method doesn't change anything to the state of the object --> therefor it is a const method.