Posted by & filed under Tips.

For a few years now we have been asked by users to add some “push” to Understand. “Don’t make me right click, show me what I need to know”, they ask.  In Understand 2.0 we have addressed that wish in two primary ways:

  • Browse mode in the editor (I’ll write about that in a post soon)
  • Contextual Information Sidebar (CIS)
Big picture of the CIS Sidebar

In this note I’ll tell you a bit about the CIS.  Let’s take the acryonym apart:

  • C – contextual. Context is wherever you are in source code. In a file, at a line, inside a class, inside a method. 
  • I –  information. That is what Understand provides – information about code.
  • S – Sidebar. Hint… look for the “context” “information” on the right side of your editor.
Big picture of the CIS Sidebar

The CIS watches where you are as you visit source code an pushes information about the file you are in and the scope you are in.

First the “File Context” area, which is divided into two tabs:

File Context portion of the CIS

Structure Browser shows you the major parts of the file. In this case, Includes, public functions, so forth.  It also highlights where you are in the editor in the Structure Browser – like a radar overview.

Next is the File Information tab:

File Information part of the CIS

Looks familiar doesn’t it. It is the Information Browser, but always for the file your are editing. Note that how you configure the IB here, doesn’t affect how the others in the rest of the GUI work – this one remembers just its settings.

Okay, so where ever you go, CIS tells you about the File you are in.

Now as you move about the file, your scope changes. Hence the second part, “Scope Context”.

Again, it is divided into two sections. The first, is the Scope Information section, which is the Information Browser for the scope you are in:

Und11

Whatever scope you are in, the Scope Context IB shows you the Information Browser for it. Auto-magically.

Next up is something pretty new. I’m quasi-proud of it, because I thought of it. But a new engineer with Scitools, Rob Gempeler, implemented it. It is called the “Context Browser”.  Its job is to always tell you whre you are, with quick links to higher scopes, AND, to provide a quick list of entities within a window of your cursor.

Und12

So above, we can see that when the cursor is at line 17, I’m in file ActionItem.cpp, Class ActionItem, and Public Virtual Function “redo”.  Further more, as I look at that region of code:

Und13

with a glance to the right I can see that “Applied” is an enumerator – 2, and REQUIRE is an unknown function (actually it is a macro I forgot to define).

So there you have it.  The first parts of our “Push” information effort.  Next up…. the browse mode of the 2.0 editor.