MATLAB Community

MATLAB, community & more

Hanging out at the Document Bar 6

Posted by admin,

When you have multiple documents (M-Files in the Editor, variables in the Array Editor, docked Figures, etc) open within a MATLAB desktop tool there is an activation button corresponding to each document. The area where these buttons appear is referred to as the “Document Bar”. The document bar is in some respects similar to the Windows Task Bar, except it’s embedded within a MATLAB desktop tool and its scope is limited to the documents docked within that tool.

Document Bar

Like the Windows task bar, the document bar can be positioned along any edge of the containing tool. An easy way to change the document bar’s location is to mouse down on its grip or any empty bar area and drag toward to edge where you want it to appear. You can also set the document bar position via the Desktop->Document Bar->Bar Position menu. When the document bar appears at the left or right (as shown below) instead of the bottom or top, it can provide access to a larger number of documents without requiring scrolling.

Document Bar at Right

The long file names in the above screen shot cause the document bar to be rather wide. If you have a wide-screen monitor this may be perfectly fine. If not, you can drag the edge of the bar to reduce its width. The file names are truncated to fit within the allotted width.

Narrowed Document Bar

If you now move the bar back to the top or the bottom you’ll notice that the buttons are still narrowed. With the bar in this position you can adjust the width of its buttons by dragging the separators between them. You may find that simply adjusting the button width on the horizontal bar provides space for an adequate number of buttons.

Adjusting Button Widths with Bar at Bottom

By default document bar buttons appear in the order in which the corresponding documents were opened. Alternatively you can choose to have the buttons appear alphabetically (choose Desktop->Document Bar->Alphabetize or choose Alphabetize from the document bar context menu). You can also reorder the buttons arbitrarily by dragging along the bar or using the Desktop->Document Bar->Move menu.

Moving a Button on the Document Bar

If after learning about all these features you decide you are simply not a bar fly then you can hide the document bar (Desktop->Document Bar->Bar Position->Hide) and recoup the real-estate. The Window menu and the Ctrl-PageDown, Ctrl-PageUp key bindings will then be your bar refugee friends as you access the documents within a tool.


Comments are closed.

6 CommentsOldest to Newest

tyson Aflalo replied on : 1 of 6
I end up working on several projects at once and for each project I will have 10+ functions that I am working on. I don't like the Document Bar to be too clustered so I normally try to only have the function of the current project open. It would be great if there was some way of quickly saving out and being able to re-access a group of functions at a time. eg one could imagine right clicking the document bar and getting the option of saving out this list of funcitons or loading a previously saved list of functions.
Ken replied on : 2 of 6
Hey Tyson, I too like an uncluttered work area, so I definitely identify with your pain! We're currently working on a feature that would support working in this project-centric manner, where files can be grouped by you, inferring some relation among them. Most IDEs offer some sort of project facility - in fact, most IDEs force you to have a project. MATLAB has been different in that many people want to simply explore their data without having to deal with the overhead of a project mechanism. But, there are equally many people now who wish to use MATLAB in a more structured form. Your point is well received Tyson! -Ken
Nate replied on : 3 of 6
I regularly use the document bar, and often have 30-50 files open at a time. However, a problem I have is occasionally when matlab crashes, when I open it again, it has cleared the document bar history. However, since I'm often running multiple copies of matlab, I almost always have another copy that still has the 30+ files in the document bar. It would be nice to have a feature where the document bar can be re-saved.
Mike replied on : 4 of 6
@Nate, Do you have multiple copies of the same version of MATLAB running? The mechanism that saves/restores desktop state isn't really designed for that scenario.
Stephen replied on : 5 of 6
Forgive me if this has already been addressed, I haven't searched too hard for the answer. But I see my question quite precisely stated within Tyson's remark above. Since this part of the thread is ~3.5 years old now, one would hope it has been addressed, but since I'm using a substantially newer version of Matlab than was available then, it seems to have not been addressed. My question: When will a project code folder mechanism be available within the Matlab Editor Document Bar? I too, work on many files simultaneously within a project, and have to switch between projects quite often, and don't like a cluttered bar. Further, when Matlab crashes and all tabs are closed, it makes recovering the pre-crash state quite slow. Especially with files that were open being distributed far and wide on the tree. So I cast my question into the internet sea. Hopefully it won't get lost. Otherwise, a big thanks to the Mathworks team for putting out such a great product!
Mike replied on : 6 of 6
@Stephen, We are probably not going to introduce what you're looking for any time soon. I can't comment on any ongoing work, but we plan to address the context-switching pain in a future version. In the meantime, if you have MATLAB R2011a, I have posted an example this week on using the Editor API to open/close sets of files programmatically. You can use this a starting point to create your own "open file set" switch.