User forums > Using Code::Blocks

Hello, and "How to synch class tree with current class in editor?"

(1/1)

johanekdahl:
God day, all! I have been using C::B for a few weeks now and am, in general, very pleased with what I have seen. Great effort!

I have one question/wish, however:

The project I'm working in has close to 1K (yes 1000, "one-thousand") classes organized in a directory tree with maybe 30 directories on different levels. Class inheritance is largely "lateral" between directories (one part of the tree holds framework/generic/abstract classes, other sub-trees lateral to the framework holds specific/concrete classes inheriting from the framework.

Navigating from the class tree to source code works OK, but I am looking for functionality to go the other way. I often find myself looking at a piece of source code, and need to "synch" the class tree. The only way I have found is to do it manually.
Did I miss something?

dje:
Hi !

I think the "Search" text control on the Symbols tab is what you need but I never saw it work. I only have a tool tip that tells me "Searching the symbol tree is currently disabled".

To browse my code, I use the wonderful items :
- "Find declaration of:" (contextual menu)
- "Find implementation of:" (contextual menu)
- Alt+g to open project files with an efficient pattern filter
- Ctrl+Alt+g to go to methods declaration/implementation with the same efficient pattern filter

I hope it will help you if you didn't know them !

Dje

johanekdahl:

--- Quote from: dje on November 28, 2006, 10:56:32 am ---"I think the "Search" text control on the Symbols tab is what you need"

--- End quote ---
no, not unless the dialogue box that would follow already had the class name pasted into the appropriate field - and even then it would still be somewhat "cludgy".

What I am looking for is a "one-click" solution to synch the class tree so that "the current class" shows up in the class tree.

What do I mean with "current class"? Well something along the lines of:
- Right-clicking inside a class declaration would give a "Show Cx in class tree" (or some such formulation) alternative in the context menu.
- Right clicking on a class name would do the same.
and maybe (wishful thinking)
- Right-clicking on a instance variable, eg. any "i" in "Cx i; i.SomeOp();" would do the same.
- Right-clicking on a pointer to an instance would do the same, eg. any "p" in "Cx * p = new Cx(); p->SomeOp();" would do the same.
- Right-clicking on/inside a member function definition, eg on/in "Cx::SomeOp() { ... }" would do the same.

This wish has to do with both the complexity of the project I am working with, and my "modus operandi" in general. I'm just not very good at finding my way around large class hierarchies by filenames, and finding my way inside a class by scrolling the source file.


--- Quote from: dje on November 28, 2006, 10:56:32 am ---To browse my code, I use the wonderful items :
[...]
- Alt+g to open project files with an efficient pattern filter
- Ctrl+Alt+g to go to methods declaration/implementation with the same efficient pattern filter

--- End quote ---
At my end, the first one only seems to open a list with all files in the project (all 2000 of them).
The second one looks interesting, but I am not sure what it actually does.

I have been assuming (after looking around a bit) that there is no documentation for C::B. Am I right in this? How can I find out what accelerator keystrokes there are?

Thank you very much for the help!

dje:
What you describe looks like a plug-in. If you feel its developement ;-)
The basis could be found in the "Find declaration of:" implementation that works fine; it could give the instance class.


--- Quote ---At my end, the first one only seems to open a list with all files in the project (all 2000 of them).
--- End quote ---
Yes, by default, it displays all the files, but the files list is updated as soon as you type a fragment of your file name.


--- Quote ---The second one looks interesting, but I am not sure what it actually does.
--- End quote ---
It parses current file (h or cpp) to find functions/methods declaration/implementation. It makes it possible to quickly jump to the item you want to go to. Same thing : type few letters of your method name and the list is filtered/updated.


--- Quote ---How can I find out what accelerator keystrokes there are?
--- End quote ---
Well, I do not know any efficient way to browse keystrokes...
I personnaly browse the main menu bar first.
Then, there is the keybinder plug-in. Let's have a look at "Settings/Editor", click on the "Keyboard shortcuts" item on the left and you will be able to browse and edit menu shortcuts.


--- Quote ---I have been assuming (after looking around a bit) that there is no documentation for C::B.
--- End quote ---
I don't know... I did not look for documentation. I try the different features that look nice (and there is a lot of work with this wonderdul IDE...)

Dje

mandrav:
For documentation, shortcuts, etc check the wiki.

Navigation

[0] Message Index

Go to full version